summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2007-11-15 17:03:53 +0000
committerFelipe Heidrich <fheidric>2007-11-15 17:03:53 +0000
commitee37eed09abf2b304605b7bd7be15ba102d37b58 (patch)
tree5ff8b26c4b049d7c8b7e66827f50afece3bbd7e4
parent4eb84c684bfa237dcce3337cdcdd67ab82c88da5 (diff)
downloadeclipse.platform.swt-ee37eed09abf2b304605b7bd7be15ba102d37b58.tar.gz
eclipse.platform.swt-ee37eed09abf2b304605b7bd7be15ba102d37b58.tar.xz
eclipse.platform.swt-ee37eed09abf2b304605b7bd7be15ba102d37b58.zip
cocoa merge
-rwxr-xr-xbundles/org.eclipse.swt/.classpath_cocoa39
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Browser/cocoa/org/eclipse/swt/browser/Safari.java1283
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java199
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/build.sh21
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/build.xml26
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/make_macosx.mak52
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c4829
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.h26
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_custom.c331
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_custom.h29
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.c355
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.h341
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_structs.c464
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_structs.h157
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/Platform.java17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CGPoint.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CGRect.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CGSize.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CIColor.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CIImage.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/MacGenerator.java770
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSATSTypesetter.java24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSActionCell.java100
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAffineTransform.java85
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAffineTransformStruct.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAlert.java133
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAnimation.java121
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAnimationContext.java34
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAppleEventDescriptor.java209
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAppleEventManager.java62
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAppleScript.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSApplication.java363
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSArchiver.java53
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSArray.java256
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSArrayController.java208
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAssertionHandler.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAttributedString.java95
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAutoreleasePool.java69
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBezierPath.java313
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBitmapImageRep.java183
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBox.java145
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBrowser.java422
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBrowserCell.java70
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBundle.java206
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButton.java177
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButtonCell.java245
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCIImageRep.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCachedImageRep.java34
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCachedURLResponse.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCalendar.java113
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCalendarDate.java136
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCell.java616
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCharacterSet.java134
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSClassDescription.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSClipView.java90
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCloneCommand.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCloseCommand.java17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCoder.java258
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCollectionView.java110
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCollectionViewItem.java44
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColor.java487
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorList.java72
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorPanel.java96
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorPicker.java59
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorSpace.java94
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorWell.java50
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSComboBox.java159
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSComboBoxCell.java164
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSComparisonPredicate.java59
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCompoundPredicate.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCondition.java38
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSConditionLock.java55
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSConnection.java189
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSControl.java278
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSController.java37
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCountedSet.java35
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCreateCommand.java23
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCursor.java156
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCustomImageRep.java27
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSData.java158
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDate.java141
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDateComponents.java93
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDateFormatter.java327
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDatePicker.java150
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDatePickerCell.java134
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDecimal.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDecimalNumber.java175
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDecimalNumberHandler.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDeleteCommand.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDictionary.java244
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDictionaryController.java72
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDirectoryEnumerator.java27
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDistantObject.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDistantObjectRequest.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDistributedLock.java40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDistributedNotificationCenter.java59
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDockTile.java54
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDocument.java456
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDocumentController.java241
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDrawer.java131
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSEPSImageRep.java38
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSEnumerator.java23
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSError.java62
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSEvent.java255
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSException.java55
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSExpression.java132
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFileHandle.java137
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFileManager.java203
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFileWrapper.java147
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFont.java343
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFontDescriptor.java101
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFontManager.java240
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFontPanel.java56
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSForm.java92
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFormCell.java94
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFormatter.java40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGarbageCollector.java54
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGlyphGenerator.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGlyphInfo.java41
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGradient.java75
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGraphicsContext.java143
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHTTPCookie.java90
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHTTPCookieStorage.java48
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHTTPURLResponse.java27
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHashEnumerator.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHashTable.java107
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHashTableCallBacks.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHelpManager.java51
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHost.java64
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSImage.java311
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSImageCell.java37
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSImageRep.java181
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSImageView.java70
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSIndexPath.java59
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSIndexSet.java99
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSIndexSpecifier.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInputManager.java75
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInputServer.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInputStream.java45
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInvocation.java72
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInvocationOperation.java33
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSKeyedArchiver.java102
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSKeyedUnarchiver.java94
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLayoutManager.java603
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLevelIndicator.java79
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLevelIndicatorCell.java96
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLocale.java93
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLock.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLogicalTest.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMachBootstrapServer.java37
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMachPort.java45
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMapEnumerator.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMapTable.java94
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMapTableKeyCallBacks.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMapTableValueCallBacks.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMatrix.java415
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenu.java258
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenuItem.java250
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenuItemCell.java113
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenuView.java189
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMessagePortNameServer.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMetadataItem.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMetadataQuery.java136
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMetadataQueryAttributeValueTuple.java27
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMetadataQueryResultGroup.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMethodSignature.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMoveCommand.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMovie.java51
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMovieView.java162
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableArray.java123
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableAttributedString.java66
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableCharacterSet.java41
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableData.java69
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableDictionary.java55
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableIndexSet.java45
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableParagraphStyle.java101
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableSet.java59
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableString.java51
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableURLRequest.java57
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNameSpecifier.java27
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNetService.java129
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNetServiceBrowser.java50
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNib.java31
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNibConnector.java48
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNibControlConnector.java17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNibOutletConnector.java17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNotification.java38
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNotificationCenter.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNotificationQueue.java35
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNull.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNumber.java247
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNumberFormatter.java589
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSObject.java1177
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSObjectController.java146
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenGLContext.java109
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenGLPixelBuffer.java38
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenGLPixelFormat.java44
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenGLView.java57
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenPanel.java76
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOperation.java66
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOperationQueue.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOutlineView.java122
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOutputStream.java51
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPDFImageRep.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPICTImageRep.java34
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPageLayout.java65
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPanel.java37
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSParagraphStyle.java101
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPasteboard.java124
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPathCell.java128
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPathComponentCell.java31
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPathControl.java74
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPersistentDocument.java52
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPipe.java28
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPoint.java19
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPointerArray.java85
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPointerFunctions.java39
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPopUpButton.java167
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPopUpButtonCell.java212
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPort.java68
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPortCoder.java49
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPortMessage.java45
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPortNameServer.java36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPositionalSpecifier.java53
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPredicate.java51
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPredicateEditor.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPredicateEditorRowTemplate.java88
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrintInfo.java196
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrintOperation.java196
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrintPanel.java100
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrinter.java142
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSProcessInfo.java77
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSProgressIndicator.java121
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPropertyListSerialization.java27
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSProtocolChecker.java33
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSProxy.java53
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSQuickDrawView.java17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSQuitCommand.java17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRange.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRangeSpecifier.java36
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRect.java21
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRecursiveLock.java30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRelativeSpecifier.java35
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSResponder.java466
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRuleEditor.java194
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRulerMarker.java97
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRulerView.java147
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRunLoop.java81
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSavePanel.java181
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScanner.java127
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScreen.java57
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptClassDescription.java107
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptCoercionHandler.java27
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptCommand.java127
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptCommandDescription.java78
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptExecutionContext.java45
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptObjectSpecifier.java117
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptSuiteRegistry.java82
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptWhoseTest.java17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScrollView.java249
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScroller.java107
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSearchField.java31
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSearchFieldCell.java108
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSecureTextField.java13
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSecureTextFieldCell.java21
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSegmentedCell.java141
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSegmentedControl.java100
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSet.java163
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSetCommand.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSShadow.java44
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSize.java19
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSlider.java140
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSliderCell.java163
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSocketPort.java59
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSocketPortNameServer.java53
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSortDescriptor.java45
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSound.java145
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpecifierTest.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpeechRecognizer.java64
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpeechSynthesizer.java125
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpellChecker.java131
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpellServer.java34
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSplitView.java88
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStatusBar.java35
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStatusItem.java142
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStepper.java53
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStepperCell.java53
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStream.java60
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSString.java668
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSwappedDouble.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSwappedFloat.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTabView.java159
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTabViewItem.java82
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableColumn.java137
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableHeaderCell.java23
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableHeaderView.java44
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableView.java509
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTask.java117
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSText.java306
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextAttachment.java36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextBlock.java99
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextContainer.java88
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextField.java136
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextFieldCell.java83
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextList.java32
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextStorage.java123
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextTab.java40
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextTable.java61
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextTableBlock.java39
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextView.java726
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSThread.java115
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTimeZone.java144
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTimer.java67
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTokenField.java47
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTokenFieldCell.java56
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbar.java128
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbarItem.java159
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbarItemGroup.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTrackingArea.java38
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTreeController.java206
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTreeNode.java61
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTypesetter.java285
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURL.java169
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLAuthenticationChallenge.java52
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLCache.java68
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLConnection.java53
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLCredential.java41
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLCredentialStorage.java45
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLDownload.java53
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLHandle.java117
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLProtectionSpace.java60
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLProtocol.java75
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLRequest.java80
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLResponse.java42
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUnarchiver.java66
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUndoManager.java141
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUniqueIDSpecifier.java27
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUserDefaults.java162
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUserDefaultsController.java66
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSValue.java103
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSValueTransformer.java45
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSView.java912
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSViewAnimation.java27
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSViewController.java71
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWhoseSpecifier.java59
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWindow.java1080
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWindowController.java128
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWorkspace.java204
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLDTD.java90
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLDTDNode.java57
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLDocument.java151
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLElement.java134
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLNode.java253
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLParser.java87
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java9977
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTBox.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTButton.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTComboBox.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTDatePicker.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTImageView.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTOutlineView.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTPanelDelegate.java21
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTPopUpButton.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTProgressIndicator.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTScrollView.java17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTScroller.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTSlider.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTStepper.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTabView.java16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTableView.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTextView.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTreeItem.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTView.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTWindowDelegate.java21
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/id.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/objc_super.java6
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/PrintDialog.java305
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/Printer.java637
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Program/cocoa/org/eclipse/swt/program/Program.java546
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Color.java271
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Cursor.java418
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Device.java623
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/DeviceData.java23
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Font.java291
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/FontData.java446
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/FontMetrics.java132
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java3362
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GCData.java57
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java986
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Path.java517
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Pattern.java214
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Region.java676
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java1416
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Transform.java370
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java499
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java320
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Caret.java500
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ColorDialog.java156
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java1349
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Composite.java878
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java3258
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java435
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Decorations.java680
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DirectoryDialog.java167
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java3054
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FileDialog.java256
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FontDialog.java281
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Group.java195
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java321
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Link.java428
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java1225
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java845
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MenuItem.java739
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MessageBox.java258
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ProgressBar.java209
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Sash.java319
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scale.java347
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ScrollBar.java659
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java309
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java1237
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Slider.java512
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java767
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TabFolder.java596
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TabItem.java291
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java2317
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableColumn.java538
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableItem.java1030
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java1711
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java447
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java736
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tracker.java1061
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TrayItem.java440
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java2264
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java534
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeItem.java1385
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java1183
436 files changed, 102743 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/.classpath_cocoa b/bundles/org.eclipse.swt/.classpath_cocoa
new file mode 100755
index 0000000000..f82c81af63
--- /dev/null
+++ b/bundles/org.eclipse.swt/.classpath_cocoa
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="src" path="Eclipse SWT/cocoa"/>
+ <classpathentry kind="src" path="Eclipse SWT/common"/>
+ <classpathentry kind="src" path="Eclipse SWT/common_j2se"/>
+ <classpathentry kind="src" path="Eclipse SWT/emulated/bidi"/>
+ <classpathentry kind="src" path="Eclipse SWT/emulated/coolbar"/>
+ <classpathentry kind="src" path="Eclipse SWT/emulated/expand"/>
+ <classpathentry kind="src" path="Eclipse SWT/emulated/ime"/>
+ <classpathentry kind="src" path="Eclipse SWT/emulated/tooltip"/>
+ <classpathentry kind="src" path="Eclipse SWT PI/common"/>
+ <classpathentry kind="src" path="Eclipse SWT PI/cocoa">
+ <attributes>
+ <attribute value="org.eclipse.swt.cocoa.macosx" name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="src" path="Eclipse SWT PI/common_j2se"/>
+ <classpathentry kind="src" path="Eclipse SWT Accessibility/common"/>
+ <classpathentry kind="src" path="Eclipse SWT Accessibility/emulated"/>
+ <classpathentry kind="src" path="Eclipse SWT AWT/common"/>
+ <classpathentry kind="src" path="Eclipse SWT AWT/emulated"/>
+ <classpathentry kind="src" path="Eclipse SWT Custom Widgets/common"/>
+ <classpathentry kind="src" path="Eclipse SWT Drag and Drop/common"/>
+ <classpathentry kind="src" path="Eclipse SWT Drag and Drop/emulated"/>
+ <classpathentry kind="src" path="Eclipse SWT Printing/common"/>
+ <classpathentry kind="src" path="Eclipse SWT Printing/cocoa"/>
+ <classpathentry kind="src" path="Eclipse SWT Program/common"/>
+ <classpathentry kind="src" path="Eclipse SWT Program/cocoa"/>
+ <classpathentry kind="src" path="Eclipse SWT Browser/common"/>
+ <classpathentry kind="src" path="Eclipse SWT Browser/cocoa"/>
+ <classpathentry kind="src" path="Eclipse SWT Mozilla/common"/>
+ <classpathentry kind="src" path="Eclipse SWT Mozilla/cocoa"/>
+ <classpathentry kind="src" path="Eclipse SWT OpenGL/emulated"/>
+ <classpathentry kind="src" path="Eclipse SWT OpenGL/common"/>
+ <classpathentry kind="src" path="Eclipse SWT Theme/emulated"/>
+ <classpathentry kind="lib" path="extra_jars/exceptions.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/cocoa/org/eclipse/swt/browser/Safari.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/cocoa/org/eclipse/swt/browser/Safari.java
new file mode 100755
index 0000000000..ce29f0a138
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/cocoa/org/eclipse/swt/browser/Safari.java
@@ -0,0 +1,1283 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.browser;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.Callback;
+import org.eclipse.swt.internal.carbon.*;
+import org.eclipse.swt.internal.cocoa.*;
+import org.eclipse.swt.widgets.*;
+
+class Safari extends WebBrowser {
+
+ /* Objective-C WebView delegate */
+ int delegate;
+
+ /* Carbon HIView handle */
+ int webViewHandle;
+ int windowBoundsHandler;
+
+ boolean changingLocation;
+ String lastHoveredLinkURL;
+ String html;
+ int identifier;
+ int resourceCount;
+ String url = "";
+ Point location;
+ Point size;
+ boolean statusBar = true, toolBar = true, ignoreDispose;
+ //TEMPORARY CODE
+// boolean doit;
+
+ static boolean Initialized;
+ static Callback Callback3, Callback7;
+
+ static final int MIN_SIZE = 16;
+ static final int MAX_PROGRESS = 100;
+ static final String WebElementLinkURLKey = "WebElementLinkURL"; //$NON-NLS-1$
+ static final String URI_FROMMEMORY = "file:///"; //$NON-NLS-1$
+ static final String ABOUT_BLANK = "about:blank"; //$NON-NLS-1$
+ static final String ADD_WIDGET_KEY = "org.eclipse.swt.internal.addWidget"; //$NON-NLS-1$
+ static final String BROWSER_WINDOW = "org.eclipse.swt.browser.Browser.Window"; //$NON-NLS-1$
+
+ static {
+ NativeClearSessions = new Runnable() {
+ public void run() {
+ int storage = Cocoa.objc_msgSend (Cocoa.C_NSHTTPCookieStorage, Cocoa.S_sharedHTTPCookieStorage);
+ int cookies = Cocoa.objc_msgSend (storage, Cocoa.S_cookies);
+ int count = Cocoa.objc_msgSend (cookies, Cocoa.S_count);
+ for (int i = 0; i < count; i++) {
+ int cookie = Cocoa.objc_msgSend (cookies, Cocoa.S_objectAtIndex, i);
+ boolean isSession = Cocoa.objc_msgSend (cookie, Cocoa.S_isSessionOnly) != 0;
+ if (isSession) {
+ Cocoa.objc_msgSend (storage, Cocoa.S_deleteCookie, cookie);
+ }
+ }
+ }
+ };
+ }
+
+public void create (Composite parent, int style) {
+ /*
+ * Note. Loading the webkit bundle on Jaguar causes a crash.
+ * The workaround is to detect any OS prior to 10.30 and fail
+ * without crashing.
+ */
+ if (OS.VERSION < 0x1030) {
+ browser.dispose();
+ SWT.error(SWT.ERROR_NO_HANDLES);
+ }
+ int outControl[] = new int[1];
+ try {
+ Cocoa.HIWebViewCreate(outControl);
+ } catch (UnsatisfiedLinkError e) {
+ browser.dispose();
+ SWT.error(SWT.ERROR_NO_HANDLES);
+ }
+ webViewHandle = outControl[0];
+ if (webViewHandle == 0) {
+ browser.dispose();
+ SWT.error(SWT.ERROR_NO_HANDLES);
+ }
+ Display display = browser.getDisplay();
+ display.setData(ADD_WIDGET_KEY, new Object[] {new Integer(webViewHandle), browser});
+
+ /*
+ * Bug in Safari. For some reason, every application must contain
+ * a visible window that has never had a WebView or mouse move events
+ * are not delivered. This seems to happen after a browser has been
+ * either hidden or disposed in any window. The fix is to create a
+ * single transparent overlay window that is disposed when the display
+ * is disposed.
+ */
+ if (display.getData(BROWSER_WINDOW) == null) {
+ Rect bounds = new Rect ();
+ OS.SetRect (bounds, (short) 0, (short) 0, (short) 1, (short) 1);
+ final int[] outWindow = new int[1];
+ OS.CreateNewWindow(OS.kOverlayWindowClass, 0, bounds, outWindow);
+ OS.ShowWindow(outWindow[0]);
+ display.disposeExec(new Runnable() {
+ public void run() {
+ if (outWindow[0] != 0) {
+ OS.DisposeWindow(outWindow[0]);
+ }
+ outWindow[0] = 0;
+ }
+ });
+ display.setData(BROWSER_WINDOW, outWindow);
+ }
+
+ /*
+ * Bug in Safari. The WebView does not draw properly if it is embedded as
+ * sub view of the browser handle. The fix is to add the web view to the
+ * window root control and resize it on top of the browser handle.
+ *
+ * Note that when reparent the browser is reparented, the web view has to
+ * be reparent by hand by hooking kEventControlOwningWindowChanged.
+ */
+ int window = OS.GetControlOwner(browser.handle);
+ int[] contentView = new int[1];
+ OS.HIViewFindByID(OS.HIViewGetRoot(window), OS.kHIViewWindowContentID(), contentView);
+ OS.HIViewAddSubview(contentView[0], webViewHandle);
+ OS.HIViewChangeFeatures(webViewHandle, OS.kHIViewFeatureIsOpaque, 0);
+
+ /*
+ * Bug in Safari. The WebView does not receive mouse and key events when it is added
+ * to a visible top window. It is assumed that Safari hooks its own event listener
+ * when the top window emits the kEventWindowShown event. The workaround is to send a
+ * fake kEventWindowShown event to the top window after the WebView has been added
+ * to the HIView (after the top window is visible) to give Safari a chance to hook
+ * events.
+ */
+ OS.HIViewSetVisible(webViewHandle, true);
+ if (browser.getShell().isVisible()) {
+ int[] showEvent = new int[1];
+ OS.CreateEvent(0, OS.kEventClassWindow, OS.kEventWindowShown, 0.0, OS.kEventAttributeUserEvent, showEvent);
+ OS.SetEventParameter(showEvent[0], OS.kEventParamDirectObject, OS.typeWindowRef, 4, new int[] {OS.GetControlOwner(browser.handle)});
+ OS.SendEventToEventTarget(showEvent[0], OS.GetWindowEventTarget(window));
+ if (showEvent[0] != 0) OS.ReleaseEvent(showEvent[0]);
+ }
+
+ final int webView = Cocoa.HIWebViewGetWebView(webViewHandle);
+ /*
+ * This code is intentionally commented. Setting a group name is the right thing
+ * to do in order to avoid multiple open window requests. For some reason, Safari
+ * crashes when requested to reopen the same window if that window was previously
+ * closed. This may be because that window was not correctly closed.
+ */
+// String groupName = "MyDocument"; //$NON-NLS-1$
+// int length = groupName.length();
+// char[] buffer = new char[length];
+// groupName.getChars(0, length, buffer, 0);
+// int groupNameString = OS.CFStringCreateWithCharacters(0, buffer, length);
+// // [webView setGroupName:@"MyDocument"];
+// WebKit.objc_msgSend(webView, WebKit.S_setGroupName, groupNameString);
+// OS.CFRelease(groupNameString);
+
+ final int notificationCenter = Cocoa.objc_msgSend(Cocoa.C_NSNotificationCenter, Cocoa.S_defaultCenter);
+
+ Listener listener = new Listener() {
+ public void handleEvent(Event e) {
+ switch (e.type) {
+ case SWT.Dispose: {
+ /* make this handler run after other dispose listeners */
+ if (ignoreDispose) {
+ ignoreDispose = false;
+ break;
+ }
+ ignoreDispose = true;
+ browser.notifyListeners (e.type, e);
+ e.type = SWT.NONE;
+
+ OS.RemoveEventHandler(windowBoundsHandler);
+ windowBoundsHandler = 0;
+
+ e.display.setData(ADD_WIDGET_KEY, new Object[] {new Integer(webViewHandle), null});
+
+ Cocoa.objc_msgSend(webView, Cocoa.S_setFrameLoadDelegate, 0);
+ Cocoa.objc_msgSend(webView, Cocoa.S_setResourceLoadDelegate, 0);
+ Cocoa.objc_msgSend(webView, Cocoa.S_setUIDelegate, 0);
+ Cocoa.objc_msgSend(webView, Cocoa.S_setPolicyDelegate, 0);
+ Cocoa.objc_msgSend(notificationCenter, Cocoa.S_removeObserver, delegate);
+
+ Cocoa.objc_msgSend(delegate, Cocoa.S_release);
+ OS.DisposeControl(webViewHandle);
+ html = null;
+ lastHoveredLinkURL = null;
+ break;
+ }
+ }
+ }
+ };
+ browser.addListener(SWT.Dispose, listener);
+
+ if (Callback3 == null) Callback3 = new Callback(this.getClass(), "eventProc3", 3); //$NON-NLS-1$
+ int callback3Address = Callback3.getAddress();
+ if (callback3Address == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
+
+ int[] mask = new int[] {
+ OS.kEventClassKeyboard, OS.kEventRawKeyDown,
+ OS.kEventClassControl, OS.kEventControlDraw,
+ OS.kEventClassControl, OS.kEventControlSetCursor,
+ OS.kEventClassTextInput, OS.kEventTextInputUnicodeForKeyEvent,
+ };
+ OS.InstallEventHandler(OS.GetControlEventTarget(webViewHandle), callback3Address, mask.length / 2, mask, webViewHandle, null);
+ int[] mask1 = new int[] {
+ OS.kEventClassControl, OS.kEventControlBoundsChanged,
+ OS.kEventClassControl, OS.kEventControlVisibilityChanged,
+ OS.kEventClassControl, OS.kEventControlOwningWindowChanged,
+ };
+ OS.InstallEventHandler(OS.GetControlEventTarget(browser.handle), callback3Address, mask1.length / 2, mask1, browser.handle, null);
+ int[] mask2 = new int[] {
+ OS.kEventClassWindow, OS.kEventWindowBoundsChanged,
+ };
+ int[] outRef = new int[1];
+ OS.InstallEventHandler(OS.GetWindowEventTarget(window), callback3Address, mask2.length / 2, mask2, browser.handle, outRef);
+ windowBoundsHandler = outRef[0];
+
+ if (Callback7 == null) Callback7 = new Callback(this.getClass(), "eventProc7", 7); //$NON-NLS-1$
+ int callback7Address = Callback7.getAddress();
+ if (callback7Address == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
+
+ // delegate = [[WebResourceLoadDelegate alloc] init eventProc];
+ delegate = Cocoa.objc_msgSend(Cocoa.C_WebKitDelegate, Cocoa.S_alloc);
+ delegate = Cocoa.objc_msgSend(delegate, Cocoa.S_initWithProc, callback7Address, webViewHandle);
+
+ // [webView setFrameLoadDelegate:delegate];
+ Cocoa.objc_msgSend(webView, Cocoa.S_setFrameLoadDelegate, delegate);
+
+ // [webView setResourceLoadDelegate:delegate];
+ Cocoa.objc_msgSend(webView, Cocoa.S_setResourceLoadDelegate, delegate);
+
+ // [webView setUIDelegate:delegate];
+ Cocoa.objc_msgSend(webView, Cocoa.S_setUIDelegate, delegate);
+
+ /* register delegate for all notifications sent out from webview */
+ Cocoa.objc_msgSend(notificationCenter, Cocoa.S_addObserver_selector_name_object, delegate, Cocoa.S_handleNotification, 0, webView);
+
+ // [webView setPolicyDelegate:delegate];
+ Cocoa.objc_msgSend(webView, Cocoa.S_setPolicyDelegate, delegate);
+
+ // [webView setDownloadDelegate:delegate];
+ Cocoa.objc_msgSend(webView, Cocoa.S_setDownloadDelegate, delegate);
+
+ if (!Initialized) {
+ Initialized = true;
+ /* disable applets */
+ int preferences = Cocoa.objc_msgSend(Cocoa.C_WebPreferences, Cocoa.S_standardPreferences);
+ Cocoa.objc_msgSend(preferences, Cocoa.S_setJavaEnabled, 0);
+ }
+}
+
+static int eventProc3(int nextHandler, int theEvent, int userData) {
+ Widget widget = Display.getCurrent().findWidget(userData);
+ if (widget instanceof Browser) {
+ return ((Safari)((Browser)widget).webBrowser).handleCallback(nextHandler, theEvent);
+ }
+ return OS.eventNotHandledErr;
+}
+
+static int eventProc7(int webview, int userData, int selector, int arg0, int arg1, int arg2, int arg3) {
+ Widget widget = Display.getCurrent().findWidget(userData);
+ if (widget instanceof Browser) {
+ return ((Safari)((Browser)widget).webBrowser).handleCallback(selector, arg0, arg1, arg2, arg3);
+ }
+ return 0;
+}
+
+public boolean back() {
+ html = null;
+ int webView = Cocoa.HIWebViewGetWebView(webViewHandle);
+ return Cocoa.objc_msgSend(webView, Cocoa.S_goBack) != 0;
+}
+
+public boolean execute(String script) {
+ int length = script.length();
+ char[] buffer = new char[length];
+ script.getChars(0, length, buffer, 0);
+ int string = OS.CFStringCreateWithCharacters(0, buffer, length);
+
+ int webView = Cocoa.HIWebViewGetWebView(webViewHandle);
+ int value = Cocoa.objc_msgSend(webView, Cocoa.S_stringByEvaluatingJavaScriptFromString, string);
+ OS.CFRelease(string);
+ return value != 0;
+}
+
+public boolean forward() {
+ html = null;
+ int webView = Cocoa.HIWebViewGetWebView(webViewHandle);
+ return Cocoa.objc_msgSend(webView, Cocoa.S_goForward) != 0;
+}
+
+public String getText() {
+ int webView = Cocoa.HIWebViewGetWebView(webViewHandle);
+ int mainFrame = Cocoa.objc_msgSend(webView, Cocoa.S_mainFrame);
+ int dataSource = Cocoa.objc_msgSend(mainFrame, Cocoa.S_dataSource);
+ if (dataSource == 0) return ""; //$NON-NLS-1$
+ int representation = Cocoa.objc_msgSend(dataSource, Cocoa.S_representation);
+ if (representation == 0) return ""; //$NON-NLS-1$
+ int source = Cocoa.objc_msgSend(representation, Cocoa.S_documentSource);
+ if (source == 0) return ""; //$NON-NLS-1$
+ int length = OS.CFStringGetLength(source);
+ char[] buffer = new char[length];
+ CFRange range = new CFRange();
+ range.length = length;
+ OS.CFStringGetCharacters(source, range, buffer);
+ return new String(buffer);
+}
+
+public String getUrl() {
+ return url;
+}
+
+int handleCallback(int nextHandler, int theEvent) {
+ int eventKind = OS.GetEventKind(theEvent);
+ switch (OS.GetEventClass(theEvent)) {
+ case OS.kEventClassControl:
+ switch (eventKind) {
+ case OS.kEventControlSetCursor: {
+ return OS.noErr;
+ }
+ case OS.kEventControlDraw: {
+ /*
+ * Bug on Safari. The web view cannot be obscured by other views above it.
+ * This problem is specified in the apple documentation for HiWebViewCreate.
+ * The workaround is to don't draw the web view when it is not visible.
+ */
+ if (!browser.isVisible ()) return OS.noErr;
+ break;
+ }
+ case OS.kEventControlOwningWindowChanged: {
+ /* Reparent the web view handler */
+ int window = OS.GetControlOwner(browser.handle);
+ int[] contentView = new int[1];
+ OS.HIViewFindByID(OS.HIViewGetRoot(window), OS.kHIViewWindowContentID(), contentView);
+ OS.HIViewAddSubview(contentView[0], webViewHandle);
+
+ /* Reset the kEventWindowBoundsChanged handler */
+ OS.RemoveEventHandler(windowBoundsHandler);
+ int[] mask2 = new int[] {
+ OS.kEventClassWindow, OS.kEventWindowBoundsChanged,
+ };
+ int[] outRef = new int[1];
+ OS.InstallEventHandler(OS.GetWindowEventTarget(window), Callback3.getAddress(), mask2.length / 2, mask2, browser.handle, outRef);
+ windowBoundsHandler = outRef[0];
+ break;
+ }
+ case OS.kEventControlBoundsChanged:
+ case OS.kEventControlVisibilityChanged: {
+ /*
+ * Bug on Safari. The web view cannot be obscured by other views above it.
+ * This problem is specified in the apple documentation for HiWebViewCreate.
+ * The workaround is to hook kEventControlVisibilityChanged on the browser
+ * and move the browser out of the screen when hidden and restore its bounds
+ * when shown.
+ */
+ CGRect bounds = new CGRect();
+ if (!browser.isVisible()) {
+ bounds.x = bounds.y = -MIN_SIZE;
+ bounds.width = bounds.height = MIN_SIZE;
+ OS.HIViewSetFrame(webViewHandle, bounds);
+ } else {
+ OS.HIViewGetBounds(browser.handle, bounds);
+ int[] contentView = new int[1];
+ OS.HIViewFindByID(OS.HIViewGetRoot(OS.GetControlOwner(browser.handle)), OS.kHIViewWindowContentID(), contentView);
+ OS.HIViewConvertRect(bounds, browser.handle, contentView[0]);
+ /*
+ * Bug in Safari. For some reason, the web view will display incorrectly or
+ * blank depending on its contents, if its size is set to a value smaller than
+ * MIN_SIZE. It will not display properly even after the size is made larger.
+ * The fix is to avoid setting sizes smaller than MIN_SIZE.
+ */
+ if (bounds.width <= MIN_SIZE) bounds.width = MIN_SIZE;
+ if (bounds.height <= MIN_SIZE) bounds.height = MIN_SIZE;
+ OS.HIViewSetFrame(webViewHandle, bounds);
+ }
+ break;
+ }
+ }
+ case OS.kEventClassWindow:
+ switch (eventKind) {
+ case OS.kEventWindowBoundsChanged:
+ /*
+ * Bug on Safari. Resizing the height of a Shell containing a Browser at
+ * a fixed location causes the Browser to redraw at a wrong location.
+ * The web view is a HIView container that internally hosts
+ * a Cocoa NSView that uses a coordinates system with the origin at the
+ * bottom left corner of a window instead of the coordinates system used
+ * in Carbon that starts at the top left corner. The workaround is to
+ * reposition the web view every time the Shell of the Browser is resized.
+ *
+ * Note the size should not be updated if the browser is hidden.
+ */
+ if (browser.isVisible()) {
+ CGRect oldBounds = new CGRect();
+ OS.GetEventParameter (theEvent, OS.kEventParamOriginalBounds, OS.typeHIRect, null, CGRect.sizeof, null, oldBounds);
+ CGRect bounds = new CGRect();
+ OS.GetEventParameter (theEvent, OS.kEventParamCurrentBounds, OS.typeHIRect, null, CGRect.sizeof, null, bounds);
+ if (oldBounds.height == bounds.height) break;
+ OS.HIViewGetBounds(browser.handle, bounds);
+ int[] contentView = new int[1];
+ OS.HIViewFindByID(OS.HIViewGetRoot(OS.GetControlOwner(browser.handle)), OS.kHIViewWindowContentID(), contentView);
+ OS.HIViewConvertRect(bounds, browser.handle, contentView[0]);
+ /*
+ * Bug in Safari. For some reason, the web view will display incorrectly or
+ * blank depending on its contents, if its size is set to a value smaller than
+ * MIN_SIZE. It will not display properly even after the size is made larger.
+ * The fix is to avoid setting sizes smaller than MIN_SIZE.
+ */
+ if (bounds.width <= MIN_SIZE) bounds.width = MIN_SIZE;
+ if (bounds.height <= MIN_SIZE) bounds.height = MIN_SIZE;
+ bounds.x++;
+ /* Note that the bounds needs to change */
+ OS.HIViewSetFrame(webViewHandle, bounds);
+ bounds.x--;
+ OS.HIViewSetFrame(webViewHandle, bounds);
+ }
+ }
+ case OS.kEventClassKeyboard:
+ switch (eventKind) {
+ case OS.kEventRawKeyDown: {
+ /*
+ * Bug in Safari. The WebView blocks the propagation of certain Carbon events
+ * such as kEventRawKeyDown. On the Mac, Carbon events propagate from the
+ * Focus Target Handler to the Control Target Handler, Window Target and finally
+ * the Application Target Handler. It is assumed that WebView hooks its events
+ * on the Window Target and does not pass kEventRawKeyDown to the next handler.
+ * Since kEventRawKeyDown events never make it to the Application Target Handler,
+ * the Application Target Handler never gets to emit kEventTextInputUnicodeForKeyEvent
+ * used by SWT to send a SWT.KeyDown event.
+ * The workaround is to hook kEventRawKeyDown on the Control Target Handler which gets
+ * called before the WebView hook on the Window Target Handler. Then, forward this event
+ * directly to the Application Target Handler. Note that if in certain conditions Safari
+ * does not block the kEventRawKeyDown, then multiple kEventTextInputUnicodeForKeyEvent
+ * events might be generated as a result of this workaround.
+ */
+ //TEMPORARY CODE
+// doit = false;
+// OS.SendEventToEventTarget(theEvent, OS.GetApplicationEventTarget());
+// if (!doit) return OS.noErr;
+
+ int[] length = new int[1];
+ int status = OS.GetEventParameter (theEvent, OS.kEventParamKeyUnicodes, OS.typeUnicodeText, null, 4, length, (char[])null);
+ if (status == OS.noErr && length[0] != 0) {
+ int[] modifiers = new int[1];
+ OS.GetEventParameter (theEvent, OS.kEventParamKeyModifiers, OS.typeUInt32, null, 4, null, modifiers);
+ char[] chars = new char[1];
+ OS.GetEventParameter (theEvent, OS.kEventParamKeyUnicodes, OS.typeUnicodeText, null, 2, null, chars);
+ if ((modifiers[0] & OS.cmdKey) != 0) {
+ switch (chars[0]) {
+ case 'v': {
+ int webView = Cocoa.HIWebViewGetWebView (webViewHandle);
+ Cocoa.objc_msgSend (webView, Cocoa.S_paste);
+ return OS.noErr;
+ }
+ case 'c': {
+ int webView = Cocoa.HIWebViewGetWebView (webViewHandle);
+ Cocoa.objc_msgSend (webView, Cocoa.S_copy);
+ return OS.noErr;
+ }
+ case 'x': {
+ int webView = Cocoa.HIWebViewGetWebView (webViewHandle);
+ Cocoa.objc_msgSend (webView, Cocoa.S_cut);
+ return OS.noErr;
+ }
+ }
+ }
+ }
+ break;
+ }
+ }
+ case OS.kEventClassTextInput:
+ switch (eventKind) {
+ case OS.kEventTextInputUnicodeForKeyEvent: {
+ /*
+ * Note. This event is received from the Window Target therefore after it was received
+ * by the Focus Target. The SWT.KeyDown event is sent by SWT on the Focus Target. If it
+ * is received here, then the SWT.KeyDown doit flag must have been left to the value
+ * true. For package visibility reasons we cannot access the doit flag directly.
+ *
+ * Sequence of events when the user presses a key down
+ *
+ * .Control Target - kEventRawKeyDown
+ * .forward to ApplicationEventTarget
+ * .Focus Target kEventTextInputUnicodeForKeyEvent - SWT emits SWT.KeyDown -
+ * blocks further propagation if doit false. Browser does not know directly about
+ * the doit flag value.
+ * .Window Target kEventTextInputUnicodeForKeyEvent - if received, Browser knows
+ * SWT.KeyDown is not blocked and event should be sent to WebKit
+ * Return from Control Target - kEventRawKeyDown: let the event go to WebKit if doit true
+ * (eventNotHandledErr) or stop it (noErr).
+ */
+ //TEMPORARY CODE
+// doit = true;
+ break;
+ }
+ }
+ }
+ return OS.eventNotHandledErr;
+}
+
+/* Here we dispatch all WebView upcalls. */
+int handleCallback(int selector, int arg0, int arg1, int arg2, int arg3) {
+ int ret = 0;
+ // for meaning of selector see WebKitDelegate methods in webkit.c
+ switch (selector) {
+ case 1: didFailProvisionalLoadWithError(arg0, arg1); break;
+ case 2: didFinishLoadForFrame(arg0); break;
+ case 3: didReceiveTitle(arg0, arg1); break;
+ case 4: didStartProvisionalLoadForFrame(arg0); break;
+ case 5: didFinishLoadingFromDataSource(arg0, arg1); break;
+ case 6: didFailLoadingWithError(arg0, arg1, arg2); break;
+ case 7: ret = identifierForInitialRequest(arg0, arg1); break;
+ case 8: ret = willSendRequest(arg0, arg1, arg2, arg3); break;
+ case 9: handleNotification(arg0); break;
+ case 10: didCommitLoadForFrame(arg0); break;
+ case 11: ret = createWebViewWithRequest(arg0); break;
+ case 12: webViewShow(arg0); break;
+ case 13: setFrame(arg0); break;
+ case 14: webViewClose(); break;
+ case 15: ret = contextMenuItemsForElement(arg0, arg1); break;
+ case 16: setStatusBarVisible(arg0); break;
+ case 17: setResizable(arg0); break;
+ case 18: setToolbarsVisible(arg0); break;
+ case 19: decidePolicyForMIMEType(arg0, arg1, arg2, arg3); break;
+ case 20: decidePolicyForNavigationAction(arg0, arg1, arg2, arg3); break;
+ case 21: decidePolicyForNewWindowAction(arg0, arg1, arg2, arg3); break;
+ case 22: unableToImplementPolicyWithError(arg0, arg1); break;
+ case 23: setStatusText(arg0); break;
+ case 24: webViewFocus(); break;
+ case 25: webViewUnfocus(); break;
+ case 26: runJavaScriptAlertPanelWithMessage(arg0); break;
+ case 27: ret = runJavaScriptConfirmPanelWithMessage(arg0); break;
+ case 28: runOpenPanelForFileButtonWithResultListener(arg0); break;
+ case 29: decideDestinationWithSuggestedFilename(arg0, arg1); break;
+ case 30: mouseDidMoveOverElement(arg0, arg1); break;
+ }
+ return ret;
+}
+
+public boolean isBackEnabled() {
+ int webView = Cocoa.HIWebViewGetWebView(webViewHandle);
+ return Cocoa.objc_msgSend(webView, Cocoa.S_canGoBack) != 0;
+}
+
+public boolean isForwardEnabled() {
+ int webView = Cocoa.HIWebViewGetWebView(webViewHandle);
+ return Cocoa.objc_msgSend(webView, Cocoa.S_canGoForward) != 0;
+}
+
+public void refresh() {
+ int webView = Cocoa.HIWebViewGetWebView(webViewHandle);
+ Cocoa.objc_msgSend(webView, Cocoa.S_reload, 0);
+}
+
+public boolean setText(String html) {
+ /*
+ * Bug in Safari. The web view segment faults in some circumstances
+ * when the text changes during the location changing callback. The
+ * fix is to defer the work until the callback is done.
+ */
+ if (changingLocation) {
+ this.html = html;
+ } else {
+ _setText(html);
+ }
+ return true;
+}
+
+void _setText(String html) {
+ int length = html.length();
+ char[] buffer = new char[length];
+ html.getChars(0, length, buffer, 0);
+ int string = OS.CFStringCreateWithCharacters(0, buffer, length);
+
+ length = URI_FROMMEMORY.length();
+ buffer = new char[length];
+ URI_FROMMEMORY.getChars(0, length, buffer, 0);
+ int URLString = OS.CFStringCreateWithCharacters(0, buffer, length);
+
+ /*
+ * Note. URLWithString uses autorelease. The resulting URL
+ * does not need to be released.
+ * URL = [NSURL URLWithString:(NSString *)URLString]
+ */
+ int URL = Cocoa.objc_msgSend(Cocoa.C_NSURL, Cocoa.S_URLWithString, URLString);
+ OS.CFRelease(URLString);
+
+ int webView = Cocoa.HIWebViewGetWebView(webViewHandle);
+
+ //mainFrame = [webView mainFrame];
+ int mainFrame = Cocoa.objc_msgSend(webView, Cocoa.S_mainFrame);
+
+ //[mainFrame loadHTMLString:(NSString *) string baseURL:(NSURL *)URL];
+ Cocoa.objc_msgSend(mainFrame, Cocoa.S_loadHTMLStringbaseURL, string, URL);
+ OS.CFRelease(string);
+}
+
+public boolean setUrl(String url) {
+ html = null;
+
+ StringBuffer buffer = new StringBuffer();
+ if (url.indexOf('/') == 0) buffer.append("file://"); //$NON-NLS-1$ //$NON-NLS-2$
+ else if (url.indexOf(':') == -1) buffer.append("http://"); //$NON-NLS-1$
+ for (int i = 0; i < url.length(); i++) {
+ char c = url.charAt(i);
+ if (c == ' ') buffer.append("%20"); //$NON-NLS-1$ //$NON-NLS-2$
+ else buffer.append(c);
+ }
+
+ int length = buffer.length();
+ char[] chars = new char[length];
+ buffer.getChars(0, length, chars, 0);
+ int sHandle = OS.CFStringCreateWithCharacters(0, chars, length);
+
+ /*
+ * Note. URLWithString uses autorelease. The resulting URL
+ * does not need to be released.
+ * inURL = [NSURL URLWithString:(NSString *)sHandle]
+ */
+ int inURL= Cocoa.objc_msgSend(Cocoa.C_NSURL, Cocoa.S_URLWithString, sHandle);
+ OS.CFRelease(sHandle);
+
+ //request = [NSURLRequest requestWithURL:(NSURL*)inURL];
+ int request= Cocoa.objc_msgSend(Cocoa.C_NSURLRequest, Cocoa.S_requestWithURL, inURL);
+
+ int webView = Cocoa.HIWebViewGetWebView(webViewHandle);
+
+ //mainFrame = [webView mainFrame];
+ int mainFrame= Cocoa.objc_msgSend(webView, Cocoa.S_mainFrame);
+
+ //[mainFrame loadRequest:request];
+ Cocoa.objc_msgSend(mainFrame, Cocoa.S_loadRequest, request);
+
+ return true;
+}
+
+public void stop() {
+ html = null;
+ int webView = Cocoa.HIWebViewGetWebView(webViewHandle);
+ Cocoa.objc_msgSend(webView, Cocoa.S_stopLoading, 0);
+}
+
+/* WebFrameLoadDelegate */
+
+void didFailProvisionalLoadWithError(int error, int frame) {
+ int webView = Cocoa.HIWebViewGetWebView(webViewHandle);
+ if (frame == Cocoa.objc_msgSend(webView, Cocoa.S_mainFrame)) {
+ /*
+ * Feature on Safari. The identifier is used here as a marker for the events
+ * related to the top frame and the URL changes related to that top frame as
+ * they should appear on the location bar of a browser. It is expected to reset
+ * the identifier to 0 when the event didFinishLoadingFromDataSource related to
+ * the identifierForInitialRequest event is received. Howeever, Safari fires
+ * the didFinishLoadingFromDataSource event before the entire content of the
+ * top frame is loaded. It is possible to receive multiple willSendRequest
+ * events in this interval, causing the Browser widget to send unwanted
+ * Location.changing events. For this reason, the identifier is reset to 0
+ * when the top frame has either finished loading (didFinishLoadForFrame
+ * event) or failed (didFailProvisionalLoadWithError).
+ */
+ identifier = 0;
+ }
+}
+
+void didFinishLoadForFrame(int frame) {
+ int webView = Cocoa.HIWebViewGetWebView(webViewHandle);
+ if (frame == Cocoa.objc_msgSend(webView, Cocoa.S_mainFrame)) {
+ final Display display = browser.getDisplay();
+ /*
+ * To be consistent with other platforms a title event should be fired when a
+ * page has completed loading. A page with a <title> tag will do this
+ * automatically when the didReceiveTitle callback is received. However a page
+ * without a <title> tag will not do this by default, so fire the event
+ * here with the page's url as the title.
+ */
+ int dataSource = Cocoa.objc_msgSend(frame, Cocoa.S_dataSource);
+ if (dataSource != 0) {
+ int title = Cocoa.objc_msgSend(dataSource, Cocoa.S_pageTitle);
+ if (title == 0) { /* page has no title */
+ final TitleEvent newEvent = new TitleEvent(browser);
+ newEvent.display = display;
+ newEvent.widget = browser;
+ newEvent.title = url;
+ for (int i = 0; i < titleListeners.length; i++) {
+ final TitleListener listener = titleListeners[i];
+ /*
+ * Note on WebKit. Running the event loop from a Browser
+ * delegate callback breaks the WebKit (stop loading or
+ * crash). The workaround is to invoke Display.asyncExec()
+ * so that the Browser does not crash if this is attempted.
+ */
+ display.asyncExec(
+ new Runnable() {
+ public void run() {
+ if (!display.isDisposed() && !browser.isDisposed()) {
+ listener.changed(newEvent);
+ }
+ }
+ }
+ );
+ }
+ }
+ }
+ final ProgressEvent progress = new ProgressEvent(browser);
+ progress.display = display;
+ progress.widget = browser;
+ progress.current = MAX_PROGRESS;
+ progress.total = MAX_PROGRESS;
+ for (int i = 0; i < progressListeners.length; i++) {
+ final ProgressListener listener = progressListeners[i];
+ /*
+ * Note on WebKit. Running the event loop from a Browser
+ * delegate callback breaks the WebKit (stop loading or
+ * crash). The ProgressBar widget currently touches the
+ * event loop every time the method setSelection is called.
+ * The workaround is to invoke Display.asyncExec() so that
+ * the Browser does not crash when the user updates the
+ * selection of the ProgressBar.
+ */
+ display.asyncExec(
+ new Runnable() {
+ public void run() {
+ if (!display.isDisposed() && !browser.isDisposed()) {
+ listener.completed(progress);
+ }
+ }
+ }
+ );
+ }
+ /*
+ * Feature on Safari. The identifier is used here as a marker for the events
+ * related to the top frame and the URL changes related to that top frame as
+ * they should appear on the location bar of a browser. It is expected to reset
+ * the identifier to 0 when the event didFinishLoadingFromDataSource related to
+ * the identifierForInitialRequest event is received. Howeever, Safari fires
+ * the didFinishLoadingFromDataSource event before the entire content of the
+ * top frame is loaded. It is possible to receive multiple willSendRequest
+ * events in this interval, causing the Browser widget to send unwanted
+ * Location.changing events. For this reason, the identifier is reset to 0
+ * when the top frame has either finished loading (didFinishLoadForFrame
+ * event) or failed (didFailProvisionalLoadWithError).
+ */
+ identifier = 0;
+ }
+}
+
+void didReceiveTitle(int title, int frame) {
+ int webView = Cocoa.HIWebViewGetWebView(webViewHandle);
+ if (frame == Cocoa.objc_msgSend(webView, Cocoa.S_mainFrame)) {
+ int length = OS.CFStringGetLength(title);
+ char[] buffer = new char[length];
+ CFRange range = new CFRange();
+ range.length = length;
+ OS.CFStringGetCharacters(title, range, buffer);
+ String newTitle = new String(buffer);
+ TitleEvent newEvent = new TitleEvent(browser);
+ newEvent.display = browser.getDisplay();
+ newEvent.widget = browser;
+ newEvent.title = newTitle;
+ for (int i = 0; i < titleListeners.length; i++) {
+ titleListeners[i].changed(newEvent);
+ }
+ }
+}
+
+void didStartProvisionalLoadForFrame(int frame) {
+ /*
+ * This code is intentionally commented. WebFrameLoadDelegate:didStartProvisionalLoadForFrame is
+ * called before WebResourceLoadDelegate:willSendRequest and
+ * WebFrameLoadDelegate:didCommitLoadForFrame. The resource count is reset when didCommitLoadForFrame
+ * is received for the top frame.
+ */
+// int webView = WebKit.HIWebViewGetWebView(webViewHandle);
+// if (frame == WebKit.objc_msgSend(webView, WebKit.S_mainFrame)) {
+// /* reset resource status variables */
+// resourceCount= 0;
+// }
+}
+
+void didCommitLoadForFrame(int frame) {
+ int webView = Cocoa.HIWebViewGetWebView(webViewHandle);
+ //id url= [[[[frame provisionalDataSource] request] URL] absoluteString];
+ int dataSource = Cocoa.objc_msgSend(frame, Cocoa.S_dataSource);
+ int request = Cocoa.objc_msgSend(dataSource, Cocoa.S_request);
+ int url = Cocoa.objc_msgSend(request, Cocoa.S_URL);
+ int s = Cocoa.objc_msgSend(url, Cocoa.S_absoluteString);
+ int length = OS.CFStringGetLength(s);
+ if (length == 0) return;
+ char[] buffer = new char[length];
+ CFRange range = new CFRange();
+ range.length = length;
+ OS.CFStringGetCharacters(s, range, buffer);
+ String url2 = new String(buffer);
+ /*
+ * If the URI indicates that the page is being rendered from memory
+ * (via setText()) then set it to about:blank to be consistent with IE.
+ */
+ if (url2.equals (URI_FROMMEMORY)) url2 = ABOUT_BLANK;
+
+ final Display display = browser.getDisplay();
+ boolean top = frame == Cocoa.objc_msgSend(webView, Cocoa.S_mainFrame);
+ if (top) {
+ /* reset resource status variables */
+ resourceCount = 0;
+ this.url = url2;
+
+ final ProgressEvent progress = new ProgressEvent(browser);
+ progress.display = display;
+ progress.widget = browser;
+ progress.current = 1;
+ progress.total = MAX_PROGRESS;
+ for (int i = 0; i < progressListeners.length; i++) {
+ final ProgressListener listener = progressListeners[i];
+ /*
+ * Note on WebKit. Running the event loop from a Browser
+ * delegate callback breaks the WebKit (stop loading or
+ * crash). The widget ProgressBar currently touches the
+ * event loop every time the method setSelection is called.
+ * The workaround is to invoke Display.asyncexec so that
+ * the Browser does not crash when the user updates the
+ * selection of the ProgressBar.
+ */
+ display.asyncExec(
+ new Runnable() {
+ public void run() {
+ if (!display.isDisposed() && !browser.isDisposed())
+ listener.changed(progress);
+ }
+ }
+ );
+ }
+
+ StatusTextEvent statusText = new StatusTextEvent(browser);
+ statusText.display = display;
+ statusText.widget = browser;
+ statusText.text = url2;
+ for (int i = 0; i < statusTextListeners.length; i++) {
+ statusTextListeners[i].changed(statusText);
+ }
+ }
+ LocationEvent location = new LocationEvent(browser);
+ location.display = display;
+ location.widget = browser;
+ location.location = url2;
+ location.top = top;
+ for (int i = 0; i < locationListeners.length; i++) {
+ locationListeners[i].changed(location);
+ }
+}
+
+/* WebResourceLoadDelegate */
+
+void didFinishLoadingFromDataSource(int identifier, int dataSource) {
+ /*
+ * Feature on Safari. The identifier is used here as a marker for the events
+ * related to the top frame and the URL changes related to that top frame as
+ * they should appear on the location bar of a browser. It is expected to reset
+ * the identifier to 0 when the event didFinishLoadingFromDataSource related to
+ * the identifierForInitialRequest event is received. Howeever, Safari fires
+ * the didFinishLoadingFromDataSource event before the entire content of the
+ * top frame is loaded. It is possible to receive multiple willSendRequest
+ * events in this interval, causing the Browser widget to send unwanted
+ * Location.changing events. For this reason, the identifier is reset to 0
+ * when the top frame has either finished loading (didFinishLoadForFrame
+ * event) or failed (didFailProvisionalLoadWithError).
+ */
+ // this code is intentionally commented
+ //if (this.identifier == identifier) this.identifier = 0;
+}
+
+void didFailLoadingWithError(int identifier, int error, int dataSource) {
+ /*
+ * Feature on Safari. The identifier is used here as a marker for the events
+ * related to the top frame and the URL changes related to that top frame as
+ * they should appear on the location bar of a browser. It is expected to reset
+ * the identifier to 0 when the event didFinishLoadingFromDataSource related to
+ * the identifierForInitialRequest event is received. Howeever, Safari fires
+ * the didFinishLoadingFromDataSource event before the entire content of the
+ * top frame is loaded. It is possible to receive multiple willSendRequest
+ * events in this interval, causing the Browser widget to send unwanted
+ * Location.changing events. For this reason, the identifier is reset to 0
+ * when the top frame has either finished loading (didFinishLoadForFrame
+ * event) or failed (didFailProvisionalLoadWithError).
+ */
+ // this code is intentionally commented
+ //if (this.identifier == identifier) this.identifier = 0;
+}
+
+int identifierForInitialRequest(int request, int dataSource) {
+ final Display display = browser.getDisplay();
+ final ProgressEvent progress = new ProgressEvent(browser);
+ progress.display = display;
+ progress.widget = browser;
+ progress.current = resourceCount;
+ progress.total = Math.max(resourceCount, MAX_PROGRESS);
+ for (int i = 0; i < progressListeners.length; i++) {
+ final ProgressListener listener = progressListeners[i];
+ /*
+ * Note on WebKit. Running the event loop from a Browser
+ * delegate callback breaks the WebKit (stop loading or
+ * crash). The widget ProgressBar currently touches the
+ * event loop every time the method setSelection is called.
+ * The workaround is to invoke Display.asyncexec so that
+ * the Browser does not crash when the user updates the
+ * selection of the ProgressBar.
+ */
+ display.asyncExec(
+ new Runnable() {
+ public void run() {
+ if (!display.isDisposed() && !browser.isDisposed())
+ listener.changed(progress);
+ }
+ }
+ );
+ }
+
+ /*
+ * Note. numberWithInt uses autorelease. The resulting object
+ * does not need to be released.
+ * identifier = [NSNumber numberWithInt: resourceCount++]
+ */
+ int identifier = Cocoa.objc_msgSend(Cocoa.C_NSNumber, Cocoa.S_numberWithInt, resourceCount++);
+
+ if (this.identifier == 0) {
+ int webView = Cocoa.HIWebViewGetWebView(webViewHandle);
+ int frame = Cocoa.objc_msgSend(dataSource, Cocoa.S_webFrame);
+ if (frame == Cocoa.objc_msgSend(webView, Cocoa.S_mainFrame)) this.identifier = identifier;
+ }
+ return identifier;
+
+}
+
+int willSendRequest(int identifier, int request, int redirectResponse, int dataSource) {
+ return request;
+}
+
+/* handleNotification */
+
+void handleNotification(int notification) {
+}
+
+/* UIDelegate */
+int createWebViewWithRequest(int request) {
+ WindowEvent newEvent = new WindowEvent(browser);
+ newEvent.display = browser.getDisplay();
+ newEvent.widget = browser;
+ newEvent.required = true;
+ if (openWindowListeners != null) {
+ for (int i = 0; i < openWindowListeners.length; i++) {
+ openWindowListeners[i].open(newEvent);
+ }
+ }
+ int webView = 0;
+
+ Browser browser = null;
+ if (newEvent.browser != null && newEvent.browser.webBrowser instanceof Safari) {
+ browser = newEvent.browser;
+ }
+ if (browser != null && !browser.isDisposed()) {
+ webView = Cocoa.HIWebViewGetWebView(((Safari)browser.webBrowser).webViewHandle);
+
+ if (request != 0) {
+ //mainFrame = [webView mainFrame];
+ int mainFrame= Cocoa.objc_msgSend(webView, Cocoa.S_mainFrame);
+
+ //[mainFrame loadRequest:request];
+ Cocoa.objc_msgSend(mainFrame, Cocoa.S_loadRequest, request);
+ }
+ }
+ return webView;
+}
+
+void webViewShow(int sender) {
+ /*
+ * Feature on WebKit. The Safari WebKit expects the application
+ * to create a new Window using the Objective C Cocoa API in response
+ * to UIDelegate.createWebViewWithRequest. The application is then
+ * expected to use Objective C Cocoa API to make this window visible
+ * when receiving the UIDelegate.webViewShow message. For some reason,
+ * a window created with the Carbon API hosting the new browser instance
+ * does not redraw until it has been resized. The fix is to increase the
+ * size of the Shell and restore it to its initial size.
+ */
+ Shell parent = browser.getShell();
+ Point pt = parent.getSize();
+ parent.setSize(pt.x+1, pt.y);
+ parent.setSize(pt.x, pt.y);
+ WindowEvent newEvent = new WindowEvent(browser);
+ newEvent.display = browser.getDisplay();
+ newEvent.widget = browser;
+ if (location != null) newEvent.location = location;
+ if (size != null) newEvent.size = size;
+ /*
+ * Feature in Safari. Safari's tool bar contains
+ * the address bar. The address bar is displayed
+ * if the tool bar is displayed. There is no separate
+ * notification for the address bar.
+ * Feature in Safari. The menu bar is always
+ * displayed. There is no notification to hide
+ * the menu bar.
+ */
+ newEvent.addressBar = toolBar;
+ newEvent.menuBar = true;
+ newEvent.statusBar = statusBar;
+ newEvent.toolBar = toolBar;
+ for (int i = 0; i < visibilityWindowListeners.length; i++) {
+ visibilityWindowListeners[i].show(newEvent);
+ }
+ location = null;
+ size = null;
+}
+
+void setFrame(int frame) {
+ float[] dest = new float[4];
+ OS.memmove(dest, frame, 16);
+ /* convert to SWT system coordinates */
+ Rectangle bounds = browser.getDisplay().getBounds();
+ location = new Point((int)dest[0], bounds.height - (int)dest[1] - (int)dest[3]);
+ size = new Point((int)dest[2], (int)dest[3]);
+}
+
+void webViewFocus() {
+}
+
+void webViewUnfocus() {
+}
+
+void runJavaScriptAlertPanelWithMessage(int message) {
+ int length = OS.CFStringGetLength(message);
+ char[] buffer = new char[length];
+ CFRange range = new CFRange();
+ range.length = length;
+ OS.CFStringGetCharacters(message, range, buffer);
+ String text = new String(buffer);
+
+ MessageBox messageBox = new MessageBox(browser.getShell(), SWT.OK | SWT.ICON_WARNING);
+ messageBox.setText("Javascript"); //$NON-NLS-1$
+ messageBox.setMessage(text);
+ messageBox.open();
+}
+
+int runJavaScriptConfirmPanelWithMessage(int message) {
+ int length = OS.CFStringGetLength(message);
+ char[] buffer = new char[length];
+ CFRange range = new CFRange();
+ range.length = length;
+ OS.CFStringGetCharacters(message, range, buffer);
+ String text = new String(buffer);
+
+ MessageBox messageBox = new MessageBox(browser.getShell(), SWT.OK | SWT.CANCEL | SWT.ICON_QUESTION);
+ messageBox.setText("Javascript"); //$NON-NLS-1$
+ messageBox.setMessage(text);
+ return messageBox.open() == SWT.OK ? 1 : 0;
+}
+
+void runOpenPanelForFileButtonWithResultListener(int resultListener) {
+ FileDialog dialog = new FileDialog(browser.getShell(), SWT.NONE);
+ String result = dialog.open();
+ if (result == null) {
+ Cocoa.objc_msgSend(resultListener, Cocoa.S_cancel);
+ return;
+ }
+ int length = result.length();
+ char[] buffer = new char[length];
+ result.getChars(0, length, buffer, 0);
+ int filename = OS.CFStringCreateWithCharacters(0, buffer, length);
+ Cocoa.objc_msgSend(resultListener, Cocoa.S_chooseFilename, filename);
+ OS.CFRelease(filename);
+}
+
+void webViewClose() {
+ Shell parent = browser.getShell();
+ WindowEvent newEvent = new WindowEvent(browser);
+ newEvent.display = browser.getDisplay();
+ newEvent.widget = browser;
+ for (int i = 0; i < closeWindowListeners.length; i++) {
+ closeWindowListeners[i].close(newEvent);
+ }
+ browser.dispose();
+ if (parent.isDisposed()) return;
+ /*
+ * Feature on WebKit. The Safari WebKit expects the application
+ * to create a new Window using the Objective C Cocoa API in response
+ * to UIDelegate.createWebViewWithRequest. The application is then
+ * expected to use Objective C Cocoa API to make this window visible
+ * when receiving the UIDelegate.webViewShow message. For some reason,
+ * a window created with the Carbon API hosting the new browser instance
+ * does not redraw until it has been resized. The fix is to increase the
+ * size of the Shell and restore it to its initial size.
+ */
+ Point pt = parent.getSize();
+ parent.setSize(pt.x+1, pt.y);
+ parent.setSize(pt.x, pt.y);
+}
+
+int contextMenuItemsForElement(int element, int defaultMenuItems) {
+ org.eclipse.swt.internal.carbon.Point pt = new org.eclipse.swt.internal.carbon.Point();
+ OS.GetGlobalMouse(pt);
+ Event event = new Event();
+ event.x = pt.h;
+ event.y = pt.v;
+ browser.notifyListeners(SWT.MenuDetect, event);
+ Menu menu = browser.getMenu();
+ if (!event.doit) return 0;
+ if (menu != null && !menu.isDisposed()) {
+ if (event.x != pt.h || event.y != pt.v) {
+ menu.setLocation(event.x, event.y);
+ }
+ menu.setVisible(true);
+ return 0;
+ }
+ return defaultMenuItems;
+}
+
+void setStatusBarVisible(int visible) {
+ /* Note. Webkit only emits the notification when the status bar should be hidden. */
+ statusBar = visible != 0;
+}
+
+void setStatusText(int text) {
+ int length = OS.CFStringGetLength(text);
+ if (length == 0) return;
+ char[] buffer = new char[length];
+ CFRange range = new CFRange();
+ range.length = length;
+ OS.CFStringGetCharacters(text, range, buffer);
+
+ StatusTextEvent statusText = new StatusTextEvent(browser);
+ statusText.display = browser.getDisplay();
+ statusText.widget = browser;
+ statusText.text = new String(buffer);
+ for (int i = 0; i < statusTextListeners.length; i++) {
+ statusTextListeners[i].changed(statusText);
+ }
+}
+
+void setResizable(int visible) {
+}
+
+void setToolbarsVisible(int visible) {
+ /* Note. Webkit only emits the notification when the tool bar should be hidden. */
+ toolBar = visible != 0;
+}
+
+void mouseDidMoveOverElement (int elementInformation, int modifierFlags) {
+ if (elementInformation == 0) return;
+
+ int length = WebElementLinkURLKey.length();
+ char[] chars = new char[length];
+ WebElementLinkURLKey.getChars(0, length, chars, 0);
+ int key = OS.CFStringCreateWithCharacters(0, chars, length);
+ int value = Cocoa.objc_msgSend(elementInformation, Cocoa.S_valueForKey, key);
+ OS.CFRelease(key);
+ if (value == 0) {
+ /* not currently over a link */
+ if (lastHoveredLinkURL == null) return;
+ lastHoveredLinkURL = null;
+ StatusTextEvent statusText = new StatusTextEvent(browser);
+ statusText.display = browser.getDisplay();
+ statusText.widget = browser;
+ statusText.text = ""; //$NON-NLS-1$
+ for (int i = 0; i < statusTextListeners.length; i++) {
+ statusTextListeners[i].changed(statusText);
+ }
+ return;
+ }
+
+ int stringPtr = Cocoa.objc_msgSend(value, Cocoa.S_absoluteString);
+ length = OS.CFStringGetLength(stringPtr);
+ String urlString;
+ if (length == 0) {
+ urlString = ""; //$NON-NLS-1$
+ } else {
+ chars = new char[length];
+ CFRange range = new CFRange();
+ range.length = length;
+ OS.CFStringGetCharacters(stringPtr, range, chars);
+ urlString = new String(chars);
+ }
+ if (urlString.equals(lastHoveredLinkURL)) return;
+
+ lastHoveredLinkURL = urlString;
+ StatusTextEvent statusText = new StatusTextEvent(browser);
+ statusText.display = browser.getDisplay();
+ statusText.widget = browser;
+ statusText.text = urlString;
+ for (int i = 0; i < statusTextListeners.length; i++) {
+ statusTextListeners[i].changed(statusText);
+ }
+}
+
+/* PolicyDelegate */
+
+void decidePolicyForMIMEType(int type, int request, int frame, int listener) {
+ boolean canShow = Cocoa.objc_msgSend(Cocoa.C_WebView, Cocoa.S_canShowMIMEType, type) != 0;
+ Cocoa.objc_msgSend(listener, canShow ? Cocoa.S_use : Cocoa.S_download);
+}
+
+void decidePolicyForNavigationAction(int actionInformation, int request, int frame, int listener) {
+ int url = Cocoa.objc_msgSend(request, Cocoa.S_URL);
+ if (url == 0) {
+ /* indicates that a URL with an invalid format was specified */
+ Cocoa.objc_msgSend(listener, Cocoa.S_ignore);
+ return;
+ }
+ int s = Cocoa.objc_msgSend(url, Cocoa.S_absoluteString);
+ int length = OS.CFStringGetLength(s);
+ char[] buffer = new char[length];
+ CFRange range = new CFRange();
+ range.length = length;
+ OS.CFStringGetCharacters(s, range, buffer);
+ String url2 = new String(buffer);
+ /*
+ * If the URI indicates that the page is being rendered from memory
+ * (via setText()) then set it to about:blank to be consistent with IE.
+ */
+ if (url2.equals (URI_FROMMEMORY)) url2 = ABOUT_BLANK;
+
+ LocationEvent newEvent = new LocationEvent(browser);
+ newEvent.display = browser.getDisplay();
+ newEvent.widget = browser;
+ newEvent.location = url2;
+ newEvent.doit = true;
+ if (locationListeners != null) {
+ changingLocation = true;
+ for (int i = 0; i < locationListeners.length; i++) {
+ locationListeners[i].changing(newEvent);
+ }
+ changingLocation = false;
+ }
+
+ Cocoa.objc_msgSend(listener, newEvent.doit ? Cocoa.S_use : Cocoa.S_ignore);
+
+ if (html != null && !browser.isDisposed()) {
+ String html = this.html;
+ this.html = null;
+ _setText(html);
+ }
+}
+
+void decidePolicyForNewWindowAction(int actionInformation, int request, int frameName, int listener) {
+ Cocoa.objc_msgSend(listener, Cocoa.S_use);
+}
+
+void unableToImplementPolicyWithError(int error, int frame) {
+}
+
+/* WebDownload */
+
+void decideDestinationWithSuggestedFilename (int download, int filename) {
+ int length = OS.CFStringGetLength(filename);
+ char[] buffer = new char[length];
+ CFRange range = new CFRange();
+ range.length = length;
+ OS.CFStringGetCharacters(filename, range, buffer);
+ String name = new String(buffer);
+ FileDialog dialog = new FileDialog(browser.getShell(), SWT.SAVE);
+ dialog.setText(SWT.getMessage ("SWT_FileDownload")); //$NON-NLS-1$
+ dialog.setFileName(name);
+ String path = dialog.open();
+ if (path == null) {
+ /* cancel pressed */
+ Cocoa.objc_msgSend(download, Cocoa.S_cancel);
+ return;
+ }
+ length = path.length();
+ char[] chars = new char[length];
+ path.getChars(0, length, chars, 0);
+ int result = OS.CFStringCreateWithCharacters(0, chars, length);
+ Cocoa.objc_msgSend(download, Cocoa.S_setDestinationAllowOverwrite, result, 1);
+ OS.CFRelease(result);
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java
new file mode 100755
index 0000000000..44efa0217a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java
@@ -0,0 +1,199 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.browser;
+
+import java.util.Hashtable;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.carbon.*;
+import org.eclipse.swt.internal.cocoa.*;
+import org.eclipse.swt.widgets.*;
+
+class MozillaDelegate {
+ Browser browser;
+ Listener listener;
+ boolean hasFocus;
+ static Callback Callback3;
+ static Hashtable handles = new Hashtable ();
+ static final boolean USE_COCOA_VIEW_CREATE = false;
+
+MozillaDelegate (Browser browser) {
+ super ();
+ this.browser = browser;
+}
+
+static Browser findBrowser (int handle) {
+ LONG value = (LONG)handles.get (new LONG (handle));
+ if (value != null) {
+ Display display = Display.getCurrent ();
+ return (Browser)display.findWidget (value.value);
+ }
+ return null;
+}
+
+static char[] mbcsToWcs (String codePage, byte [] buffer) {
+ int encoding = OS.CFStringGetSystemEncoding ();
+ int cfstring = OS.CFStringCreateWithBytes (OS.kCFAllocatorDefault, buffer, buffer.length, encoding, false);
+ char[] chars = null;
+ if (cfstring != 0) {
+ int length = OS.CFStringGetLength (cfstring);
+ chars = new char [length];
+ if (length != 0) {
+ CFRange range = new CFRange ();
+ range.length = length;
+ OS.CFStringGetCharacters (cfstring, range, chars);
+ }
+ OS.CFRelease (cfstring);
+ }
+ return chars;
+}
+
+static byte[] wcsToMbcs (String codePage, String string, boolean terminate) {
+ char[] chars = new char [string.length()];
+ string.getChars (0, chars.length, chars, 0);
+ int cfstring = OS.CFStringCreateWithCharacters (OS.kCFAllocatorDefault, chars, chars.length);
+ byte[] buffer = null;
+ if (cfstring != 0) {
+ CFRange range = new CFRange ();
+ range.length = chars.length;
+ int encoding = OS.CFStringGetSystemEncoding ();
+ int[] size = new int[1];
+ int numChars = OS.CFStringGetBytes (cfstring, range, encoding, (byte)'?', true, null, 0, size);
+ buffer = new byte [size[0] + (terminate ? 1 : 0)];
+ if (numChars != 0) {
+ numChars = OS.CFStringGetBytes (cfstring, range, encoding, (byte)'?', true, buffer, size[0], size);
+ }
+ OS.CFRelease (cfstring);
+ }
+ return buffer;
+}
+
+static int eventProc3 (int nextHandler, int theEvent, int userData) {
+ Widget widget = Display.getCurrent ().findWidget (userData);
+ if (widget instanceof Browser) {
+ Browser browser = (Browser) widget;
+ browser.getShell ().forceActive ();
+ ((Mozilla)browser.webBrowser).Activate ();
+ }
+ return OS.eventNotHandledErr;
+}
+
+int getHandle () {
+ int embedHandle = Cocoa.objc_msgSend (Cocoa.C_NSImageView, Cocoa.S_alloc);
+ if (embedHandle == 0) SWT.error (SWT.ERROR_NO_HANDLES);
+ NSRect r = new NSRect ();
+ embedHandle = Cocoa.objc_msgSend (embedHandle, Cocoa.S_initWithFrame, r);
+ int rc;
+ int[] outControl = new int[1];
+ if (USE_COCOA_VIEW_CREATE && OS.VERSION >= 0x1050) {
+ rc = Cocoa.HICocoaViewCreate (embedHandle, 0, outControl);
+ } else {
+ try {
+ System.loadLibrary ("frameembedding"); //$NON-NLS-1$
+ } catch (UnsatisfiedLinkError e) {}
+ rc = Cocoa.HIJavaViewCreateWithCocoaView (outControl, embedHandle);
+ }
+ if (rc != OS.noErr || outControl[0] == 0) SWT.error (SWT.ERROR_NO_HANDLES);
+ int subHIView = outControl[0];
+ HILayoutInfo newLayoutInfo = new HILayoutInfo ();
+ newLayoutInfo.version = 0;
+ OS.HIViewGetLayoutInfo (subHIView, newLayoutInfo);
+ HISideBinding biding = newLayoutInfo.binding.top;
+ biding.toView = 0;
+ biding.kind = OS.kHILayoutBindMin;
+ biding.offset = 0;
+ biding = newLayoutInfo.binding.left;
+ biding.toView = 0;
+ biding.kind = OS.kHILayoutBindMin;
+ biding.offset = 0;
+ biding = newLayoutInfo.binding.bottom;
+ biding.toView = 0;
+ biding.kind = OS.kHILayoutBindMax;
+ biding.offset = 0;
+ biding = newLayoutInfo.binding.right;
+ biding.toView = 0;
+ biding.kind = OS.kHILayoutBindMax;
+ biding.offset = 0;
+ OS.HIViewSetLayoutInfo (subHIView, newLayoutInfo);
+ OS.HIViewChangeFeatures (subHIView, OS.kHIViewFeatureIsOpaque, 0);
+ OS.HIViewSetVisible (subHIView, true);
+ int parentHandle = browser.handle;
+ OS.HIViewAddSubview (browser.handle, subHIView);
+ CGRect rect = new CGRect ();
+ OS.HIViewGetFrame (parentHandle, rect);
+ rect.x = rect.y = 0;
+ OS.HIViewSetFrame (subHIView, rect);
+ handles.put (new LONG (embedHandle), new LONG (browser.handle));
+
+ if (Callback3 == null) Callback3 = new Callback (this.getClass (), "eventProc3", 3); //$NON-NLS-1$
+ int callback3Address = Callback3.getAddress ();
+ if (callback3Address == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS);
+ int [] mask = new int [] {
+ OS.kEventClassMouse, OS.kEventMouseDown,
+ };
+ int controlTarget = OS.GetControlEventTarget (subHIView);
+ OS.InstallEventHandler (controlTarget, callback3Address, mask.length / 2, mask, browser.handle, null);
+
+ return embedHandle;
+}
+
+String getLibraryName () {
+ return "libxpcom.dylib"; //$NON-NLS-1$
+}
+
+void handleFocus () {
+ if (hasFocus) return;
+ hasFocus = true;
+ ((Mozilla)browser.webBrowser).Activate ();
+ browser.setFocus ();
+ listener = new Listener () {
+ public void handleEvent (Event event) {
+ if (event.widget == browser) return;
+ ((Mozilla)browser.webBrowser).Deactivate ();
+ hasFocus = false;
+ browser.getDisplay ().removeFilter (SWT.FocusIn, this);
+ browser.getShell ().removeListener (SWT.Deactivate, this);
+ listener = null;
+ }
+
+ };
+ browser.getDisplay ().addFilter (SWT.FocusIn, listener);
+ browser.getShell ().addListener (SWT.Deactivate, listener);
+}
+
+boolean hookEnterExit () {
+ return true;
+}
+
+void init () {
+}
+
+boolean needsSpinup () {
+ return false;
+}
+
+void onDispose (int embedHandle) {
+ handles.remove (new LONG (embedHandle));
+ if (listener != null) {
+ browser.getDisplay ().removeFilter (SWT.FocusIn, listener);
+ browser.getShell ().removeListener (SWT.Deactivate, listener);
+ listener = null;
+ }
+ browser = null;
+}
+
+void setSize (int embedHandle, int width, int height) {
+ // TODO
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/build.sh b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/build.sh
new file mode 100755
index 0000000000..299f6e1474
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/build.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+#*******************************************************************************
+# Copyright (c) 2000, 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+#*******************************************************************************
+
+cd `dirname $0`
+
+OUTPUT_DIR=../../../org.eclipse.swt.cocoa.macosx
+
+export OUTPUT_DIR
+
+export MACOSX_DEPLOYMENT_TARGET=10.4
+
+make -f make_macosx.mak $1 $2 $3 $4 $5 $6 $7 $8 $9
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/build.xml b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/build.xml
new file mode 100755
index 0000000000..1061d674fa
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/build.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project default="build_cocoa_lib" basedir="../../..">
+
+<target name="init">
+ <eclipse.refreshLocal resource="org.eclipse.swt" depth="infinite" />
+ <eclipse.refreshLocal resource="org.eclipse.swt.tools" depth="infinite" />
+ <eclipse.incrementalBuild project="org.eclipse.swt" kind="incr" />
+</target>
+
+<target name="build_cocoa_lib" depends="init">
+ <exec dir="./bin/library" executable="sh">
+ <arg line="${basedir}/bin/library/build.sh"/>
+ <arg line="install"/>
+ </exec>
+ <eclipse.refreshLocal resource="org.eclipse.swt.cocoa.macosx" depth="infinite" />
+</target>
+
+<target name="clean">
+ <exec dir="./bin/library" executable="sh">
+ <arg line="${basedir}/bin/library/build.sh"/>
+ <arg line="clean"/>
+ </exec>
+</target>
+
+</project> \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/make_macosx.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/make_macosx.mak
new file mode 100755
index 0000000000..dbe3d92a5c
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/make_macosx.mak
@@ -0,0 +1,52 @@
+#*******************************************************************************
+# Copyright (c) 2000, 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+#*******************************************************************************
+
+# Makefile for SWT libraries on Cocoa/Mac
+
+include make_common.mak
+
+SWT_PREFIX=swt
+SWTPI_PREFIX=swt-pi
+WS_PREFIX=cocoa
+SWT_VERSION=$(maj_ver)$(min_ver)
+SWT_LIB=lib$(SWT_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).jnilib
+SWTPI_LIB=lib$(SWTPI_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).jnilib
+
+# Uncomment for Native Stats tool
+#NATIVE_STATS = -DNATIVE_STATS
+
+#SWT_DEBUG = -g
+ARCHS = -arch i386 -arch ppc
+CFLAGS = -c -xobjective-c -Wall $(ARCHS) -DSWT_VERSION=$(SWT_VERSION) $(NATIVE_STATS) $(SWT_DEBUG) -DUSE_ASSEMBLER -DCOCOA \
+ -I /System/Library/Frameworks/JavaVM.framework/Headers \
+ -I /System/Library/Frameworks/Cocoa.framework/Headers
+LFLAGS = -bundle $(ARCHS) -framework JavaVM -framework Cocoa -framework Carbon
+SWT_OBJECTS = swt.o c.o c_stats.o callback.o
+SWTPI_OBJECTS = swt.o os.o os_structs.o os_stats.o os_custom.o
+
+
+all: $(SWT_LIB) $(SWTPI_LIB)
+
+.c.o:
+ cc $(CFLAGS) $*.c
+
+$(SWT_LIB): $(SWT_OBJECTS)
+ cc -o $(SWT_LIB) $(LFLAGS) $(SWT_OBJECTS)
+
+$(SWTPI_LIB): $(SWTPI_OBJECTS)
+ cc -o $(SWTPI_LIB) $(LFLAGS) $(SWTPI_OBJECTS)
+
+
+install: all
+ cp *.jnilib $(OUTPUT_DIR)
+
+clean:
+ rm -f *.jnilib *.o
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c
new file mode 100644
index 0000000000..f1d31c78e7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c
@@ -0,0 +1,4829 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+#include "swt.h"
+#include "os_structs.h"
+#include "os_stats.h"
+
+#define OS_NATIVE(func) Java_org_eclipse_swt_internal_cocoa_OS_##func
+
+#ifndef NO_CGWarpMouseCursorPosition
+JNIEXPORT jint JNICALL OS_NATIVE(CGWarpMouseCursorPosition)
+ (JNIEnv *env, jclass that, jobject arg0)
+{
+ CGPoint _arg0, *lparg0=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, CGWarpMouseCursorPosition_FUNC);
+ if (arg0) if ((lparg0 = getCGPointFields(env, arg0, &_arg0)) == NULL) goto fail;
+ rc = (jint)CGWarpMouseCursorPosition(*lparg0);
+fail:
+ if (arg0 && lparg0) setCGPointFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, CGWarpMouseCursorPosition_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_CloseRgn
+JNIEXPORT void JNICALL OS_NATIVE(CloseRgn)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ OS_NATIVE_ENTER(env, that, CloseRgn_FUNC);
+/*
+ CloseRgn(arg0);
+*/
+ {
+ static int initialized = 0;
+ static CFBundleRef bundle = NULL;
+ typedef void (*FPTR)(jint);
+ static FPTR fptr;
+ if (!initialized) {
+ if (!bundle) bundle = CFBundleGetBundleWithIdentifier(CFSTR(CloseRgn_LIB));
+ if (bundle) fptr = (FPTR)CFBundleGetFunctionPointerForName(bundle, CFSTR("CloseRgn"));
+ initialized = 1;
+ }
+ if (fptr) {
+ (*fptr)(arg0);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, CloseRgn_FUNC);
+}
+#endif
+
+#ifndef NO_CopyRgn
+JNIEXPORT void JNICALL OS_NATIVE(CopyRgn)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1)
+{
+ OS_NATIVE_ENTER(env, that, CopyRgn_FUNC);
+/*
+ CopyRgn(arg0, arg1);
+*/
+ {
+ static int initialized = 0;
+ static CFBundleRef bundle = NULL;
+ typedef void (*FPTR)(jint, jint);
+ static FPTR fptr;
+ if (!initialized) {
+ if (!bundle) bundle = CFBundleGetBundleWithIdentifier(CFSTR(CopyRgn_LIB));
+ if (bundle) fptr = (FPTR)CFBundleGetFunctionPointerForName(bundle, CFSTR("CopyRgn"));
+ initialized = 1;
+ }
+ if (fptr) {
+ (*fptr)(arg0, arg1);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, CopyRgn_FUNC);
+}
+#endif
+
+#ifndef NO_DeleteGlobalRef
+JNIEXPORT void JNICALL OS_NATIVE(DeleteGlobalRef)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ OS_NATIVE_ENTER(env, that, DeleteGlobalRef_FUNC);
+ (*env)->DeleteGlobalRef(env, (jobject)arg0);
+ OS_NATIVE_EXIT(env, that, DeleteGlobalRef_FUNC);
+}
+#endif
+
+#ifndef NO_DiffRgn
+JNIEXPORT void JNICALL OS_NATIVE(DiffRgn)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2)
+{
+ OS_NATIVE_ENTER(env, that, DiffRgn_FUNC);
+/*
+ DiffRgn(arg0, arg1, arg2);
+*/
+ {
+ static int initialized = 0;
+ static CFBundleRef bundle = NULL;
+ typedef void (*FPTR)(jint, jint, jint);
+ static FPTR fptr;
+ if (!initialized) {
+ if (!bundle) bundle = CFBundleGetBundleWithIdentifier(CFSTR(DiffRgn_LIB));
+ if (bundle) fptr = (FPTR)CFBundleGetFunctionPointerForName(bundle, CFSTR("DiffRgn"));
+ initialized = 1;
+ }
+ if (fptr) {
+ (*fptr)(arg0, arg1, arg2);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, DiffRgn_FUNC);
+}
+#endif
+
+#ifndef NO_DisposeRgn
+JNIEXPORT void JNICALL OS_NATIVE(DisposeRgn)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ OS_NATIVE_ENTER(env, that, DisposeRgn_FUNC);
+/*
+ DisposeRgn(arg0);
+*/
+ {
+ static int initialized = 0;
+ static CFBundleRef bundle = NULL;
+ typedef void (*FPTR)(jint);
+ static FPTR fptr;
+ if (!initialized) {
+ if (!bundle) bundle = CFBundleGetBundleWithIdentifier(CFSTR(DisposeRgn_LIB));
+ if (bundle) fptr = (FPTR)CFBundleGetFunctionPointerForName(bundle, CFSTR("DisposeRgn"));
+ initialized = 1;
+ }
+ if (fptr) {
+ (*fptr)(arg0);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, DisposeRgn_FUNC);
+}
+#endif
+
+#ifndef NO_EmptyRgn
+JNIEXPORT jboolean JNICALL OS_NATIVE(EmptyRgn)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jboolean rc = 0;
+ OS_NATIVE_ENTER(env, that, EmptyRgn_FUNC);
+/*
+ rc = (jboolean)EmptyRgn(arg0);
+*/
+ {
+ static int initialized = 0;
+ static CFBundleRef bundle = NULL;
+ typedef jboolean (*FPTR)(jint);
+ static FPTR fptr;
+ rc = 0;
+ if (!initialized) {
+ if (!bundle) bundle = CFBundleGetBundleWithIdentifier(CFSTR(EmptyRgn_LIB));
+ if (bundle) fptr = (FPTR)CFBundleGetFunctionPointerForName(bundle, CFSTR("EmptyRgn"));
+ initialized = 1;
+ }
+ if (fptr) {
+ rc = (jboolean)(*fptr)(arg0);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, EmptyRgn_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_GetCurrentProcess
+JNIEXPORT jint JNICALL OS_NATIVE(GetCurrentProcess)
+ (JNIEnv *env, jclass that, jintArray arg0)
+{
+ jint *lparg0=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, GetCurrentProcess_FUNC);
+ if (arg0) if ((lparg0 = (*env)->GetIntArrayElements(env, arg0, NULL)) == NULL) goto fail;
+ rc = (jint)GetCurrentProcess((ProcessSerialNumber *)lparg0);
+fail:
+ if (arg0 && lparg0) (*env)->ReleaseIntArrayElements(env, arg0, lparg0, 0);
+ OS_NATIVE_EXIT(env, that, GetCurrentProcess_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_GetRegionBounds
+JNIEXPORT void JNICALL OS_NATIVE(GetRegionBounds)
+ (JNIEnv *env, jclass that, jint arg0, jshortArray arg1)
+{
+ jshort *lparg1=NULL;
+ OS_NATIVE_ENTER(env, that, GetRegionBounds_FUNC);
+ if (arg1) if ((lparg1 = (*env)->GetShortArrayElements(env, arg1, NULL)) == NULL) goto fail;
+/*
+ GetRegionBounds(arg0, lparg1);
+*/
+ {
+ static int initialized = 0;
+ static CFBundleRef bundle = NULL;
+ typedef void (*FPTR)(jint, jshort *);
+ static FPTR fptr;
+ if (!initialized) {
+ if (!bundle) bundle = CFBundleGetBundleWithIdentifier(CFSTR(GetRegionBounds_LIB));
+ if (bundle) fptr = (FPTR)CFBundleGetFunctionPointerForName(bundle, CFSTR("GetRegionBounds"));
+ initialized = 1;
+ }
+ if (fptr) {
+ (*fptr)(arg0, lparg1);
+ }
+ }
+fail:
+ if (arg1 && lparg1) (*env)->ReleaseShortArrayElements(env, arg1, lparg1, 0);
+ OS_NATIVE_EXIT(env, that, GetRegionBounds_FUNC);
+}
+#endif
+
+#ifndef NO_LineTo
+JNIEXPORT void JNICALL OS_NATIVE(LineTo)
+ (JNIEnv *env, jclass that, jshort arg0, jshort arg1)
+{
+ OS_NATIVE_ENTER(env, that, LineTo_FUNC);
+/*
+ LineTo(arg0, arg1);
+*/
+ {
+ static int initialized = 0;
+ static CFBundleRef bundle = NULL;
+ typedef void (*FPTR)(jshort, jshort);
+ static FPTR fptr;
+ if (!initialized) {
+ if (!bundle) bundle = CFBundleGetBundleWithIdentifier(CFSTR(LineTo_LIB));
+ if (bundle) fptr = (FPTR)CFBundleGetFunctionPointerForName(bundle, CFSTR("LineTo"));
+ initialized = 1;
+ }
+ if (fptr) {
+ (*fptr)(arg0, arg1);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, LineTo_FUNC);
+}
+#endif
+
+#ifndef NO_MoveTo
+JNIEXPORT void JNICALL OS_NATIVE(MoveTo)
+ (JNIEnv *env, jclass that, jshort arg0, jshort arg1)
+{
+ OS_NATIVE_ENTER(env, that, MoveTo_FUNC);
+/*
+ MoveTo(arg0, arg1);
+*/
+ {
+ static int initialized = 0;
+ static CFBundleRef bundle = NULL;
+ typedef void (*FPTR)(jshort, jshort);
+ static FPTR fptr;
+ if (!initialized) {
+ if (!bundle) bundle = CFBundleGetBundleWithIdentifier(CFSTR(MoveTo_LIB));
+ if (bundle) fptr = (FPTR)CFBundleGetFunctionPointerForName(bundle, CFSTR("MoveTo"));
+ initialized = 1;
+ }
+ if (fptr) {
+ (*fptr)(arg0, arg1);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, MoveTo_FUNC);
+}
+#endif
+
+#ifndef NO_NSBackgroundColorAttributeName
+JNIEXPORT jint JNICALL OS_NATIVE(NSBackgroundColorAttributeName)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, NSBackgroundColorAttributeName_FUNC);
+ rc = (jint)NSBackgroundColorAttributeName;
+ OS_NATIVE_EXIT(env, that, NSBackgroundColorAttributeName_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_NSBaselineOffsetAttributeName
+JNIEXPORT jint JNICALL OS_NATIVE(NSBaselineOffsetAttributeName)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, NSBaselineOffsetAttributeName_FUNC);
+ rc = (jint)NSBaselineOffsetAttributeName;
+ OS_NATIVE_EXIT(env, that, NSBaselineOffsetAttributeName_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_NSBitsPerPixelFromDepth
+JNIEXPORT jint JNICALL OS_NATIVE(NSBitsPerPixelFromDepth)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, NSBitsPerPixelFromDepth_FUNC);
+ rc = (jint)NSBitsPerPixelFromDepth(arg0);
+ OS_NATIVE_EXIT(env, that, NSBitsPerPixelFromDepth_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_NSDefaultRunLoopMode
+JNIEXPORT jint JNICALL OS_NATIVE(NSDefaultRunLoopMode)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, NSDefaultRunLoopMode_FUNC);
+ rc = (jint)NSDefaultRunLoopMode;
+ OS_NATIVE_EXIT(env, that, NSDefaultRunLoopMode_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_NSDeviceRGBColorSpace
+JNIEXPORT jint JNICALL OS_NATIVE(NSDeviceRGBColorSpace)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, NSDeviceRGBColorSpace_FUNC);
+ rc = (jint)NSDeviceRGBColorSpace;
+ OS_NATIVE_EXIT(env, that, NSDeviceRGBColorSpace_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_NSDeviceResolution
+JNIEXPORT jint JNICALL OS_NATIVE(NSDeviceResolution)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, NSDeviceResolution_FUNC);
+ rc = (jint)NSDeviceResolution;
+ OS_NATIVE_EXIT(env, that, NSDeviceResolution_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_NSFontAttributeName
+JNIEXPORT jint JNICALL OS_NATIVE(NSFontAttributeName)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, NSFontAttributeName_FUNC);
+ rc = (jint)NSFontAttributeName;
+ OS_NATIVE_EXIT(env, that, NSFontAttributeName_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_NSForegroundColorAttributeName
+JNIEXPORT jint JNICALL OS_NATIVE(NSForegroundColorAttributeName)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, NSForegroundColorAttributeName_FUNC);
+ rc = (jint)NSForegroundColorAttributeName;
+ OS_NATIVE_EXIT(env, that, NSForegroundColorAttributeName_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_NSLinkAttributeName
+JNIEXPORT jint JNICALL OS_NATIVE(NSLinkAttributeName)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, NSLinkAttributeName_FUNC);
+ rc = (jint)NSLinkAttributeName;
+ OS_NATIVE_EXIT(env, that, NSLinkAttributeName_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_NSParagraphStyleAttributeName
+JNIEXPORT jint JNICALL OS_NATIVE(NSParagraphStyleAttributeName)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, NSParagraphStyleAttributeName_FUNC);
+ rc = (jint)NSParagraphStyleAttributeName;
+ OS_NATIVE_EXIT(env, that, NSParagraphStyleAttributeName_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_NSStrikethroughColorAttributeName
+JNIEXPORT jint JNICALL OS_NATIVE(NSStrikethroughColorAttributeName)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, NSStrikethroughColorAttributeName_FUNC);
+ rc = (jint)NSStrikethroughColorAttributeName;
+ OS_NATIVE_EXIT(env, that, NSStrikethroughColorAttributeName_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_NSStrikethroughStyleAttributeName
+JNIEXPORT jint JNICALL OS_NATIVE(NSStrikethroughStyleAttributeName)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, NSStrikethroughStyleAttributeName_FUNC);
+ rc = (jint)NSStrikethroughStyleAttributeName;
+ OS_NATIVE_EXIT(env, that, NSStrikethroughStyleAttributeName_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_NSUnderlineColorAttributeName
+JNIEXPORT jint JNICALL OS_NATIVE(NSUnderlineColorAttributeName)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, NSUnderlineColorAttributeName_FUNC);
+ rc = (jint)NSUnderlineColorAttributeName;
+ OS_NATIVE_EXIT(env, that, NSUnderlineColorAttributeName_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_NSUnderlineStyleAttributeName
+JNIEXPORT jint JNICALL OS_NATIVE(NSUnderlineStyleAttributeName)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, NSUnderlineStyleAttributeName_FUNC);
+ rc = (jint)NSUnderlineStyleAttributeName;
+ OS_NATIVE_EXIT(env, that, NSUnderlineStyleAttributeName_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_NewGlobalRef
+JNIEXPORT jint JNICALL OS_NATIVE(NewGlobalRef)
+ (JNIEnv *env, jclass that, jobject arg0)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, NewGlobalRef_FUNC);
+ rc = (jint)(*env)->NewGlobalRef(env, (jobject)arg0);
+ OS_NATIVE_EXIT(env, that, NewGlobalRef_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_NewRgn
+JNIEXPORT jint JNICALL OS_NATIVE(NewRgn)
+ (JNIEnv *env, jclass that)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, NewRgn_FUNC);
+/*
+ rc = (jint)NewRgn();
+*/
+ {
+ static int initialized = 0;
+ static CFBundleRef bundle = NULL;
+ typedef jint (*FPTR)();
+ static FPTR fptr;
+ rc = 0;
+ if (!initialized) {
+ if (!bundle) bundle = CFBundleGetBundleWithIdentifier(CFSTR(NewRgn_LIB));
+ if (bundle) fptr = (FPTR)CFBundleGetFunctionPointerForName(bundle, CFSTR("NewRgn"));
+ initialized = 1;
+ }
+ if (fptr) {
+ rc = (jint)(*fptr)();
+ }
+ }
+ OS_NATIVE_EXIT(env, that, NewRgn_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_OffsetRgn
+JNIEXPORT void JNICALL OS_NATIVE(OffsetRgn)
+ (JNIEnv *env, jclass that, jint arg0, jshort arg1, jshort arg2)
+{
+ OS_NATIVE_ENTER(env, that, OffsetRgn_FUNC);
+/*
+ OffsetRgn(arg0, arg1, arg2);
+*/
+ {
+ static int initialized = 0;
+ static CFBundleRef bundle = NULL;
+ typedef void (*FPTR)(jint, jshort, jshort);
+ static FPTR fptr;
+ if (!initialized) {
+ if (!bundle) bundle = CFBundleGetBundleWithIdentifier(CFSTR(OffsetRgn_LIB));
+ if (bundle) fptr = (FPTR)CFBundleGetFunctionPointerForName(bundle, CFSTR("OffsetRgn"));
+ initialized = 1;
+ }
+ if (fptr) {
+ (*fptr)(arg0, arg1, arg2);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, OffsetRgn_FUNC);
+}
+#endif
+
+#ifndef NO_OpenRgn
+JNIEXPORT void JNICALL OS_NATIVE(OpenRgn)
+ (JNIEnv *env, jclass that)
+{
+ OS_NATIVE_ENTER(env, that, OpenRgn_FUNC);
+/*
+ OpenRgn();
+*/
+ {
+ static int initialized = 0;
+ static CFBundleRef bundle = NULL;
+ typedef void (*FPTR)();
+ static FPTR fptr;
+ if (!initialized) {
+ if (!bundle) bundle = CFBundleGetBundleWithIdentifier(CFSTR(OpenRgn_LIB));
+ if (bundle) fptr = (FPTR)CFBundleGetFunctionPointerForName(bundle, CFSTR("OpenRgn"));
+ initialized = 1;
+ }
+ if (fptr) {
+ (*fptr)();
+ }
+ }
+ OS_NATIVE_EXIT(env, that, OpenRgn_FUNC);
+}
+#endif
+
+#ifndef NO_PtInRgn
+JNIEXPORT jboolean JNICALL OS_NATIVE(PtInRgn)
+ (JNIEnv *env, jclass that, jshortArray arg0, jint arg1)
+{
+ jshort *lparg0=NULL;
+ jboolean rc = 0;
+ OS_NATIVE_ENTER(env, that, PtInRgn_FUNC);
+ if (arg0) if ((lparg0 = (*env)->GetShortArrayElements(env, arg0, NULL)) == NULL) goto fail;
+/*
+ rc = (jboolean)PtInRgn(lparg0, arg1);
+*/
+ {
+ static int initialized = 0;
+ static CFBundleRef bundle = NULL;
+ typedef jboolean (*FPTR)(jshort *, jint);
+ static FPTR fptr;
+ rc = 0;
+ if (!initialized) {
+ if (!bundle) bundle = CFBundleGetBundleWithIdentifier(CFSTR(PtInRgn_LIB));
+ if (bundle) fptr = (FPTR)CFBundleGetFunctionPointerForName(bundle, CFSTR("PtInRgn"));
+ initialized = 1;
+ }
+ if (fptr) {
+ rc = (jboolean)(*fptr)(lparg0, arg1);
+ }
+ }
+fail:
+ if (arg0 && lparg0) (*env)->ReleaseShortArrayElements(env, arg0, lparg0, 0);
+ OS_NATIVE_EXIT(env, that, PtInRgn_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_QDRegionToRects
+JNIEXPORT jint JNICALL OS_NATIVE(QDRegionToRects)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, QDRegionToRects_FUNC);
+/*
+ rc = (jint)QDRegionToRects(arg0, arg1, arg2, arg3);
+*/
+ {
+ static int initialized = 0;
+ static CFBundleRef bundle = NULL;
+ typedef jint (*FPTR)(jint, jint, jint, jint);
+ static FPTR fptr;
+ rc = 0;
+ if (!initialized) {
+ if (!bundle) bundle = CFBundleGetBundleWithIdentifier(CFSTR(QDRegionToRects_LIB));
+ if (bundle) fptr = (FPTR)CFBundleGetFunctionPointerForName(bundle, CFSTR("QDRegionToRects"));
+ initialized = 1;
+ }
+ if (fptr) {
+ rc = (jint)(*fptr)(arg0, arg1, arg2, arg3);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, QDRegionToRects_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_RectInRgn
+JNIEXPORT jboolean JNICALL OS_NATIVE(RectInRgn)
+ (JNIEnv *env, jclass that, jshortArray arg0, jint arg1)
+{
+ jshort *lparg0=NULL;
+ jboolean rc = 0;
+ OS_NATIVE_ENTER(env, that, RectInRgn_FUNC);
+ if (arg0) if ((lparg0 = (*env)->GetShortArrayElements(env, arg0, NULL)) == NULL) goto fail;
+/*
+ rc = (jboolean)RectInRgn(lparg0, arg1);
+*/
+ {
+ static int initialized = 0;
+ static CFBundleRef bundle = NULL;
+ typedef jboolean (*FPTR)(jshort *, jint);
+ static FPTR fptr;
+ rc = 0;
+ if (!initialized) {
+ if (!bundle) bundle = CFBundleGetBundleWithIdentifier(CFSTR(RectInRgn_LIB));
+ if (bundle) fptr = (FPTR)CFBundleGetFunctionPointerForName(bundle, CFSTR("RectInRgn"));
+ initialized = 1;
+ }
+ if (fptr) {
+ rc = (jboolean)(*fptr)(lparg0, arg1);
+ }
+ }
+fail:
+ if (arg0 && lparg0) (*env)->ReleaseShortArrayElements(env, arg0, lparg0, 0);
+ OS_NATIVE_EXIT(env, that, RectInRgn_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_RectRgn
+JNIEXPORT void JNICALL OS_NATIVE(RectRgn)
+ (JNIEnv *env, jclass that, jint arg0, jshortArray arg1)
+{
+ jshort *lparg1=NULL;
+ OS_NATIVE_ENTER(env, that, RectRgn_FUNC);
+ if (arg1) if ((lparg1 = (*env)->GetShortArrayElements(env, arg1, NULL)) == NULL) goto fail;
+/*
+ RectRgn(arg0, lparg1);
+*/
+ {
+ static int initialized = 0;
+ static CFBundleRef bundle = NULL;
+ typedef void (*FPTR)(jint, jshort *);
+ static FPTR fptr;
+ if (!initialized) {
+ if (!bundle) bundle = CFBundleGetBundleWithIdentifier(CFSTR(RectRgn_LIB));
+ if (bundle) fptr = (FPTR)CFBundleGetFunctionPointerForName(bundle, CFSTR("RectRgn"));
+ initialized = 1;
+ }
+ if (fptr) {
+ (*fptr)(arg0, lparg1);
+ }
+ }
+fail:
+ if (arg1 && lparg1) (*env)->ReleaseShortArrayElements(env, arg1, lparg1, 0);
+ OS_NATIVE_EXIT(env, that, RectRgn_FUNC);
+}
+#endif
+
+#ifndef NO_SectRgn
+JNIEXPORT void JNICALL OS_NATIVE(SectRgn)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2)
+{
+ OS_NATIVE_ENTER(env, that, SectRgn_FUNC);
+/*
+ SectRgn(arg0, arg1, arg2);
+*/
+ {
+ static int initialized = 0;
+ static CFBundleRef bundle = NULL;
+ typedef void (*FPTR)(jint, jint, jint);
+ static FPTR fptr;
+ if (!initialized) {
+ if (!bundle) bundle = CFBundleGetBundleWithIdentifier(CFSTR(SectRgn_LIB));
+ if (bundle) fptr = (FPTR)CFBundleGetFunctionPointerForName(bundle, CFSTR("SectRgn"));
+ initialized = 1;
+ }
+ if (fptr) {
+ (*fptr)(arg0, arg1, arg2);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, SectRgn_FUNC);
+}
+#endif
+
+#ifndef NO_SetFrontProcess
+JNIEXPORT jint JNICALL OS_NATIVE(SetFrontProcess)
+ (JNIEnv *env, jclass that, jintArray arg0)
+{
+ jint *lparg0=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, SetFrontProcess_FUNC);
+ if (arg0) if ((lparg0 = (*env)->GetIntArrayElements(env, arg0, NULL)) == NULL) goto fail;
+ rc = (jint)SetFrontProcess((ProcessSerialNumber *)lparg0);
+fail:
+ if (arg0 && lparg0) (*env)->ReleaseIntArrayElements(env, arg0, lparg0, 0);
+ OS_NATIVE_EXIT(env, that, SetFrontProcess_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_TransformProcessType
+JNIEXPORT jint JNICALL OS_NATIVE(TransformProcessType)
+ (JNIEnv *env, jclass that, jintArray arg0, jint arg1)
+{
+ jint *lparg0=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, TransformProcessType_FUNC);
+ if (arg0) if ((lparg0 = (*env)->GetIntArrayElements(env, arg0, NULL)) == NULL) goto fail;
+ rc = (jint)TransformProcessType((ProcessSerialNumber *)lparg0, arg1);
+fail:
+ if (arg0 && lparg0) (*env)->ReleaseIntArrayElements(env, arg0, lparg0, 0);
+ OS_NATIVE_EXIT(env, that, TransformProcessType_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_UnionRgn
+JNIEXPORT void JNICALL OS_NATIVE(UnionRgn)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2)
+{
+ OS_NATIVE_ENTER(env, that, UnionRgn_FUNC);
+/*
+ UnionRgn(arg0, arg1, arg2);
+*/
+ {
+ static int initialized = 0;
+ static CFBundleRef bundle = NULL;
+ typedef void (*FPTR)(jint, jint, jint);
+ static FPTR fptr;
+ if (!initialized) {
+ if (!bundle) bundle = CFBundleGetBundleWithIdentifier(CFSTR(UnionRgn_LIB));
+ if (bundle) fptr = (FPTR)CFBundleGetFunctionPointerForName(bundle, CFSTR("UnionRgn"));
+ initialized = 1;
+ }
+ if (fptr) {
+ (*fptr)(arg0, arg1, arg2);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, UnionRgn_FUNC);
+}
+#endif
+
+#ifndef NO_class_1addIvar
+JNIEXPORT jboolean JNICALL OS_NATIVE(class_1addIvar)
+ (JNIEnv *env, jclass that, jint arg0, jstring arg1, jint arg2, jbyte arg3, jstring arg4)
+{
+ const char *lparg1= NULL;
+ const char *lparg4= NULL;
+ jboolean rc = 0;
+ OS_NATIVE_ENTER(env, that, class_1addIvar_FUNC);
+ if (arg1) if ((lparg1 = (*env)->GetStringUTFChars(env, arg1, NULL)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = (*env)->GetStringUTFChars(env, arg4, NULL)) == NULL) goto fail;
+ rc = (jboolean)class_addIvar((Class)arg0, (const char *)lparg1, (size_t)arg2, arg3, (const char *)lparg4);
+fail:
+ if (arg4 && lparg4) (*env)->ReleaseStringUTFChars(env, arg4, lparg4);
+ if (arg1 && lparg1) (*env)->ReleaseStringUTFChars(env, arg1, lparg1);
+ OS_NATIVE_EXIT(env, that, class_1addIvar_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_class_1addMethod
+JNIEXPORT jboolean JNICALL OS_NATIVE(class_1addMethod)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jstring arg3)
+{
+ const char *lparg3= NULL;
+ jboolean rc = 0;
+ OS_NATIVE_ENTER(env, that, class_1addMethod_FUNC);
+ if (arg3) if ((lparg3 = (*env)->GetStringUTFChars(env, arg3, NULL)) == NULL) goto fail;
+ rc = (jboolean)class_addMethod((Class)arg0, (SEL)arg1, (IMP)arg2, (const char *)lparg3);
+fail:
+ if (arg3 && lparg3) (*env)->ReleaseStringUTFChars(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, class_1addMethod_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_memmove__ILorg_eclipse_swt_internal_cocoa_NSRect_2I
+JNIEXPORT void JNICALL OS_NATIVE(memmove__ILorg_eclipse_swt_internal_cocoa_NSRect_2I)
+ (JNIEnv *env, jclass that, jint arg0, jobject arg1, jint arg2)
+{
+ NSRect _arg1, *lparg1=NULL;
+ OS_NATIVE_ENTER(env, that, memmove__ILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+ if (arg1) if ((lparg1 = getNSRectFields(env, arg1, &_arg1)) == NULL) goto fail;
+ memmove((void *)arg0, (void *)lparg1, arg2);
+fail:
+ if (arg1 && lparg1) setNSRectFields(env, arg1, lparg1);
+ OS_NATIVE_EXIT(env, that, memmove__ILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+}
+#endif
+
+#ifndef NO_memmove__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II
+JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2)
+{
+ NSPoint _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II_FUNC);
+ if (arg0) if ((lparg0 = getNSPointFields(env, arg0, &_arg0)) == NULL) goto fail;
+ memmove((void *)lparg0, (void *)arg1, arg2);
+fail:
+ if (arg0 && lparg0) setNSPointFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II_FUNC);
+}
+#endif
+
+#ifndef NO_memmove__Lorg_eclipse_swt_internal_cocoa_NSRange_2II
+JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_cocoa_NSRange_2II)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2)
+{
+ NSRange _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ memmove((void *)lparg0, (void *)arg1, arg2);
+fail:
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC);
+}
+#endif
+
+#ifndef NO_memmove__Lorg_eclipse_swt_internal_cocoa_NSRect_2II
+JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_cocoa_NSRect_2II)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2)
+{
+ NSRect _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_cocoa_NSRect_2II_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ memmove((void *)lparg0, (void *)arg1, arg2);
+fail:
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_cocoa_NSRect_2II_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1allocateClassPair
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1allocateClassPair)
+ (JNIEnv *env, jclass that, jint arg0, jstring arg1, jint arg2)
+{
+ const char *lparg1= NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1allocateClassPair_FUNC);
+ if (arg1) if ((lparg1 = (*env)->GetStringUTFChars(env, arg1, NULL)) == NULL) goto fail;
+ rc = (jint)objc_allocateClassPair((Class)arg0, (const char *)lparg1, (size_t)arg2);
+fail:
+ if (arg1 && lparg1) (*env)->ReleaseStringUTFChars(env, arg1, lparg1);
+ OS_NATIVE_EXIT(env, that, objc_1allocateClassPair_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1getClass
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1getClass)
+ (JNIEnv *env, jclass that, jstring arg0)
+{
+ const char *lparg0= NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1getClass_FUNC);
+ if (arg0) if ((lparg0 = (*env)->GetStringUTFChars(env, arg0, NULL)) == NULL) goto fail;
+ rc = (jint)objc_getClass((const char *)lparg0);
+fail:
+ if (arg0 && lparg0) (*env)->ReleaseStringUTFChars(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1getClass_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1lookUpClass
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1lookUpClass)
+ (JNIEnv *env, jclass that, jstring arg0)
+{
+ const char *lparg0= NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1lookUpClass_FUNC);
+ if (arg0) if ((lparg0 = (*env)->GetStringUTFChars(env, arg0, NULL)) == NULL) goto fail;
+ rc = (jint)objc_lookUpClass((const char *)lparg0);
+fail:
+ if (arg0 && lparg0) (*env)->ReleaseStringUTFChars(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1lookUpClass_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__II
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__II)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__II_FUNC);
+ rc = (jint)((jint (*)(id, SEL))objc_msgSend)((id)arg0, (SEL)arg1);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__II_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIB
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIB)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jbyte arg2)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIB_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jbyte))objc_msgSend)((id)arg0, (SEL)arg1, arg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIB_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IID
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IID)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jdouble arg2)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IID_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jdouble))objc_msgSend)((id)arg0, (SEL)arg1, arg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IID_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIDD
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIDD)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jdouble arg2, jdouble arg3)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIDD_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jdouble, jdouble))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIDD_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIDI
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIDI)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jdouble arg2, jint arg3)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIDI_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jdouble, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIDI_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIDIIIZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIDIIIZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jdouble arg2, jint arg3, jint arg4, jint arg5, jboolean arg6)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIDIIIZ_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jdouble, jint, jint, jint, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5, arg6);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIDIIIZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIDIZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIDIZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jdouble arg2, jint arg3, jboolean arg4)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIDIZ_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jdouble, jint, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIDIZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIF
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jfloat arg2)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIF_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, arg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIFF
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIFF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jfloat arg2, jfloat arg3)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIFF_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jfloat, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIFF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIFFFF
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIFFFF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jfloat arg2, jfloat arg3, jfloat arg4, jfloat arg5)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIFFFF_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jfloat, jfloat, jfloat, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIFFFF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIFFFFF
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIFFFFF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jfloat arg2, jfloat arg3, jfloat arg4, jfloat arg5, jfloat arg6)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIFFFFF_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jfloat, jfloat, jfloat, jfloat, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5, arg6);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIFFFFF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIFI
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIFI)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jfloat arg2, jint arg3)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIFI_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jfloat, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIFI_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIFIF
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIFIF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jfloat arg2, jint arg3, jfloat arg4)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIFIF_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jfloat, jint, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIFIF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIFII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIFII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jfloat arg2, jint arg3, jint arg4)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIFII_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jfloat, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIFII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIFIII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIFIII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jfloat arg2, jint arg3, jint arg4, jint arg5)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIFIII_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jfloat, jint, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIFIII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__III
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__III)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__III_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__III_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIDIIIZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIDIIIZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jdouble arg3, jint arg4, jint arg5, jint arg6, jboolean arg7)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIDIIIZ_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jdouble, jint, jint, jint, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIDIIIZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIF
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jfloat arg3)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIF_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIFFF
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIFFF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jfloat arg3, jfloat arg4, jfloat arg5)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIFFF_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jfloat, jfloat, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIFFF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIFI
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIFI)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jfloat arg3, jint arg4)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIFI_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jfloat, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIFI_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIFILorg_eclipse_swt_internal_cocoa_NSPoint_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIFILorg_eclipse_swt_internal_cocoa_NSPoint_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jfloat arg3, jint arg4, jobject arg5)
+{
+ NSPoint _arg5, *lparg5=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIFILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ if (arg5) if ((lparg5 = getNSPointFields(env, arg5, &_arg5)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, jfloat, jint, NSPoint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, *lparg5);
+fail:
+ if (arg5 && lparg5) setNSPointFields(env, arg5, lparg5);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIFILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIII_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIID
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIID)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jdouble arg4)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIID_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jdouble))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIID_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIDI
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIDI)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jdouble arg4, jint arg5)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIDI_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jdouble, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIDI_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIF
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jfloat arg4)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIF_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIFII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIFII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jfloat arg4, jint arg5, jint arg6)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIFII_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jfloat, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5, arg6);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIFII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIII_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIIF
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIIF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jfloat arg5)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIIF_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jint, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIIF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIII_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIIII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIIII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIIII_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jint, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5, arg6);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIIII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIIIII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIIIII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jint arg7)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIIIII_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jint, jint, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIIIII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIIIIII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIIIIII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jint arg7, jint arg8)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIIIIII_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jint, jint, jint, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIIIIII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIIIILorg_eclipse_swt_internal_cocoa_NSPoint_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIIIILorg_eclipse_swt_internal_cocoa_NSPoint_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jobject arg7)
+{
+ NSPoint _arg7, *lparg7=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIIIILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ if (arg7) if ((lparg7 = getNSPointFields(env, arg7, &_arg7)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jint, jint, jint, NSPoint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5, arg6, *lparg7);
+fail:
+ if (arg7 && lparg7) setNSPointFields(env, arg7, lparg7);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIIIILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIIIILorg_eclipse_swt_internal_cocoa_NSRange_2I
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIIIILorg_eclipse_swt_internal_cocoa_NSRange_2I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jobject arg7, jint arg8)
+{
+ NSRange _arg7, *lparg7=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIIIILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+ if (arg7) if ((lparg7 = getNSRangeFields(env, arg7, &_arg7)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jint, jint, jint, NSRange, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5, arg6, *lparg7, arg8);
+fail:
+ if (arg7 && lparg7) setNSRangeFields(env, arg7, lparg7);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIIIILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIIIIZZIII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIIIIZZIII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jboolean arg7, jboolean arg8, jint arg9, jint arg10, jint arg11)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIIIIZZIII_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jint, jint, jint, jboolean, jboolean, jint, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIIIIZZIII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIIIIZZIIII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIIIIZZIIII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jboolean arg7, jboolean arg8, jint arg9, jint arg10, jint arg11, jint arg12)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIIIIZZIIII_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jint, jint, jint, jboolean, jboolean, jint, jint, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIIIIZZIIII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIIILorg_eclipse_swt_internal_cocoa_NSRect_2FFF
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIIILorg_eclipse_swt_internal_cocoa_NSRect_2FFF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5, jobject arg6, jfloat arg7, jfloat arg8, jfloat arg9)
+{
+ NSRect _arg6, *lparg6=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIIILorg_eclipse_swt_internal_cocoa_NSRect_2FFF_FUNC);
+ if (arg6) if ((lparg6 = getNSRectFields(env, arg6, &_arg6)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jint, jint, NSRect, jfloat, jfloat, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5, *lparg6, arg7, arg8, arg9);
+fail:
+ if (arg6 && lparg6) setNSRectFields(env, arg6, lparg6);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIIILorg_eclipse_swt_internal_cocoa_NSRect_2FFF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIILorg_eclipse_swt_internal_cocoa_NSPoint_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIILorg_eclipse_swt_internal_cocoa_NSPoint_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jobject arg5)
+{
+ NSPoint _arg5, *lparg5=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ if (arg5) if ((lparg5 = getNSPointFields(env, arg5, &_arg5)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jint, NSPoint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, *lparg5);
+fail:
+ if (arg5 && lparg5) setNSPointFields(env, arg5, lparg5);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIILorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIILorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jobject arg5)
+{
+ NSRange _arg5, *lparg5=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg5) if ((lparg5 = getNSRangeFields(env, arg5, &_arg5)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jint, NSRange))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, *lparg5);
+fail:
+ if (arg5 && lparg5) setNSRangeFields(env, arg5, lparg5);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIILorg_eclipse_swt_internal_cocoa_NSRange_2I
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIILorg_eclipse_swt_internal_cocoa_NSRange_2I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jobject arg5, jint arg6)
+{
+ NSRange _arg5, *lparg5=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+ if (arg5) if ((lparg5 = getNSRangeFields(env, arg5, &_arg5)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jint, NSRange, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, *lparg5, arg6);
+fail:
+ if (arg5 && lparg5) setNSRangeFields(env, arg5, lparg5);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIISI
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIISI)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jshort arg5, jint arg6)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIISI_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jint, jshort, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5, arg6);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIISI_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIIZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIIZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jboolean arg5)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIIZ_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jint, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIIZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIIZI
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIIZI)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jint arg4, jboolean arg5, jint arg6)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIIZI_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jint, jboolean, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5, arg6);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIIZI_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIJ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIJ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jlong arg4)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIJ_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jlong))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIJ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSPoint_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSPoint_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jobject arg4)
+{
+ NSPoint _arg4, *lparg4=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ if (arg4) if ((lparg4 = getNSPointFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, jint, NSPoint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, *lparg4);
+fail:
+ if (arg4 && lparg4) setNSPointFields(env, arg4, lparg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSPoint_2I
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSPoint_2I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jobject arg4, jint arg5)
+{
+ NSPoint _arg4, *lparg4=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC);
+ if (arg4) if ((lparg4 = getNSPointFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, jint, NSPoint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, *lparg4, arg5);
+fail:
+ if (arg4 && lparg4) setNSPointFields(env, arg4, lparg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jobject arg4)
+{
+ NSRange _arg4, *lparg4=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg4) if ((lparg4 = getNSRangeFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, jint, NSRange))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, *lparg4);
+fail:
+ if (arg4 && lparg4) setNSRangeFields(env, arg4, lparg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2I
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jobject arg4, jint arg5)
+{
+ NSRange _arg4, *lparg4=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+ if (arg4) if ((lparg4 = getNSRangeFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, jint, NSRange, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, *lparg4, arg5);
+fail:
+ if (arg4 && lparg4) setNSRangeFields(env, arg4, lparg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2ILorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2ILorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jobject arg4, jint arg5, jobject arg6)
+{
+ NSRange _arg4, *lparg4=NULL;
+ NSRange _arg6, *lparg6=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg4) if ((lparg4 = getNSRangeFields(env, arg4, &_arg4)) == NULL) goto fail;
+ if (arg6) if ((lparg6 = getNSRangeFields(env, arg6, &_arg6)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, jint, NSRange, jint, NSRange))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, *lparg4, arg5, *lparg6);
+fail:
+ if (arg6 && lparg6) setNSRangeFields(env, arg6, lparg6);
+ if (arg4 && lparg4) setNSRangeFields(env, arg4, lparg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jobject arg4, jobject arg5)
+{
+ NSRange _arg4, *lparg4=NULL;
+ NSPoint _arg5, *lparg5=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ if (arg4) if ((lparg4 = getNSRangeFields(env, arg4, &_arg4)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = getNSPointFields(env, arg5, &_arg5)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, jint, NSRange, NSPoint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, *lparg4, *lparg5);
+fail:
+ if (arg5 && lparg5) setNSPointFields(env, arg5, lparg5);
+ if (arg4 && lparg4) setNSRangeFields(env, arg4, lparg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSSize_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSSize_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jobject arg4, jobject arg5, jint arg6, jint arg7, jobject arg8)
+{
+ NSRange _arg4, *lparg4=NULL;
+ NSPoint _arg5, *lparg5=NULL;
+ NSSize _arg8, *lparg8=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC);
+ if (arg4) if ((lparg4 = getNSRangeFields(env, arg4, &_arg4)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = getNSPointFields(env, arg5, &_arg5)) == NULL) goto fail;
+ if (arg8) if ((lparg8 = getNSSizeFields(env, arg8, &_arg8)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, jint, NSRange, NSPoint, jint, jint, NSSize))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, *lparg4, *lparg5, arg6, arg7, *lparg8);
+fail:
+ if (arg8 && lparg8) setNSSizeFields(env, arg8, lparg8);
+ if (arg5 && lparg5) setNSPointFields(env, arg5, lparg5);
+ if (arg4 && lparg4) setNSRangeFields(env, arg4, lparg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRect_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRect_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jobject arg4)
+{
+ NSRect _arg4, *lparg4=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ if (arg4) if ((lparg4 = getNSRectFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, jint, NSRect))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, *lparg4);
+fail:
+ if (arg4 && lparg4) setNSRectFields(env, arg4, lparg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRect_2I
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRect_2I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jobject arg4, jint arg5)
+{
+ NSRect _arg4, *lparg4=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+ if (arg4) if ((lparg4 = getNSRectFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, jint, NSRect, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, *lparg4, arg5);
+fail:
+ if (arg4 && lparg4) setNSRectFields(env, arg4, lparg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRect_2II
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRect_2II)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jobject arg4, jint arg5, jint arg6)
+{
+ NSRect _arg4, *lparg4=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRect_2II_FUNC);
+ if (arg4) if ((lparg4 = getNSRectFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, jint, NSRect, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, *lparg4, arg5, arg6);
+fail:
+ if (arg4 && lparg4) setNSRectFields(env, arg4, lparg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRect_2II_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIS
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIS)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jshort arg4)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIS_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jshort))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIS_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jboolean arg4)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIZ_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIZI
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIZI)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jboolean arg4, jint arg5)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIZI_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jboolean, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIZI_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIIZII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIIZII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jboolean arg4, jint arg5, jint arg6)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIIZII_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jint, jboolean, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5, arg6);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIIZII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3)
+{
+ NSPoint _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSPoint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2I
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jint arg4)
+{
+ NSPoint _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC);
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSPoint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, arg4);
+fail:
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIIIIF
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIIIIF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jint arg4, jdouble arg5, jint arg6, jint arg7, jint arg8, jint arg9, jfloat arg10)
+{
+ NSPoint _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIIIIF_FUNC);
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSPoint, jint, jdouble, jint, jint, jint, jint, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
+fail:
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIIIIF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIIIII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIIIII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jint arg4, jdouble arg5, jint arg6, jint arg7, jint arg8, jint arg9, jint arg10)
+{
+ NSPoint _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIIIII_FUNC);
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSPoint, jint, jdouble, jint, jint, jint, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
+fail:
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIIIII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIIIIZS
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIIIIZS)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jint arg4, jdouble arg5, jint arg6, jint arg7, jint arg8, jint arg9, jboolean arg10, jshort arg11)
+{
+ NSPoint _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIIIIZS_FUNC);
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSPoint, jint, jdouble, jint, jint, jint, jint, jboolean, jshort))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11);
+fail:
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIIIIZS_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIISII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIISII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jint arg4, jdouble arg5, jint arg6, jint arg7, jshort arg8, jint arg9, jint arg10)
+{
+ NSPoint _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIISII_FUNC);
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSPoint, jint, jdouble, jint, jint, jshort, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
+fail:
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIISII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2II
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2II)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jint arg4, jint arg5)
+{
+ NSPoint _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2II_FUNC);
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSPoint, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, arg4, arg5);
+fail:
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2II_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jobject arg4)
+{
+ NSPoint _arg3, *lparg3=NULL;
+ NSPoint _arg4, *lparg4=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSPointFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSPoint, NSPoint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, *lparg4);
+fail:
+ if (arg4 && lparg4) setNSPointFields(env, arg4, lparg4);
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSSize_2IIIZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSSize_2IIIZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jobject arg4, jint arg5, jint arg6, jint arg7, jboolean arg8)
+{
+ NSPoint _arg3, *lparg3=NULL;
+ NSSize _arg4, *lparg4=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSSize_2IIIZ_FUNC);
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSSizeFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSPoint, NSSize, jint, jint, jint, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, *lparg4, arg5, arg6, arg7, arg8);
+fail:
+ if (arg4 && lparg4) setNSSizeFields(env, arg4, lparg4);
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSSize_2IIIZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Z
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Z)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jboolean arg4)
+{
+ NSPoint _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Z_FUNC);
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSPoint, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, arg4);
+fail:
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Z_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3)
+{
+ NSRange _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSRange))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2I
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jint arg4)
+{
+ NSRange _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSRange, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, arg4);
+fail:
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2II
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2II)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jint arg4, jint arg5)
+{
+ NSRange _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC);
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSRange, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, arg4, arg5);
+fail:
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2IZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2IZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jint arg4, jboolean arg5)
+{
+ NSRange _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2IZ_FUNC);
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSRange, jint, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, arg4, arg5);
+fail:
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2IZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jobject arg4)
+{
+ NSRange _arg3, *lparg3=NULL;
+ NSRange _arg4, *lparg4=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSRangeFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSRange, NSRange))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, *lparg4);
+fail:
+ if (arg4 && lparg4) setNSRangeFields(env, arg4, lparg4);
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3)
+{
+ NSRect _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSRect))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2I
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jint arg4)
+{
+ NSRect _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSRect, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, arg4);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2II
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2II)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jint arg4, jint arg5)
+{
+ NSRect _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2II_FUNC);
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSRect, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, arg4, arg5);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2II_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2IIZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2IIZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jint arg4, jint arg5, jboolean arg6)
+{
+ NSRect _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2IIZ_FUNC);
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSRect, jint, jint, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, arg4, arg5, arg6);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2IIZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2I
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jint arg4, jobject arg5, jint arg6)
+{
+ NSRect _arg3, *lparg3=NULL;
+ NSRange _arg5, *lparg5=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = getNSRangeFields(env, arg5, &_arg5)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSRect, jint, NSRange, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, arg4, *lparg5, arg6);
+fail:
+ if (arg5 && lparg5) setNSRangeFields(env, arg5, lparg5);
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2IZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2IZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jint arg4, jboolean arg5)
+{
+ NSRect _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2IZ_FUNC);
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSRect, jint, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, arg4, arg5);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2IZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2IZI
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2IZI)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jint arg4, jboolean arg5, jint arg6)
+{
+ NSRect _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2IZI_FUNC);
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSRect, jint, jboolean, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, arg4, arg5, arg6);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2IZI_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2ZI
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2ZI)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jboolean arg4, jint arg5)
+{
+ NSRect _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2ZI_FUNC);
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSRect, jboolean, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, arg4, arg5);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2ZI_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSSize_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSSize_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3)
+{
+ NSSize _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC);
+ if (arg3) if ((lparg3 = getNSSizeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSSize))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSSizeFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSSize_2Z
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSSize_2Z)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3, jboolean arg4)
+{
+ NSSize _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSSize_2Z_FUNC);
+ if (arg3) if ((lparg3 = getNSSizeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint, NSSize, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, arg4);
+fail:
+ if (arg3 && lparg3) setNSSizeFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSSize_2Z_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIS
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIS)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jshort arg3)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIS_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jshort))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIS_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIISZZZZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIISZZZZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jshort arg3, jboolean arg4, jboolean arg5, jboolean arg6, jboolean arg7)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIISZZZZ_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jshort, jboolean, jboolean, jboolean, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIISZZZZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jboolean arg3)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIZ_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIZI
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIZI)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jboolean arg3, jint arg4)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIZI_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jboolean, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIZI_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIZII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIZII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jboolean arg3, jint arg4, jint arg5)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIZII_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jboolean, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIZII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIZIII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIZIII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jboolean arg3, jint arg4, jint arg5, jint arg6)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIZIII_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jboolean, jint, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5, arg6);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIZIII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIZZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIZZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jboolean arg3, jboolean arg4)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIZZ_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jboolean, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIZZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIIZZII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIIZZII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jboolean arg3, jboolean arg4, jint arg5, jint arg6)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIIZZII_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jint, jboolean, jboolean, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5, arg6);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIIZZII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIJ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIJ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jlong arg2)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIJ_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jlong))objc_msgSend)((id)arg0, (SEL)arg1, arg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIJ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIJI
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIJI)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jlong arg2, jint arg3)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIJI_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jlong, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIJI_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIJSZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIJSZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jlong arg2, jshort arg3, jboolean arg4)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIJSZ_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jlong, jshort, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIJSZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILjava_lang_String_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILjava_lang_String_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jstring arg2)
+{
+ const char *lparg2= NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILjava_lang_String_2_FUNC);
+ if (arg2) if ((lparg2 = (*env)->GetStringUTFChars(env, arg2, NULL)) == NULL) goto fail;
+ rc = (jint)objc_msgSend((id)arg0, (SEL)arg1, lparg2);
+fail:
+ if (arg2 && lparg2) (*env)->ReleaseStringUTFChars(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILjava_lang_String_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSAffineTransformStruct_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSAffineTransformStruct_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2)
+{
+ NSAffineTransformStruct _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSAffineTransformStruct_2_FUNC);
+ if (arg2) if ((lparg2 = getNSAffineTransformStructFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSAffineTransformStruct))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2);
+fail:
+ if (arg2 && lparg2) setNSAffineTransformStructFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSAffineTransformStruct_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSDecimal_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSDecimal_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2)
+{
+ NSDecimal _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSDecimal_2_FUNC);
+ if (arg2) if ((lparg2 = getNSDecimalFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSDecimal))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2);
+fail:
+ if (arg2 && lparg2) setNSDecimalFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSDecimal_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSPoint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2);
+fail:
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2F
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2F)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jfloat arg3)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2F_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSPoint, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3);
+fail:
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2F_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2FFF
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2FFF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jfloat arg3, jfloat arg4, jfloat arg5)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2FFF_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSPoint, jfloat, jfloat, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4, arg5);
+fail:
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2FFF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2FFFZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2FFFZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jfloat arg3, jfloat arg4, jfloat arg5, jboolean arg6)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2FFFZ_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSPoint, jfloat, jfloat, jfloat, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4, arg5, arg6);
+fail:
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2FFFZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2FLorg_eclipse_swt_internal_cocoa_NSPoint_2FI
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2FLorg_eclipse_swt_internal_cocoa_NSPoint_2FI)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jfloat arg3, jobject arg4, jfloat arg5, jint arg6)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ NSPoint _arg4, *lparg4=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2FLorg_eclipse_swt_internal_cocoa_NSPoint_2FI_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSPointFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSPoint, jfloat, NSPoint, jfloat, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, *lparg4, arg5, arg6);
+fail:
+ if (arg4 && lparg4) setNSPointFields(env, arg4, lparg4);
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2FLorg_eclipse_swt_internal_cocoa_NSPoint_2FI_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2I
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSPoint, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3);
+fail:
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2IF
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2IF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jfloat arg4)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2IF_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSPoint, jint, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4);
+fail:
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2IF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2II
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2II)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jint arg4)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2II_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSPoint, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4);
+fail:
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2II_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2ILorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2ILorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jobject arg4)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ NSRange _arg4, *lparg4=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSRangeFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSPoint, jint, NSRange))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, *lparg4);
+fail:
+ if (arg4 && lparg4) setNSRangeFields(env, arg4, lparg4);
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ NSPoint _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSPoint, NSPoint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2F
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2F)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3, jfloat arg4)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ NSPoint _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2F_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSPoint, NSPoint, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3, arg4);
+fail:
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2F_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2I
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3, jint arg4)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ NSPoint _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSPoint, NSPoint, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3, arg4);
+fail:
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2IZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2IZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3, jint arg4, jboolean arg5)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ NSPoint _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2IZ_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSPoint, NSPoint, jint, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3, arg4, arg5);
+fail:
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2IZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3, jobject arg4)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ NSPoint _arg3, *lparg3=NULL;
+ NSPoint _arg4, *lparg4=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSPointFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSPoint, NSPoint, NSPoint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3, *lparg4);
+fail:
+ if (arg4 && lparg4) setNSPointFields(env, arg4, lparg4);
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ NSRange _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSPoint, NSRange))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ NSRect _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSPoint, NSRect))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2F
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2F)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3, jfloat arg4)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ NSRect _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2F_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSPoint, NSRect, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3, arg4);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2F_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2I
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3, jint arg4)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ NSRect _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSPoint, NSRect, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3, arg4);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2IF
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2IF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3, jint arg4, jfloat arg5)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ NSRect _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2IF_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSPoint, NSRect, jint, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3, arg4, arg5);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2IF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2)
+{
+ NSRange _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg2) if ((lparg2 = getNSRangeFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRange))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2);
+fail:
+ if (arg2 && lparg2) setNSRangeFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2I
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3)
+{
+ NSRange _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+ if (arg2) if ((lparg2 = getNSRangeFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRange, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3);
+fail:
+ if (arg2 && lparg2) setNSRangeFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IFLorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IFLorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jfloat arg4, jobject arg5, jobject arg6, jobject arg7)
+{
+ NSRange _arg2, *lparg2=NULL;
+ NSRect _arg5, *lparg5=NULL;
+ NSRange _arg6, *lparg6=NULL;
+ NSPoint _arg7, *lparg7=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IFLorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ if (arg2) if ((lparg2 = getNSRangeFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = getNSRectFields(env, arg5, &_arg5)) == NULL) goto fail;
+ if (arg6) if ((lparg6 = getNSRangeFields(env, arg6, &_arg6)) == NULL) goto fail;
+ if (arg7) if ((lparg7 = getNSPointFields(env, arg7, &_arg7)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRange, jint, jfloat, NSRect, NSRange, NSPoint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4, *lparg5, *lparg6, *lparg7);
+fail:
+ if (arg7 && lparg7) setNSPointFields(env, arg7, lparg7);
+ if (arg6 && lparg6) setNSRangeFields(env, arg6, lparg6);
+ if (arg5 && lparg5) setNSRectFields(env, arg5, lparg5);
+ if (arg2 && lparg2) setNSRangeFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IFLorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2II
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2II)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jint arg4)
+{
+ NSRange _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC);
+ if (arg2) if ((lparg2 = getNSRangeFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRange, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4);
+fail:
+ if (arg2 && lparg2) setNSRangeFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2III
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2III)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jint arg4, jint arg5)
+{
+ NSRange _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2III_FUNC);
+ if (arg2) if ((lparg2 = getNSRangeFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRange, jint, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4, arg5);
+fail:
+ if (arg2 && lparg2) setNSRangeFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2III_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IIII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IIII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jint arg4, jint arg5, jint arg6)
+{
+ NSRange _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IIII_FUNC);
+ if (arg2) if ((lparg2 = getNSRangeFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRange, jint, jint, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4, arg5, arg6);
+fail:
+ if (arg2 && lparg2) setNSRangeFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IIII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IIIII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IIIII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jint arg4, jint arg5, jint arg6, jint arg7)
+{
+ NSRange _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IIIII_FUNC);
+ if (arg2) if ((lparg2 = getNSRangeFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRange, jint, jint, jint, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4, arg5, arg6, arg7);
+fail:
+ if (arg2 && lparg2) setNSRangeFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IIIII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2ILorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2ILorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jobject arg4)
+{
+ NSRange _arg2, *lparg2=NULL;
+ NSRange _arg4, *lparg4=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg2) if ((lparg2 = getNSRangeFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSRangeFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRange, jint, NSRange))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, *lparg4);
+fail:
+ if (arg4 && lparg4) setNSRangeFields(env, arg4, lparg4);
+ if (arg2 && lparg2) setNSRangeFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2ILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2ILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jobject arg4, jobject arg5, jobject arg6)
+{
+ NSRange _arg2, *lparg2=NULL;
+ NSRect _arg4, *lparg4=NULL;
+ NSRange _arg5, *lparg5=NULL;
+ NSPoint _arg6, *lparg6=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2ILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ if (arg2) if ((lparg2 = getNSRangeFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSRectFields(env, arg4, &_arg4)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = getNSRangeFields(env, arg5, &_arg5)) == NULL) goto fail;
+ if (arg6) if ((lparg6 = getNSPointFields(env, arg6, &_arg6)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRange, jint, NSRect, NSRange, NSPoint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, *lparg4, *lparg5, *lparg6);
+fail:
+ if (arg6 && lparg6) setNSPointFields(env, arg6, lparg6);
+ if (arg5 && lparg5) setNSRangeFields(env, arg5, lparg5);
+ if (arg4 && lparg4) setNSRectFields(env, arg4, lparg4);
+ if (arg2 && lparg2) setNSRangeFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2ILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jboolean arg4)
+{
+ NSRange _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IZ_FUNC);
+ if (arg2) if ((lparg2 = getNSRangeFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRange, jint, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4);
+fail:
+ if (arg2 && lparg2) setNSRangeFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3)
+{
+ NSRange _arg2, *lparg2=NULL;
+ NSPoint _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ if (arg2) if ((lparg2 = getNSRangeFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRange, NSPoint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSRangeFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3)
+{
+ NSRange _arg2, *lparg2=NULL;
+ NSRange _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg2) if ((lparg2 = getNSRangeFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRange, NSRange))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSRangeFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2II
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2II)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3, jint arg4, jint arg5)
+{
+ NSRange _arg2, *lparg2=NULL;
+ NSRange _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC);
+ if (arg2) if ((lparg2 = getNSRangeFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRange, NSRange, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3, arg4, arg5);
+fail:
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSRangeFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2ZI
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2ZI)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jboolean arg3, jint arg4)
+{
+ NSRange _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2ZI_FUNC);
+ if (arg2) if ((lparg2 = getNSRangeFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRange, jboolean, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4);
+fail:
+ if (arg2 && lparg2) setNSRangeFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2ZI_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2)
+{
+ NSRect _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2);
+fail:
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2F
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2F)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jfloat arg3)
+{
+ NSRect _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2F_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3);
+fail:
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2F_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2FF
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2FF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jfloat arg3, jfloat arg4)
+{
+ NSRect _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2FF_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, jfloat, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4);
+fail:
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2FF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2I
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3)
+{
+ NSRect _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3);
+fail:
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2II
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2II)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jint arg4)
+{
+ NSRect _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2II_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4);
+fail:
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2II_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2III
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2III)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jint arg4, jint arg5)
+{
+ NSRect _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2III_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, jint, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4, arg5);
+fail:
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2III_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jint arg4, jint arg5, jint arg6)
+{
+ NSRect _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIII_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, jint, jint, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4, arg5, arg6);
+fail:
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIIII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIIII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jint arg4, jint arg5, jint arg6, jint arg7)
+{
+ NSRect _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIIII_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, jint, jint, jint, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4, arg5, arg6, arg7);
+fail:
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIIII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jint arg4, jboolean arg5)
+{
+ NSRect _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIZ_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, jint, jint, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4, arg5);
+fail:
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIZI
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIZI)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jint arg4, jboolean arg5, jint arg6)
+{
+ NSRect _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIZI_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, jint, jint, jboolean, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4, arg5, arg6);
+fail:
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIZI_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jobject arg4)
+{
+ NSRect _arg2, *lparg2=NULL;
+ NSRange _arg4, *lparg4=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSRangeFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, jint, NSRange))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, *lparg4);
+fail:
+ if (arg4 && lparg4) setNSRangeFields(env, arg4, lparg4);
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2I
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jobject arg4, jint arg5)
+{
+ NSRect _arg2, *lparg2=NULL;
+ NSRange _arg4, *lparg4=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSRangeFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, jint, NSRange, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, *lparg4, arg5);
+fail:
+ if (arg4 && lparg4) setNSRangeFields(env, arg4, lparg4);
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jboolean arg4)
+{
+ NSRect _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IZ_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, jint, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4);
+fail:
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IZI
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IZI)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jboolean arg4, jint arg5)
+{
+ NSRect _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IZI_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, jint, jboolean, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4, arg5);
+fail:
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IZI_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3)
+{
+ NSRect _arg2, *lparg2=NULL;
+ NSPoint _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, NSPoint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRect_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRect_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3, jobject arg4)
+{
+ NSRect _arg2, *lparg2=NULL;
+ NSRange _arg3, *lparg3=NULL;
+ NSRect _arg4, *lparg4=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSRectFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, NSRange, NSRect))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3, *lparg4);
+fail:
+ if (arg4 && lparg4) setNSRectFields(env, arg4, lparg4);
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRect_2F
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRect_2F)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3, jobject arg4, jfloat arg5)
+{
+ NSRect _arg2, *lparg2=NULL;
+ NSRange _arg3, *lparg3=NULL;
+ NSRect _arg4, *lparg4=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRect_2F_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSRectFields(env, arg4, &_arg4)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, NSRange, NSRect, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3, *lparg4, arg5);
+fail:
+ if (arg4 && lparg4) setNSRectFields(env, arg4, lparg4);
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRect_2F_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2I
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3, jint arg4)
+{
+ NSRect _arg2, *lparg2=NULL;
+ NSRect _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, NSRect, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3, arg4);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2IF
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2IF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3, jint arg4, jfloat arg5)
+{
+ NSRect _arg2, *lparg2=NULL;
+ NSRect _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2IF_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, NSRect, jint, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3, arg4, arg5);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2IF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSSize_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSSize_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3)
+{
+ NSRect _arg2, *lparg2=NULL;
+ NSSize _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSSizeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, NSSize))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSSizeFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Z
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Z)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jboolean arg3)
+{
+ NSRect _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Z_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3);
+fail:
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Z_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2ZZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2ZZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jboolean arg3, jboolean arg4)
+{
+ NSRect _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2ZZ_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect, jboolean, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4);
+fail:
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2ZZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2)
+{
+ NSSize _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC);
+ if (arg2) if ((lparg2 = getNSSizeFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSSize))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2);
+fail:
+ if (arg2 && lparg2) setNSSizeFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2I
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3)
+{
+ NSSize _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2I_FUNC);
+ if (arg2) if ((lparg2 = getNSSizeFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSSize, jint))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3);
+fail:
+ if (arg2 && lparg2) setNSSizeFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2IZZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2IZZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3, jboolean arg4, jboolean arg5)
+{
+ NSSize _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2IZZ_FUNC);
+ if (arg2) if ((lparg2 = getNSSizeFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSSize, jint, jboolean, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, arg3, arg4, arg5);
+fail:
+ if (arg2 && lparg2) setNSSizeFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2IZZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2Lorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2Lorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jobject arg3)
+{
+ NSSize _arg2, *lparg2=NULL;
+ NSRange _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2Lorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg2) if ((lparg2 = getNSSizeFields(env, arg2, &_arg2)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSSize, NSRange))objc_msgSend)((id)arg0, (SEL)arg1, *lparg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ if (arg2 && lparg2) setNSSizeFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2Lorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIS
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIS)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jshort arg2)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIS_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jshort))objc_msgSend)((id)arg0, (SEL)arg1, arg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIS_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IISI
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IISI)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jshort arg2, jint arg3)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IISI_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jshort, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IISI_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jboolean arg2)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIZ_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, arg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIZI
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIZI)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jboolean arg2, jint arg3)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIZI_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jboolean, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIZI_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIZII
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIZII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jboolean arg2, jint arg3, jint arg4)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIZII_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jboolean, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3, arg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIZII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIZLorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIZLorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jboolean arg2, jobject arg3)
+{
+ NSRange _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIZLorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jboolean, NSRange))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIZLorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIZLorg_eclipse_swt_internal_cocoa_NSRect_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIZLorg_eclipse_swt_internal_cocoa_NSRect_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jboolean arg2, jobject arg3)
+{
+ NSRect _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIZLorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jboolean, NSRect))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIZLorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIZLorg_eclipse_swt_internal_cocoa_NSRect_2I
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIZLorg_eclipse_swt_internal_cocoa_NSRect_2I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jboolean arg2, jobject arg3, jint arg4)
+{
+ NSRect _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIZLorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jboolean, NSRect, jint))objc_msgSend)((id)arg0, (SEL)arg1, arg2, *lparg3, arg4);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIZLorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__IIZZ
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__IIZZ)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jboolean arg2, jboolean arg3)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__IIZZ_FUNC);
+ rc = (jint)((jint (*)(id, SEL, jboolean, jboolean))objc_msgSend)((id)arg0, (SEL)arg1, arg2, arg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__IIZZ_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__II_3C
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__II_3C)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jcharArray arg2)
+{
+ jchar *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__II_3C_FUNC);
+ if (arg2) if ((lparg2 = (*env)->GetCharArrayElements(env, arg2, NULL)) == NULL) goto fail;
+ rc = (jint)objc_msgSend((id)arg0, (SEL)arg1, lparg2);
+fail:
+ if (arg2 && lparg2) (*env)->ReleaseCharArrayElements(env, arg2, lparg2, 0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__II_3C_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__II_3CI
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__II_3CI)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jcharArray arg2, jint arg3)
+{
+ jchar *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__II_3CI_FUNC);
+ if (arg2) if ((lparg2 = (*env)->GetCharArrayElements(env, arg2, NULL)) == NULL) goto fail;
+ rc = (jint)objc_msgSend((id)arg0, (SEL)arg1, lparg2, arg3);
+fail:
+ if (arg2 && lparg2) (*env)->ReleaseCharArrayElements(env, arg2, lparg2, 0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__II_3CI_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__II_3CLorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__II_3CLorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jcharArray arg2, jobject arg3)
+{
+ jchar *lparg2=NULL;
+ NSRange _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__II_3CLorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg2) if ((lparg2 = (*env)->GetCharArrayElements(env, arg2, NULL)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jchar *, NSRange))objc_msgSend)((id)arg0, (SEL)arg1, lparg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ if (arg2 && lparg2) (*env)->ReleaseCharArrayElements(env, arg2, lparg2, 0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__II_3CLorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__II_3F
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__II_3F)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jfloatArray arg2)
+{
+ jfloat *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__II_3F_FUNC);
+ if (arg2) if ((lparg2 = (*env)->GetFloatArrayElements(env, arg2, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jfloat *))objc_msgSend)((id)arg0, (SEL)arg1, lparg2);
+fail:
+ if (arg2 && lparg2) (*env)->ReleaseFloatArrayElements(env, arg2, lparg2, 0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__II_3F_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__II_3FIF
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__II_3FIF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jfloatArray arg2, jint arg3, jfloat arg4)
+{
+ jfloat *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__II_3FIF_FUNC);
+ if (arg2) if ((lparg2 = (*env)->GetFloatArrayElements(env, arg2, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jfloat *, jint, jfloat))objc_msgSend)((id)arg0, (SEL)arg1, lparg2, arg3, arg4);
+fail:
+ if (arg2 && lparg2) (*env)->ReleaseFloatArrayElements(env, arg2, lparg2, 0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__II_3FIF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend__II_3III
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend__II_3III)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jintArray arg2, jint arg3, jint arg4)
+{
+ jint *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend__II_3III_FUNC);
+ if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint *, jint, jint))objc_msgSend)((id)arg0, (SEL)arg1, lparg2, arg3, arg4);
+fail:
+ if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend__II_3III_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSendSuper__Lorg_eclipse_swt_internal_cocoa_objc_1super_2I
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSendSuper__Lorg_eclipse_swt_internal_cocoa_objc_1super_2I)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1)
+{
+ struct objc_super _arg0, *lparg0=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSendSuper__Lorg_eclipse_swt_internal_cocoa_objc_1super_2I_FUNC);
+ if (arg0) if ((lparg0 = getobjc_superFields(env, arg0, &_arg0)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL))objc_msgSendSuper)((id)lparg0, (SEL)arg1);
+fail:
+ if (arg0 && lparg0) setobjc_superFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSendSuper__Lorg_eclipse_swt_internal_cocoa_objc_1super_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSendSuper__Lorg_eclipse_swt_internal_cocoa_objc_1super_2II
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSendSuper__Lorg_eclipse_swt_internal_cocoa_objc_1super_2II)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2)
+{
+ struct objc_super _arg0, *lparg0=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSendSuper__Lorg_eclipse_swt_internal_cocoa_objc_1super_2II_FUNC);
+ if (arg0) if ((lparg0 = getobjc_superFields(env, arg0, &_arg0)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, jint))objc_msgSendSuper)((id)lparg0, (SEL)arg1, arg2);
+fail:
+ if (arg0 && lparg0) setobjc_superFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSendSuper__Lorg_eclipse_swt_internal_cocoa_objc_1super_2II_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSendSuper__Lorg_eclipse_swt_internal_cocoa_objc_1super_2ILorg_eclipse_swt_internal_cocoa_NSRect_2
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSendSuper__Lorg_eclipse_swt_internal_cocoa_objc_1super_2ILorg_eclipse_swt_internal_cocoa_NSRect_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jobject arg2)
+{
+ struct objc_super _arg0, *lparg0=NULL;
+ NSRect _arg2, *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSendSuper__Lorg_eclipse_swt_internal_cocoa_objc_1super_2ILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ if (arg0) if ((lparg0 = getobjc_superFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jint)((jint (*)(id, SEL, NSRect))objc_msgSendSuper)((id)lparg0, (SEL)arg1, *lparg2);
+fail:
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ if (arg0 && lparg0) setobjc_superFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSendSuper__Lorg_eclipse_swt_internal_cocoa_objc_1super_2ILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1fpret__II
+JNIEXPORT jdouble JNICALL OS_NATIVE(objc_1msgSend_1fpret__II)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1)
+{
+ jdouble rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1fpret__II_FUNC);
+ rc = (jdouble)((jdouble (*)(id, SEL))objc_msgSend_fpret)((id)arg0, (SEL)arg1);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1fpret__II_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1fpret__IID
+JNIEXPORT jdouble JNICALL OS_NATIVE(objc_1msgSend_1fpret__IID)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jdouble arg2)
+{
+ jdouble rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1fpret__IID_FUNC);
+ rc = (jdouble)((jdouble (*)(id, SEL, jdouble))objc_msgSend_fpret)((id)arg0, (SEL)arg1, arg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1fpret__IID_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1fpret__IIF
+JNIEXPORT jdouble JNICALL OS_NATIVE(objc_1msgSend_1fpret__IIF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jfloat arg2)
+{
+ jdouble rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1fpret__IIF_FUNC);
+ rc = (jdouble)((jdouble (*)(id, SEL, jfloat))objc_msgSend_fpret)((id)arg0, (SEL)arg1, arg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1fpret__IIF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1fpret__III
+JNIEXPORT jdouble JNICALL OS_NATIVE(objc_1msgSend_1fpret__III)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2)
+{
+ jdouble rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1fpret__III_FUNC);
+ rc = (jdouble)((jdouble (*)(id, SEL, jint))objc_msgSend_fpret)((id)arg0, (SEL)arg1, arg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1fpret__III_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1fpret__IIIF
+JNIEXPORT jdouble JNICALL OS_NATIVE(objc_1msgSend_1fpret__IIIF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jfloat arg3)
+{
+ jdouble rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1fpret__IIIF_FUNC);
+ rc = (jdouble)((jdouble (*)(id, SEL, jint, jfloat))objc_msgSend_fpret)((id)arg0, (SEL)arg1, arg2, arg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1fpret__IIIF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1fpret__IIIFI
+JNIEXPORT jdouble JNICALL OS_NATIVE(objc_1msgSend_1fpret__IIIFI)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jfloat arg3, jint arg4)
+{
+ jdouble rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1fpret__IIIFI_FUNC);
+ rc = (jdouble)((jdouble (*)(id, SEL, jint, jfloat, jint))objc_msgSend_fpret)((id)arg0, (SEL)arg1, arg2, arg3, arg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1fpret__IIIFI_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1fpret__IIII
+JNIEXPORT jdouble JNICALL OS_NATIVE(objc_1msgSend_1fpret__IIII)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3)
+{
+ jdouble rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1fpret__IIII_FUNC);
+ rc = (jdouble)((jdouble (*)(id, SEL, jint, jint))objc_msgSend_fpret)((id)arg0, (SEL)arg1, arg2, arg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1fpret__IIII_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1fpret__IIIIF
+JNIEXPORT jdouble JNICALL OS_NATIVE(objc_1msgSend_1fpret__IIIIF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jfloat arg4)
+{
+ jdouble rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1fpret__IIIIF_FUNC);
+ rc = (jdouble)((jdouble (*)(id, SEL, jint, jint, jfloat))objc_msgSend_fpret)((id)arg0, (SEL)arg1, arg2, arg3, arg4);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1fpret__IIIIF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1fpret__IIIIZF
+JNIEXPORT jdouble JNICALL OS_NATIVE(objc_1msgSend_1fpret__IIIIZF)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jint arg3, jboolean arg4, jfloat arg5)
+{
+ jdouble rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1fpret__IIIIZF_FUNC);
+ rc = (jdouble)((jdouble (*)(id, SEL, jint, jint, jboolean, jfloat))objc_msgSend_fpret)((id)arg0, (SEL)arg1, arg2, arg3, arg4, arg5);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1fpret__IIIIZF_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1fpret__IIILorg_eclipse_swt_internal_cocoa_NSRect_2
+JNIEXPORT jdouble JNICALL OS_NATIVE(objc_1msgSend_1fpret__IIILorg_eclipse_swt_internal_cocoa_NSRect_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jint arg2, jobject arg3)
+{
+ NSRect _arg3, *lparg3=NULL;
+ jdouble rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1fpret__IIILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ rc = (jdouble)((jdouble (*)(id, SEL, jint, NSRect))objc_msgSend_fpret)((id)arg0, (SEL)arg1, arg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1fpret__IIILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSPoint_2
+JNIEXPORT jdouble JNICALL OS_NATIVE(objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSPoint_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ jdouble rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jdouble)((jdouble (*)(id, SEL, NSPoint))objc_msgSend_fpret)((id)arg0, (SEL)arg1, *lparg2);
+fail:
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSPoint_2I
+JNIEXPORT jdouble JNICALL OS_NATIVE(objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSPoint_2I)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2, jint arg3)
+{
+ NSPoint _arg2, *lparg2=NULL;
+ jdouble rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC);
+ if (arg2) if ((lparg2 = getNSPointFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jdouble)((jdouble (*)(id, SEL, NSPoint, jint))objc_msgSend_fpret)((id)arg0, (SEL)arg1, *lparg2, arg3);
+fail:
+ if (arg2 && lparg2) setNSPointFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSRect_2
+JNIEXPORT jdouble JNICALL OS_NATIVE(objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSRect_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2)
+{
+ NSRect _arg2, *lparg2=NULL;
+ jdouble rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jdouble)((jdouble (*)(id, SEL, NSRect))objc_msgSend_fpret)((id)arg0, (SEL)arg1, *lparg2);
+fail:
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSSize_2
+JNIEXPORT jdouble JNICALL OS_NATIVE(objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSSize_2)
+ (JNIEnv *env, jclass that, jint arg0, jint arg1, jobject arg2)
+{
+ NSSize _arg2, *lparg2=NULL;
+ jdouble rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC);
+ if (arg2) if ((lparg2 = getNSSizeFields(env, arg2, &_arg2)) == NULL) goto fail;
+ rc = (jdouble)((jdouble (*)(id, SEL, NSSize))objc_msgSend_fpret)((id)arg0, (SEL)arg1, *lparg2);
+fail:
+ if (arg2 && lparg2) setNSSizeFields(env, arg2, lparg2);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSAffineTransformStruct_2II
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSAffineTransformStruct_2II)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2)
+{
+ NSAffineTransformStruct _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSAffineTransformStruct_2II_FUNC);
+ if (arg0) if ((lparg0 = getNSAffineTransformStructFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSAffineTransformStruct *, id, SEL))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2);
+fail:
+ if (arg0 && lparg0) setNSAffineTransformStructFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSAffineTransformStruct_2II_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSDecimal_2II
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSDecimal_2II)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2)
+{
+ NSDecimal _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSDecimal_2II_FUNC);
+ if (arg0) if ((lparg0 = getNSDecimalFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSDecimal *, id, SEL))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2);
+fail:
+ if (arg0 && lparg0) setNSDecimalFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSDecimal_2II_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2)
+{
+ NSPoint _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II_FUNC);
+ if (arg0) if ((lparg0 = getNSPointFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSPoint *, id, SEL))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2);
+fail:
+ if (arg0 && lparg0) setNSPointFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2III
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2III)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3)
+{
+ NSPoint _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2III_FUNC);
+ if (arg0) if ((lparg0 = getNSPointFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSPoint *, id, SEL, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3);
+fail:
+ if (arg0 && lparg0) setNSPointFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2III_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIIII
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIIII)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5)
+{
+ NSPoint _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIIII_FUNC);
+ if (arg0) if ((lparg0 = getNSPointFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSPoint *, id, SEL, jint, jint, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, arg4, arg5);
+fail:
+ if (arg0 && lparg0) setNSPointFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIIII_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIIIIII
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIIIIII)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jint arg7)
+{
+ NSPoint _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIIIIII_FUNC);
+ if (arg0) if ((lparg0 = getNSPointFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSPoint *, id, SEL, jint, jint, jint, jint, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, arg4, arg5, arg6, arg7);
+fail:
+ if (arg0 && lparg0) setNSPointFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIIIIII_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2I
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2I)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jobject arg4, jint arg5)
+{
+ NSPoint _arg0, *lparg0=NULL;
+ NSRect _arg4, *lparg4=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+ if (arg0) if ((lparg0 = getNSPointFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSRectFields(env, arg4, &_arg4)) == NULL) goto fail;
+ ((void (*)(NSPoint *, id, SEL, jint, NSRect, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, *lparg4, arg5);
+fail:
+ if (arg4 && lparg4) setNSRectFields(env, arg4, lparg4);
+ if (arg0 && lparg0) setNSPointFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIISLorg_eclipse_swt_internal_cocoa_NSRect_2
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIISLorg_eclipse_swt_internal_cocoa_NSRect_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jshort arg4, jobject arg5)
+{
+ NSPoint _arg0, *lparg0=NULL;
+ NSRect _arg5, *lparg5=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIISLorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ if (arg0) if ((lparg0 = getNSPointFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = getNSRectFields(env, arg5, &_arg5)) == NULL) goto fail;
+ ((void (*)(NSPoint *, id, SEL, jint, jshort, NSRect))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, arg4, *lparg5);
+fail:
+ if (arg5 && lparg5) setNSRectFields(env, arg5, lparg5);
+ if (arg0 && lparg0) setNSPointFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIISLorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3)
+{
+ NSPoint _arg0, *lparg0=NULL;
+ NSPoint _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ if (arg0) if ((lparg0 = getNSPointFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ ((void (*)(NSPoint *, id, SEL, NSPoint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSPointFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2I
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2I)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3, jint arg4)
+{
+ NSPoint _arg0, *lparg0=NULL;
+ NSPoint _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC);
+ if (arg0) if ((lparg0 = getNSPointFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ ((void (*)(NSPoint *, id, SEL, NSPoint, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3, arg4);
+fail:
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSPointFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSRect_2
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSRect_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3)
+{
+ NSPoint _arg0, *lparg0=NULL;
+ NSRect _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ if (arg0) if ((lparg0 = getNSPointFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ ((void (*)(NSPoint *, id, SEL, NSRect))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSPointFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2II
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2II)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2)
+{
+ NSRange _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSRange *, id, SEL))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2);
+fail:
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2III
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2III)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3)
+{
+ NSRange _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2III_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSRange *, id, SEL, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3);
+fail:
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2III_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIII
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIII)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jint arg4)
+{
+ NSRange _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIII_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSRange *, id, SEL, jint, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, arg4);
+fail:
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIII_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIII
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIII)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5)
+{
+ NSRange _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIII_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSRange *, id, SEL, jint, jint, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, arg4, arg5);
+fail:
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIII_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIIII
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIIII)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6)
+{
+ NSRange _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIIII_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSRange *, id, SEL, jint, jint, jint, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, arg4, arg5, arg6);
+fail:
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIIII_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIIIIZ
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIIIIZ)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5, jint arg6, jboolean arg7)
+{
+ NSRange _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIIIIZ_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSRange *, id, SEL, jint, jint, jint, jint, jboolean))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, arg4, arg5, arg6, arg7);
+fail:
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIIIIZ_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIIIZII
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIIIZII)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5, jboolean arg6, jint arg7, jint arg8)
+{
+ NSRange _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIIIZII_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSRange *, id, SEL, jint, jint, jint, jboolean, jint, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, arg4, arg5, arg6, arg7, arg8);
+fail:
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIIIZII_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIILorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIILorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jint arg4, jobject arg5)
+{
+ NSRange _arg0, *lparg0=NULL;
+ NSRange _arg5, *lparg5=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = getNSRangeFields(env, arg5, &_arg5)) == NULL) goto fail;
+ ((void (*)(NSRange *, id, SEL, jint, jint, NSRange))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, arg4, *lparg5);
+fail:
+ if (arg5 && lparg5) setNSRangeFields(env, arg5, lparg5);
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIILorg_eclipse_swt_internal_cocoa_NSRange_2I
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIILorg_eclipse_swt_internal_cocoa_NSRange_2I)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jint arg4, jobject arg5, jint arg6)
+{
+ NSRange _arg0, *lparg0=NULL;
+ NSRange _arg5, *lparg5=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = getNSRangeFields(env, arg5, &_arg5)) == NULL) goto fail;
+ ((void (*)(NSRange *, id, SEL, jint, jint, NSRange, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, arg4, *lparg5, arg6);
+fail:
+ if (arg5 && lparg5) setNSRangeFields(env, arg5, lparg5);
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jobject arg4, jobject arg5)
+{
+ NSRange _arg0, *lparg0=NULL;
+ NSRange _arg4, *lparg4=NULL;
+ NSRange _arg5, *lparg5=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSRangeFields(env, arg4, &_arg4)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = getNSRangeFields(env, arg5, &_arg5)) == NULL) goto fail;
+ ((void (*)(NSRange *, id, SEL, jint, NSRange, NSRange))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, *lparg4, *lparg5);
+fail:
+ if (arg5 && lparg5) setNSRangeFields(env, arg5, lparg5);
+ if (arg4 && lparg4) setNSRangeFields(env, arg4, lparg4);
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3)
+{
+ NSRange _arg0, *lparg0=NULL;
+ NSRange _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ ((void (*)(NSRange *, id, SEL, NSRange))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2I
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2I)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3, jint arg4)
+{
+ NSRange _arg0, *lparg0=NULL;
+ NSRange _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ ((void (*)(NSRange *, id, SEL, NSRange, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3, arg4);
+fail:
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2II
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2II)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3, jint arg4, jint arg5)
+{
+ NSRange _arg0, *lparg0=NULL;
+ NSRange _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ ((void (*)(NSRange *, id, SEL, NSRange, jint, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3, arg4, arg5);
+fail:
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRect_2
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRect_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3)
+{
+ NSRange _arg0, *lparg0=NULL;
+ NSRect _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ ((void (*)(NSRange *, id, SEL, NSRect))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRect_2I
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRect_2I)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3, jint arg4)
+{
+ NSRange _arg0, *lparg0=NULL;
+ NSRect _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ ((void (*)(NSRange *, id, SEL, NSRect, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3, arg4);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2II
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2II)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2)
+{
+ NSRect _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2II_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2);
+fail:
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2II_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2III
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2III)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3)
+{
+ NSRect _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2III_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3);
+fail:
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2III_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIII
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIII)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jint arg4)
+{
+ NSRect _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIII_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, jint, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, arg4);
+fail:
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIII_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIII
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIII)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jint arg4, jint arg5)
+{
+ NSRect _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIII_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, jint, jint, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, arg4, arg5);
+fail:
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIII_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIILorg_eclipse_swt_internal_cocoa_NSRect_2
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIILorg_eclipse_swt_internal_cocoa_NSRect_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jint arg4, jobject arg5)
+{
+ NSRect _arg0, *lparg0=NULL;
+ NSRect _arg5, *lparg5=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = getNSRectFields(env, arg5, &_arg5)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, jint, jint, NSRect))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, arg4, *lparg5);
+fail:
+ if (arg5 && lparg5) setNSRectFields(env, arg5, lparg5);
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2I
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2I)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jint arg4, jobject arg5, jobject arg6, jint arg7)
+{
+ NSRect _arg0, *lparg0=NULL;
+ NSRect _arg5, *lparg5=NULL;
+ NSPoint _arg6, *lparg6=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = getNSRectFields(env, arg5, &_arg5)) == NULL) goto fail;
+ if (arg6) if ((lparg6 = getNSPointFields(env, arg6, &_arg6)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, jint, jint, NSRect, NSPoint, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, arg4, *lparg5, *lparg6, arg7);
+fail:
+ if (arg6 && lparg6) setNSPointFields(env, arg6, lparg6);
+ if (arg5 && lparg5) setNSRectFields(env, arg5, lparg5);
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIIZ
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIIZ)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jint arg4, jboolean arg5)
+{
+ NSRect _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIIZ_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, jint, jint, jboolean))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, arg4, arg5);
+fail:
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIIZ_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jobject arg4, jobject arg5, jint arg6, jobject arg7)
+{
+ NSRect _arg0, *lparg0=NULL;
+ NSPoint _arg4, *lparg4=NULL;
+ NSRect _arg5, *lparg5=NULL;
+ NSRange _arg7, *lparg7=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSPointFields(env, arg4, &_arg4)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = getNSRectFields(env, arg5, &_arg5)) == NULL) goto fail;
+ if (arg7) if ((lparg7 = getNSRangeFields(env, arg7, &_arg7)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, jint, NSPoint, NSRect, jint, NSRange))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, *lparg4, *lparg5, arg6, *lparg7);
+fail:
+ if (arg7 && lparg7) setNSRangeFields(env, arg7, lparg7);
+ if (arg5 && lparg5) setNSRectFields(env, arg5, lparg5);
+ if (arg4 && lparg4) setNSPointFields(env, arg4, lparg4);
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jobject arg4)
+{
+ NSRect _arg0, *lparg0=NULL;
+ NSRange _arg4, *lparg4=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSRangeFields(env, arg4, &_arg4)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, jint, NSRange))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, *lparg4);
+fail:
+ if (arg4 && lparg4) setNSRangeFields(env, arg4, lparg4);
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jobject arg4)
+{
+ NSRect _arg0, *lparg0=NULL;
+ NSRect _arg4, *lparg4=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSRectFields(env, arg4, &_arg4)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, jint, NSRect))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, *lparg4);
+fail:
+ if (arg4 && lparg4) setNSRectFields(env, arg4, lparg4);
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2I
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2I)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jobject arg4, jint arg5)
+{
+ NSRect _arg0, *lparg0=NULL;
+ NSRect _arg4, *lparg4=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSRectFields(env, arg4, &_arg4)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, jint, NSRect, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, *lparg4, arg5);
+fail:
+ if (arg4 && lparg4) setNSRectFields(env, arg4, lparg4);
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2I
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2I)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jobject arg4, jobject arg5, jint arg6)
+{
+ NSRect _arg0, *lparg0=NULL;
+ NSRect _arg4, *lparg4=NULL;
+ NSPoint _arg5, *lparg5=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSRectFields(env, arg4, &_arg4)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = getNSPointFields(env, arg5, &_arg5)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, jint, NSRect, NSPoint, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, *lparg4, *lparg5, arg6);
+fail:
+ if (arg5 && lparg5) setNSPointFields(env, arg5, lparg5);
+ if (arg4 && lparg4) setNSRectFields(env, arg4, lparg4);
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2I
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2I)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jobject arg4, jobject arg5, jint arg6)
+{
+ NSRect _arg0, *lparg0=NULL;
+ NSRect _arg4, *lparg4=NULL;
+ NSRect _arg5, *lparg5=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSRectFields(env, arg4, &_arg4)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = getNSRectFields(env, arg5, &_arg5)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, jint, NSRect, NSRect, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, *lparg4, *lparg5, arg6);
+fail:
+ if (arg5 && lparg5) setNSRectFields(env, arg5, lparg5);
+ if (arg4 && lparg4) setNSRectFields(env, arg4, lparg4);
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jobject arg4, jobject arg5, jint arg6, jobject arg7)
+{
+ NSRect _arg0, *lparg0=NULL;
+ NSRect _arg4, *lparg4=NULL;
+ NSRect _arg5, *lparg5=NULL;
+ NSRange _arg7, *lparg7=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSRectFields(env, arg4, &_arg4)) == NULL) goto fail;
+ if (arg5) if ((lparg5 = getNSRectFields(env, arg5, &_arg5)) == NULL) goto fail;
+ if (arg7) if ((lparg7 = getNSRangeFields(env, arg7, &_arg7)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, jint, NSRect, NSRect, jint, NSRange))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, *lparg4, *lparg5, arg6, *lparg7);
+fail:
+ if (arg7 && lparg7) setNSRangeFields(env, arg7, lparg7);
+ if (arg5 && lparg5) setNSRectFields(env, arg5, lparg5);
+ if (arg4 && lparg4) setNSRectFields(env, arg4, lparg4);
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3, jobject arg4, jint arg5, jobject arg6)
+{
+ NSRect _arg0, *lparg0=NULL;
+ NSPoint _arg3, *lparg3=NULL;
+ NSRect _arg4, *lparg4=NULL;
+ NSRange _arg6, *lparg6=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSRectFields(env, arg4, &_arg4)) == NULL) goto fail;
+ if (arg6) if ((lparg6 = getNSRangeFields(env, arg6, &_arg6)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, NSPoint, NSRect, jint, NSRange))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3, *lparg4, arg5, *lparg6);
+fail:
+ if (arg6 && lparg6) setNSRangeFields(env, arg6, lparg6);
+ if (arg4 && lparg4) setNSRectFields(env, arg4, lparg4);
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3)
+{
+ NSRect _arg0, *lparg0=NULL;
+ NSRange _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, NSRange))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRange_2I
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRange_2I)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3, jint arg4)
+{
+ NSRect _arg0, *lparg0=NULL;
+ NSRange _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, NSRange, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3, arg4);
+fail:
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3)
+{
+ NSRect _arg0, *lparg0=NULL;
+ NSRect _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, NSRect))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2I
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2I)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3, jint arg4)
+{
+ NSRect _arg0, *lparg0=NULL;
+ NSRect _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, NSRect, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3, arg4);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2III
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2III)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3, jint arg4, jint arg5, jint arg6)
+{
+ NSRect _arg0, *lparg0=NULL;
+ NSRect _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2III_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, NSRect, jint, jint, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3, arg4, arg5, arg6);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2III_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3, jobject arg4, jint arg5, jobject arg6)
+{
+ NSRect _arg0, *lparg0=NULL;
+ NSRect _arg3, *lparg3=NULL;
+ NSRect _arg4, *lparg4=NULL;
+ NSRange _arg6, *lparg6=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSRectFields(env, arg4, &_arg4)) == NULL) goto fail;
+ if (arg6) if ((lparg6 = getNSRangeFields(env, arg6, &_arg6)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, NSRect, NSRect, jint, NSRange))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3, *lparg4, arg5, *lparg6);
+fail:
+ if (arg6 && lparg6) setNSRangeFields(env, arg6, lparg6);
+ if (arg4 && lparg4) setNSRectFields(env, arg4, lparg4);
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSSize_2I
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSSize_2I)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3, jint arg4)
+{
+ NSRect _arg0, *lparg0=NULL;
+ NSSize _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSSize_2I_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSSizeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, NSSize, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3, arg4);
+fail:
+ if (arg3 && lparg3) setNSSizeFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSSize_2I_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSSize_2II
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSSize_2II)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3, jint arg4, jint arg5)
+{
+ NSRect _arg0, *lparg0=NULL;
+ NSSize _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSSize_2II_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSSizeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, NSSize, jint, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3, arg4, arg5);
+fail:
+ if (arg3 && lparg3) setNSSizeFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSSize_2II_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIZ
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIZ)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jboolean arg3)
+{
+ NSRect _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIZ_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSRect *, id, SEL, jboolean))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3);
+fail:
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIZ_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2II
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2II)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2)
+{
+ NSSize _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2II_FUNC);
+ if (arg0) if ((lparg0 = getNSSizeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSSize *, id, SEL))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2);
+fail:
+ if (arg0 && lparg0) setNSSizeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2II_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIF
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIF)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jfloat arg3)
+{
+ NSSize _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIF_FUNC);
+ if (arg0) if ((lparg0 = getNSSizeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSSize *, id, SEL, jfloat))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3);
+fail:
+ if (arg0 && lparg0) setNSSizeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIF_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2III
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2III)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3)
+{
+ NSSize _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2III_FUNC);
+ if (arg0) if ((lparg0 = getNSSizeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSSize *, id, SEL, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3);
+fail:
+ if (arg0 && lparg0) setNSSizeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2III_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIII
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIII)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jint arg4)
+{
+ NSSize _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIII_FUNC);
+ if (arg0) if ((lparg0 = getNSSizeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSSize *, id, SEL, jint, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, arg4);
+fail:
+ if (arg0 && lparg0) setNSSizeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIII_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIILorg_eclipse_swt_internal_cocoa_NSRange_2II
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIILorg_eclipse_swt_internal_cocoa_NSRange_2II)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jobject arg4, jint arg5, jint arg6)
+{
+ NSSize _arg0, *lparg0=NULL;
+ NSRange _arg4, *lparg4=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIILorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC);
+ if (arg0) if ((lparg0 = getNSSizeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSRangeFields(env, arg4, &_arg4)) == NULL) goto fail;
+ ((void (*)(NSSize *, id, SEL, jint, NSRange, jint, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, *lparg4, arg5, arg6);
+fail:
+ if (arg4 && lparg4) setNSRangeFields(env, arg4, lparg4);
+ if (arg0 && lparg0) setNSSizeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIILorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIILorg_eclipse_swt_internal_cocoa_NSSize_2
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIILorg_eclipse_swt_internal_cocoa_NSSize_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3, jobject arg4)
+{
+ NSSize _arg0, *lparg0=NULL;
+ NSSize _arg4, *lparg4=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIILorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC);
+ if (arg0) if ((lparg0 = getNSSizeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg4) if ((lparg4 = getNSSizeFields(env, arg4, &_arg4)) == NULL) goto fail;
+ ((void (*)(NSSize *, id, SEL, jint, NSSize))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3, *lparg4);
+fail:
+ if (arg4 && lparg4) setNSSizeFields(env, arg4, lparg4);
+ if (arg0 && lparg0) setNSSizeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIILorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSRect_2
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSRect_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3)
+{
+ NSSize _arg0, *lparg0=NULL;
+ NSRect _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+ if (arg0) if ((lparg0 = getNSSizeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRectFields(env, arg3, &_arg3)) == NULL) goto fail;
+ ((void (*)(NSSize *, id, SEL, NSRect))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSRectFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSSizeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3)
+{
+ NSSize _arg0, *lparg0=NULL;
+ NSSize _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC);
+ if (arg0) if ((lparg0 = getNSSizeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSSizeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ ((void (*)(NSSize *, id, SEL, NSSize))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3);
+fail:
+ if (arg3 && lparg3) setNSSizeFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSSizeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2I
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2I)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3, jint arg4)
+{
+ NSSize _arg0, *lparg0=NULL;
+ NSSize _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2I_FUNC);
+ if (arg0) if ((lparg0 = getNSSizeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSSizeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ ((void (*)(NSSize *, id, SEL, NSSize, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3, arg4);
+fail:
+ if (arg3 && lparg3) setNSSizeFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSSizeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2I_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2ZZI
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2ZZI)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3, jboolean arg4, jboolean arg5, jint arg6)
+{
+ NSSize _arg0, *lparg0=NULL;
+ NSSize _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2ZZI_FUNC);
+ if (arg0) if ((lparg0 = getNSSizeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSSizeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ ((void (*)(NSSize *, id, SEL, NSSize, jboolean, jboolean, jint))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, *lparg3, arg4, arg5, arg6);
+fail:
+ if (arg3 && lparg3) setNSSizeFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSSizeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2ZZI_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIZ
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIZ)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jboolean arg3)
+{
+ NSSize _arg0, *lparg0=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIZ_FUNC);
+ if (arg0) if ((lparg0 = getNSSizeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ ((void (*)(NSSize *, id, SEL, jboolean))objc_msgSend_stret)(lparg0, (id)arg1, (SEL)arg2, arg3);
+fail:
+ if (arg0 && lparg0) setNSSizeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIZ_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1registerClassPair
+JNIEXPORT void JNICALL OS_NATIVE(objc_1registerClassPair)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ OS_NATIVE_ENTER(env, that, objc_1registerClassPair_FUNC);
+ objc_registerClassPair((Class)arg0);
+ OS_NATIVE_EXIT(env, that, objc_1registerClassPair_FUNC);
+}
+#endif
+
+#ifndef NO_object_1getClassName
+JNIEXPORT jint JNICALL OS_NATIVE(object_1getClassName)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, object_1getClassName_FUNC);
+ rc = (jint)object_getClassName((id)arg0);
+ OS_NATIVE_EXIT(env, that, object_1getClassName_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_object_1getInstanceVariable
+JNIEXPORT jint JNICALL OS_NATIVE(object_1getInstanceVariable)
+ (JNIEnv *env, jclass that, jint arg0, jstring arg1, jintArray arg2)
+{
+ const char *lparg1= NULL;
+ jint *lparg2=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, object_1getInstanceVariable_FUNC);
+ if (arg1) if ((lparg1 = (*env)->GetStringUTFChars(env, arg1, NULL)) == NULL) goto fail;
+ if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail;
+ rc = (jint)object_getInstanceVariable((id)arg0, (const char *)lparg1, (void **)lparg2);
+fail:
+ if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0);
+ if (arg1 && lparg1) (*env)->ReleaseStringUTFChars(env, arg1, lparg1);
+ OS_NATIVE_EXIT(env, that, object_1getInstanceVariable_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_object_1setInstanceVariable
+JNIEXPORT jint JNICALL OS_NATIVE(object_1setInstanceVariable)
+ (JNIEnv *env, jclass that, jint arg0, jstring arg1, jint arg2)
+{
+ const char *lparg1= NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, object_1setInstanceVariable_FUNC);
+ if (arg1) if ((lparg1 = (*env)->GetStringUTFChars(env, arg1, NULL)) == NULL) goto fail;
+ rc = (jint)object_setInstanceVariable((id)arg0, (const char *)lparg1, (void *)arg2);
+fail:
+ if (arg1 && lparg1) (*env)->ReleaseStringUTFChars(env, arg1, lparg1);
+ OS_NATIVE_EXIT(env, that, object_1setInstanceVariable_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_sel_1registerName
+JNIEXPORT jint JNICALL OS_NATIVE(sel_1registerName)
+ (JNIEnv *env, jclass that, jstring arg0)
+{
+ const char *lparg0= NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, sel_1registerName_FUNC);
+ if (arg0) if ((lparg0 = (*env)->GetStringUTFChars(env, arg0, NULL)) == NULL) goto fail;
+ rc = (jint)sel_registerName((const char *)lparg0);
+fail:
+ if (arg0 && lparg0) (*env)->ReleaseStringUTFChars(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, sel_1registerName_FUNC);
+ return rc;
+}
+#endif
+
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.h b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.h
new file mode 100755
index 0000000000..2012acba91
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.h
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+#ifndef INC_os_H
+#define INC_os_H
+
+/*#define NDEBUG*/
+
+#include <Cocoa/Cocoa.h>
+#import <objc/objc-runtime.h>
+
+#include "os_custom.h"
+
+#ifndef __i386__
+#define objc_msgSend_fpret objc_msgSend
+#endif
+
+#endif /* INC_os_H */
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_custom.c b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_custom.c
new file mode 100755
index 0000000000..64b76b4177
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_custom.c
@@ -0,0 +1,331 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+#include "swt.h"
+#include "os_structs.h"
+#include "os_stats.h"
+
+#define OS_NATIVE(func) Java_org_eclipse_swt_internal_cocoa_OS_##func
+
+#ifndef NO_JNIGetObject
+JNIEXPORT jobject JNICALL OS_NATIVE(JNIGetObject)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jobject rc = 0;
+ OS_NATIVE_ENTER(env, that, JNIGetObject_FUNC);
+ rc = (jobject)arg0;
+ OS_NATIVE_EXIT(env, that, JNIGetObject_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_NSIntersectionRect
+JNIEXPORT void JNICALL OS_NATIVE(NSIntersectionRect)
+ (JNIEnv *env, jclass that, jobject arg0, jobject arg1, jobject arg2)
+{
+ NSRect _arg0, *lparg0=NULL;
+ NSRect _arg1, *lparg1=NULL;
+ NSRect _arg2, *lparg2=NULL;
+ OS_NATIVE_ENTER(env, that, NSIntersectionRect_FUNC);
+ if (arg0) if ((lparg0 = getNSRectFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg1) if ((lparg1 = getNSRectFields(env, arg1, &_arg1)) == NULL) goto fail;
+ if (arg2) if ((lparg2 = getNSRectFields(env, arg2, &_arg2)) == NULL) goto fail;
+ *lparg0 = NSIntersectionRect(*lparg1, *lparg2);
+fail:
+ if (arg2 && lparg2) setNSRectFields(env, arg2, lparg2);
+ if (arg1 && lparg1) setNSRectFields(env, arg1, lparg1);
+ if (arg0 && lparg0) setNSRectFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, NSIntersectionRect_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2
+static SEL cascadeTopLeftFromPoint;
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3)
+{
+ NSPoint _arg0, *lparg0=NULL;
+ NSPoint _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ if (arg0) if ((lparg0 = getNSPointFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+
+ //rc = (jint)objc_msgSend_struct(lparg0, arg1, arg2, lparg3);
+
+ if (cascadeTopLeftFromPoint == NULL) cascadeTopLeftFromPoint = sel_registerName("cascadeTopLeftFromPoint:");
+ if ((SEL)arg2 == cascadeTopLeftFromPoint) {
+ *lparg0 = [(NSWindow *)arg1 cascadeTopLeftFromPoint: _arg3];
+ }
+fail:
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSPointFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC);
+ return rc;
+}
+#endif
+
+
+#ifndef NO_objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2III
+static SEL locationForGlyphAtIndex;
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2III)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3)
+{
+ NSPoint _arg0, *lparg0=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2III_FUNC);
+ if (arg0) if ((lparg0 = getNSPointFields(env, arg0, &_arg0)) == NULL) goto fail;
+
+ //rc = (jint)objc_msgSend_struct(lparg0, arg1, arg2);
+
+ if (locationForGlyphAtIndex == 0) locationForGlyphAtIndex = sel_registerName("locationForGlyphAtIndex:");
+ if ((SEL)arg2 == locationForGlyphAtIndex) {
+ *lparg0 = [(NSLayoutManager *)arg1 locationForGlyphAtIndex: arg3];
+ }
+
+fail:
+ if (arg0 && lparg0) setNSPointFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2III_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II
+static SEL mouseLocationOutsideOfEventStream;
+static SEL locationInWindow;
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2)
+{
+ NSPoint _arg0, *lparg0=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II_FUNC);
+ if (arg0) if ((lparg0 = getNSPointFields(env, arg0, &_arg0)) == NULL) goto fail;
+
+ //rc = (jint)objc_msgSend_struct(lparg0, arg1, arg2);
+
+ if (mouseLocationOutsideOfEventStream == 0) mouseLocationOutsideOfEventStream = sel_registerName("mouseLocationOutsideOfEventStream");
+ if ((SEL)arg2 == mouseLocationOutsideOfEventStream) {
+ *lparg0 = [(NSWindow *)arg1 mouseLocationOutsideOfEventStream];
+ } else {
+ if (locationInWindow == 0) locationInWindow = sel_registerName("locationInWindow");
+ if ((SEL)arg2 == locationInWindow) {
+ *lparg0 = [(NSEvent *)arg1 locationInWindow];
+ }
+ }
+
+fail:
+ if (arg0 && lparg0) setNSPointFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2I
+static SEL glyphRangeForCharacterRange;
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2I)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3, jint arg4)
+{
+ NSRange _arg0, *lparg0=NULL;
+ NSRange _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ //objc_msgSend_struct(lparg0, arg1, arg2, lparg3, arg4);
+ if (glyphRangeForCharacterRange == 0) glyphRangeForCharacterRange = sel_registerName("glyphRangeForCharacterRange:actualCharacterRange::");
+ if ((SEL)arg2 == glyphRangeForCharacterRange) {
+ *lparg0 = [(id)arg1 glyphRangeForCharacterRange: *lparg3 actualCharacterRange: (NSRange *)arg4];
+ }
+fail:
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2ZZI
+static SEL frameSizeForContentSize;
+JNIEXPORT void JNICALL OS_NATIVE(objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2ZZI)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3, jboolean arg4, jboolean arg5, jint arg6)
+{
+ NSSize _arg0, *lparg0=NULL;
+ NSSize _arg3, *lparg3=NULL;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2ZZI_FUNC);
+ if (arg0) if ((lparg0 = getNSSizeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSSizeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ //objc_msgSend_struct(lparg0, arg1, arg2, lparg3, arg4, arg5, arg6);
+ if (frameSizeForContentSize == 0) frameSizeForContentSize = sel_registerName("frameSizeForContentSize:hasHorizontalScroller:hasVerticalScroller:borderType:");
+ if ((SEL)arg2 == frameSizeForContentSize) {
+ *lparg0 = [(id)arg1 frameSizeForContentSize: *lparg3 hasHorizontalScroller: arg4 hasVerticalScroller: arg5 borderType: arg6];
+ }
+fail:
+ if (arg3 && lparg3) setNSSizeFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSSizeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2ZZI_FUNC);
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2II
+static SEL selectedRange;
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2II)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2)
+{
+ NSRange _arg0, *lparg0=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+
+ //rc = (jint)objc_msgSend_struct(lparg0, arg1, arg2);
+ if (selectedRange == 0) selectedRange = sel_registerName("selectedRange");
+ if ((SEL)arg2 == selectedRange) {
+ *lparg0 = [(NSText *)arg1 selectedRange];
+ }
+
+fail:
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC);
+ return rc;
+}
+#endif
+
+
+#ifndef NO_objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2III
+static SEL doubleClickAtIndex;
+static SEL glyphRangeForTextContainer;
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2III)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jint arg3)
+{
+ NSRange _arg0, *lparg0=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2III_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+
+ //rc = (jint)objc_msgSend_struct(lparg0, arg1, arg2, arg3);
+ if (doubleClickAtIndex == 0) doubleClickAtIndex = sel_registerName("doubleClickAtIndex:");
+ if ((SEL)arg2 == doubleClickAtIndex) {
+ *lparg0 = [(NSAttributedString *)arg1 doubleClickAtIndex: arg3];
+ } else {
+ if (glyphRangeForTextContainer == 0) glyphRangeForTextContainer = sel_registerName("glyphRangeForTextContainer:");
+ if ((SEL)arg2 == glyphRangeForTextContainer) {
+ *lparg0 = [(NSLayoutManager *)arg1 glyphRangeForTextContainer: (NSTextContainer *)arg3];
+ }
+ }
+
+fail:
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2III_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSSize_2II
+static SEL size;
+static SEL minimumSize;
+static SEL contentSize;
+static SEL cellSize;
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSSize_2II)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2)
+{
+ NSSize _arg0, *lparg0=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSSize_2II_FUNC);
+ if (arg0) if ((lparg0 = getNSSizeFields(env, arg0, &_arg0)) == NULL) goto fail;
+
+ //rc = (jint)objc_msgSend_struct(lparg0, arg1, arg2);
+ if (size == 0) size = sel_registerName("size");
+ if ((SEL)arg2 == size) {
+ *lparg0 = [(NSAttributedString *)arg1 size];
+ } else {
+ if (minimumSize == 0) minimumSize = sel_registerName("minimumSize");
+ if ((SEL)arg2 == minimumSize) {
+ *lparg0 = [(NSTabView *)arg1 minimumSize];
+ } else {
+ if (contentSize == 0) contentSize = sel_registerName("contentSize");
+ if ((SEL)arg2 == contentSize) {
+ *lparg0 = [(NSScrollView *)arg1 contentSize];
+ } else {
+ if (cellSize == 0) cellSize = sel_registerName("cellSize");
+ if ((SEL)arg2 == contentSize) {
+ *lparg0 = [(NSCell *)arg1 cellSize];
+ }
+ }
+ }
+ }
+
+fail:
+ if (arg0 && lparg0) setNSSizeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSSize_2II_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2I
+static SEL convertPointfromView;
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2I)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3, jint arg4)
+{
+ NSPoint _arg0, *lparg0=NULL;
+ NSPoint _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC);
+ if (arg0) if ((lparg0 = getNSPointFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSPointFields(env, arg3, &_arg3)) == NULL) goto fail;
+
+ //rc = (jint)objc_msgSend_struct(lparg0, arg1, arg2, lparg3, arg4);
+ if (convertPointfromView == 0) convertPointfromView = sel_registerName("convertPoint:fromView:");
+ if ((SEL)arg2 == convertPointfromView) {
+ *lparg0 = [(NSView *)arg1 convertPoint: _arg3 fromView: (NSView *)arg4];
+ }
+
+fail:
+ if (arg3 && lparg3) setNSPointFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSPointFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2
+static SEL lineRangeForRange;
+JNIEXPORT jint JNICALL OS_NATIVE(objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2)
+ (JNIEnv *env, jclass that, jobject arg0, jint arg1, jint arg2, jobject arg3)
+{
+ NSRange _arg0, *lparg0=NULL;
+ NSRange _arg3, *lparg3=NULL;
+ jint rc = 0;
+ OS_NATIVE_ENTER(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ if (arg0) if ((lparg0 = getNSRangeFields(env, arg0, &_arg0)) == NULL) goto fail;
+ if (arg3) if ((lparg3 = getNSRangeFields(env, arg3, &_arg3)) == NULL) goto fail;
+ //rc = (jint)objc_msgSend_struct(lparg0, arg1, arg2, lparg3);
+ if (lineRangeForRange == 0) lineRangeForRange = sel_registerName("lineRangeForRange:");
+ if ((SEL)arg2 == lineRangeForRange) {
+ *lparg0 = [(NSString *)arg1 lineRangeForRange: *lparg3];
+ }
+fail:
+ if (arg3 && lparg3) setNSRangeFields(env, arg3, lparg3);
+ if (arg0 && lparg0) setNSRangeFields(env, arg0, lparg0);
+ OS_NATIVE_EXIT(env, that, objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO_drawRect_1CALLBACK
+static SWT_PTR drawRect_1CALLBACK;
+static void drawRect(id obj, SEL sel, NSRect rect)
+{
+ return ((void (*)(id, SEL, NSRect*))drawRect_1CALLBACK)(obj, sel, &rect);
+}
+JNIEXPORT SWT_PTR JNICALL OS_NATIVE(drawRect_1CALLBACK)
+ (JNIEnv *env, jclass that, SWT_PTR func)
+{
+ drawRect_1CALLBACK = func;
+ return (SWT_PTR)drawRect;
+}
+#endif \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_custom.h
new file mode 100755
index 0000000000..46d63a35df
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_custom.h
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+/* Libraries for dynamic loaded functions */
+#define UnionRgn_LIB "com.apple.Carbon"
+#define SectRgn_LIB "com.apple.Carbon"
+#define RectRgn_LIB "com.apple.Carbon"
+#define RectInRgn_LIB "com.apple.Carbon"
+#define QDRegionToRects_LIB "com.apple.Carbon"
+#define PtInRgn_LIB "com.apple.Carbon"
+#define OpenRgn_LIB "com.apple.Carbon"
+#define OffsetRgn_LIB "com.apple.Carbon"
+#define NewRgn_LIB "com.apple.Carbon"
+#define MoveTo_LIB "com.apple.Carbon"
+#define LineTo_LIB "com.apple.Carbon"
+#define GetRegionBounds_LIB "com.apple.Carbon"
+#define EmptyRgn_LIB "com.apple.Carbon"
+#define DisposeRgn_LIB "com.apple.Carbon"
+#define DiffRgn_LIB "com.apple.Carbon"
+#define CopyRgn_LIB "com.apple.Carbon"
+#define CloseRgn_LIB "com.apple.Carbon"
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.c
new file mode 100644
index 0000000000..13fcb79b4b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.c
@@ -0,0 +1,355 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+#include "swt.h"
+#include "os_stats.h"
+
+#ifdef NATIVE_STATS
+
+int OS_nativeFunctionCount = 313;
+int OS_nativeFunctionCallCount[313];
+char * OS_nativeFunctionNames[] = {
+ "CGWarpMouseCursorPosition",
+ "CloseRgn",
+ "CopyRgn",
+ "DeleteGlobalRef",
+ "DiffRgn",
+ "DisposeRgn",
+ "EmptyRgn",
+ "GetCurrentProcess",
+ "GetRegionBounds",
+ "JNIGetObject",
+ "LineTo",
+ "MoveTo",
+ "NSBackgroundColorAttributeName",
+ "NSBaselineOffsetAttributeName",
+ "NSBitsPerPixelFromDepth",
+ "NSDefaultRunLoopMode",
+ "NSDeviceRGBColorSpace",
+ "NSDeviceResolution",
+ "NSFontAttributeName",
+ "NSForegroundColorAttributeName",
+ "NSIntersectionRect",
+ "NSLinkAttributeName",
+ "NSParagraphStyleAttributeName",
+ "NSStrikethroughColorAttributeName",
+ "NSStrikethroughStyleAttributeName",
+ "NSUnderlineColorAttributeName",
+ "NSUnderlineStyleAttributeName",
+ "NewGlobalRef",
+ "NewRgn",
+ "OffsetRgn",
+ "OpenRgn",
+ "PtInRgn",
+ "QDRegionToRects",
+ "RectInRgn",
+ "RectRgn",
+ "SectRgn",
+ "SetFrontProcess",
+ "TransformProcessType",
+ "UnionRgn",
+ "class_1addIvar",
+ "class_1addMethod",
+ "drawRect_1CALLBACK",
+ "memmove__ILorg_eclipse_swt_internal_cocoa_NSRect_2I",
+ "memmove__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II",
+ "memmove__Lorg_eclipse_swt_internal_cocoa_NSRange_2II",
+ "memmove__Lorg_eclipse_swt_internal_cocoa_NSRect_2II",
+ "objc_1allocateClassPair",
+ "objc_1getClass",
+ "objc_1lookUpClass",
+ "objc_1msgSend__II",
+ "objc_1msgSend__IIB",
+ "objc_1msgSend__IID",
+ "objc_1msgSend__IIDD",
+ "objc_1msgSend__IIDI",
+ "objc_1msgSend__IIDIIIZ",
+ "objc_1msgSend__IIDIZ",
+ "objc_1msgSend__IIF",
+ "objc_1msgSend__IIFF",
+ "objc_1msgSend__IIFFFF",
+ "objc_1msgSend__IIFFFFF",
+ "objc_1msgSend__IIFI",
+ "objc_1msgSend__IIFIF",
+ "objc_1msgSend__IIFII",
+ "objc_1msgSend__IIFIII",
+ "objc_1msgSend__III",
+ "objc_1msgSend__IIIDIIIZ",
+ "objc_1msgSend__IIIF",
+ "objc_1msgSend__IIIFFF",
+ "objc_1msgSend__IIIFI",
+ "objc_1msgSend__IIIFILorg_eclipse_swt_internal_cocoa_NSPoint_2",
+ "objc_1msgSend__IIII",
+ "objc_1msgSend__IIIID",
+ "objc_1msgSend__IIIIDI",
+ "objc_1msgSend__IIIIF",
+ "objc_1msgSend__IIIIFII",
+ "objc_1msgSend__IIIII",
+ "objc_1msgSend__IIIIIF",
+ "objc_1msgSend__IIIIII",
+ "objc_1msgSend__IIIIIII",
+ "objc_1msgSend__IIIIIIII",
+ "objc_1msgSend__IIIIIIIII",
+ "objc_1msgSend__IIIIIIILorg_eclipse_swt_internal_cocoa_NSPoint_2",
+ "objc_1msgSend__IIIIIIILorg_eclipse_swt_internal_cocoa_NSRange_2I",
+ "objc_1msgSend__IIIIIIIZZIII",
+ "objc_1msgSend__IIIIIIIZZIIII",
+ "objc_1msgSend__IIIIIILorg_eclipse_swt_internal_cocoa_NSRect_2FFF",
+ "objc_1msgSend__IIIIILorg_eclipse_swt_internal_cocoa_NSPoint_2",
+ "objc_1msgSend__IIIIILorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend__IIIIILorg_eclipse_swt_internal_cocoa_NSRange_2I",
+ "objc_1msgSend__IIIIISI",
+ "objc_1msgSend__IIIIIZ",
+ "objc_1msgSend__IIIIIZI",
+ "objc_1msgSend__IIIIJ",
+ "objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSPoint_2",
+ "objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSPoint_2I",
+ "objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2I",
+ "objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2ILorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2",
+ "objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSSize_2",
+ "objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRect_2",
+ "objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRect_2I",
+ "objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRect_2II",
+ "objc_1msgSend__IIIIS",
+ "objc_1msgSend__IIIIZ",
+ "objc_1msgSend__IIIIZI",
+ "objc_1msgSend__IIIIZII",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2I",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIIIIF",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIIIII",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIIIIZS",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIISII",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2II",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSSize_2IIIZ",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Z",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2I",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2II",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2IZ",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2I",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2II",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2IIZ",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2I",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2IZ",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2IZI",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2ZI",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSSize_2",
+ "objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSSize_2Z",
+ "objc_1msgSend__IIIS",
+ "objc_1msgSend__IIISZZZZ",
+ "objc_1msgSend__IIIZ",
+ "objc_1msgSend__IIIZI",
+ "objc_1msgSend__IIIZII",
+ "objc_1msgSend__IIIZIII",
+ "objc_1msgSend__IIIZZ",
+ "objc_1msgSend__IIIZZII",
+ "objc_1msgSend__IIJ",
+ "objc_1msgSend__IIJI",
+ "objc_1msgSend__IIJSZ",
+ "objc_1msgSend__IILjava_lang_String_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSAffineTransformStruct_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSDecimal_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2F",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2FFF",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2FFFZ",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2FLorg_eclipse_swt_internal_cocoa_NSPoint_2FI",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2I",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2IF",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2II",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2ILorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2F",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2I",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2IZ",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2F",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2I",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2IF",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2I",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IFLorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2II",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2III",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IIII",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IIIII",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2ILorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2ILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IZ",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2II",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2ZI",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2F",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2FF",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2I",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2II",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2III",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIII",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIIII",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIZ",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIZI",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2I",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IZ",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IZI",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRect_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRect_2F",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2I",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2IF",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSSize_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Z",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2ZZ",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2I",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2IZZ",
+ "objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2Lorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend__IIS",
+ "objc_1msgSend__IISI",
+ "objc_1msgSend__IIZ",
+ "objc_1msgSend__IIZI",
+ "objc_1msgSend__IIZII",
+ "objc_1msgSend__IIZLorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend__IIZLorg_eclipse_swt_internal_cocoa_NSRect_2",
+ "objc_1msgSend__IIZLorg_eclipse_swt_internal_cocoa_NSRect_2I",
+ "objc_1msgSend__IIZZ",
+ "objc_1msgSend__II_3C",
+ "objc_1msgSend__II_3CI",
+ "objc_1msgSend__II_3CLorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend__II_3F",
+ "objc_1msgSend__II_3FIF",
+ "objc_1msgSend__II_3III",
+ "objc_1msgSendSuper__Lorg_eclipse_swt_internal_cocoa_objc_1super_2I",
+ "objc_1msgSendSuper__Lorg_eclipse_swt_internal_cocoa_objc_1super_2II",
+ "objc_1msgSendSuper__Lorg_eclipse_swt_internal_cocoa_objc_1super_2ILorg_eclipse_swt_internal_cocoa_NSRect_2",
+ "objc_1msgSend_1fpret__II",
+ "objc_1msgSend_1fpret__IID",
+ "objc_1msgSend_1fpret__IIF",
+ "objc_1msgSend_1fpret__III",
+ "objc_1msgSend_1fpret__IIIF",
+ "objc_1msgSend_1fpret__IIIFI",
+ "objc_1msgSend_1fpret__IIII",
+ "objc_1msgSend_1fpret__IIIIF",
+ "objc_1msgSend_1fpret__IIIIZF",
+ "objc_1msgSend_1fpret__IIILorg_eclipse_swt_internal_cocoa_NSRect_2",
+ "objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSPoint_2",
+ "objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSPoint_2I",
+ "objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSRect_2",
+ "objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSSize_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSAffineTransformStruct_2II",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSDecimal_2II",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2III",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIIII",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIIIIII",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2I",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIISLorg_eclipse_swt_internal_cocoa_NSRect_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2I",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSRect_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2II",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2III",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIII",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIII",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIIII",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIIIIZ",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIIIZII",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIILorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIILorg_eclipse_swt_internal_cocoa_NSRange_2I",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2I",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2II",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRect_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRect_2I",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2II",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2III",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIII",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIII",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIILorg_eclipse_swt_internal_cocoa_NSRect_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2I",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIIZ",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2I",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2I",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2I",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRange_2I",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2I",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2III",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSSize_2I",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSSize_2II",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIZ",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2II",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIF",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2III",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIII",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIILorg_eclipse_swt_internal_cocoa_NSRange_2II",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIILorg_eclipse_swt_internal_cocoa_NSSize_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSRect_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2I",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2ZZI",
+ "objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIZ",
+ "objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II",
+ "objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2III",
+ "objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2",
+ "objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2I",
+ "objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2II",
+ "objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2III",
+ "objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2",
+ "objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2I",
+ "objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSSize_2II",
+ "objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2ZZI",
+ "objc_1registerClassPair",
+ "object_1getClassName",
+ "object_1getInstanceVariable",
+ "object_1setInstanceVariable",
+ "sel_1registerName",
+};
+
+#define STATS_NATIVE(func) Java_org_eclipse_swt_tools_internal_NativeStats_##func
+
+JNIEXPORT jint JNICALL STATS_NATIVE(OS_1GetFunctionCount)
+ (JNIEnv *env, jclass that)
+{
+ return OS_nativeFunctionCount;
+}
+
+JNIEXPORT jstring JNICALL STATS_NATIVE(OS_1GetFunctionName)
+ (JNIEnv *env, jclass that, jint index)
+{
+ return (*env)->NewStringUTF(env, OS_nativeFunctionNames[index]);
+}
+
+JNIEXPORT jint JNICALL STATS_NATIVE(OS_1GetFunctionCallCount)
+ (JNIEnv *env, jclass that, jint index)
+{
+ return OS_nativeFunctionCallCount[index];
+}
+
+#endif
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.h
new file mode 100644
index 0000000000..d53e442b60
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.h
@@ -0,0 +1,341 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+#ifdef NATIVE_STATS
+extern int OS_nativeFunctionCount;
+extern int OS_nativeFunctionCallCount[];
+extern char* OS_nativeFunctionNames[];
+#define OS_NATIVE_ENTER(env, that, func) OS_nativeFunctionCallCount[func]++;
+#define OS_NATIVE_EXIT(env, that, func)
+#else
+#ifndef OS_NATIVE_ENTER
+#define OS_NATIVE_ENTER(env, that, func)
+#endif
+#ifndef OS_NATIVE_EXIT
+#define OS_NATIVE_EXIT(env, that, func)
+#endif
+#endif
+
+typedef enum {
+ CGWarpMouseCursorPosition_FUNC,
+ CloseRgn_FUNC,
+ CopyRgn_FUNC,
+ DeleteGlobalRef_FUNC,
+ DiffRgn_FUNC,
+ DisposeRgn_FUNC,
+ EmptyRgn_FUNC,
+ GetCurrentProcess_FUNC,
+ GetRegionBounds_FUNC,
+ JNIGetObject_FUNC,
+ LineTo_FUNC,
+ MoveTo_FUNC,
+ NSBackgroundColorAttributeName_FUNC,
+ NSBaselineOffsetAttributeName_FUNC,
+ NSBitsPerPixelFromDepth_FUNC,
+ NSDefaultRunLoopMode_FUNC,
+ NSDeviceRGBColorSpace_FUNC,
+ NSDeviceResolution_FUNC,
+ NSFontAttributeName_FUNC,
+ NSForegroundColorAttributeName_FUNC,
+ NSIntersectionRect_FUNC,
+ NSLinkAttributeName_FUNC,
+ NSParagraphStyleAttributeName_FUNC,
+ NSStrikethroughColorAttributeName_FUNC,
+ NSStrikethroughStyleAttributeName_FUNC,
+ NSUnderlineColorAttributeName_FUNC,
+ NSUnderlineStyleAttributeName_FUNC,
+ NewGlobalRef_FUNC,
+ NewRgn_FUNC,
+ OffsetRgn_FUNC,
+ OpenRgn_FUNC,
+ PtInRgn_FUNC,
+ QDRegionToRects_FUNC,
+ RectInRgn_FUNC,
+ RectRgn_FUNC,
+ SectRgn_FUNC,
+ SetFrontProcess_FUNC,
+ TransformProcessType_FUNC,
+ UnionRgn_FUNC,
+ class_1addIvar_FUNC,
+ class_1addMethod_FUNC,
+ drawRect_1CALLBACK_FUNC,
+ memmove__ILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC,
+ memmove__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II_FUNC,
+ memmove__Lorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC,
+ memmove__Lorg_eclipse_swt_internal_cocoa_NSRect_2II_FUNC,
+ objc_1allocateClassPair_FUNC,
+ objc_1getClass_FUNC,
+ objc_1lookUpClass_FUNC,
+ objc_1msgSend__II_FUNC,
+ objc_1msgSend__IIB_FUNC,
+ objc_1msgSend__IID_FUNC,
+ objc_1msgSend__IIDD_FUNC,
+ objc_1msgSend__IIDI_FUNC,
+ objc_1msgSend__IIDIIIZ_FUNC,
+ objc_1msgSend__IIDIZ_FUNC,
+ objc_1msgSend__IIF_FUNC,
+ objc_1msgSend__IIFF_FUNC,
+ objc_1msgSend__IIFFFF_FUNC,
+ objc_1msgSend__IIFFFFF_FUNC,
+ objc_1msgSend__IIFI_FUNC,
+ objc_1msgSend__IIFIF_FUNC,
+ objc_1msgSend__IIFII_FUNC,
+ objc_1msgSend__IIFIII_FUNC,
+ objc_1msgSend__III_FUNC,
+ objc_1msgSend__IIIDIIIZ_FUNC,
+ objc_1msgSend__IIIF_FUNC,
+ objc_1msgSend__IIIFFF_FUNC,
+ objc_1msgSend__IIIFI_FUNC,
+ objc_1msgSend__IIIFILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
+ objc_1msgSend__IIII_FUNC,
+ objc_1msgSend__IIIID_FUNC,
+ objc_1msgSend__IIIIDI_FUNC,
+ objc_1msgSend__IIIIF_FUNC,
+ objc_1msgSend__IIIIFII_FUNC,
+ objc_1msgSend__IIIII_FUNC,
+ objc_1msgSend__IIIIIF_FUNC,
+ objc_1msgSend__IIIIII_FUNC,
+ objc_1msgSend__IIIIIII_FUNC,
+ objc_1msgSend__IIIIIIII_FUNC,
+ objc_1msgSend__IIIIIIIII_FUNC,
+ objc_1msgSend__IIIIIIILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
+ objc_1msgSend__IIIIIIILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC,
+ objc_1msgSend__IIIIIIIZZIII_FUNC,
+ objc_1msgSend__IIIIIIIZZIIII_FUNC,
+ objc_1msgSend__IIIIIILorg_eclipse_swt_internal_cocoa_NSRect_2FFF_FUNC,
+ objc_1msgSend__IIIIILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
+ objc_1msgSend__IIIIILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend__IIIIILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC,
+ objc_1msgSend__IIIIISI_FUNC,
+ objc_1msgSend__IIIIIZ_FUNC,
+ objc_1msgSend__IIIIIZI_FUNC,
+ objc_1msgSend__IIIIJ_FUNC,
+ objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
+ objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC,
+ objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC,
+ objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
+ objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC,
+ objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
+ objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC,
+ objc_1msgSend__IIIILorg_eclipse_swt_internal_cocoa_NSRect_2II_FUNC,
+ objc_1msgSend__IIIIS_FUNC,
+ objc_1msgSend__IIIIZ_FUNC,
+ objc_1msgSend__IIIIZI_FUNC,
+ objc_1msgSend__IIIIZII_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIIIIF_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIIIII_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIIIIZS_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2IDIISII_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2II_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSSize_2IIIZ_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Z_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2IZ_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2II_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2IIZ_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2IZ_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2IZI_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSRect_2ZI_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC,
+ objc_1msgSend__IIILorg_eclipse_swt_internal_cocoa_NSSize_2Z_FUNC,
+ objc_1msgSend__IIIS_FUNC,
+ objc_1msgSend__IIISZZZZ_FUNC,
+ objc_1msgSend__IIIZ_FUNC,
+ objc_1msgSend__IIIZI_FUNC,
+ objc_1msgSend__IIIZII_FUNC,
+ objc_1msgSend__IIIZIII_FUNC,
+ objc_1msgSend__IIIZZ_FUNC,
+ objc_1msgSend__IIIZZII_FUNC,
+ objc_1msgSend__IIJ_FUNC,
+ objc_1msgSend__IIJI_FUNC,
+ objc_1msgSend__IIJSZ_FUNC,
+ objc_1msgSend__IILjava_lang_String_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSAffineTransformStruct_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSDecimal_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2F_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2FFF_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2FFFZ_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2FLorg_eclipse_swt_internal_cocoa_NSPoint_2FI_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2IF_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2II_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2F_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2IZ_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2F_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2IF_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IFLorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2III_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IIII_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IIIII_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2ILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2IZ_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRange_2ZI_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2F_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2FF_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2II_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2III_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIII_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIIII_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIZ_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IIZI_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IZ_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2IZI_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRect_2F_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2IF_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2Z_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSRect_2ZZ_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2I_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2IZZ_FUNC,
+ objc_1msgSend__IILorg_eclipse_swt_internal_cocoa_NSSize_2Lorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend__IIS_FUNC,
+ objc_1msgSend__IISI_FUNC,
+ objc_1msgSend__IIZ_FUNC,
+ objc_1msgSend__IIZI_FUNC,
+ objc_1msgSend__IIZII_FUNC,
+ objc_1msgSend__IIZLorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend__IIZLorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
+ objc_1msgSend__IIZLorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC,
+ objc_1msgSend__IIZZ_FUNC,
+ objc_1msgSend__II_3C_FUNC,
+ objc_1msgSend__II_3CI_FUNC,
+ objc_1msgSend__II_3CLorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend__II_3F_FUNC,
+ objc_1msgSend__II_3FIF_FUNC,
+ objc_1msgSend__II_3III_FUNC,
+ objc_1msgSendSuper__Lorg_eclipse_swt_internal_cocoa_objc_1super_2I_FUNC,
+ objc_1msgSendSuper__Lorg_eclipse_swt_internal_cocoa_objc_1super_2II_FUNC,
+ objc_1msgSendSuper__Lorg_eclipse_swt_internal_cocoa_objc_1super_2ILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
+ objc_1msgSend_1fpret__II_FUNC,
+ objc_1msgSend_1fpret__IID_FUNC,
+ objc_1msgSend_1fpret__IIF_FUNC,
+ objc_1msgSend_1fpret__III_FUNC,
+ objc_1msgSend_1fpret__IIIF_FUNC,
+ objc_1msgSend_1fpret__IIIFI_FUNC,
+ objc_1msgSend_1fpret__IIII_FUNC,
+ objc_1msgSend_1fpret__IIIIF_FUNC,
+ objc_1msgSend_1fpret__IIIIZF_FUNC,
+ objc_1msgSend_1fpret__IIILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
+ objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
+ objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC,
+ objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
+ objc_1msgSend_1fpret__IILorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSAffineTransformStruct_2II_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSDecimal_2II_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2III_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIIII_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIIIIII_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IIISLorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2III_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIII_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIII_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIIII_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIIIIZ_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIIIZII_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIIILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IIILorg_eclipse_swt_internal_cocoa_NSRange_2Lorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2II_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2III_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIII_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIII_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIIIZ_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2I_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2III_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSRect_2Lorg_eclipse_swt_internal_cocoa_NSRect_2ILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSSize_2I_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IILorg_eclipse_swt_internal_cocoa_NSSize_2II_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSRect_2IIZ_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2II_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIF_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2III_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIII_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIILorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIILorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSRect_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2I_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2ZZI_FUNC,
+ objc_1msgSend_1stret__Lorg_eclipse_swt_internal_cocoa_NSSize_2IIZ_FUNC,
+ objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2II_FUNC,
+ objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2III_FUNC,
+ objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2_FUNC,
+ objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSPoint_2IILorg_eclipse_swt_internal_cocoa_NSPoint_2I_FUNC,
+ objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2II_FUNC,
+ objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2III_FUNC,
+ objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2_FUNC,
+ objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSRange_2IILorg_eclipse_swt_internal_cocoa_NSRange_2I_FUNC,
+ objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSSize_2II_FUNC,
+ objc_1msgSend_1struct__Lorg_eclipse_swt_internal_cocoa_NSSize_2IILorg_eclipse_swt_internal_cocoa_NSSize_2ZZI_FUNC,
+ objc_1registerClassPair_FUNC,
+ object_1getClassName_FUNC,
+ object_1getInstanceVariable_FUNC,
+ object_1setInstanceVariable_FUNC,
+ sel_1registerName_FUNC,
+} OS_FUNCS;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_structs.c b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_structs.c
new file mode 100644
index 0000000000..269baebb64
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_structs.c
@@ -0,0 +1,464 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+#include "swt.h"
+#include "os_structs.h"
+
+#ifndef NO_CGPoint
+typedef struct CGPoint_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID x, y;
+} CGPoint_FID_CACHE;
+
+CGPoint_FID_CACHE CGPointFc;
+
+void cacheCGPointFields(JNIEnv *env, jobject lpObject)
+{
+ if (CGPointFc.cached) return;
+ CGPointFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ CGPointFc.x = (*env)->GetFieldID(env, CGPointFc.clazz, "x", "F");
+ CGPointFc.y = (*env)->GetFieldID(env, CGPointFc.clazz, "y", "F");
+ CGPointFc.cached = 1;
+}
+
+CGPoint *getCGPointFields(JNIEnv *env, jobject lpObject, CGPoint *lpStruct)
+{
+ if (!CGPointFc.cached) cacheCGPointFields(env, lpObject);
+ lpStruct->x = (*env)->GetFloatField(env, lpObject, CGPointFc.x);
+ lpStruct->y = (*env)->GetFloatField(env, lpObject, CGPointFc.y);
+ return lpStruct;
+}
+
+void setCGPointFields(JNIEnv *env, jobject lpObject, CGPoint *lpStruct)
+{
+ if (!CGPointFc.cached) cacheCGPointFields(env, lpObject);
+ (*env)->SetFloatField(env, lpObject, CGPointFc.x, (jfloat)lpStruct->x);
+ (*env)->SetFloatField(env, lpObject, CGPointFc.y, (jfloat)lpStruct->y);
+}
+#endif
+
+#ifndef NO_CGRect
+typedef struct CGRect_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID origin, size;
+} CGRect_FID_CACHE;
+
+CGRect_FID_CACHE CGRectFc;
+
+void cacheCGRectFields(JNIEnv *env, jobject lpObject)
+{
+ if (CGRectFc.cached) return;
+ CGRectFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ CGRectFc.origin = (*env)->GetFieldID(env, CGRectFc.clazz, "origin", "Lorg/eclipse/swt/internal/cocoa/CGPoint;");
+ CGRectFc.size = (*env)->GetFieldID(env, CGRectFc.clazz, "size", "Lorg/eclipse/swt/internal/cocoa/CGSize;");
+ CGRectFc.cached = 1;
+}
+
+CGRect *getCGRectFields(JNIEnv *env, jobject lpObject, CGRect *lpStruct)
+{
+ if (!CGRectFc.cached) cacheCGRectFields(env, lpObject);
+ {
+ jobject lpObject1 = (*env)->GetObjectField(env, lpObject, CGRectFc.origin);
+ if (lpObject1 != NULL) getCGPointFields(env, lpObject1, &lpStruct->origin);
+ }
+ {
+ jobject lpObject1 = (*env)->GetObjectField(env, lpObject, CGRectFc.size);
+ if (lpObject1 != NULL) getCGSizeFields(env, lpObject1, &lpStruct->size);
+ }
+ return lpStruct;
+}
+
+void setCGRectFields(JNIEnv *env, jobject lpObject, CGRect *lpStruct)
+{
+ if (!CGRectFc.cached) cacheCGRectFields(env, lpObject);
+ {
+ jobject lpObject1 = (*env)->GetObjectField(env, lpObject, CGRectFc.origin);
+ if (lpObject1 != NULL) setCGPointFields(env, lpObject1, &lpStruct->origin);
+ }
+ {
+ jobject lpObject1 = (*env)->GetObjectField(env, lpObject, CGRectFc.size);
+ if (lpObject1 != NULL) setCGSizeFields(env, lpObject1, &lpStruct->size);
+ }
+}
+#endif
+
+#ifndef NO_CGSize
+typedef struct CGSize_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID width, height;
+} CGSize_FID_CACHE;
+
+CGSize_FID_CACHE CGSizeFc;
+
+void cacheCGSizeFields(JNIEnv *env, jobject lpObject)
+{
+ if (CGSizeFc.cached) return;
+ CGSizeFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ CGSizeFc.width = (*env)->GetFieldID(env, CGSizeFc.clazz, "width", "F");
+ CGSizeFc.height = (*env)->GetFieldID(env, CGSizeFc.clazz, "height", "F");
+ CGSizeFc.cached = 1;
+}
+
+CGSize *getCGSizeFields(JNIEnv *env, jobject lpObject, CGSize *lpStruct)
+{
+ if (!CGSizeFc.cached) cacheCGSizeFields(env, lpObject);
+ lpStruct->width = (*env)->GetFloatField(env, lpObject, CGSizeFc.width);
+ lpStruct->height = (*env)->GetFloatField(env, lpObject, CGSizeFc.height);
+ return lpStruct;
+}
+
+void setCGSizeFields(JNIEnv *env, jobject lpObject, CGSize *lpStruct)
+{
+ if (!CGSizeFc.cached) cacheCGSizeFields(env, lpObject);
+ (*env)->SetFloatField(env, lpObject, CGSizeFc.width, (jfloat)lpStruct->width);
+ (*env)->SetFloatField(env, lpObject, CGSizeFc.height, (jfloat)lpStruct->height);
+}
+#endif
+
+#ifndef NO_NSAffineTransformStruct
+typedef struct NSAffineTransformStruct_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID m11, m12, m21, m22, tX, tY;
+} NSAffineTransformStruct_FID_CACHE;
+
+NSAffineTransformStruct_FID_CACHE NSAffineTransformStructFc;
+
+void cacheNSAffineTransformStructFields(JNIEnv *env, jobject lpObject)
+{
+ if (NSAffineTransformStructFc.cached) return;
+ NSAffineTransformStructFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ NSAffineTransformStructFc.m11 = (*env)->GetFieldID(env, NSAffineTransformStructFc.clazz, "m11", "F");
+ NSAffineTransformStructFc.m12 = (*env)->GetFieldID(env, NSAffineTransformStructFc.clazz, "m12", "F");
+ NSAffineTransformStructFc.m21 = (*env)->GetFieldID(env, NSAffineTransformStructFc.clazz, "m21", "F");
+ NSAffineTransformStructFc.m22 = (*env)->GetFieldID(env, NSAffineTransformStructFc.clazz, "m22", "F");
+ NSAffineTransformStructFc.tX = (*env)->GetFieldID(env, NSAffineTransformStructFc.clazz, "tX", "F");
+ NSAffineTransformStructFc.tY = (*env)->GetFieldID(env, NSAffineTransformStructFc.clazz, "tY", "F");
+ NSAffineTransformStructFc.cached = 1;
+}
+
+NSAffineTransformStruct *getNSAffineTransformStructFields(JNIEnv *env, jobject lpObject, NSAffineTransformStruct *lpStruct)
+{
+ if (!NSAffineTransformStructFc.cached) cacheNSAffineTransformStructFields(env, lpObject);
+ lpStruct->m11 = (*env)->GetFloatField(env, lpObject, NSAffineTransformStructFc.m11);
+ lpStruct->m12 = (*env)->GetFloatField(env, lpObject, NSAffineTransformStructFc.m12);
+ lpStruct->m21 = (*env)->GetFloatField(env, lpObject, NSAffineTransformStructFc.m21);
+ lpStruct->m22 = (*env)->GetFloatField(env, lpObject, NSAffineTransformStructFc.m22);
+ lpStruct->tX = (*env)->GetFloatField(env, lpObject, NSAffineTransformStructFc.tX);
+ lpStruct->tY = (*env)->GetFloatField(env, lpObject, NSAffineTransformStructFc.tY);
+ return lpStruct;
+}
+
+void setNSAffineTransformStructFields(JNIEnv *env, jobject lpObject, NSAffineTransformStruct *lpStruct)
+{
+ if (!NSAffineTransformStructFc.cached) cacheNSAffineTransformStructFields(env, lpObject);
+ (*env)->SetFloatField(env, lpObject, NSAffineTransformStructFc.m11, (jfloat)lpStruct->m11);
+ (*env)->SetFloatField(env, lpObject, NSAffineTransformStructFc.m12, (jfloat)lpStruct->m12);
+ (*env)->SetFloatField(env, lpObject, NSAffineTransformStructFc.m21, (jfloat)lpStruct->m21);
+ (*env)->SetFloatField(env, lpObject, NSAffineTransformStructFc.m22, (jfloat)lpStruct->m22);
+ (*env)->SetFloatField(env, lpObject, NSAffineTransformStructFc.tX, (jfloat)lpStruct->tX);
+ (*env)->SetFloatField(env, lpObject, NSAffineTransformStructFc.tY, (jfloat)lpStruct->tY);
+}
+#endif
+
+#ifndef NO_NSDecimal
+typedef struct NSDecimal_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID _exponent, _length, _isNegative, _isCompact, _reserved, _mantissa;
+} NSDecimal_FID_CACHE;
+
+NSDecimal_FID_CACHE NSDecimalFc;
+
+void cacheNSDecimalFields(JNIEnv *env, jobject lpObject)
+{
+ if (NSDecimalFc.cached) return;
+ NSDecimalFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ NSDecimalFc._exponent = (*env)->GetFieldID(env, NSDecimalFc.clazz, "_exponent", "I");
+ NSDecimalFc._length = (*env)->GetFieldID(env, NSDecimalFc.clazz, "_length", "I");
+ NSDecimalFc._isNegative = (*env)->GetFieldID(env, NSDecimalFc.clazz, "_isNegative", "I");
+ NSDecimalFc._isCompact = (*env)->GetFieldID(env, NSDecimalFc.clazz, "_isCompact", "I");
+ NSDecimalFc._reserved = (*env)->GetFieldID(env, NSDecimalFc.clazz, "_reserved", "I");
+ NSDecimalFc._mantissa = (*env)->GetFieldID(env, NSDecimalFc.clazz, "_mantissa", "[S");
+ NSDecimalFc.cached = 1;
+}
+
+NSDecimal *getNSDecimalFields(JNIEnv *env, jobject lpObject, NSDecimal *lpStruct)
+{
+ if (!NSDecimalFc.cached) cacheNSDecimalFields(env, lpObject);
+ lpStruct->_exponent = (*env)->GetIntField(env, lpObject, NSDecimalFc._exponent);
+ lpStruct->_length = (*env)->GetIntField(env, lpObject, NSDecimalFc._length);
+ lpStruct->_isNegative = (*env)->GetIntField(env, lpObject, NSDecimalFc._isNegative);
+ lpStruct->_isCompact = (*env)->GetIntField(env, lpObject, NSDecimalFc._isCompact);
+ lpStruct->_reserved = (*env)->GetIntField(env, lpObject, NSDecimalFc._reserved);
+ {
+ jshortArray lpObject1 = (jshortArray)(*env)->GetObjectField(env, lpObject, NSDecimalFc._mantissa);
+ (*env)->GetShortArrayRegion(env, lpObject1, 0, sizeof(lpStruct->_mantissa) / 2, (jshort *)lpStruct->_mantissa);
+ }
+ return lpStruct;
+}
+
+void setNSDecimalFields(JNIEnv *env, jobject lpObject, NSDecimal *lpStruct)
+{
+ if (!NSDecimalFc.cached) cacheNSDecimalFields(env, lpObject);
+ (*env)->SetIntField(env, lpObject, NSDecimalFc._exponent, (jint)lpStruct->_exponent);
+ (*env)->SetIntField(env, lpObject, NSDecimalFc._length, (jint)lpStruct->_length);
+ (*env)->SetIntField(env, lpObject, NSDecimalFc._isNegative, (jint)lpStruct->_isNegative);
+ (*env)->SetIntField(env, lpObject, NSDecimalFc._isCompact, (jint)lpStruct->_isCompact);
+ (*env)->SetIntField(env, lpObject, NSDecimalFc._reserved, (jint)lpStruct->_reserved);
+ {
+ jshortArray lpObject1 = (jshortArray)(*env)->GetObjectField(env, lpObject, NSDecimalFc._mantissa);
+ (*env)->SetShortArrayRegion(env, lpObject1, 0, sizeof(lpStruct->_mantissa) / 2, (jshort *)lpStruct->_mantissa);
+ }
+}
+#endif
+
+#ifndef NO_NSPoint
+typedef struct NSPoint_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID x, y;
+} NSPoint_FID_CACHE;
+
+NSPoint_FID_CACHE NSPointFc;
+
+void cacheNSPointFields(JNIEnv *env, jobject lpObject)
+{
+ if (NSPointFc.cached) return;
+ NSPointFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ NSPointFc.x = (*env)->GetFieldID(env, NSPointFc.clazz, "x", "F");
+ NSPointFc.y = (*env)->GetFieldID(env, NSPointFc.clazz, "y", "F");
+ NSPointFc.cached = 1;
+}
+
+NSPoint *getNSPointFields(JNIEnv *env, jobject lpObject, NSPoint *lpStruct)
+{
+ if (!NSPointFc.cached) cacheNSPointFields(env, lpObject);
+ lpStruct->x = (*env)->GetFloatField(env, lpObject, NSPointFc.x);
+ lpStruct->y = (*env)->GetFloatField(env, lpObject, NSPointFc.y);
+ return lpStruct;
+}
+
+void setNSPointFields(JNIEnv *env, jobject lpObject, NSPoint *lpStruct)
+{
+ if (!NSPointFc.cached) cacheNSPointFields(env, lpObject);
+ (*env)->SetFloatField(env, lpObject, NSPointFc.x, (jfloat)lpStruct->x);
+ (*env)->SetFloatField(env, lpObject, NSPointFc.y, (jfloat)lpStruct->y);
+}
+#endif
+
+#ifndef NO_NSRange
+typedef struct NSRange_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID location, length;
+} NSRange_FID_CACHE;
+
+NSRange_FID_CACHE NSRangeFc;
+
+void cacheNSRangeFields(JNIEnv *env, jobject lpObject)
+{
+ if (NSRangeFc.cached) return;
+ NSRangeFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ NSRangeFc.location = (*env)->GetFieldID(env, NSRangeFc.clazz, "location", "I");
+ NSRangeFc.length = (*env)->GetFieldID(env, NSRangeFc.clazz, "length", "I");
+ NSRangeFc.cached = 1;
+}
+
+NSRange *getNSRangeFields(JNIEnv *env, jobject lpObject, NSRange *lpStruct)
+{
+ if (!NSRangeFc.cached) cacheNSRangeFields(env, lpObject);
+ lpStruct->location = (*env)->GetIntField(env, lpObject, NSRangeFc.location);
+ lpStruct->length = (*env)->GetIntField(env, lpObject, NSRangeFc.length);
+ return lpStruct;
+}
+
+void setNSRangeFields(JNIEnv *env, jobject lpObject, NSRange *lpStruct)
+{
+ if (!NSRangeFc.cached) cacheNSRangeFields(env, lpObject);
+ (*env)->SetIntField(env, lpObject, NSRangeFc.location, (jint)lpStruct->location);
+ (*env)->SetIntField(env, lpObject, NSRangeFc.length, (jint)lpStruct->length);
+}
+#endif
+
+#ifndef NO_NSRect
+typedef struct NSRect_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID x, y, width, height;
+} NSRect_FID_CACHE;
+
+NSRect_FID_CACHE NSRectFc;
+
+void cacheNSRectFields(JNIEnv *env, jobject lpObject)
+{
+ if (NSRectFc.cached) return;
+ NSRectFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ NSRectFc.x = (*env)->GetFieldID(env, NSRectFc.clazz, "x", "F");
+ NSRectFc.y = (*env)->GetFieldID(env, NSRectFc.clazz, "y", "F");
+ NSRectFc.width = (*env)->GetFieldID(env, NSRectFc.clazz, "width", "F");
+ NSRectFc.height = (*env)->GetFieldID(env, NSRectFc.clazz, "height", "F");
+ NSRectFc.cached = 1;
+}
+
+NSRect *getNSRectFields(JNIEnv *env, jobject lpObject, NSRect *lpStruct)
+{
+ if (!NSRectFc.cached) cacheNSRectFields(env, lpObject);
+ lpStruct->origin.x = (*env)->GetFloatField(env, lpObject, NSRectFc.x);
+ lpStruct->origin.y = (*env)->GetFloatField(env, lpObject, NSRectFc.y);
+ lpStruct->size.width = (*env)->GetFloatField(env, lpObject, NSRectFc.width);
+ lpStruct->size.height = (*env)->GetFloatField(env, lpObject, NSRectFc.height);
+ return lpStruct;
+}
+
+void setNSRectFields(JNIEnv *env, jobject lpObject, NSRect *lpStruct)
+{
+ if (!NSRectFc.cached) cacheNSRectFields(env, lpObject);
+ (*env)->SetFloatField(env, lpObject, NSRectFc.x, (jfloat)lpStruct->origin.x);
+ (*env)->SetFloatField(env, lpObject, NSRectFc.y, (jfloat)lpStruct->origin.y);
+ (*env)->SetFloatField(env, lpObject, NSRectFc.width, (jfloat)lpStruct->size.width);
+ (*env)->SetFloatField(env, lpObject, NSRectFc.height, (jfloat)lpStruct->size.height);
+}
+#endif
+
+#ifndef NO_NSSize
+typedef struct NSSize_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID width, height;
+} NSSize_FID_CACHE;
+
+NSSize_FID_CACHE NSSizeFc;
+
+void cacheNSSizeFields(JNIEnv *env, jobject lpObject)
+{
+ if (NSSizeFc.cached) return;
+ NSSizeFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ NSSizeFc.width = (*env)->GetFieldID(env, NSSizeFc.clazz, "width", "F");
+ NSSizeFc.height = (*env)->GetFieldID(env, NSSizeFc.clazz, "height", "F");
+ NSSizeFc.cached = 1;
+}
+
+NSSize *getNSSizeFields(JNIEnv *env, jobject lpObject, NSSize *lpStruct)
+{
+ if (!NSSizeFc.cached) cacheNSSizeFields(env, lpObject);
+ lpStruct->width = (*env)->GetFloatField(env, lpObject, NSSizeFc.width);
+ lpStruct->height = (*env)->GetFloatField(env, lpObject, NSSizeFc.height);
+ return lpStruct;
+}
+
+void setNSSizeFields(JNIEnv *env, jobject lpObject, NSSize *lpStruct)
+{
+ if (!NSSizeFc.cached) cacheNSSizeFields(env, lpObject);
+ (*env)->SetFloatField(env, lpObject, NSSizeFc.width, (jfloat)lpStruct->width);
+ (*env)->SetFloatField(env, lpObject, NSSizeFc.height, (jfloat)lpStruct->height);
+}
+#endif
+
+#ifndef NO_NSSwappedDouble
+typedef struct NSSwappedDouble_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID v;
+} NSSwappedDouble_FID_CACHE;
+
+NSSwappedDouble_FID_CACHE NSSwappedDoubleFc;
+
+void cacheNSSwappedDoubleFields(JNIEnv *env, jobject lpObject)
+{
+ if (NSSwappedDoubleFc.cached) return;
+ NSSwappedDoubleFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ NSSwappedDoubleFc.v = (*env)->GetFieldID(env, NSSwappedDoubleFc.clazz, "v", "J");
+ NSSwappedDoubleFc.cached = 1;
+}
+
+NSSwappedDouble *getNSSwappedDoubleFields(JNIEnv *env, jobject lpObject, NSSwappedDouble *lpStruct)
+{
+ if (!NSSwappedDoubleFc.cached) cacheNSSwappedDoubleFields(env, lpObject);
+ lpStruct->v = (*env)->GetLongField(env, lpObject, NSSwappedDoubleFc.v);
+ return lpStruct;
+}
+
+void setNSSwappedDoubleFields(JNIEnv *env, jobject lpObject, NSSwappedDouble *lpStruct)
+{
+ if (!NSSwappedDoubleFc.cached) cacheNSSwappedDoubleFields(env, lpObject);
+ (*env)->SetLongField(env, lpObject, NSSwappedDoubleFc.v, (jlong)lpStruct->v);
+}
+#endif
+
+#ifndef NO_NSSwappedFloat
+typedef struct NSSwappedFloat_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID v;
+} NSSwappedFloat_FID_CACHE;
+
+NSSwappedFloat_FID_CACHE NSSwappedFloatFc;
+
+void cacheNSSwappedFloatFields(JNIEnv *env, jobject lpObject)
+{
+ if (NSSwappedFloatFc.cached) return;
+ NSSwappedFloatFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ NSSwappedFloatFc.v = (*env)->GetFieldID(env, NSSwappedFloatFc.clazz, "v", "I");
+ NSSwappedFloatFc.cached = 1;
+}
+
+NSSwappedFloat *getNSSwappedFloatFields(JNIEnv *env, jobject lpObject, NSSwappedFloat *lpStruct)
+{
+ if (!NSSwappedFloatFc.cached) cacheNSSwappedFloatFields(env, lpObject);
+ lpStruct->v = (*env)->GetIntField(env, lpObject, NSSwappedFloatFc.v);
+ return lpStruct;
+}
+
+void setNSSwappedFloatFields(JNIEnv *env, jobject lpObject, NSSwappedFloat *lpStruct)
+{
+ if (!NSSwappedFloatFc.cached) cacheNSSwappedFloatFields(env, lpObject);
+ (*env)->SetIntField(env, lpObject, NSSwappedFloatFc.v, (jint)lpStruct->v);
+}
+#endif
+
+#ifndef NO_objc_super
+typedef struct objc_super_FID_CACHE {
+ int cached;
+ jclass clazz;
+ jfieldID receiver, cls;
+} objc_super_FID_CACHE;
+
+objc_super_FID_CACHE objc_superFc;
+
+void cacheobjc_superFields(JNIEnv *env, jobject lpObject)
+{
+ if (objc_superFc.cached) return;
+ objc_superFc.clazz = (*env)->GetObjectClass(env, lpObject);
+ objc_superFc.receiver = (*env)->GetFieldID(env, objc_superFc.clazz, "receiver", "I");
+ objc_superFc.cls = (*env)->GetFieldID(env, objc_superFc.clazz, "cls", "I");
+ objc_superFc.cached = 1;
+}
+
+struct objc_super *getobjc_superFields(JNIEnv *env, jobject lpObject, struct objc_super *lpStruct)
+{
+ if (!objc_superFc.cached) cacheobjc_superFields(env, lpObject);
+ lpStruct->receiver = (id)(*env)->GetIntField(env, lpObject, objc_superFc.receiver);
+ lpStruct->class = (Class)(*env)->GetIntField(env, lpObject, objc_superFc.cls);
+ return lpStruct;
+}
+
+void setobjc_superFields(JNIEnv *env, jobject lpObject, struct objc_super *lpStruct)
+{
+ if (!objc_superFc.cached) cacheobjc_superFields(env, lpObject);
+ (*env)->SetIntField(env, lpObject, objc_superFc.receiver, (jint)lpStruct->receiver);
+ (*env)->SetIntField(env, lpObject, objc_superFc.cls, (jint)lpStruct->class);
+}
+#endif
+
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_structs.h b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_structs.h
new file mode 100644
index 0000000000..4d06f4da08
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_structs.h
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+#include "os.h"
+
+#ifndef NO_CGPoint
+void cacheCGPointFields(JNIEnv *env, jobject lpObject);
+CGPoint *getCGPointFields(JNIEnv *env, jobject lpObject, CGPoint *lpStruct);
+void setCGPointFields(JNIEnv *env, jobject lpObject, CGPoint *lpStruct);
+#define CGPoint_sizeof() sizeof(CGPoint)
+#else
+#define cacheCGPointFields(a,b)
+#define getCGPointFields(a,b,c) NULL
+#define setCGPointFields(a,b,c)
+#define CGPoint_sizeof() 0
+#endif
+
+#ifndef NO_CGRect
+void cacheCGRectFields(JNIEnv *env, jobject lpObject);
+CGRect *getCGRectFields(JNIEnv *env, jobject lpObject, CGRect *lpStruct);
+void setCGRectFields(JNIEnv *env, jobject lpObject, CGRect *lpStruct);
+#define CGRect_sizeof() sizeof(CGRect)
+#else
+#define cacheCGRectFields(a,b)
+#define getCGRectFields(a,b,c) NULL
+#define setCGRectFields(a,b,c)
+#define CGRect_sizeof() 0
+#endif
+
+#ifndef NO_CGSize
+void cacheCGSizeFields(JNIEnv *env, jobject lpObject);
+CGSize *getCGSizeFields(JNIEnv *env, jobject lpObject, CGSize *lpStruct);
+void setCGSizeFields(JNIEnv *env, jobject lpObject, CGSize *lpStruct);
+#define CGSize_sizeof() sizeof(CGSize)
+#else
+#define cacheCGSizeFields(a,b)
+#define getCGSizeFields(a,b,c) NULL
+#define setCGSizeFields(a,b,c)
+#define CGSize_sizeof() 0
+#endif
+
+#ifndef NO_NSAffineTransformStruct
+void cacheNSAffineTransformStructFields(JNIEnv *env, jobject lpObject);
+NSAffineTransformStruct *getNSAffineTransformStructFields(JNIEnv *env, jobject lpObject, NSAffineTransformStruct *lpStruct);
+void setNSAffineTransformStructFields(JNIEnv *env, jobject lpObject, NSAffineTransformStruct *lpStruct);
+#define NSAffineTransformStruct_sizeof() sizeof(NSAffineTransformStruct)
+#else
+#define cacheNSAffineTransformStructFields(a,b)
+#define getNSAffineTransformStructFields(a,b,c) NULL
+#define setNSAffineTransformStructFields(a,b,c)
+#define NSAffineTransformStruct_sizeof() 0
+#endif
+
+#ifndef NO_NSDecimal
+void cacheNSDecimalFields(JNIEnv *env, jobject lpObject);
+NSDecimal *getNSDecimalFields(JNIEnv *env, jobject lpObject, NSDecimal *lpStruct);
+void setNSDecimalFields(JNIEnv *env, jobject lpObject, NSDecimal *lpStruct);
+#define NSDecimal_sizeof() sizeof(NSDecimal)
+#else
+#define cacheNSDecimalFields(a,b)
+#define getNSDecimalFields(a,b,c) NULL
+#define setNSDecimalFields(a,b,c)
+#define NSDecimal_sizeof() 0
+#endif
+
+#ifndef NO_NSPoint
+void cacheNSPointFields(JNIEnv *env, jobject lpObject);
+NSPoint *getNSPointFields(JNIEnv *env, jobject lpObject, NSPoint *lpStruct);
+void setNSPointFields(JNIEnv *env, jobject lpObject, NSPoint *lpStruct);
+#define NSPoint_sizeof() sizeof(NSPoint)
+#else
+#define cacheNSPointFields(a,b)
+#define getNSPointFields(a,b,c) NULL
+#define setNSPointFields(a,b,c)
+#define NSPoint_sizeof() 0
+#endif
+
+#ifndef NO_NSRange
+void cacheNSRangeFields(JNIEnv *env, jobject lpObject);
+NSRange *getNSRangeFields(JNIEnv *env, jobject lpObject, NSRange *lpStruct);
+void setNSRangeFields(JNIEnv *env, jobject lpObject, NSRange *lpStruct);
+#define NSRange_sizeof() sizeof(NSRange)
+#else
+#define cacheNSRangeFields(a,b)
+#define getNSRangeFields(a,b,c) NULL
+#define setNSRangeFields(a,b,c)
+#define NSRange_sizeof() 0
+#endif
+
+#ifndef NO_NSRect
+void cacheNSRectFields(JNIEnv *env, jobject lpObject);
+NSRect *getNSRectFields(JNIEnv *env, jobject lpObject, NSRect *lpStruct);
+void setNSRectFields(JNIEnv *env, jobject lpObject, NSRect *lpStruct);
+#define NSRect_sizeof() sizeof(NSRect)
+#else
+#define cacheNSRectFields(a,b)
+#define getNSRectFields(a,b,c) NULL
+#define setNSRectFields(a,b,c)
+#define NSRect_sizeof() 0
+#endif
+
+#ifndef NO_NSSize
+void cacheNSSizeFields(JNIEnv *env, jobject lpObject);
+NSSize *getNSSizeFields(JNIEnv *env, jobject lpObject, NSSize *lpStruct);
+void setNSSizeFields(JNIEnv *env, jobject lpObject, NSSize *lpStruct);
+#define NSSize_sizeof() sizeof(NSSize)
+#else
+#define cacheNSSizeFields(a,b)
+#define getNSSizeFields(a,b,c) NULL
+#define setNSSizeFields(a,b,c)
+#define NSSize_sizeof() 0
+#endif
+
+#ifndef NO_NSSwappedDouble
+void cacheNSSwappedDoubleFields(JNIEnv *env, jobject lpObject);
+NSSwappedDouble *getNSSwappedDoubleFields(JNIEnv *env, jobject lpObject, NSSwappedDouble *lpStruct);
+void setNSSwappedDoubleFields(JNIEnv *env, jobject lpObject, NSSwappedDouble *lpStruct);
+#define NSSwappedDouble_sizeof() sizeof(NSSwappedDouble)
+#else
+#define cacheNSSwappedDoubleFields(a,b)
+#define getNSSwappedDoubleFields(a,b,c) NULL
+#define setNSSwappedDoubleFields(a,b,c)
+#define NSSwappedDouble_sizeof() 0
+#endif
+
+#ifndef NO_NSSwappedFloat
+void cacheNSSwappedFloatFields(JNIEnv *env, jobject lpObject);
+NSSwappedFloat *getNSSwappedFloatFields(JNIEnv *env, jobject lpObject, NSSwappedFloat *lpStruct);
+void setNSSwappedFloatFields(JNIEnv *env, jobject lpObject, NSSwappedFloat *lpStruct);
+#define NSSwappedFloat_sizeof() sizeof(NSSwappedFloat)
+#else
+#define cacheNSSwappedFloatFields(a,b)
+#define getNSSwappedFloatFields(a,b,c) NULL
+#define setNSSwappedFloatFields(a,b,c)
+#define NSSwappedFloat_sizeof() 0
+#endif
+
+#ifndef NO_objc_super
+void cacheobjc_superFields(JNIEnv *env, jobject lpObject);
+struct objc_super *getobjc_superFields(JNIEnv *env, jobject lpObject, struct objc_super *lpStruct);
+void setobjc_superFields(JNIEnv *env, jobject lpObject, struct objc_super *lpStruct);
+#define objc_super_sizeof() sizeof(objc_super)
+#else
+#define cacheobjc_superFields(a,b)
+#define getobjc_superFields(a,b,c) NULL
+#define setobjc_superFields(a,b,c)
+#define objc_super_sizeof() 0
+#endif
+
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/Platform.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/Platform.java
new file mode 100755
index 0000000000..dddce482bc
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/Platform.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal;
+
+public class Platform {
+
+public static final String PLATFORM = "cocoa"; //$NON-NLS-1$
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CGPoint.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CGPoint.java
new file mode 100644
index 0000000000..6c63fc4a81
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CGPoint.java
@@ -0,0 +1,6 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class CGPoint {
+public float x;
+public float y;
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CGRect.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CGRect.java
new file mode 100644
index 0000000000..e985ebc074
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CGRect.java
@@ -0,0 +1,6 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class CGRect {
+public CGPoint origin = new CGPoint();
+public CGSize size = new CGSize();
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CGSize.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CGSize.java
new file mode 100644
index 0000000000..1781675901
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CGSize.java
@@ -0,0 +1,6 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class CGSize {
+public float width;
+public float height;
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CIColor.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CIColor.java
new file mode 100644
index 0000000000..88b3dc412e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CIColor.java
@@ -0,0 +1,18 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class CIColor extends NSObject {
+
+public CIColor() {
+ super();
+}
+
+public CIColor(int id) {
+ super(id);
+}
+
+public CIColor initWithColor(NSColor color) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithColor_1, color != null ? color.id : 0);
+ return result != 0 ? this : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CIImage.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CIImage.java
new file mode 100644
index 0000000000..b9e8affc17
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/CIImage.java
@@ -0,0 +1,26 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class CIImage extends NSObject {
+
+public CIImage() {
+ super();
+}
+
+public CIImage(int id) {
+ super(id);
+}
+
+public void drawAtPoint(NSPoint point, NSRect fromRect, int op, float delta) {
+ OS.objc_msgSend(this.id, OS.sel_drawAtPoint_1fromRect_1operation_1fraction_1, point, fromRect, op, delta);
+}
+
+public void drawInRect(NSRect rect, NSRect fromRect, int op, float delta) {
+ OS.objc_msgSend(this.id, OS.sel_drawInRect_1fromRect_1operation_1fraction_1, rect, fromRect, op, delta);
+}
+
+public CIImage initWithBitmapImageRep(NSBitmapImageRep bitmapImageRep) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithBitmapImageRep_1, bitmapImageRep != null ? bitmapImageRep.id : 0);
+ return result != 0 ? this : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/MacGenerator.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/MacGenerator.java
new file mode 100644
index 0000000000..9c3c48b118
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/MacGenerator.java
@@ -0,0 +1,770 @@
+package org.eclipse.swt.internal.cocoa;
+
+
+import java.io.BufferedOutputStream;
+import java.io.FileOutputStream;
+import java.io.PrintStream;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+
+import com.sun.org.apache.xerces.internal.parsers.DOMParser;
+import org.w3c.dom.*;
+
+public class MacGenerator {
+ String[] classes;
+ String xml[];
+ String outputDir;
+
+ PrintStream out;
+
+public MacGenerator(String[] xml) throws Exception {
+ this.xml = xml;
+}
+
+public void out(String str) {
+ PrintStream out = this.out;
+ if (out == null) out = System.out;
+ out.print(str);
+}
+
+public void outln() {
+ PrintStream out = this.out;
+ if (out == null) out = System.out;
+ out.println();
+}
+
+public void generateConstants() throws Exception {
+ for (int j = 0; j < xml.length; j++) {
+ DOMParser parser = new DOMParser();
+ parser.parse(xml[j]);
+ Document document = parser.getDocument();
+ NodeList list = document.getDocumentElement().getChildNodes();
+ for (int i = 0; i < list.getLength(); i++) {
+ Node node = list.item(i);
+ if ("constant".equals(node.getLocalName())) {
+ NamedNodeMap attributes = node.getAttributes();
+ out("public static final native int ");
+ out(attributes.getNamedItem("name").getNodeValue());
+ out("();");
+ outln();
+ }
+ }
+ }
+}
+
+public void generateConstantsMetaData() throws Exception {
+ for (int j = 0; j < xml.length; j++) {
+ DOMParser parser = new DOMParser();
+ parser.parse(xml[j]);
+ Document document = parser.getDocument();
+ NodeList list = document.getDocumentElement().getChildNodes();
+ for (int i = 0; i < list.getLength(); i++) {
+ Node node = list.item(i);
+ if ("constant".equals(node.getLocalName())) {
+ NamedNodeMap attributes = node.getAttributes();
+ out("OS_");
+ out(attributes.getNamedItem("name").getNodeValue());
+ out("=flags=const");
+ outln();
+ }
+ }
+ }
+}
+
+public void generateEnums() throws Exception {
+ for (int j = 0; j < xml.length; j++) {
+ DOMParser parser = new DOMParser();
+ parser.parse(xml[j]);
+ Document document = parser.getDocument();
+ NodeList list = document.getDocumentElement().getChildNodes();
+ for (int i = 0; i < list.getLength(); i++) {
+ Node node = list.item(i);
+ if ("enum".equals(node.getLocalName())) {
+ NamedNodeMap attributes = node.getAttributes();
+ Node value = attributes.getNamedItem("value");
+ if (value != null) {
+ out("public static final ");
+ if (value.getNodeValue().indexOf('.') != -1) {
+ out("double ");
+ } else {
+ out("int ");
+ }
+ out(attributes.getNamedItem("name").getNodeValue());
+ out(" = ");
+ out(value.getNodeValue());
+ out(";");
+ outln();
+ }
+ }
+ }
+ }
+}
+
+boolean isStruct(Node node) {
+ NamedNodeMap attributes = node.getAttributes();
+ String code = attributes.getNamedItem("type").getNodeValue();
+ return code.startsWith("{");
+}
+
+boolean isFloatingPoint(Node node) {
+ NamedNodeMap attributes = node.getAttributes();
+ String code = attributes.getNamedItem("type").getNodeValue();
+ return code.equals("f") || code.equals("d");
+}
+
+boolean isObject(Node node) {
+ NamedNodeMap attributes = node.getAttributes();
+ String code = attributes.getNamedItem("type").getNodeValue();
+ return code.equals("@");
+}
+
+boolean isBoolean(Node node) {
+ NamedNodeMap attributes = node.getAttributes();
+ String code = attributes.getNamedItem("type").getNodeValue();
+ return code.equals("B");
+}
+
+boolean getGenerateClass(String className) {
+ if (classes != null) {
+ for (int i = 0; i < classes.length; i++) {
+ if (className.equals(classes[i])) return true;
+ }
+ return false;
+ }
+ return true;
+}
+
+public boolean isUnique(Node method, NodeList methods) {
+ String methodName = method.getAttributes().getNamedItem("selector").getNodeValue();
+ int index = methodName.indexOf(":");
+ if (index != -1) methodName = methodName.substring(0, index);
+ for (int j = 0; j < methods.getLength(); j++) {
+ Node other = methods.item(j);
+ NamedNodeMap attributes = other.getAttributes();
+ Node otherSel = null;
+ if (attributes != null) otherSel = attributes.getNamedItem("selector");
+ if (other != method && otherSel != null) {
+ String otherName = otherSel.getNodeValue();
+ index = otherName.indexOf(":");
+ if (index != -1) otherName = otherName.substring(0, index);
+ if (methodName.equals(otherName)) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+public void generateClasses() throws Exception {
+ for (int x = 0; x < xml.length; x++) {
+ DOMParser parser = new DOMParser();
+ parser.parse(xml[x]);
+ Document document = parser.getDocument();
+ NodeList list = document.getDocumentElement().getChildNodes();
+ for (int i = 0; i < list.getLength(); i++) {
+ Node node = list.item(i);
+ if ("class".equals(node.getLocalName())) {
+ NamedNodeMap attributes = node.getAttributes();
+ String name = attributes.getNamedItem("name").getNodeValue();
+ if (getGenerateClass(name)) {
+ if (outputDir != null) {
+ FileOutputStream is = new FileOutputStream(outputDir + "/" + name + ".java");
+ out = new PrintStream(new BufferedOutputStream(is));
+ }
+ out("package org.eclipse.swt.internal.cocoa;");
+ outln();
+ outln();
+ out("public class ");
+ out(name);
+ if (name.equals("NSObject")) {
+ out(" extends id {");
+ } else {
+ out(" extends NSObject {");
+ }
+ outln();
+ outln();
+ out("public ");
+ out(name);
+ out("() {");
+ outln();
+ out("\tsuper();");
+ outln();
+ out("}");
+ outln();
+ outln();
+ out("public ");
+ out(name);
+ out("(int id) {");
+ outln();
+ out("\tsuper(id);");
+ outln();
+ out("}");
+ outln();
+ outln();
+ NodeList methods = node.getChildNodes();
+ for (int j = 0; j < methods.getLength(); j++) {
+ Node method = methods.item(j);
+ if ("method".equals(method.getLocalName())) {
+ String sel = method.getAttributes().getNamedItem("selector").getNodeValue();
+ out("public ");
+ boolean isStatic = method.getAttributes().getNamedItem("class_method") != null;
+ if (isStatic) out("static ");
+ Node returnNode = getReturnNode(method.getChildNodes());
+ if (getType(returnNode).equals("void")) returnNode = null;
+ if (returnNode != null) {
+ out(getJavaType(returnNode));
+ out(" ");
+ } else {
+ out("void ");
+ }
+ String methodName = sel;
+ if (isUnique(method, methods)) {
+ int index = methodName.indexOf(":");
+ if (index != -1) methodName = methodName.substring(0, index);
+ } else {
+ methodName = methodName.replaceAll(":", "_");
+ if (isStatic) methodName = "static_" + methodName;
+ }
+ out(methodName);
+ out("(");
+ NodeList params = method.getChildNodes();
+ boolean first = true;
+ for (int k = 0; k < params.getLength(); k++) {
+ Node param = params.item(k);
+ if ("arg".equals(param.getLocalName())) {
+ NamedNodeMap paramAttributes = param.getAttributes();
+ if (!first) out(", ");
+ out(getJavaType(param));
+ first = false;
+ out(" ");
+ String paramName = paramAttributes.getNamedItem("name").getNodeValue();
+ if (paramName.equals("boolean")) paramName = "b";
+ out(paramName);
+ }
+ }
+ out(") {");
+ outln();
+ if (returnNode != null && isStruct(returnNode)) {
+ String type = getJavaType(returnNode);
+ out("\t");
+ out(type);
+ out(" result = new ");
+ out(type);
+ out("();");
+ outln();
+ out("\tOS.objc_msgSend_stret(result, ");
+ } else if (returnNode != null && isFloatingPoint(returnNode)) {
+ String type = getJavaType(returnNode);
+ out("\treturn ");
+ if (type.equals("float")) out("(float)");
+ out("OS.objc_msgSend_fpret(");
+ } else if (returnNode != null && isObject(returnNode)) {
+ out("\tint result = OS.objc_msgSend(");
+ } else {
+ if (returnNode != null) {
+ out("\treturn ");
+ String type = getJavaType(returnNode);
+ if (!(type.equals("int") || type.equals("boolean"))) {
+ out("(");
+ out(type);
+ out(")");
+ }
+ } else {
+ out("\t");
+ }
+ out("OS.objc_msgSend(");
+ }
+ if (isStatic) {
+ out("OS.class_");
+ out(name);
+ } else {
+ out("this.id");
+ }
+ out(", OS.");
+ out(getSelConst(sel));
+ first = false;
+ for (int k = 0; k < params.getLength(); k++) {
+ Node param = params.item(k);
+ if ("arg".equals(param.getLocalName())) {
+ NamedNodeMap paramAttributes = param.getAttributes();
+ if (!first) out(", ");
+ first = false;
+ String paramName = paramAttributes.getNamedItem("name").getNodeValue();
+ if (paramName.equals("boolean")) paramName = "b";
+ if (isObject(param)) {
+ out(paramName);
+ out(" != null ? ");
+ out(paramName);
+ out(".id : 0");
+ } else {
+ out(paramName);
+ }
+ }
+ }
+ out(")");
+ if (returnNode != null && isBoolean(returnNode)) {
+ out(" != 0");
+ }
+ out(";");
+ outln();
+ if (returnNode != null && isObject(returnNode)) {
+ if (!isStatic && getJavaType(returnNode).equals(name)) {
+ out("\treturn result == this.id ? this : (result != 0 ? new ");
+ out(getJavaType(returnNode));
+ out("(result) : null);");
+ } else {
+ out("\treturn result != 0 ? new ");
+ out(getJavaType(returnNode));
+ out("(result) : null;");
+ }
+ outln();
+ } else if (returnNode != null && isStruct(returnNode)) {
+ out("\treturn result;");
+ outln();
+ }
+ out("}");
+ outln();
+ outln();
+ }
+ }
+ out("}");
+ outln();
+ if (outputDir != null) {
+ out.close();
+ out = null;
+ }
+ }
+ }
+ }
+ }
+}
+
+public void generateSelectorsConst() throws Exception {
+ HashSet set = new HashSet();
+ for (int x = 0; x < xml.length; x++) {
+ DOMParser parser = new DOMParser();
+ parser.parse(xml[x]);
+ Document document = parser.getDocument();
+ NodeList list = document.getDocumentElement().getChildNodes();
+ for (int i = 0; i < list.getLength(); i++) {
+ Node node = list.item(i);
+ if ("class".equals(node.getLocalName())) {
+ NamedNodeMap attributes = node.getAttributes();
+ String name = attributes.getNamedItem("name").getNodeValue();
+ if (getGenerateClass(name)) {
+ NodeList methods = node.getChildNodes();
+ for (int j = 0; j < methods.getLength(); j++) {
+ Node method = methods.item(j);
+ if ("method".equals(method.getLocalName())) {
+ String sel = method.getAttributes().getNamedItem("selector").getNodeValue();
+ set.add(sel);
+ }
+ }
+ }
+ }
+ }
+ }
+ for (Iterator iterator = set.iterator(); iterator.hasNext();) {
+ String sel = (String) iterator.next();
+ String selConst = getSelConst(sel);
+ out("public static final int ");
+ out(selConst);
+ out(" = ");
+ out("sel_registerName(\"");
+ out(sel);
+ out("\");");
+ outln();
+ }
+}
+
+public void generateSends() throws Exception {
+ HashSet set = new HashSet();
+ for (int x = 0; x < xml.length; x++) {
+ DOMParser parser = new DOMParser();
+ parser.parse(xml[x]);
+ Document document = parser.getDocument();
+ NodeList list = document.getDocumentElement().getChildNodes();
+ for (int i = 0; i < list.getLength(); i++) {
+ Node node = list.item(i);
+ if ("class".equals(node.getLocalName())) {
+ NamedNodeMap attributes = node.getAttributes();
+ String name = attributes.getNamedItem("name").getNodeValue();
+ if (getGenerateClass(name)) {
+ NodeList methods = node.getChildNodes();
+ for (int j = 0; j < methods.getLength(); j++) {
+ Node method = methods.item(j);
+ if ("method".equals(method.getLocalName())) {
+ Node returnNode = getReturnNode(method.getChildNodes());
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("public static final native ");
+ if (returnNode != null && isStruct(returnNode)) {
+ buffer.append("void objc_msgSend_stret(");
+ buffer.append(getJavaType(returnNode));
+ buffer.append(" result, ");
+ } else if (returnNode != null && isFloatingPoint(returnNode)) {
+ buffer.append("double objc_msgSend_fpret(");
+ } else {
+ buffer.append("int objc_msgSend(");
+ }
+ buffer.append("int id, int sel");
+ NodeList params = method.getChildNodes();
+ boolean first = false;
+ int count = 0;
+ for (int k = 0; k < params.getLength(); k++) {
+ Node param = params.item(k);
+ if ("arg".equals(param.getLocalName())) {
+ if (!first) buffer.append(", ");
+ if (isStruct(param)) {
+ buffer.append(getJavaType(param));
+ } else {
+ buffer.append(getType(param));
+ }
+ first = false;
+ buffer.append(" arg");
+ buffer.append(String.valueOf(count++));
+ }
+ }
+ buffer.append(");");
+ set.add(buffer.toString());
+ }
+ }
+ }
+ }
+ }
+ }
+ for (Iterator iterator = set.iterator(); iterator.hasNext();) {
+ out(iterator.next().toString());
+ outln();
+ }
+}
+
+public void generateSendsMetaData() throws Exception {
+ HashMap set = new HashMap();
+ for (int x = 0; x < xml.length; x++) {
+ DOMParser parser = new DOMParser();
+ parser.parse(xml[x]);
+ Document document = parser.getDocument();
+ NodeList list = document.getDocumentElement().getChildNodes();
+ for (int i = 0; i < list.getLength(); i++) {
+ Node node = list.item(i);
+ if ("class".equals(node.getLocalName())) {
+ NamedNodeMap attributes = node.getAttributes();
+ String name = attributes.getNamedItem("name").getNodeValue();
+ if (getGenerateClass(name)) {
+ NodeList methods = node.getChildNodes();
+ for (int j = 0; j < methods.getLength(); j++) {
+ Node method = methods.item(j);
+ if ("method".equals(method.getLocalName())) {
+ Node returnNode = getReturnNode(method.getChildNodes());
+ StringBuffer buffer = new StringBuffer();
+ if (returnNode != null && isStruct(returnNode)) {
+ buffer.append("OS_objc_1msgSend_1stret__");
+ buffer.append("Lorg_eclipse_swt_internal_cocoa_");
+ buffer.append(getJavaType(returnNode));
+ buffer.append("_2");
+ } else if (returnNode != null && isFloatingPoint(returnNode)) {
+ buffer.append("OS_objc_1msgSend_1fpret__");
+ } else {
+ buffer.append("OS_objc_1msgSend__");
+ }
+ buffer.append("II");
+ NodeList params = method.getChildNodes();
+ for (int k = 0; k < params.getLength(); k++) {
+ Node param = params.item(k);
+ if ("arg".equals(param.getLocalName())) {
+ if (isStruct(param)) {
+ buffer.append("Lorg_eclipse_swt_internal_cocoa_");
+ buffer.append(getJavaType(param));
+ buffer.append("_2");
+ } else {
+ buffer.append(getJNIType(param));
+ }
+ }
+ }
+ String key = buffer.toString();
+ if (set.get(key) == null) set.put(key, method);
+ }
+ }
+ }
+ }
+ }
+ }
+ for (Iterator iterator = set.keySet().iterator(); iterator.hasNext();) {
+ String key = iterator.next().toString();
+ out(key);
+ out("=flags=cast");
+ outln();
+ int count = 2;
+ if (key.indexOf("stret") != -1) {
+ count = 3;
+ out(key);
+ out("_0=");
+ outln();
+ out(key);
+ out("_1=cast=(id)");
+ outln();
+ out(key);
+ out("_2=cast=(SEL)");
+ outln();
+ } else {
+ out(key);
+ out("_0=cast=(id)");
+ outln();
+ out(key);
+ out("_1=cast=(SEL)");
+ outln();
+ }
+ Node method = (Node)set.get(key);
+ NodeList params = method.getChildNodes();
+ for (int k = 0; k < params.getLength(); k++) {
+ Node param = params.item(k);
+ if ("arg".equals(param.getLocalName())) {
+ out(key);
+ out("_");
+ out(String.valueOf(count));
+ out("=");
+ if (isStruct(param)) {
+ out("flags=struct");
+ }
+ outln();
+ count++;
+ }
+ }
+ outln();
+ }
+}
+
+
+String getSelConst(String sel) {
+ return "sel_" + sel.replaceAll(":", "_1");
+}
+
+public void generateClassesConst() throws Exception {
+ HashSet set = new HashSet();
+ for (int x = 0; x < xml.length; x++) {
+ DOMParser parser = new DOMParser();
+ parser.parse(xml[x]);
+ Document document = parser.getDocument();
+ NodeList list = document.getDocumentElement().getChildNodes();
+ for (int i = 0; i < list.getLength(); i++) {
+ Node node = list.item(i);
+ if ("class".equals(node.getLocalName())) {
+ NamedNodeMap attributes = node.getAttributes();
+ String name = attributes.getNamedItem("name").getNodeValue();
+ if (getGenerateClass(name)) {
+ set.add(name);
+ }
+ }
+ }
+ }
+ for (Iterator iterator = set.iterator(); iterator.hasNext();) {
+ String cls = (String) iterator.next();
+ String clsConst = "class_" + cls;
+ out("public static final int ");
+ out(clsConst);
+ out(" = ");
+ out("objc_getClass(\"");
+ out(cls);
+ out("\");");
+ outln();
+ }
+}
+
+Node getReturnNode(NodeList list) {
+ for (int j = 0; j < list.getLength(); j++) {
+ Node node = list.item(j);
+ if ("retval".equals(node.getLocalName())) {
+ return node;
+ }
+ }
+ return null;
+}
+
+String getType(Node node) {
+ NamedNodeMap attributes = node.getAttributes();
+ String code = attributes.getNamedItem("type").getNodeValue();
+ if (code.equals("c")) return "byte";
+ if (code.equals("i")) return "int";
+ if (code.equals("s")) return "short";
+ if (code.equals("l")) return "int";
+ if (code.equals("q")) return "long";
+ if (code.equals("C")) return "byte";
+ if (code.equals("I")) return "int";
+ if (code.equals("S")) return "short";
+ if (code.equals("L")) return "int";
+ if (code.equals("Q")) return "long";
+ if (code.equals("f")) return "float";
+ if (code.equals("d")) return "double";
+ if (code.equals("B")) return "boolean";
+ if (code.equals("v")) return "void";
+ if (code.equals("*")) return "int";
+ if (code.equals("@")) return "int";
+ if (code.equals("#")) return "int";
+ if (code.equals(":")) return "int";
+ if (code.startsWith("^")) return "int";
+ if (code.startsWith("[")) return "BAD " + code;
+ if (code.startsWith("{")) {
+ return attributes.getNamedItem("declared_type").getNodeValue();
+ }
+ if (code.startsWith("(")) return "BAD " + code;
+ return "BAD " + code;
+}
+String getJNIType(Node node) {
+ NamedNodeMap attributes = node.getAttributes();
+ String code = attributes.getNamedItem("type").getNodeValue();
+ if (code.equals("c")) return "B";
+ if (code.equals("i")) return "I";
+ if (code.equals("s")) return "S";
+ if (code.equals("l")) return "I";
+ if (code.equals("q")) return "J";
+ if (code.equals("C")) return "B";
+ if (code.equals("I")) return "I";
+ if (code.equals("S")) return "S";
+ if (code.equals("L")) return "I";
+ if (code.equals("Q")) return "J";
+ if (code.equals("f")) return "F";
+ if (code.equals("d")) return "D";
+ if (code.equals("B")) return "Z";
+ if (code.equals("v")) return "V";
+ if (code.equals("*")) return "I";
+ if (code.equals("@")) return "I";
+ if (code.equals("#")) return "I";
+ if (code.equals(":")) return "I";
+ if (code.startsWith("^")) return "I";
+ if (code.startsWith("[")) return "BAD " + code;
+ if (code.startsWith("{")) {
+ return "BAD " + code;
+ }
+ if (code.startsWith("(")) return "BAD " + code;
+ return "BAD " + code;
+}
+
+String getJavaType(Node node) {
+ NamedNodeMap attributes = node.getAttributes();
+ String code = attributes.getNamedItem("type").getNodeValue();
+ if (code.equals("c")) return "byte";
+ if (code.equals("i")) return "int";
+ if (code.equals("s")) return "short";
+ if (code.equals("l")) return "int";
+ if (code.equals("q")) return "long";
+ if (code.equals("C")) return "byte";
+ if (code.equals("I")) return "int";
+ if (code.equals("S")) return "short";
+ if (code.equals("L")) return "int";
+ if (code.equals("Q")) return "long";
+ if (code.equals("f")) return "float";
+ if (code.equals("d")) return "double";
+ if (code.equals("B")) return "boolean";
+ if (code.equals("v")) return "void";
+ if (code.equals("*")) return "int";
+ if (code.equals("@")) {
+ String type = attributes.getNamedItem("declared_type").getNodeValue();
+ int index = type.indexOf('*');
+ if (index != -1) type = type.substring(0, index);
+ index = type.indexOf('<');
+ if (index != -1) type = type.substring(0, index);
+ return type;
+ }
+ if (code.equals("#")) return "int";
+ if (code.equals(":")) return "int";
+ if (code.startsWith("^")) return "int";
+ if (code.startsWith("[")) return "BAD " + code;
+ if (code.startsWith("{")) {
+ return attributes.getNamedItem("declared_type").getNodeValue();
+ }
+ if (code.startsWith("(")) return "BAD " + code;
+ return "BAD " + code;
+}
+
+public void generateFunctions() throws Exception {
+ for (int x = 0; x < xml.length; x++) {
+ DOMParser parser = new DOMParser();
+ parser.parse(xml[x]);
+ Document document = parser.getDocument();
+ NodeList list = document.getDocumentElement().getChildNodes();
+ for (int i = 0; i < list.getLength(); i++) {
+ Node node = list.item(i);
+ if ("function".equals(node.getLocalName())) {
+ NamedNodeMap attributes = node.getAttributes();
+ String name = attributes.getNamedItem("name").getNodeValue();
+ out("public static final native ");
+ Node returnNode = getReturnNode(node.getChildNodes());
+ if (returnNode != null) {
+ out(getType(returnNode));
+ out(" ");
+ } else {
+ out("void ");
+ }
+ out(name);
+ out("(");
+ NodeList params = node.getChildNodes();
+ boolean first = true;
+ for (int j = 0; j < params.getLength(); j++) {
+ Node param = params.item(j);
+ if ("arg".equals(param.getLocalName())) {
+ NamedNodeMap paramAttributes = param.getAttributes();
+ if (!first) out(", ");
+ out(getType(param));
+ first = false;
+ out(" ");
+ out(paramAttributes.getNamedItem("name").getNodeValue());
+ }
+ }
+ out(");");
+ outln();
+ }
+ }
+ }
+}
+
+public void generateOS() throws Exception {
+ out("/** Classes */");
+ outln();
+ generateClassesConst();
+ outln();
+ out("/** Selectors */");
+ outln();
+ generateSelectorsConst();
+ outln();
+ out("/** Constants */");
+ outln();
+ generateEnums();
+ outln();
+ out("/** Globals */");
+ outln();
+ generateConstants();
+ outln();
+ out("/** Functions */");
+ outln();
+ generateFunctions();
+ outln();
+ out("/** Sends */");
+ outln();
+ generateSends();
+}
+
+public void generateMetadata() throws Exception {
+ generateConstantsMetaData();
+ generateSendsMetaData();
+}
+
+public void setClasses(String[] classes) {
+ this.classes = classes;
+}
+
+public void setOutputDir(String dir) {
+ this.outputDir = dir;
+}
+
+public static void main(String[] args) throws Exception {
+ MacGenerator gen = new MacGenerator(args);
+// gen.setClasses(new String[]{
+// "NSURL",
+// });
+ gen.setOutputDir("/Users/adclabs/Desktop/workspace/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa");
+// gen.generateOS();
+// gen.generateMetadata();
+ gen.generateClasses();
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSATSTypesetter.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSATSTypesetter.java
new file mode 100644
index 0000000000..bfa040089a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSATSTypesetter.java
@@ -0,0 +1,24 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSATSTypesetter extends NSTypesetter {
+
+public NSATSTypesetter() {
+ super();
+}
+
+public NSATSTypesetter(int id) {
+ super(id);
+}
+
+public NSRect lineFragmentRectForProposedRect(NSRect proposedRect, int remainingRect) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_lineFragmentRectForProposedRect_1remainingRect_1, proposedRect, remainingRect);
+ return result;
+}
+
+public static id sharedTypesetter() {
+ int result = OS.objc_msgSend(OS.class_NSATSTypesetter, OS.sel_sharedTypesetter);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSActionCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSActionCell.java
new file mode 100644
index 0000000000..29dcc20d0f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSActionCell.java
@@ -0,0 +1,100 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSActionCell extends NSCell {
+
+public NSActionCell() {
+ super();
+}
+
+public NSActionCell(int id) {
+ super(id);
+}
+
+public int action() {
+ return OS.objc_msgSend(this.id, OS.sel_action);
+}
+
+public NSView controlView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_controlView);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public double doubleValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_doubleValue);
+}
+
+public float floatValue() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_floatValue);
+}
+
+public int intValue() {
+ return OS.objc_msgSend(this.id, OS.sel_intValue);
+}
+
+public int integerValue() {
+ return OS.objc_msgSend(this.id, OS.sel_integerValue);
+}
+
+public void setAction(int aSelector) {
+ OS.objc_msgSend(this.id, OS.sel_setAction_1, aSelector);
+}
+
+public void setAlignment(int mode) {
+ OS.objc_msgSend(this.id, OS.sel_setAlignment_1, mode);
+}
+
+public void setBezeled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setBezeled_1, flag);
+}
+
+public void setBordered(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setBordered_1, flag);
+}
+
+public void setControlView(NSView view) {
+ OS.objc_msgSend(this.id, OS.sel_setControlView_1, view != null ? view.id : 0);
+}
+
+public void setEnabled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setEnabled_1, flag);
+}
+
+public void setFloatingPointFormat(boolean autoRange, int leftDigits, int rightDigits) {
+ OS.objc_msgSend(this.id, OS.sel_setFloatingPointFormat_1left_1right_1, autoRange, leftDigits, rightDigits);
+}
+
+public void setFont(NSFont fontObj) {
+ OS.objc_msgSend(this.id, OS.sel_setFont_1, fontObj != null ? fontObj.id : 0);
+}
+
+public void setImage(NSImage image) {
+ OS.objc_msgSend(this.id, OS.sel_setImage_1, image != null ? image.id : 0);
+}
+
+public void setObjectValue(id obj) {
+ OS.objc_msgSend(this.id, OS.sel_setObjectValue_1, obj != null ? obj.id : 0);
+}
+
+public void setTag(int anInt) {
+ OS.objc_msgSend(this.id, OS.sel_setTag_1, anInt);
+}
+
+public void setTarget(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setTarget_1, anObject != null ? anObject.id : 0);
+}
+
+public NSString stringValue() {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringValue);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int tag() {
+ return OS.objc_msgSend(this.id, OS.sel_tag);
+}
+
+public id target() {
+ int result = OS.objc_msgSend(this.id, OS.sel_target);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAffineTransform.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAffineTransform.java
new file mode 100644
index 0000000000..fe1c2cd2f2
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAffineTransform.java
@@ -0,0 +1,85 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSAffineTransform extends NSObject {
+
+public NSAffineTransform() {
+ super();
+}
+
+public NSAffineTransform(int id) {
+ super(id);
+}
+
+public void appendTransform(NSAffineTransform transform) {
+ OS.objc_msgSend(this.id, OS.sel_appendTransform_1, transform != null ? transform.id : 0);
+}
+
+public NSAffineTransform initWithTransform(NSAffineTransform transform) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithTransform_1, transform != null ? transform.id : 0);
+ return result != 0 ? this : null;
+}
+
+public void invert() {
+ OS.objc_msgSend(this.id, OS.sel_invert);
+}
+
+public void set() {
+ OS.objc_msgSend(this.id, OS.sel_set);
+}
+
+public void concat() {
+ OS.objc_msgSend(this.id, OS.sel_concat);
+}
+
+public void prependTransform(NSAffineTransform transform) {
+ OS.objc_msgSend(this.id, OS.sel_prependTransform_1, transform != null ? transform.id : 0);
+}
+
+public void rotateByDegrees(float angle) {
+ OS.objc_msgSend(this.id, OS.sel_rotateByDegrees_1, angle);
+}
+
+public void rotateByRadians(float angle) {
+ OS.objc_msgSend(this.id, OS.sel_rotateByRadians_1, angle);
+}
+
+public void scaleBy(float scale) {
+ OS.objc_msgSend(this.id, OS.sel_scaleBy_1, scale);
+}
+
+public void scaleXBy(float scaleX, float scaleY) {
+ OS.objc_msgSend(this.id, OS.sel_scaleXBy_1yBy_1, scaleX, scaleY);
+}
+
+public void setTransformStruct(NSAffineTransformStruct transformStruct) {
+ OS.objc_msgSend(this.id, OS.sel_setTransformStruct_1, transformStruct);
+}
+
+public static NSAffineTransform transform() {
+ int result = OS.objc_msgSend(OS.class_NSAffineTransform, OS.sel_transform);
+ return result != 0 ? new NSAffineTransform(result) : null;
+}
+
+public NSPoint transformPoint(NSPoint aPoint) {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_transformPoint_1, aPoint);
+ return result;
+}
+
+public NSSize transformSize(NSSize aSize) {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_transformSize_1, aSize);
+ return result;
+}
+
+public NSAffineTransformStruct transformStruct() {
+ NSAffineTransformStruct result = new NSAffineTransformStruct();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_transformStruct);
+ return result;
+}
+
+public void translateXBy(float deltaX, float deltaY) {
+ OS.objc_msgSend(this.id, OS.sel_translateXBy_1yBy_1, deltaX, deltaY);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAffineTransformStruct.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAffineTransformStruct.java
new file mode 100644
index 0000000000..ba23e57986
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAffineTransformStruct.java
@@ -0,0 +1,6 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSAffineTransformStruct {
+ public float m11, m12, m21, m22;
+ public float tX, tY;
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAlert.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAlert.java
new file mode 100644
index 0000000000..c3da761134
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAlert.java
@@ -0,0 +1,133 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSAlert extends NSObject {
+
+public NSAlert() {
+ super();
+}
+
+public NSAlert(int id) {
+ super(id);
+}
+
+public NSView accessoryView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_accessoryView);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public NSButton addButtonWithTitle(NSString title) {
+ int result = OS.objc_msgSend(this.id, OS.sel_addButtonWithTitle_1, title != null ? title.id : 0);
+ return result != 0 ? new NSButton(result) : null;
+}
+
+public int alertStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_alertStyle);
+}
+
+public static NSAlert alertWithError(NSError error) {
+ int result = OS.objc_msgSend(OS.class_NSAlert, OS.sel_alertWithError_1, error != null ? error.id : 0);
+ return result != 0 ? new NSAlert(result) : null;
+}
+
+public static NSAlert alertWithMessageText(NSString message, NSString defaultButton, NSString alternateButton, NSString otherButton, NSString informativeTextWithFormat) {
+ int result = OS.objc_msgSend(OS.class_NSAlert, OS.sel_alertWithMessageText_1defaultButton_1alternateButton_1otherButton_1informativeTextWithFormat_1, message != null ? message.id : 0, defaultButton != null ? defaultButton.id : 0, alternateButton != null ? alternateButton.id : 0, otherButton != null ? otherButton.id : 0, informativeTextWithFormat != null ? informativeTextWithFormat.id : 0);
+ return result != 0 ? new NSAlert(result) : null;
+}
+
+public void beginSheetModalForWindow(NSWindow window, id delegate, int didEndSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_beginSheetModalForWindow_1modalDelegate_1didEndSelector_1contextInfo_1, window != null ? window.id : 0, delegate != null ? delegate.id : 0, didEndSelector, contextInfo);
+}
+
+public NSArray buttons() {
+ int result = OS.objc_msgSend(this.id, OS.sel_buttons);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString helpAnchor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_helpAnchor);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSImage icon() {
+ int result = OS.objc_msgSend(this.id, OS.sel_icon);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public NSString informativeText() {
+ int result = OS.objc_msgSend(this.id, OS.sel_informativeText);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void layout() {
+ OS.objc_msgSend(this.id, OS.sel_layout);
+}
+
+public NSString messageText() {
+ int result = OS.objc_msgSend(this.id, OS.sel_messageText);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int runModal() {
+ return OS.objc_msgSend(this.id, OS.sel_runModal);
+}
+
+public void setAccessoryView(NSView view) {
+ OS.objc_msgSend(this.id, OS.sel_setAccessoryView_1, view != null ? view.id : 0);
+}
+
+public void setAlertStyle(int style) {
+ OS.objc_msgSend(this.id, OS.sel_setAlertStyle_1, style);
+}
+
+public void setDelegate(id delegate) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegate != null ? delegate.id : 0);
+}
+
+public void setHelpAnchor(NSString anchor) {
+ OS.objc_msgSend(this.id, OS.sel_setHelpAnchor_1, anchor != null ? anchor.id : 0);
+}
+
+public void setIcon(NSImage icon) {
+ OS.objc_msgSend(this.id, OS.sel_setIcon_1, icon != null ? icon.id : 0);
+}
+
+public void setInformativeText(NSString informativeText) {
+ OS.objc_msgSend(this.id, OS.sel_setInformativeText_1, informativeText != null ? informativeText.id : 0);
+}
+
+public void setMessageText(NSString messageText) {
+ OS.objc_msgSend(this.id, OS.sel_setMessageText_1, messageText != null ? messageText.id : 0);
+}
+
+public void setShowsHelp(boolean showsHelp) {
+ OS.objc_msgSend(this.id, OS.sel_setShowsHelp_1, showsHelp);
+}
+
+public void setShowsSuppressionButton(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setShowsSuppressionButton_1, flag);
+}
+
+public boolean showsHelp() {
+ return OS.objc_msgSend(this.id, OS.sel_showsHelp) != 0;
+}
+
+public boolean showsSuppressionButton() {
+ return OS.objc_msgSend(this.id, OS.sel_showsSuppressionButton) != 0;
+}
+
+public NSButton suppressionButton() {
+ int result = OS.objc_msgSend(this.id, OS.sel_suppressionButton);
+ return result != 0 ? new NSButton(result) : null;
+}
+
+public id window() {
+ int result = OS.objc_msgSend(this.id, OS.sel_window);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAnimation.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAnimation.java
new file mode 100644
index 0000000000..6651fb87f7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAnimation.java
@@ -0,0 +1,121 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSAnimation extends NSObject {
+
+public NSAnimation() {
+ super();
+}
+
+public NSAnimation(int id) {
+ super(id);
+}
+
+public void addProgressMark(float progressMark) {
+ OS.objc_msgSend(this.id, OS.sel_addProgressMark_1, progressMark);
+}
+
+public int animationBlockingMode() {
+ return OS.objc_msgSend(this.id, OS.sel_animationBlockingMode);
+}
+
+public int animationCurve() {
+ return OS.objc_msgSend(this.id, OS.sel_animationCurve);
+}
+
+public void clearStartAnimation() {
+ OS.objc_msgSend(this.id, OS.sel_clearStartAnimation);
+}
+
+public void clearStopAnimation() {
+ OS.objc_msgSend(this.id, OS.sel_clearStopAnimation);
+}
+
+public float currentProgress() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_currentProgress);
+}
+
+public float currentValue() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_currentValue);
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public double duration() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_duration);
+}
+
+public float frameRate() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_frameRate);
+}
+
+public NSAnimation initWithDuration(double duration, int animationCurve) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithDuration_1animationCurve_1, duration, animationCurve);
+ return result != 0 ? this : null;
+}
+
+public boolean isAnimating() {
+ return OS.objc_msgSend(this.id, OS.sel_isAnimating) != 0;
+}
+
+public NSArray progressMarks() {
+ int result = OS.objc_msgSend(this.id, OS.sel_progressMarks);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void removeProgressMark(float progressMark) {
+ OS.objc_msgSend(this.id, OS.sel_removeProgressMark_1, progressMark);
+}
+
+public NSArray runLoopModesForAnimating() {
+ int result = OS.objc_msgSend(this.id, OS.sel_runLoopModesForAnimating);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void setAnimationBlockingMode(int animationBlockingMode) {
+ OS.objc_msgSend(this.id, OS.sel_setAnimationBlockingMode_1, animationBlockingMode);
+}
+
+public void setAnimationCurve(int curve) {
+ OS.objc_msgSend(this.id, OS.sel_setAnimationCurve_1, curve);
+}
+
+public void setCurrentProgress(float progress) {
+ OS.objc_msgSend(this.id, OS.sel_setCurrentProgress_1, progress);
+}
+
+public void setDelegate(id delegate) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegate != null ? delegate.id : 0);
+}
+
+public void setDuration(double duration) {
+ OS.objc_msgSend(this.id, OS.sel_setDuration_1, duration);
+}
+
+public void setFrameRate(float framesPerSecond) {
+ OS.objc_msgSend(this.id, OS.sel_setFrameRate_1, framesPerSecond);
+}
+
+public void setProgressMarks(NSArray progressMarks) {
+ OS.objc_msgSend(this.id, OS.sel_setProgressMarks_1, progressMarks != null ? progressMarks.id : 0);
+}
+
+public void startAnimation() {
+ OS.objc_msgSend(this.id, OS.sel_startAnimation);
+}
+
+public void startWhenAnimation(NSAnimation animation, float startProgress) {
+ OS.objc_msgSend(this.id, OS.sel_startWhenAnimation_1reachesProgress_1, animation != null ? animation.id : 0, startProgress);
+}
+
+public void stopAnimation() {
+ OS.objc_msgSend(this.id, OS.sel_stopAnimation);
+}
+
+public void stopWhenAnimation(NSAnimation animation, float stopProgress) {
+ OS.objc_msgSend(this.id, OS.sel_stopWhenAnimation_1reachesProgress_1, animation != null ? animation.id : 0, stopProgress);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAnimationContext.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAnimationContext.java
new file mode 100644
index 0000000000..69db20910e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAnimationContext.java
@@ -0,0 +1,34 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSAnimationContext extends NSObject {
+
+public NSAnimationContext() {
+ super();
+}
+
+public NSAnimationContext(int id) {
+ super(id);
+}
+
+public static void beginGrouping() {
+ OS.objc_msgSend(OS.class_NSAnimationContext, OS.sel_beginGrouping);
+}
+
+public static NSAnimationContext currentContext() {
+ int result = OS.objc_msgSend(OS.class_NSAnimationContext, OS.sel_currentContext);
+ return result != 0 ? new NSAnimationContext(result) : null;
+}
+
+public double duration() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_duration);
+}
+
+public static void endGrouping() {
+ OS.objc_msgSend(OS.class_NSAnimationContext, OS.sel_endGrouping);
+}
+
+public void setDuration(double duration) {
+ OS.objc_msgSend(this.id, OS.sel_setDuration_1, duration);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAppleEventDescriptor.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAppleEventDescriptor.java
new file mode 100644
index 0000000000..1ea3a794eb
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAppleEventDescriptor.java
@@ -0,0 +1,209 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSAppleEventDescriptor extends NSObject {
+
+public NSAppleEventDescriptor() {
+ super();
+}
+
+public NSAppleEventDescriptor(int id) {
+ super(id);
+}
+
+public int aeDesc() {
+ return OS.objc_msgSend(this.id, OS.sel_aeDesc);
+}
+
+public static NSAppleEventDescriptor appleEventWithEventClass(int eventClass, int eventID, NSAppleEventDescriptor targetDescriptor, short returnID, int transactionID) {
+ int result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_appleEventWithEventClass_1eventID_1targetDescriptor_1returnID_1transactionID_1, eventClass, eventID, targetDescriptor != null ? targetDescriptor.id : 0, returnID, transactionID);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public NSAppleEventDescriptor attributeDescriptorForKeyword(int keyword) {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributeDescriptorForKeyword_1, keyword);
+ return result == this.id ? this : (result != 0 ? new NSAppleEventDescriptor(result) : null);
+}
+
+public boolean booleanValue() {
+ return OS.objc_msgSend(this.id, OS.sel_booleanValue) != 0;
+}
+
+public NSAppleEventDescriptor coerceToDescriptorType(int descriptorType) {
+ int result = OS.objc_msgSend(this.id, OS.sel_coerceToDescriptorType_1, descriptorType);
+ return result == this.id ? this : (result != 0 ? new NSAppleEventDescriptor(result) : null);
+}
+
+public NSData data() {
+ int result = OS.objc_msgSend(this.id, OS.sel_data);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSAppleEventDescriptor descriptorAtIndex(int index) {
+ int result = OS.objc_msgSend(this.id, OS.sel_descriptorAtIndex_1, index);
+ return result == this.id ? this : (result != 0 ? new NSAppleEventDescriptor(result) : null);
+}
+
+public NSAppleEventDescriptor descriptorForKeyword(int keyword) {
+ int result = OS.objc_msgSend(this.id, OS.sel_descriptorForKeyword_1, keyword);
+ return result == this.id ? this : (result != 0 ? new NSAppleEventDescriptor(result) : null);
+}
+
+public int descriptorType() {
+ return OS.objc_msgSend(this.id, OS.sel_descriptorType);
+}
+
+public static NSAppleEventDescriptor descriptorWithBoolean(boolean b) {
+ int result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_descriptorWithBoolean_1, b);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public static NSAppleEventDescriptor static_descriptorWithDescriptorType_bytes_length_(int descriptorType, int bytes, int byteCount) {
+ int result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_descriptorWithDescriptorType_1bytes_1length_1, descriptorType, bytes, byteCount);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public static NSAppleEventDescriptor static_descriptorWithDescriptorType_data_(int descriptorType, NSData data) {
+ int result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_descriptorWithDescriptorType_1data_1, descriptorType, data != null ? data.id : 0);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public static NSAppleEventDescriptor descriptorWithEnumCode(int enumerator) {
+ int result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_descriptorWithEnumCode_1, enumerator);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public static NSAppleEventDescriptor descriptorWithInt32(int signedInt) {
+ int result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_descriptorWithInt32_1, signedInt);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public static NSAppleEventDescriptor descriptorWithString(NSString string) {
+ int result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_descriptorWithString_1, string != null ? string.id : 0);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public static NSAppleEventDescriptor descriptorWithTypeCode(int typeCode) {
+ int result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_descriptorWithTypeCode_1, typeCode);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public int enumCodeValue() {
+ return OS.objc_msgSend(this.id, OS.sel_enumCodeValue);
+}
+
+public int eventClass() {
+ return OS.objc_msgSend(this.id, OS.sel_eventClass);
+}
+
+public int eventID() {
+ return OS.objc_msgSend(this.id, OS.sel_eventID);
+}
+
+public NSAppleEventDescriptor initListDescriptor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_initListDescriptor);
+ return result != 0 ? this : null;
+}
+
+public NSAppleEventDescriptor initRecordDescriptor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_initRecordDescriptor);
+ return result != 0 ? this : null;
+}
+
+public NSAppleEventDescriptor initWithAEDescNoCopy(int aeDesc) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithAEDescNoCopy_1, aeDesc);
+ return result != 0 ? this : null;
+}
+
+public NSAppleEventDescriptor initWithDescriptorType_bytes_length_(int descriptorType, int bytes, int byteCount) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithDescriptorType_1bytes_1length_1, descriptorType, bytes, byteCount);
+ return result != 0 ? this : null;
+}
+
+public NSAppleEventDescriptor initWithDescriptorType_data_(int descriptorType, NSData data) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithDescriptorType_1data_1, descriptorType, data != null ? data.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSAppleEventDescriptor initWithEventClass(int eventClass, int eventID, NSAppleEventDescriptor targetDescriptor, short returnID, int transactionID) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithEventClass_1eventID_1targetDescriptor_1returnID_1transactionID_1, eventClass, eventID, targetDescriptor != null ? targetDescriptor.id : 0, returnID, transactionID);
+ return result != 0 ? this : null;
+}
+
+public void insertDescriptor(NSAppleEventDescriptor descriptor, int index) {
+ OS.objc_msgSend(this.id, OS.sel_insertDescriptor_1atIndex_1, descriptor != null ? descriptor.id : 0, index);
+}
+
+public int int32Value() {
+ return OS.objc_msgSend(this.id, OS.sel_int32Value);
+}
+
+public int keywordForDescriptorAtIndex(int index) {
+ return OS.objc_msgSend(this.id, OS.sel_keywordForDescriptorAtIndex_1, index);
+}
+
+public static NSAppleEventDescriptor listDescriptor() {
+ int result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_listDescriptor);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public static NSAppleEventDescriptor nullDescriptor() {
+ int result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_nullDescriptor);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public int numberOfItems() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfItems);
+}
+
+public NSAppleEventDescriptor paramDescriptorForKeyword(int keyword) {
+ int result = OS.objc_msgSend(this.id, OS.sel_paramDescriptorForKeyword_1, keyword);
+ return result == this.id ? this : (result != 0 ? new NSAppleEventDescriptor(result) : null);
+}
+
+public static NSAppleEventDescriptor recordDescriptor() {
+ int result = OS.objc_msgSend(OS.class_NSAppleEventDescriptor, OS.sel_recordDescriptor);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public void removeDescriptorAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_removeDescriptorAtIndex_1, index);
+}
+
+public void removeDescriptorWithKeyword(int keyword) {
+ OS.objc_msgSend(this.id, OS.sel_removeDescriptorWithKeyword_1, keyword);
+}
+
+public void removeParamDescriptorWithKeyword(int keyword) {
+ OS.objc_msgSend(this.id, OS.sel_removeParamDescriptorWithKeyword_1, keyword);
+}
+
+public short returnID() {
+ return (short)OS.objc_msgSend(this.id, OS.sel_returnID);
+}
+
+public void setAttributeDescriptor(NSAppleEventDescriptor descriptor, int keyword) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributeDescriptor_1forKeyword_1, descriptor != null ? descriptor.id : 0, keyword);
+}
+
+public void setDescriptor(NSAppleEventDescriptor descriptor, int keyword) {
+ OS.objc_msgSend(this.id, OS.sel_setDescriptor_1forKeyword_1, descriptor != null ? descriptor.id : 0, keyword);
+}
+
+public void setParamDescriptor(NSAppleEventDescriptor descriptor, int keyword) {
+ OS.objc_msgSend(this.id, OS.sel_setParamDescriptor_1forKeyword_1, descriptor != null ? descriptor.id : 0, keyword);
+}
+
+public NSString stringValue() {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringValue);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int transactionID() {
+ return OS.objc_msgSend(this.id, OS.sel_transactionID);
+}
+
+public int typeCodeValue() {
+ return OS.objc_msgSend(this.id, OS.sel_typeCodeValue);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAppleEventManager.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAppleEventManager.java
new file mode 100644
index 0000000000..b27df949e9
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAppleEventManager.java
@@ -0,0 +1,62 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSAppleEventManager extends NSObject {
+
+public NSAppleEventManager() {
+ super();
+}
+
+public NSAppleEventManager(int id) {
+ super(id);
+}
+
+public NSAppleEventDescriptor appleEventForSuspensionID(int suspensionID) {
+ int result = OS.objc_msgSend(this.id, OS.sel_appleEventForSuspensionID_1, suspensionID);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public NSAppleEventDescriptor currentAppleEvent() {
+ int result = OS.objc_msgSend(this.id, OS.sel_currentAppleEvent);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public NSAppleEventDescriptor currentReplyAppleEvent() {
+ int result = OS.objc_msgSend(this.id, OS.sel_currentReplyAppleEvent);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public short dispatchRawAppleEvent(int theAppleEvent, int theReply, int handlerRefCon) {
+ return (short)OS.objc_msgSend(this.id, OS.sel_dispatchRawAppleEvent_1withRawReply_1handlerRefCon_1, theAppleEvent, theReply, handlerRefCon);
+}
+
+public void removeEventHandlerForEventClass(int eventClass, int eventID) {
+ OS.objc_msgSend(this.id, OS.sel_removeEventHandlerForEventClass_1andEventID_1, eventClass, eventID);
+}
+
+public NSAppleEventDescriptor replyAppleEventForSuspensionID(int suspensionID) {
+ int result = OS.objc_msgSend(this.id, OS.sel_replyAppleEventForSuspensionID_1, suspensionID);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public void resumeWithSuspensionID(int suspensionID) {
+ OS.objc_msgSend(this.id, OS.sel_resumeWithSuspensionID_1, suspensionID);
+}
+
+public void setCurrentAppleEventAndReplyEventWithSuspensionID(int suspensionID) {
+ OS.objc_msgSend(this.id, OS.sel_setCurrentAppleEventAndReplyEventWithSuspensionID_1, suspensionID);
+}
+
+public void setEventHandler(id handler, int handleEventSelector, int eventClass, int eventID) {
+ OS.objc_msgSend(this.id, OS.sel_setEventHandler_1andSelector_1forEventClass_1andEventID_1, handler != null ? handler.id : 0, handleEventSelector, eventClass, eventID);
+}
+
+public static NSAppleEventManager sharedAppleEventManager() {
+ int result = OS.objc_msgSend(OS.class_NSAppleEventManager, OS.sel_sharedAppleEventManager);
+ return result != 0 ? new NSAppleEventManager(result) : null;
+}
+
+public int suspendCurrentAppleEvent() {
+ return OS.objc_msgSend(this.id, OS.sel_suspendCurrentAppleEvent);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAppleScript.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAppleScript.java
new file mode 100644
index 0000000000..a80aa3969b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAppleScript.java
@@ -0,0 +1,46 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSAppleScript extends NSObject {
+
+public NSAppleScript() {
+ super();
+}
+
+public NSAppleScript(int id) {
+ super(id);
+}
+
+public boolean compileAndReturnError(int errorInfo) {
+ return OS.objc_msgSend(this.id, OS.sel_compileAndReturnError_1, errorInfo) != 0;
+}
+
+public NSAppleEventDescriptor executeAndReturnError(int errorInfo) {
+ int result = OS.objc_msgSend(this.id, OS.sel_executeAndReturnError_1, errorInfo);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public NSAppleEventDescriptor executeAppleEvent(NSAppleEventDescriptor event, int errorInfo) {
+ int result = OS.objc_msgSend(this.id, OS.sel_executeAppleEvent_1error_1, event != null ? event.id : 0, errorInfo);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public NSAppleScript initWithContentsOfURL(NSURL url, int errorInfo) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1error_1, url != null ? url.id : 0, errorInfo);
+ return result != 0 ? this : null;
+}
+
+public NSAppleScript initWithSource(NSString source) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithSource_1, source != null ? source.id : 0);
+ return result != 0 ? this : null;
+}
+
+public boolean isCompiled() {
+ return OS.objc_msgSend(this.id, OS.sel_isCompiled) != 0;
+}
+
+public NSString source() {
+ int result = OS.objc_msgSend(this.id, OS.sel_source);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSApplication.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSApplication.java
new file mode 100644
index 0000000000..11ff84b5b1
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSApplication.java
@@ -0,0 +1,363 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSApplication extends NSResponder {
+
+public NSApplication() {
+ super();
+}
+
+public NSApplication(int id) {
+ super(id);
+}
+
+public void abortModal() {
+ OS.objc_msgSend(this.id, OS.sel_abortModal);
+}
+
+public void activateContextHelpMode(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_activateContextHelpMode_1, sender != null ? sender.id : 0);
+}
+
+public void activateIgnoringOtherApps(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_activateIgnoringOtherApps_1, flag);
+}
+
+public void addWindowsItem(NSWindow win, NSString aString, boolean isFilename) {
+ OS.objc_msgSend(this.id, OS.sel_addWindowsItem_1title_1filename_1, win != null ? win.id : 0, aString != null ? aString.id : 0, isFilename);
+}
+
+public NSImage applicationIconImage() {
+ int result = OS.objc_msgSend(this.id, OS.sel_applicationIconImage);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public void arrangeInFront(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_arrangeInFront_1, sender != null ? sender.id : 0);
+}
+
+public int beginModalSessionForWindow_(NSWindow theWindow) {
+ return OS.objc_msgSend(this.id, OS.sel_beginModalSessionForWindow_1, theWindow != null ? theWindow.id : 0);
+}
+
+public int beginModalSessionForWindow_relativeToWindow_(NSWindow theWindow, NSWindow docWindow) {
+ return OS.objc_msgSend(this.id, OS.sel_beginModalSessionForWindow_1relativeToWindow_1, theWindow != null ? theWindow.id : 0, docWindow != null ? docWindow.id : 0);
+}
+
+public void beginSheet(NSWindow sheet, NSWindow docWindow, id modalDelegate, int didEndSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_beginSheet_1modalForWindow_1modalDelegate_1didEndSelector_1contextInfo_1, sheet != null ? sheet.id : 0, docWindow != null ? docWindow.id : 0, modalDelegate != null ? modalDelegate.id : 0, didEndSelector, contextInfo);
+}
+
+public void cancelUserAttentionRequest(int request) {
+ OS.objc_msgSend(this.id, OS.sel_cancelUserAttentionRequest_1, request);
+}
+
+public void changeWindowsItem(NSWindow win, NSString aString, boolean isFilename) {
+ OS.objc_msgSend(this.id, OS.sel_changeWindowsItem_1title_1filename_1, win != null ? win.id : 0, aString != null ? aString.id : 0, isFilename);
+}
+
+public NSGraphicsContext context() {
+ int result = OS.objc_msgSend(this.id, OS.sel_context);
+ return result != 0 ? new NSGraphicsContext(result) : null;
+}
+
+public NSEvent currentEvent() {
+ int result = OS.objc_msgSend(this.id, OS.sel_currentEvent);
+ return result != 0 ? new NSEvent(result) : null;
+}
+
+public void deactivate() {
+ OS.objc_msgSend(this.id, OS.sel_deactivate);
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public static void detachDrawingThread(int selector, id target, id argument) {
+ OS.objc_msgSend(OS.class_NSApplication, OS.sel_detachDrawingThread_1toTarget_1withObject_1, selector, target != null ? target.id : 0, argument != null ? argument.id : 0);
+}
+
+public void discardEventsMatchingMask(int mask, NSEvent lastEvent) {
+ OS.objc_msgSend(this.id, OS.sel_discardEventsMatchingMask_1beforeEvent_1, mask, lastEvent != null ? lastEvent.id : 0);
+}
+
+public NSDockTile dockTile() {
+ int result = OS.objc_msgSend(this.id, OS.sel_dockTile);
+ return result != 0 ? new NSDockTile(result) : null;
+}
+
+public void endModalSession(int session) {
+ OS.objc_msgSend(this.id, OS.sel_endModalSession_1, session);
+}
+
+public void endSheet_(NSWindow sheet) {
+ OS.objc_msgSend(this.id, OS.sel_endSheet_1, sheet != null ? sheet.id : 0);
+}
+
+public void endSheet_returnCode_(NSWindow sheet, int returnCode) {
+ OS.objc_msgSend(this.id, OS.sel_endSheet_1returnCode_1, sheet != null ? sheet.id : 0, returnCode);
+}
+
+public void finishLaunching() {
+ OS.objc_msgSend(this.id, OS.sel_finishLaunching);
+}
+
+public void hide(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_hide_1, sender != null ? sender.id : 0);
+}
+
+public void hideOtherApplications(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_hideOtherApplications_1, sender != null ? sender.id : 0);
+}
+
+public boolean isActive() {
+ return OS.objc_msgSend(this.id, OS.sel_isActive) != 0;
+}
+
+public boolean isHidden() {
+ return OS.objc_msgSend(this.id, OS.sel_isHidden) != 0;
+}
+
+public boolean isRunning() {
+ return OS.objc_msgSend(this.id, OS.sel_isRunning) != 0;
+}
+
+public NSWindow keyWindow() {
+ int result = OS.objc_msgSend(this.id, OS.sel_keyWindow);
+ return result != 0 ? new NSWindow(result) : null;
+}
+
+public NSMenu mainMenu() {
+ int result = OS.objc_msgSend(this.id, OS.sel_mainMenu);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+public NSWindow mainWindow() {
+ int result = OS.objc_msgSend(this.id, OS.sel_mainWindow);
+ return result != 0 ? new NSWindow(result) : null;
+}
+
+public NSWindow makeWindowsPerform(int aSelector, boolean flag) {
+ int result = OS.objc_msgSend(this.id, OS.sel_makeWindowsPerform_1inOrder_1, aSelector, flag);
+ return result != 0 ? new NSWindow(result) : null;
+}
+
+public void miniaturizeAll(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_miniaturizeAll_1, sender != null ? sender.id : 0);
+}
+
+public NSWindow modalWindow() {
+ int result = OS.objc_msgSend(this.id, OS.sel_modalWindow);
+ return result != 0 ? new NSWindow(result) : null;
+}
+
+public NSEvent nextEventMatchingMask(int mask, NSDate expiration, NSString mode, boolean deqFlag) {
+ int result = OS.objc_msgSend(this.id, OS.sel_nextEventMatchingMask_1untilDate_1inMode_1dequeue_1, mask, expiration != null ? expiration.id : 0, mode != null ? mode.id : 0, deqFlag);
+ return result != 0 ? new NSEvent(result) : null;
+}
+
+public void orderFrontCharacterPalette(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_orderFrontCharacterPalette_1, sender != null ? sender.id : 0);
+}
+
+public void orderFrontColorPanel(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_orderFrontColorPanel_1, sender != null ? sender.id : 0);
+}
+
+public void orderFrontStandardAboutPanel(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_orderFrontStandardAboutPanel_1, sender != null ? sender.id : 0);
+}
+
+public void orderFrontStandardAboutPanelWithOptions(NSDictionary optionsDictionary) {
+ OS.objc_msgSend(this.id, OS.sel_orderFrontStandardAboutPanelWithOptions_1, optionsDictionary != null ? optionsDictionary.id : 0);
+}
+
+public NSArray orderedDocuments() {
+ int result = OS.objc_msgSend(this.id, OS.sel_orderedDocuments);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray orderedWindows() {
+ int result = OS.objc_msgSend(this.id, OS.sel_orderedWindows);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void postEvent(NSEvent event, boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_postEvent_1atStart_1, event != null ? event.id : 0, flag);
+}
+
+public void preventWindowOrdering() {
+ OS.objc_msgSend(this.id, OS.sel_preventWindowOrdering);
+}
+
+public void registerServicesMenuSendTypes(NSArray sendTypes, NSArray returnTypes) {
+ OS.objc_msgSend(this.id, OS.sel_registerServicesMenuSendTypes_1returnTypes_1, sendTypes != null ? sendTypes.id : 0, returnTypes != null ? returnTypes.id : 0);
+}
+
+public void removeWindowsItem(NSWindow win) {
+ OS.objc_msgSend(this.id, OS.sel_removeWindowsItem_1, win != null ? win.id : 0);
+}
+
+public void replyToApplicationShouldTerminate(boolean shouldTerminate) {
+ OS.objc_msgSend(this.id, OS.sel_replyToApplicationShouldTerminate_1, shouldTerminate);
+}
+
+public void replyToOpenOrPrint(int reply) {
+ OS.objc_msgSend(this.id, OS.sel_replyToOpenOrPrint_1, reply);
+}
+
+public void reportException(NSException theException) {
+ OS.objc_msgSend(this.id, OS.sel_reportException_1, theException != null ? theException.id : 0);
+}
+
+public int requestUserAttention(int requestType) {
+ return OS.objc_msgSend(this.id, OS.sel_requestUserAttention_1, requestType);
+}
+
+public void run() {
+ OS.objc_msgSend(this.id, OS.sel_run);
+}
+
+public int runModalForWindow_(NSWindow theWindow) {
+ return OS.objc_msgSend(this.id, OS.sel_runModalForWindow_1, theWindow != null ? theWindow.id : 0);
+}
+
+public int runModalForWindow_relativeToWindow_(NSWindow theWindow, NSWindow docWindow) {
+ return OS.objc_msgSend(this.id, OS.sel_runModalForWindow_1relativeToWindow_1, theWindow != null ? theWindow.id : 0, docWindow != null ? docWindow.id : 0);
+}
+
+public int runModalSession(int session) {
+ return OS.objc_msgSend(this.id, OS.sel_runModalSession_1, session);
+}
+
+public void runPageLayout(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_runPageLayout_1, sender != null ? sender.id : 0);
+}
+
+public boolean sendAction(int theAction, id theTarget, id sender) {
+ return OS.objc_msgSend(this.id, OS.sel_sendAction_1to_1from_1, theAction, theTarget != null ? theTarget.id : 0, sender != null ? sender.id : 0) != 0;
+}
+
+public void sendEvent(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_sendEvent_1, theEvent != null ? theEvent.id : 0);
+}
+
+public NSMenu servicesMenu() {
+ int result = OS.objc_msgSend(this.id, OS.sel_servicesMenu);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+public id servicesProvider() {
+ int result = OS.objc_msgSend(this.id, OS.sel_servicesProvider);
+ return result != 0 ? new id(result) : null;
+}
+
+public void setApplicationIconImage(NSImage image) {
+ OS.objc_msgSend(this.id, OS.sel_setApplicationIconImage_1, image != null ? image.id : 0);
+}
+
+public void setDelegate(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
+}
+
+public void setMainMenu(NSMenu aMenu) {
+ OS.objc_msgSend(this.id, OS.sel_setMainMenu_1, aMenu != null ? aMenu.id : 0);
+}
+
+public void setServicesMenu(NSMenu aMenu) {
+ OS.objc_msgSend(this.id, OS.sel_setServicesMenu_1, aMenu != null ? aMenu.id : 0);
+}
+
+public void setServicesProvider(id provider) {
+ OS.objc_msgSend(this.id, OS.sel_setServicesProvider_1, provider != null ? provider.id : 0);
+}
+
+public void setWindowsMenu(NSMenu aMenu) {
+ OS.objc_msgSend(this.id, OS.sel_setWindowsMenu_1, aMenu != null ? aMenu.id : 0);
+}
+
+public void setWindowsNeedUpdate(boolean needUpdate) {
+ OS.objc_msgSend(this.id, OS.sel_setWindowsNeedUpdate_1, needUpdate);
+}
+
+public static NSApplication sharedApplication() {
+ int result = OS.objc_msgSend(OS.class_NSApplication, OS.sel_sharedApplication);
+ return result != 0 ? new NSApplication(result) : null;
+}
+
+public void showHelp(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_showHelp_1, sender != null ? sender.id : 0);
+}
+
+public void stop(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_stop_1, sender != null ? sender.id : 0);
+}
+
+public void stopModal() {
+ OS.objc_msgSend(this.id, OS.sel_stopModal);
+}
+
+public void stopModalWithCode(int returnCode) {
+ OS.objc_msgSend(this.id, OS.sel_stopModalWithCode_1, returnCode);
+}
+
+public id targetForAction_(int theAction) {
+ int result = OS.objc_msgSend(this.id, OS.sel_targetForAction_1, theAction);
+ return result != 0 ? new id(result) : null;
+}
+
+public id targetForAction_to_from_(int theAction, id theTarget, id sender) {
+ int result = OS.objc_msgSend(this.id, OS.sel_targetForAction_1to_1from_1, theAction, theTarget != null ? theTarget.id : 0, sender != null ? sender.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void terminate(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_terminate_1, sender != null ? sender.id : 0);
+}
+
+public boolean tryToPerform(int anAction, id anObject) {
+ return OS.objc_msgSend(this.id, OS.sel_tryToPerform_1with_1, anAction, anObject != null ? anObject.id : 0) != 0;
+}
+
+public void unhide(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_unhide_1, sender != null ? sender.id : 0);
+}
+
+public void unhideAllApplications(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_unhideAllApplications_1, sender != null ? sender.id : 0);
+}
+
+public void unhideWithoutActivation() {
+ OS.objc_msgSend(this.id, OS.sel_unhideWithoutActivation);
+}
+
+public void updateWindows() {
+ OS.objc_msgSend(this.id, OS.sel_updateWindows);
+}
+
+public void updateWindowsItem(NSWindow win) {
+ OS.objc_msgSend(this.id, OS.sel_updateWindowsItem_1, win != null ? win.id : 0);
+}
+
+public id validRequestorForSendType(NSString sendType, NSString returnType) {
+ int result = OS.objc_msgSend(this.id, OS.sel_validRequestorForSendType_1returnType_1, sendType != null ? sendType.id : 0, returnType != null ? returnType.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSWindow windowWithWindowNumber(int windowNum) {
+ int result = OS.objc_msgSend(this.id, OS.sel_windowWithWindowNumber_1, windowNum);
+ return result != 0 ? new NSWindow(result) : null;
+}
+
+public NSArray windows() {
+ int result = OS.objc_msgSend(this.id, OS.sel_windows);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSMenu windowsMenu() {
+ int result = OS.objc_msgSend(this.id, OS.sel_windowsMenu);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSArchiver.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSArchiver.java
new file mode 100644
index 0000000000..e7fc8dffe6
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSArchiver.java
@@ -0,0 +1,53 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSArchiver extends NSObject {
+
+public NSArchiver() {
+ super();
+}
+
+public NSArchiver(int id) {
+ super(id);
+}
+
+public static boolean archiveRootObject(id rootObject, NSString path) {
+ return OS.objc_msgSend(OS.class_NSArchiver, OS.sel_archiveRootObject_1toFile_1, rootObject != null ? rootObject.id : 0, path != null ? path.id : 0) != 0;
+}
+
+public static NSData archivedDataWithRootObject(id rootObject) {
+ int result = OS.objc_msgSend(OS.class_NSArchiver, OS.sel_archivedDataWithRootObject_1, rootObject != null ? rootObject.id : 0);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSMutableData archiverData() {
+ int result = OS.objc_msgSend(this.id, OS.sel_archiverData);
+ return result != 0 ? new NSMutableData(result) : null;
+}
+
+public NSString classNameEncodedForTrueClassName(NSString trueName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_classNameEncodedForTrueClassName_1, trueName != null ? trueName.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void encodeClassName(NSString trueName, NSString inArchiveName) {
+ OS.objc_msgSend(this.id, OS.sel_encodeClassName_1intoClassName_1, trueName != null ? trueName.id : 0, inArchiveName != null ? inArchiveName.id : 0);
+}
+
+public void encodeConditionalObject(id object) {
+ OS.objc_msgSend(this.id, OS.sel_encodeConditionalObject_1, object != null ? object.id : 0);
+}
+
+public void encodeRootObject(id rootObject) {
+ OS.objc_msgSend(this.id, OS.sel_encodeRootObject_1, rootObject != null ? rootObject.id : 0);
+}
+
+public NSArchiver initForWritingWithMutableData(NSMutableData mdata) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initForWritingWithMutableData_1, mdata != null ? mdata.id : 0);
+ return result != 0 ? this : null;
+}
+
+public void replaceObject(id object, id newObject) {
+ OS.objc_msgSend(this.id, OS.sel_replaceObject_1withObject_1, object != null ? object.id : 0, newObject != null ? newObject.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSArray.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSArray.java
new file mode 100644
index 0000000000..b8381295a8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSArray.java
@@ -0,0 +1,256 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSArray extends NSObject {
+
+public NSArray() {
+ super();
+}
+
+public NSArray(int id) {
+ super(id);
+}
+
+public void addObserver_forKeyPath_options_context_(NSObject observer, NSString keyPath, int options, int context) {
+ OS.objc_msgSend(this.id, OS.sel_addObserver_1forKeyPath_1options_1context_1, observer != null ? observer.id : 0, keyPath != null ? keyPath.id : 0, options, context);
+}
+
+public void addObserver_toObjectsAtIndexes_forKeyPath_options_context_(NSObject observer, NSIndexSet indexes, NSString keyPath, int options, int context) {
+ OS.objc_msgSend(this.id, OS.sel_addObserver_1toObjectsAtIndexes_1forKeyPath_1options_1context_1, observer != null ? observer.id : 0, indexes != null ? indexes.id : 0, keyPath != null ? keyPath.id : 0, options, context);
+}
+
+public static id array() {
+ int result = OS.objc_msgSend(OS.class_NSArray, OS.sel_array);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSArray arrayByAddingObject(id anObject) {
+ int result = OS.objc_msgSend(this.id, OS.sel_arrayByAddingObject_1, anObject != null ? anObject.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSArray(result) : null);
+}
+
+public NSArray arrayByAddingObjectsFromArray(NSArray otherArray) {
+ int result = OS.objc_msgSend(this.id, OS.sel_arrayByAddingObjectsFromArray_1, otherArray != null ? otherArray.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSArray(result) : null);
+}
+
+public static id arrayWithArray(NSArray array) {
+ int result = OS.objc_msgSend(OS.class_NSArray, OS.sel_arrayWithArray_1, array != null ? array.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id arrayWithContentsOfFile(NSString path) {
+ int result = OS.objc_msgSend(OS.class_NSArray, OS.sel_arrayWithContentsOfFile_1, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id arrayWithContentsOfURL(NSURL url) {
+ int result = OS.objc_msgSend(OS.class_NSArray, OS.sel_arrayWithContentsOfURL_1, url != null ? url.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id arrayWithObject(id anObject) {
+ int result = OS.objc_msgSend(OS.class_NSArray, OS.sel_arrayWithObject_1, anObject != null ? anObject.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_arrayWithObjects_(id arrayWithObjects) {
+ int result = OS.objc_msgSend(OS.class_NSArray, OS.sel_arrayWithObjects_1, arrayWithObjects != null ? arrayWithObjects.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_arrayWithObjects_count_(int objects, int cnt) {
+ int result = OS.objc_msgSend(OS.class_NSArray, OS.sel_arrayWithObjects_1count_1, objects, cnt);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString componentsJoinedByString(NSString separator) {
+ int result = OS.objc_msgSend(this.id, OS.sel_componentsJoinedByString_1, separator != null ? separator.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean containsObject(id anObject) {
+ return OS.objc_msgSend(this.id, OS.sel_containsObject_1, anObject != null ? anObject.id : 0) != 0;
+}
+
+public int count() {
+ return OS.objc_msgSend(this.id, OS.sel_count);
+}
+
+public NSString description() {
+ int result = OS.objc_msgSend(this.id, OS.sel_description);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString descriptionWithLocale_(id locale) {
+ int result = OS.objc_msgSend(this.id, OS.sel_descriptionWithLocale_1, locale != null ? locale.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString descriptionWithLocale_indent_(id locale, int level) {
+ int result = OS.objc_msgSend(this.id, OS.sel_descriptionWithLocale_1indent_1, locale != null ? locale.id : 0, level);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSArray filteredArrayUsingPredicate(NSPredicate predicate) {
+ int result = OS.objc_msgSend(this.id, OS.sel_filteredArrayUsingPredicate_1, predicate != null ? predicate.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSArray(result) : null);
+}
+
+public id firstObjectCommonWithArray(NSArray otherArray) {
+ int result = OS.objc_msgSend(this.id, OS.sel_firstObjectCommonWithArray_1, otherArray != null ? otherArray.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void getObjects_(int objects) {
+ OS.objc_msgSend(this.id, OS.sel_getObjects_1, objects);
+}
+
+public void getObjects_range_(int objects, NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_getObjects_1range_1, objects, range);
+}
+
+public int indexOfObject_(id anObject) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfObject_1, anObject != null ? anObject.id : 0);
+}
+
+public int indexOfObject_inRange_(id anObject, NSRange range) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfObject_1inRange_1, anObject != null ? anObject.id : 0, range);
+}
+
+public int indexOfObjectIdenticalTo_(id anObject) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfObjectIdenticalTo_1, anObject != null ? anObject.id : 0);
+}
+
+public int indexOfObjectIdenticalTo_inRange_(id anObject, NSRange range) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfObjectIdenticalTo_1inRange_1, anObject != null ? anObject.id : 0, range);
+}
+
+public NSArray initWithArray_(NSArray array) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithArray_1, array != null ? array.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSArray initWithArray_copyItems_(NSArray array, boolean flag) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithArray_1copyItems_1, array != null ? array.id : 0, flag);
+ return result != 0 ? this : null;
+}
+
+public NSArray initWithContentsOfFile(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfFile_1, path != null ? path.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSArray initWithContentsOfURL(NSURL url) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1, url != null ? url.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSArray initWithObjects_(id initWithObjects) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithObjects_1, initWithObjects != null ? initWithObjects.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSArray initWithObjects_count_(int objects, int cnt) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithObjects_1count_1, objects, cnt);
+ return result != 0 ? this : null;
+}
+
+public boolean isEqualToArray(NSArray otherArray) {
+ return OS.objc_msgSend(this.id, OS.sel_isEqualToArray_1, otherArray != null ? otherArray.id : 0) != 0;
+}
+
+public id lastObject() {
+ int result = OS.objc_msgSend(this.id, OS.sel_lastObject);
+ return result != 0 ? new id(result) : null;
+}
+
+public void makeObjectsPerformSelector_(int aSelector) {
+ OS.objc_msgSend(this.id, OS.sel_makeObjectsPerformSelector_1, aSelector);
+}
+
+public void makeObjectsPerformSelector_withObject_(int aSelector, id argument) {
+ OS.objc_msgSend(this.id, OS.sel_makeObjectsPerformSelector_1withObject_1, aSelector, argument != null ? argument.id : 0);
+}
+
+public int objectAtIndex(int index) {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectAtIndex_1, index);
+ return result;
+// return result != 0 ? new id(result) : null;
+}
+
+public NSEnumerator objectEnumerator() {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectEnumerator);
+ return result != 0 ? new NSEnumerator(result) : null;
+}
+
+public NSArray objectsAtIndexes(NSIndexSet indexes) {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectsAtIndexes_1, indexes != null ? indexes.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSArray(result) : null);
+}
+
+public NSArray pathsMatchingExtensions(NSArray filterTypes) {
+ int result = OS.objc_msgSend(this.id, OS.sel_pathsMatchingExtensions_1, filterTypes != null ? filterTypes.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSArray(result) : null);
+}
+
+public void removeObserver_forKeyPath_(NSObject observer, NSString keyPath) {
+ OS.objc_msgSend(this.id, OS.sel_removeObserver_1forKeyPath_1, observer != null ? observer.id : 0, keyPath != null ? keyPath.id : 0);
+}
+
+public void removeObserver_fromObjectsAtIndexes_forKeyPath_(NSObject observer, NSIndexSet indexes, NSString keyPath) {
+ OS.objc_msgSend(this.id, OS.sel_removeObserver_1fromObjectsAtIndexes_1forKeyPath_1, observer != null ? observer.id : 0, indexes != null ? indexes.id : 0, keyPath != null ? keyPath.id : 0);
+}
+
+public NSEnumerator reverseObjectEnumerator() {
+ int result = OS.objc_msgSend(this.id, OS.sel_reverseObjectEnumerator);
+ return result != 0 ? new NSEnumerator(result) : null;
+}
+
+public void setValue(id value, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_setValue_1forKey_1, value != null ? value.id : 0, key != null ? key.id : 0);
+}
+
+public NSData sortedArrayHint() {
+ int result = OS.objc_msgSend(this.id, OS.sel_sortedArrayHint);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSArray sortedArrayUsingDescriptors(NSArray sortDescriptors) {
+ int result = OS.objc_msgSend(this.id, OS.sel_sortedArrayUsingDescriptors_1, sortDescriptors != null ? sortDescriptors.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSArray(result) : null);
+}
+
+public NSArray sortedArrayUsingFunction_context_(int comparator, int context) {
+ int result = OS.objc_msgSend(this.id, OS.sel_sortedArrayUsingFunction_1context_1, comparator, context);
+ return result == this.id ? this : (result != 0 ? new NSArray(result) : null);
+}
+
+public NSArray sortedArrayUsingFunction_context_hint_(int comparator, int context, NSData hint) {
+ int result = OS.objc_msgSend(this.id, OS.sel_sortedArrayUsingFunction_1context_1hint_1, comparator, context, hint != null ? hint.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSArray(result) : null);
+}
+
+public NSArray sortedArrayUsingSelector(int comparator) {
+ int result = OS.objc_msgSend(this.id, OS.sel_sortedArrayUsingSelector_1, comparator);
+ return result == this.id ? this : (result != 0 ? new NSArray(result) : null);
+}
+
+public NSArray subarrayWithRange(NSRange range) {
+ int result = OS.objc_msgSend(this.id, OS.sel_subarrayWithRange_1, range);
+ return result == this.id ? this : (result != 0 ? new NSArray(result) : null);
+}
+
+public id valueForKey(NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_valueForKey_1, key != null ? key.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean writeToFile(NSString path, boolean useAuxiliaryFile) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToFile_1atomically_1, path != null ? path.id : 0, useAuxiliaryFile) != 0;
+}
+
+public boolean writeToURL(NSURL url, boolean atomically) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToURL_1atomically_1, url != null ? url.id : 0, atomically) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSArrayController.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSArrayController.java
new file mode 100644
index 0000000000..1335ccd488
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSArrayController.java
@@ -0,0 +1,208 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSArrayController extends NSObjectController {
+
+public NSArrayController() {
+ super();
+}
+
+public NSArrayController(int id) {
+ super(id);
+}
+
+public void add(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_add_1, sender != null ? sender.id : 0);
+}
+
+public void addObject(id object) {
+ OS.objc_msgSend(this.id, OS.sel_addObject_1, object != null ? object.id : 0);
+}
+
+public void addObjects(NSArray objects) {
+ OS.objc_msgSend(this.id, OS.sel_addObjects_1, objects != null ? objects.id : 0);
+}
+
+public boolean addSelectedObjects(NSArray objects) {
+ return OS.objc_msgSend(this.id, OS.sel_addSelectedObjects_1, objects != null ? objects.id : 0) != 0;
+}
+
+public boolean addSelectionIndexes(NSIndexSet indexes) {
+ return OS.objc_msgSend(this.id, OS.sel_addSelectionIndexes_1, indexes != null ? indexes.id : 0) != 0;
+}
+
+public boolean alwaysUsesMultipleValuesMarker() {
+ return OS.objc_msgSend(this.id, OS.sel_alwaysUsesMultipleValuesMarker) != 0;
+}
+
+public NSArray arrangeObjects(NSArray objects) {
+ int result = OS.objc_msgSend(this.id, OS.sel_arrangeObjects_1, objects != null ? objects.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public id arrangedObjects() {
+ int result = OS.objc_msgSend(this.id, OS.sel_arrangedObjects);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSArray automaticRearrangementKeyPaths() {
+ int result = OS.objc_msgSend(this.id, OS.sel_automaticRearrangementKeyPaths);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean automaticallyRearrangesObjects() {
+ return OS.objc_msgSend(this.id, OS.sel_automaticallyRearrangesObjects) != 0;
+}
+
+public boolean avoidsEmptySelection() {
+ return OS.objc_msgSend(this.id, OS.sel_avoidsEmptySelection) != 0;
+}
+
+public boolean canInsert() {
+ return OS.objc_msgSend(this.id, OS.sel_canInsert) != 0;
+}
+
+public boolean canSelectNext() {
+ return OS.objc_msgSend(this.id, OS.sel_canSelectNext) != 0;
+}
+
+public boolean canSelectPrevious() {
+ return OS.objc_msgSend(this.id, OS.sel_canSelectPrevious) != 0;
+}
+
+public boolean clearsFilterPredicateOnInsertion() {
+ return OS.objc_msgSend(this.id, OS.sel_clearsFilterPredicateOnInsertion) != 0;
+}
+
+public void didChangeArrangementCriteria() {
+ OS.objc_msgSend(this.id, OS.sel_didChangeArrangementCriteria);
+}
+
+public NSPredicate filterPredicate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_filterPredicate);
+ return result != 0 ? new NSPredicate(result) : null;
+}
+
+public void insert(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_insert_1, sender != null ? sender.id : 0);
+}
+
+public void insertObject(id object, int index) {
+ OS.objc_msgSend(this.id, OS.sel_insertObject_1atArrangedObjectIndex_1, object != null ? object.id : 0, index);
+}
+
+public void insertObjects(NSArray objects, NSIndexSet indexes) {
+ OS.objc_msgSend(this.id, OS.sel_insertObjects_1atArrangedObjectIndexes_1, objects != null ? objects.id : 0, indexes != null ? indexes.id : 0);
+}
+
+public boolean preservesSelection() {
+ return OS.objc_msgSend(this.id, OS.sel_preservesSelection) != 0;
+}
+
+public void rearrangeObjects() {
+ OS.objc_msgSend(this.id, OS.sel_rearrangeObjects);
+}
+
+public void remove(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_remove_1, sender != null ? sender.id : 0);
+}
+
+public void removeObject(id object) {
+ OS.objc_msgSend(this.id, OS.sel_removeObject_1, object != null ? object.id : 0);
+}
+
+public void removeObjectAtArrangedObjectIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_removeObjectAtArrangedObjectIndex_1, index);
+}
+
+public void removeObjects(NSArray objects) {
+ OS.objc_msgSend(this.id, OS.sel_removeObjects_1, objects != null ? objects.id : 0);
+}
+
+public void removeObjectsAtArrangedObjectIndexes(NSIndexSet indexes) {
+ OS.objc_msgSend(this.id, OS.sel_removeObjectsAtArrangedObjectIndexes_1, indexes != null ? indexes.id : 0);
+}
+
+public boolean removeSelectedObjects(NSArray objects) {
+ return OS.objc_msgSend(this.id, OS.sel_removeSelectedObjects_1, objects != null ? objects.id : 0) != 0;
+}
+
+public boolean removeSelectionIndexes(NSIndexSet indexes) {
+ return OS.objc_msgSend(this.id, OS.sel_removeSelectionIndexes_1, indexes != null ? indexes.id : 0) != 0;
+}
+
+public void selectNext(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectNext_1, sender != null ? sender.id : 0);
+}
+
+public void selectPrevious(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectPrevious_1, sender != null ? sender.id : 0);
+}
+
+public NSArray selectedObjects() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedObjects);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public int selectionIndex() {
+ return OS.objc_msgSend(this.id, OS.sel_selectionIndex);
+}
+
+public NSIndexSet selectionIndexes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectionIndexes);
+ return result != 0 ? new NSIndexSet(result) : null;
+}
+
+public boolean selectsInsertedObjects() {
+ return OS.objc_msgSend(this.id, OS.sel_selectsInsertedObjects) != 0;
+}
+
+public void setAlwaysUsesMultipleValuesMarker(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAlwaysUsesMultipleValuesMarker_1, flag);
+}
+
+public void setAutomaticallyRearrangesObjects(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAutomaticallyRearrangesObjects_1, flag);
+}
+
+public void setAvoidsEmptySelection(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAvoidsEmptySelection_1, flag);
+}
+
+public void setClearsFilterPredicateOnInsertion(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setClearsFilterPredicateOnInsertion_1, flag);
+}
+
+public void setFilterPredicate(NSPredicate filterPredicate) {
+ OS.objc_msgSend(this.id, OS.sel_setFilterPredicate_1, filterPredicate != null ? filterPredicate.id : 0);
+}
+
+public void setPreservesSelection(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setPreservesSelection_1, flag);
+}
+
+public boolean setSelectedObjects(NSArray objects) {
+ return OS.objc_msgSend(this.id, OS.sel_setSelectedObjects_1, objects != null ? objects.id : 0) != 0;
+}
+
+public boolean setSelectionIndex(int index) {
+ return OS.objc_msgSend(this.id, OS.sel_setSelectionIndex_1, index) != 0;
+}
+
+public boolean setSelectionIndexes(NSIndexSet indexes) {
+ return OS.objc_msgSend(this.id, OS.sel_setSelectionIndexes_1, indexes != null ? indexes.id : 0) != 0;
+}
+
+public void setSelectsInsertedObjects(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectsInsertedObjects_1, flag);
+}
+
+public void setSortDescriptors(NSArray sortDescriptors) {
+ OS.objc_msgSend(this.id, OS.sel_setSortDescriptors_1, sortDescriptors != null ? sortDescriptors.id : 0);
+}
+
+public NSArray sortDescriptors() {
+ int result = OS.objc_msgSend(this.id, OS.sel_sortDescriptors);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAssertionHandler.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAssertionHandler.java
new file mode 100644
index 0000000000..a36af541f1
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAssertionHandler.java
@@ -0,0 +1,26 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSAssertionHandler extends NSObject {
+
+public NSAssertionHandler() {
+ super();
+}
+
+public NSAssertionHandler(int id) {
+ super(id);
+}
+
+public static NSAssertionHandler currentHandler() {
+ int result = OS.objc_msgSend(OS.class_NSAssertionHandler, OS.sel_currentHandler);
+ return result != 0 ? new NSAssertionHandler(result) : null;
+}
+
+public void handleFailureInFunction(NSString functionName, NSString fileName, int line, NSString description) {
+ OS.objc_msgSend(this.id, OS.sel_handleFailureInFunction_1file_1lineNumber_1description_1, functionName != null ? functionName.id : 0, fileName != null ? fileName.id : 0, line, description != null ? description.id : 0);
+}
+
+public void handleFailureInMethod(int selector, id object, NSString fileName, int line, NSString description) {
+ OS.objc_msgSend(this.id, OS.sel_handleFailureInMethod_1object_1file_1lineNumber_1description_1, selector, object != null ? object.id : 0, fileName != null ? fileName.id : 0, line, description != null ? description.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAttributedString.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAttributedString.java
new file mode 100644
index 0000000000..018b03e179
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAttributedString.java
@@ -0,0 +1,95 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSAttributedString extends NSObject {
+
+public NSAttributedString() {
+ super();
+}
+
+public NSAttributedString(int id) {
+ super(id);
+}
+
+public id attribute_atIndex_effectiveRange_(NSString attrName, int location, int range) {
+ int result = OS.objc_msgSend(this.id, OS.sel_attribute_1atIndex_1effectiveRange_1, attrName != null ? attrName.id : 0, location, range);
+ return result != 0 ? new id(result) : null;
+}
+
+public id attribute_atIndex_longestEffectiveRange_inRange_(NSString attrName, int location, int range, NSRange rangeLimit) {
+ int result = OS.objc_msgSend(this.id, OS.sel_attribute_1atIndex_1longestEffectiveRange_1inRange_1, attrName != null ? attrName.id : 0, location, range, rangeLimit);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSAttributedString attributedSubstringFromRange(NSRange range) {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributedSubstringFromRange_1, range);
+ return result == this.id ? this : (result != 0 ? new NSAttributedString(result) : null);
+}
+
+public NSDictionary attributesAtIndex_effectiveRange_(int location, int range) {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributesAtIndex_1effectiveRange_1, location, range);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSDictionary attributesAtIndex_longestEffectiveRange_inRange_(int location, int range, NSRange rangeLimit) {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributesAtIndex_1longestEffectiveRange_1inRange_1, location, range, rangeLimit);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSAttributedString initWithAttributedString(NSAttributedString attrStr) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithAttributedString_1, attrStr != null ? attrStr.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSAttributedString initWithString_(NSString str) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithString_1, str != null ? str.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSAttributedString initWithString_attributes_(NSString str, NSDictionary attrs) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithString_1attributes_1, str != null ? str.id : 0, attrs != null ? attrs.id : 0);
+ return result != 0 ? this : null;
+}
+
+public boolean isEqualToAttributedString(NSAttributedString other) {
+ return OS.objc_msgSend(this.id, OS.sel_isEqualToAttributedString_1, other != null ? other.id : 0) != 0;
+}
+
+public int length() {
+ return OS.objc_msgSend(this.id, OS.sel_length);
+}
+
+public NSString string() {
+ int result = OS.objc_msgSend(this.id, OS.sel_string);
+ return result != 0 ? new NSString(result) : null;
+}
+
+
+public NSSize size() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_struct(result, this.id, OS.sel_size);
+ return result;
+}
+
+public void drawAtPoint(NSPoint pt) {
+ OS.objc_msgSend(id, OS.sel_drawAtPoint_, pt);
+}
+
+public void drawInRect(NSRect rect) {
+ OS.objc_msgSend(id, OS.sel_drawInRect_1, rect);
+}
+
+public void drawInRect(NSRect rect, int options) {
+ OS.objc_msgSend(id, OS.sel_drawInRect_1, rect, options);
+}
+
+public int nextWordFromIndex(int index, boolean forward) {
+ return OS.objc_msgSend(id, OS.sel_nextWordFromIndex_1forward_1, index, forward);
+}
+
+public NSRange doubleClickAtIndex(int index) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_struct(result, id, OS.sel_doubleClickAtIndex_1, index);
+ return result;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAutoreleasePool.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAutoreleasePool.java
new file mode 100644
index 0000000000..c02217efa7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSAutoreleasePool.java
@@ -0,0 +1,69 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSAutoreleasePool extends NSObject {
+
+public NSAutoreleasePool() {
+ super();
+}
+
+public NSAutoreleasePool(int id) {
+ super(id);
+}
+
+public static void static_addObject_(id anObject) {
+ OS.objc_msgSend(OS.class_NSAutoreleasePool, OS.sel_addObject_1, anObject != null ? anObject.id : 0);
+}
+
+public void addObject_(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_addObject_1, anObject != null ? anObject.id : 0);
+}
+
+public static int autoreleasedObjectCount() {
+ return OS.objc_msgSend(OS.class_NSAutoreleasePool, OS.sel_autoreleasedObjectCount);
+}
+
+public void drain() {
+ OS.objc_msgSend(this.id, OS.sel_drain);
+}
+
+public static void enableFreedObjectCheck(boolean enable) {
+ OS.objc_msgSend(OS.class_NSAutoreleasePool, OS.sel_enableFreedObjectCheck_1, enable);
+}
+
+public static void enableRelease(boolean enable) {
+ OS.objc_msgSend(OS.class_NSAutoreleasePool, OS.sel_enableRelease_1, enable);
+}
+
+public static int poolCountHighWaterMark() {
+ return OS.objc_msgSend(OS.class_NSAutoreleasePool, OS.sel_poolCountHighWaterMark);
+}
+
+public static int poolCountHighWaterResolution() {
+ return OS.objc_msgSend(OS.class_NSAutoreleasePool, OS.sel_poolCountHighWaterResolution);
+}
+
+public static void resetTotalAutoreleasedObjects() {
+ OS.objc_msgSend(OS.class_NSAutoreleasePool, OS.sel_resetTotalAutoreleasedObjects);
+}
+
+public static void setPoolCountHighWaterMark(int count) {
+ OS.objc_msgSend(OS.class_NSAutoreleasePool, OS.sel_setPoolCountHighWaterMark_1, count);
+}
+
+public static void setPoolCountHighWaterResolution(int res) {
+ OS.objc_msgSend(OS.class_NSAutoreleasePool, OS.sel_setPoolCountHighWaterResolution_1, res);
+}
+
+public static void showPools() {
+ OS.objc_msgSend(OS.class_NSAutoreleasePool, OS.sel_showPools);
+}
+
+public static int topAutoreleasePoolCount() {
+ return OS.objc_msgSend(OS.class_NSAutoreleasePool, OS.sel_topAutoreleasePoolCount);
+}
+
+public static int totalAutoreleasedObjects() {
+ return OS.objc_msgSend(OS.class_NSAutoreleasePool, OS.sel_totalAutoreleasedObjects);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBezierPath.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBezierPath.java
new file mode 100644
index 0000000000..5fd4739c31
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBezierPath.java
@@ -0,0 +1,313 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSBezierPath extends NSObject {
+
+public NSBezierPath() {
+ super();
+}
+
+public NSBezierPath(int id) {
+ super(id);
+}
+
+public void addClip() {
+ OS.objc_msgSend(this.id, OS.sel_addClip);
+}
+
+public void appendBezierPath(NSBezierPath path) {
+ OS.objc_msgSend(this.id, OS.sel_appendBezierPath_1, path != null ? path.id : 0);
+}
+
+public void appendBezierPathWithArcFromPoint(NSPoint point1, NSPoint point2, float radius) {
+ OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithArcFromPoint_1toPoint_1radius_1, point1, point2, radius);
+}
+
+public void appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_(NSPoint center, float radius, float startAngle, float endAngle) {
+ OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithArcWithCenter_1radius_1startAngle_1endAngle_1, center, radius, startAngle, endAngle);
+}
+
+public void appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_clockwise_(NSPoint center, float radius, float startAngle, float endAngle, boolean clockwise) {
+ OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithArcWithCenter_1radius_1startAngle_1endAngle_1clockwise_1, center, radius, startAngle, endAngle, clockwise);
+}
+
+public void appendBezierPathWithGlyph(int glyph, NSFont font) {
+ OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithGlyph_1inFont_1, glyph, font != null ? font.id : 0);
+}
+
+public void appendBezierPathWithGlyphs(int glyphs, int count, NSFont font) {
+ OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithGlyphs_1count_1inFont_1, glyphs, count, font != null ? font.id : 0);
+}
+
+public void appendBezierPathWithOvalInRect(NSRect rect) {
+ OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithOvalInRect_1, rect);
+}
+
+public void appendBezierPathWithPackedGlyphs(int packedGlyphs) {
+ OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithPackedGlyphs_1, packedGlyphs);
+}
+
+public void appendBezierPathWithPoints(int points, int count) {
+ OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithPoints_1count_1, points, count);
+}
+
+public void appendBezierPathWithRect(NSRect rect) {
+ OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithRect_1, rect);
+}
+
+public void appendBezierPathWithRoundedRect(NSRect rect, float xRadius, float yRadius) {
+ OS.objc_msgSend(this.id, OS.sel_appendBezierPathWithRoundedRect_1xRadius_1yRadius_1, rect, xRadius, yRadius);
+}
+
+public static NSBezierPath bezierPath() {
+ int result = OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_bezierPath);
+ return result != 0 ? new NSBezierPath(result) : null;
+}
+
+public NSBezierPath bezierPathByFlatteningPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_bezierPathByFlatteningPath);
+ return result == this.id ? this : (result != 0 ? new NSBezierPath(result) : null);
+}
+
+public NSBezierPath bezierPathByReversingPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_bezierPathByReversingPath);
+ return result == this.id ? this : (result != 0 ? new NSBezierPath(result) : null);
+}
+
+public static NSBezierPath bezierPathWithOvalInRect(NSRect rect) {
+ int result = OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_bezierPathWithOvalInRect_1, rect);
+ return result != 0 ? new NSBezierPath(result) : null;
+}
+
+public static NSBezierPath bezierPathWithRect(NSRect rect) {
+ int result = OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_bezierPathWithRect_1, rect);
+ return result != 0 ? new NSBezierPath(result) : null;
+}
+
+public static NSBezierPath bezierPathWithRoundedRect(NSRect rect, float xRadius, float yRadius) {
+ int result = OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_bezierPathWithRoundedRect_1xRadius_1yRadius_1, rect, xRadius, yRadius);
+ return result != 0 ? new NSBezierPath(result) : null;
+}
+
+public NSRect bounds() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_bounds);
+ return result;
+}
+
+public boolean cachesBezierPath() {
+ return OS.objc_msgSend(this.id, OS.sel_cachesBezierPath) != 0;
+}
+
+public static void clipRect(NSRect rect) {
+ OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_clipRect_1, rect);
+}
+
+public void closePath() {
+ OS.objc_msgSend(this.id, OS.sel_closePath);
+}
+
+public boolean containsPoint(NSPoint point) {
+ return OS.objc_msgSend(this.id, OS.sel_containsPoint_1, point) != 0;
+}
+
+public NSRect controlPointBounds() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_controlPointBounds);
+ return result;
+}
+
+public NSPoint currentPoint() {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_currentPoint);
+ return result;
+}
+
+public void curveToPoint(NSPoint endPoint, NSPoint controlPoint1, NSPoint controlPoint2) {
+ OS.objc_msgSend(this.id, OS.sel_curveToPoint_1controlPoint1_1controlPoint2_1, endPoint, controlPoint1, controlPoint2);
+}
+
+public static float defaultFlatness() {
+ return (float)OS.objc_msgSend_fpret(OS.class_NSBezierPath, OS.sel_defaultFlatness);
+}
+
+public static int defaultLineCapStyle() {
+ return OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_defaultLineCapStyle);
+}
+
+public static int defaultLineJoinStyle() {
+ return OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_defaultLineJoinStyle);
+}
+
+public static float defaultLineWidth() {
+ return (float)OS.objc_msgSend_fpret(OS.class_NSBezierPath, OS.sel_defaultLineWidth);
+}
+
+public static float defaultMiterLimit() {
+ return (float)OS.objc_msgSend_fpret(OS.class_NSBezierPath, OS.sel_defaultMiterLimit);
+}
+
+public static int defaultWindingRule() {
+ return OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_defaultWindingRule);
+}
+
+public static void drawPackedGlyphs(int packedGlyphs, NSPoint point) {
+ OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_drawPackedGlyphs_1atPoint_1, packedGlyphs, point);
+}
+
+public int elementAtIndex_(int index) {
+ return OS.objc_msgSend(this.id, OS.sel_elementAtIndex_1, index);
+}
+
+public int elementAtIndex_associatedPoints_(int index, int points) {
+ return OS.objc_msgSend(this.id, OS.sel_elementAtIndex_1associatedPoints_1, index, points);
+}
+
+public int elementCount() {
+ return OS.objc_msgSend(this.id, OS.sel_elementCount);
+}
+
+public void fill() {
+ OS.objc_msgSend(this.id, OS.sel_fill);
+}
+
+public static void fillRect(NSRect rect) {
+ OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_fillRect_1, rect);
+}
+
+public float flatness() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_flatness);
+}
+
+public void getLineDash(int pattern, int count, int phase) {
+ OS.objc_msgSend(this.id, OS.sel_getLineDash_1count_1phase_1, pattern, count, phase);
+}
+
+public boolean isEmpty() {
+ return OS.objc_msgSend(this.id, OS.sel_isEmpty) != 0;
+}
+
+public int lineCapStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_lineCapStyle);
+}
+
+public int lineJoinStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_lineJoinStyle);
+}
+
+public void lineToPoint(NSPoint point) {
+ OS.objc_msgSend(this.id, OS.sel_lineToPoint_1, point);
+}
+
+public float lineWidth() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_lineWidth);
+}
+
+public float miterLimit() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_miterLimit);
+}
+
+public void moveToPoint(NSPoint point) {
+ OS.objc_msgSend(this.id, OS.sel_moveToPoint_1, point);
+}
+
+public void relativeCurveToPoint(NSPoint endPoint, NSPoint controlPoint1, NSPoint controlPoint2) {
+ OS.objc_msgSend(this.id, OS.sel_relativeCurveToPoint_1controlPoint1_1controlPoint2_1, endPoint, controlPoint1, controlPoint2);
+}
+
+public void relativeLineToPoint(NSPoint point) {
+ OS.objc_msgSend(this.id, OS.sel_relativeLineToPoint_1, point);
+}
+
+public void relativeMoveToPoint(NSPoint point) {
+ OS.objc_msgSend(this.id, OS.sel_relativeMoveToPoint_1, point);
+}
+
+public void removeAllPoints() {
+ OS.objc_msgSend(this.id, OS.sel_removeAllPoints);
+}
+
+public void setAssociatedPoints(int points, int index) {
+ OS.objc_msgSend(this.id, OS.sel_setAssociatedPoints_1atIndex_1, points, index);
+}
+
+public void setCachesBezierPath(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setCachesBezierPath_1, flag);
+}
+
+public void setClip() {
+ OS.objc_msgSend(this.id, OS.sel_setClip);
+}
+
+public static void setDefaultFlatness(float flatness) {
+ OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_setDefaultFlatness_1, flatness);
+}
+
+public static void setDefaultLineCapStyle(int lineCapStyle) {
+ OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_setDefaultLineCapStyle_1, lineCapStyle);
+}
+
+public static void setDefaultLineJoinStyle(int lineJoinStyle) {
+ OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_setDefaultLineJoinStyle_1, lineJoinStyle);
+}
+
+public static void setDefaultLineWidth(float lineWidth) {
+ OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_setDefaultLineWidth_1, lineWidth);
+}
+
+public static void setDefaultMiterLimit(float limit) {
+ OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_setDefaultMiterLimit_1, limit);
+}
+
+public static void setDefaultWindingRule(int windingRule) {
+ OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_setDefaultWindingRule_1, windingRule);
+}
+
+public void setFlatness(float flatness) {
+ OS.objc_msgSend(this.id, OS.sel_setFlatness_1, flatness);
+}
+
+public void setLineCapStyle(int lineCapStyle) {
+ OS.objc_msgSend(this.id, OS.sel_setLineCapStyle_1, lineCapStyle);
+}
+
+public void setLineDash(float[] pattern, int count, float phase) {
+ OS.objc_msgSend(this.id, OS.sel_setLineDash_1count_1phase_1, pattern, count, phase);
+}
+
+public void setLineJoinStyle(int lineJoinStyle) {
+ OS.objc_msgSend(this.id, OS.sel_setLineJoinStyle_1, lineJoinStyle);
+}
+
+public void setLineWidth(float lineWidth) {
+ OS.objc_msgSend(this.id, OS.sel_setLineWidth_1, lineWidth);
+}
+
+public void setMiterLimit(float miterLimit) {
+ OS.objc_msgSend(this.id, OS.sel_setMiterLimit_1, miterLimit);
+}
+
+public void setWindingRule(int windingRule) {
+ OS.objc_msgSend(this.id, OS.sel_setWindingRule_1, windingRule);
+}
+
+public void stroke() {
+ OS.objc_msgSend(this.id, OS.sel_stroke);
+}
+
+public static void strokeLineFromPoint(NSPoint point1, NSPoint point2) {
+ OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_strokeLineFromPoint_1toPoint_1, point1, point2);
+}
+
+public static void strokeRect(NSRect rect) {
+ OS.objc_msgSend(OS.class_NSBezierPath, OS.sel_strokeRect_1, rect);
+}
+
+public void transformUsingAffineTransform(NSAffineTransform transform) {
+ OS.objc_msgSend(this.id, OS.sel_transformUsingAffineTransform_1, transform != null ? transform.id : 0);
+}
+
+public int windingRule() {
+ return OS.objc_msgSend(this.id, OS.sel_windingRule);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBitmapImageRep.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBitmapImageRep.java
new file mode 100644
index 0000000000..c9dcbbd854
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBitmapImageRep.java
@@ -0,0 +1,183 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSBitmapImageRep extends NSImageRep {
+
+public NSBitmapImageRep() {
+ super();
+}
+
+public NSBitmapImageRep(int id) {
+ super(id);
+}
+
+public int CGImage() {
+ return OS.objc_msgSend(this.id, OS.sel_CGImage);
+}
+
+public NSData TIFFRepresentation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_TIFFRepresentation);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public static NSData static_TIFFRepresentationOfImageRepsInArray_(NSArray array) {
+ int result = OS.objc_msgSend(OS.class_NSBitmapImageRep, OS.sel_TIFFRepresentationOfImageRepsInArray_1, array != null ? array.id : 0);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public static NSData static_TIFFRepresentationOfImageRepsInArray_usingCompression_factor_(NSArray array, int comp, float factor) {
+ int result = OS.objc_msgSend(OS.class_NSBitmapImageRep, OS.sel_TIFFRepresentationOfImageRepsInArray_1usingCompression_1factor_1, array != null ? array.id : 0, comp, factor);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSData TIFFRepresentationUsingCompression(int comp, float factor) {
+ int result = OS.objc_msgSend(this.id, OS.sel_TIFFRepresentationUsingCompression_1factor_1, comp, factor);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public int bitmapData() {
+ return OS.objc_msgSend(this.id, OS.sel_bitmapData);
+}
+
+public int bitmapFormat() {
+ return OS.objc_msgSend(this.id, OS.sel_bitmapFormat);
+}
+
+public int bitsPerPixel() {
+ return OS.objc_msgSend(this.id, OS.sel_bitsPerPixel);
+}
+
+public int bytesPerPlane() {
+ return OS.objc_msgSend(this.id, OS.sel_bytesPerPlane);
+}
+
+public int bytesPerRow() {
+ return OS.objc_msgSend(this.id, OS.sel_bytesPerRow);
+}
+
+public boolean canBeCompressedUsing(int compression) {
+ return OS.objc_msgSend(this.id, OS.sel_canBeCompressedUsing_1, compression) != 0;
+}
+
+public NSColor colorAtX(int x, int y) {
+ int result = OS.objc_msgSend(this.id, OS.sel_colorAtX_1y_1, x, y);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public void colorizeByMappingGray(float midPoint, NSColor midPointColor, NSColor shadowColor, NSColor lightColor) {
+ OS.objc_msgSend(this.id, OS.sel_colorizeByMappingGray_1toColor_1blackMapping_1whiteMapping_1, midPoint, midPointColor != null ? midPointColor.id : 0, shadowColor != null ? shadowColor.id : 0, lightColor != null ? lightColor.id : 0);
+}
+
+public void getBitmapDataPlanes(int data) {
+ OS.objc_msgSend(this.id, OS.sel_getBitmapDataPlanes_1, data);
+}
+
+public void getCompression(int compression, int factor) {
+ OS.objc_msgSend(this.id, OS.sel_getCompression_1factor_1, compression, factor);
+}
+
+public void getPixel(int p, int x, int y) {
+ OS.objc_msgSend(this.id, OS.sel_getPixel_1atX_1y_1, p, x, y);
+}
+
+public static void getTIFFCompressionTypes(int list, int numTypes) {
+ OS.objc_msgSend(OS.class_NSBitmapImageRep, OS.sel_getTIFFCompressionTypes_1count_1, list, numTypes);
+}
+
+public static id imageRepWithData(NSData data) {
+ int result = OS.objc_msgSend(OS.class_NSBitmapImageRep, OS.sel_imageRepWithData_1, data != null ? data.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static NSArray imageRepsWithData(NSData data) {
+ int result = OS.objc_msgSend(OS.class_NSBitmapImageRep, OS.sel_imageRepsWithData_1, data != null ? data.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public int incrementalLoadFromData(NSData data, boolean complete) {
+ return OS.objc_msgSend(this.id, OS.sel_incrementalLoadFromData_1complete_1, data != null ? data.id : 0, complete);
+}
+
+public NSBitmapImageRep initForIncrementalLoad() {
+ int result = OS.objc_msgSend(this.id, OS.sel_initForIncrementalLoad);
+ return result != 0 ? this : null;
+}
+
+public NSBitmapImageRep initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bitmapFormat_bytesPerRow_bitsPerPixel_(int planes, int width, int height, int bps, int spp, boolean alpha, boolean isPlanar, NSString colorSpaceName, int bitmapFormat, int rBytes, int pBits) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithBitmapDataPlanes_1pixelsWide_1pixelsHigh_1bitsPerSample_1samplesPerPixel_1hasAlpha_1isPlanar_1colorSpaceName_1bitmapFormat_1bytesPerRow_1bitsPerPixel_1, planes, width, height, bps, spp, alpha, isPlanar, colorSpaceName != null ? colorSpaceName.id : 0, bitmapFormat, rBytes, pBits);
+ return result != 0 ? this : null;
+}
+
+public NSBitmapImageRep initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bytesPerRow_bitsPerPixel_(int planes, int width, int height, int bps, int spp, boolean alpha, boolean isPlanar, NSString colorSpaceName, int rBytes, int pBits) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithBitmapDataPlanes_1pixelsWide_1pixelsHigh_1bitsPerSample_1samplesPerPixel_1hasAlpha_1isPlanar_1colorSpaceName_1bytesPerRow_1bitsPerPixel_1, planes, width, height, bps, spp, alpha, isPlanar, colorSpaceName != null ? colorSpaceName.id : 0, rBytes, pBits);
+ return result != 0 ? this : null;
+}
+
+public NSBitmapImageRep initWithCGImage(int cgImage) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCGImage_1, cgImage);
+ return result != 0 ? this : null;
+}
+
+public NSBitmapImageRep initWithCIImage(CIImage ciImage) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCIImage_1, ciImage != null ? ciImage.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSBitmapImageRep initWithData(NSData data) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithData_1, data != null ? data.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSBitmapImageRep initWithFocusedViewRect(NSRect rect) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFocusedViewRect_1, rect);
+ return result != 0 ? this : null;
+}
+
+public boolean isPlanar() {
+ return OS.objc_msgSend(this.id, OS.sel_isPlanar) != 0;
+}
+
+public static NSString localizedNameForTIFFCompressionType(int compression) {
+ int result = OS.objc_msgSend(OS.class_NSBitmapImageRep, OS.sel_localizedNameForTIFFCompressionType_1, compression);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int numberOfPlanes() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfPlanes);
+}
+
+public static NSData representationOfImageRepsInArray(NSArray imageReps, int storageType, NSDictionary properties) {
+ int result = OS.objc_msgSend(OS.class_NSBitmapImageRep, OS.sel_representationOfImageRepsInArray_1usingType_1properties_1, imageReps != null ? imageReps.id : 0, storageType, properties != null ? properties.id : 0);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSData representationUsingType(int storageType, NSDictionary properties) {
+ int result = OS.objc_msgSend(this.id, OS.sel_representationUsingType_1properties_1, storageType, properties != null ? properties.id : 0);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public int samplesPerPixel() {
+ return OS.objc_msgSend(this.id, OS.sel_samplesPerPixel);
+}
+
+public void setColor(NSColor color, int x, int y) {
+ OS.objc_msgSend(this.id, OS.sel_setColor_1atX_1y_1, color != null ? color.id : 0, x, y);
+}
+
+public void setCompression(int compression, float factor) {
+ OS.objc_msgSend(this.id, OS.sel_setCompression_1factor_1, compression, factor);
+}
+
+public void setPixel(int p, int x, int y) {
+ OS.objc_msgSend(this.id, OS.sel_setPixel_1atX_1y_1, p, x, y);
+}
+
+public void setProperty(NSString property, id value) {
+ OS.objc_msgSend(this.id, OS.sel_setProperty_1withValue_1, property != null ? property.id : 0, value != null ? value.id : 0);
+}
+
+public id valueForProperty(NSString property) {
+ int result = OS.objc_msgSend(this.id, OS.sel_valueForProperty_1, property != null ? property.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBox.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBox.java
new file mode 100644
index 0000000000..3e1876a066
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBox.java
@@ -0,0 +1,145 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSBox extends NSView {
+
+public NSBox() {
+ super();
+}
+
+public NSBox(int id) {
+ super(id);
+}
+
+public NSColor borderColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_borderColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public NSRect borderRect() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_borderRect);
+ return result;
+}
+
+public int borderType() {
+ return OS.objc_msgSend(this.id, OS.sel_borderType);
+}
+
+public float borderWidth() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_borderWidth);
+}
+
+public int boxType() {
+ return OS.objc_msgSend(this.id, OS.sel_boxType);
+}
+
+public NSView contentView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_contentView);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public NSSize contentViewMargins() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_contentViewMargins);
+ return result;
+}
+
+public float cornerRadius() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_cornerRadius);
+}
+
+public NSColor fillColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fillColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public boolean isTransparent() {
+ return OS.objc_msgSend(this.id, OS.sel_isTransparent) != 0;
+}
+
+public void setBorderColor(NSColor borderColor) {
+ OS.objc_msgSend(this.id, OS.sel_setBorderColor_1, borderColor != null ? borderColor.id : 0);
+}
+
+public void setBorderType(int aType) {
+ OS.objc_msgSend(this.id, OS.sel_setBorderType_1, aType);
+}
+
+public void setBorderWidth(float borderWidth) {
+ OS.objc_msgSend(this.id, OS.sel_setBorderWidth_1, borderWidth);
+}
+
+public void setBoxType(int boxType) {
+ OS.objc_msgSend(this.id, OS.sel_setBoxType_1, boxType);
+}
+
+public void setContentView(NSView aView) {
+ OS.objc_msgSend(this.id, OS.sel_setContentView_1, aView != null ? aView.id : 0);
+}
+
+public void setContentViewMargins(NSSize offsetSize) {
+ OS.objc_msgSend(this.id, OS.sel_setContentViewMargins_1, offsetSize);
+}
+
+public void setCornerRadius(float cornerRadius) {
+ OS.objc_msgSend(this.id, OS.sel_setCornerRadius_1, cornerRadius);
+}
+
+public void setFillColor(NSColor fillColor) {
+ OS.objc_msgSend(this.id, OS.sel_setFillColor_1, fillColor != null ? fillColor.id : 0);
+}
+
+public void setFrameFromContentFrame(NSRect contentFrame) {
+ OS.objc_msgSend(this.id, OS.sel_setFrameFromContentFrame_1, contentFrame);
+}
+
+public void setTitle(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString != null ? aString.id : 0);
+}
+
+public void setTitleFont(NSFont fontObj) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleFont_1, fontObj != null ? fontObj.id : 0);
+}
+
+public void setTitlePosition(int aPosition) {
+ OS.objc_msgSend(this.id, OS.sel_setTitlePosition_1, aPosition);
+}
+
+public void setTitleWithMnemonic(NSString stringWithAmpersand) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleWithMnemonic_1, stringWithAmpersand != null ? stringWithAmpersand.id : 0);
+}
+
+public void setTransparent(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setTransparent_1, flag);
+}
+
+public void sizeToFit() {
+ OS.objc_msgSend(this.id, OS.sel_sizeToFit);
+}
+
+public NSString title() {
+ int result = OS.objc_msgSend(this.id, OS.sel_title);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id titleCell() {
+ int result = OS.objc_msgSend(this.id, OS.sel_titleCell);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSFont titleFont() {
+ int result = OS.objc_msgSend(this.id, OS.sel_titleFont);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public int titlePosition() {
+ return OS.objc_msgSend(this.id, OS.sel_titlePosition);
+}
+
+public NSRect titleRect() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_titleRect);
+ return result;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBrowser.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBrowser.java
new file mode 100644
index 0000000000..4f035666fe
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBrowser.java
@@ -0,0 +1,422 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSBrowser extends NSControl {
+
+public NSBrowser() {
+ super();
+}
+
+public NSBrowser(int id) {
+ super(id);
+}
+
+public boolean acceptsArrowKeys() {
+ return OS.objc_msgSend(this.id, OS.sel_acceptsArrowKeys) != 0;
+}
+
+public void addColumn() {
+ OS.objc_msgSend(this.id, OS.sel_addColumn);
+}
+
+public boolean allowsBranchSelection() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsBranchSelection) != 0;
+}
+
+public boolean allowsEmptySelection() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsEmptySelection) != 0;
+}
+
+public boolean allowsMultipleSelection() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsMultipleSelection) != 0;
+}
+
+public boolean allowsTypeSelect() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsTypeSelect) != 0;
+}
+
+public NSColor backgroundColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public boolean canDragRowsWithIndexes(NSIndexSet rowIndexes, int column, NSEvent event) {
+ return OS.objc_msgSend(this.id, OS.sel_canDragRowsWithIndexes_1inColumn_1withEvent_1, rowIndexes != null ? rowIndexes.id : 0, column, event != null ? event.id : 0) != 0;
+}
+
+public static int cellClass() {
+ return OS.objc_msgSend(OS.class_NSBrowser, OS.sel_cellClass);
+}
+
+public id cellPrototype() {
+ int result = OS.objc_msgSend(this.id, OS.sel_cellPrototype);
+ return result != 0 ? new id(result) : null;
+}
+
+public float columnContentWidthForColumnWidth(float columnWidth) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_columnContentWidthForColumnWidth_1, columnWidth);
+}
+
+public int columnOfMatrix(NSMatrix matrix) {
+ return OS.objc_msgSend(this.id, OS.sel_columnOfMatrix_1, matrix != null ? matrix.id : 0);
+}
+
+public int columnResizingType() {
+ return OS.objc_msgSend(this.id, OS.sel_columnResizingType);
+}
+
+public float columnWidthForColumnContentWidth(float columnContentWidth) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_columnWidthForColumnContentWidth_1, columnContentWidth);
+}
+
+public NSString columnsAutosaveName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_columnsAutosaveName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public void displayAllColumns() {
+ OS.objc_msgSend(this.id, OS.sel_displayAllColumns);
+}
+
+public void displayColumn(int column) {
+ OS.objc_msgSend(this.id, OS.sel_displayColumn_1, column);
+}
+
+public void doClick(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_doClick_1, sender != null ? sender.id : 0);
+}
+
+public void doDoubleClick(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_doDoubleClick_1, sender != null ? sender.id : 0);
+}
+
+public int doubleAction() {
+ return OS.objc_msgSend(this.id, OS.sel_doubleAction);
+}
+
+public NSImage draggingImageForRowsWithIndexes(NSIndexSet rowIndexes, int column, NSEvent event, int dragImageOffset) {
+ int result = OS.objc_msgSend(this.id, OS.sel_draggingImageForRowsWithIndexes_1inColumn_1withEvent_1offset_1, rowIndexes != null ? rowIndexes.id : 0, column, event != null ? event.id : 0, dragImageOffset);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public void drawTitleOfColumn(int column, NSRect aRect) {
+ OS.objc_msgSend(this.id, OS.sel_drawTitleOfColumn_1inRect_1, column, aRect);
+}
+
+public int firstVisibleColumn() {
+ return OS.objc_msgSend(this.id, OS.sel_firstVisibleColumn);
+}
+
+public NSRect frameOfColumn(int column) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_frameOfColumn_1, column);
+ return result;
+}
+
+public NSRect frameOfInsideOfColumn(int column) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_frameOfInsideOfColumn_1, column);
+ return result;
+}
+
+public boolean hasHorizontalScroller() {
+ return OS.objc_msgSend(this.id, OS.sel_hasHorizontalScroller) != 0;
+}
+
+public boolean isLoaded() {
+ return OS.objc_msgSend(this.id, OS.sel_isLoaded) != 0;
+}
+
+public boolean isTitled() {
+ return OS.objc_msgSend(this.id, OS.sel_isTitled) != 0;
+}
+
+public int lastColumn() {
+ return OS.objc_msgSend(this.id, OS.sel_lastColumn);
+}
+
+public int lastVisibleColumn() {
+ return OS.objc_msgSend(this.id, OS.sel_lastVisibleColumn);
+}
+
+public void loadColumnZero() {
+ OS.objc_msgSend(this.id, OS.sel_loadColumnZero);
+}
+
+public id loadedCellAtRow(int row, int col) {
+ int result = OS.objc_msgSend(this.id, OS.sel_loadedCellAtRow_1column_1, row, col);
+ return result != 0 ? new id(result) : null;
+}
+
+public int matrixClass() {
+ return OS.objc_msgSend(this.id, OS.sel_matrixClass);
+}
+
+public NSMatrix matrixInColumn(int column) {
+ int result = OS.objc_msgSend(this.id, OS.sel_matrixInColumn_1, column);
+ return result != 0 ? new NSMatrix(result) : null;
+}
+
+public int maxVisibleColumns() {
+ return OS.objc_msgSend(this.id, OS.sel_maxVisibleColumns);
+}
+
+public float minColumnWidth() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_minColumnWidth);
+}
+
+public int numberOfVisibleColumns() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfVisibleColumns);
+}
+
+public NSString path() {
+ int result = OS.objc_msgSend(this.id, OS.sel_path);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString pathSeparator() {
+ int result = OS.objc_msgSend(this.id, OS.sel_pathSeparator);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString pathToColumn(int column) {
+ int result = OS.objc_msgSend(this.id, OS.sel_pathToColumn_1, column);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean prefersAllColumnUserResizing() {
+ return OS.objc_msgSend(this.id, OS.sel_prefersAllColumnUserResizing) != 0;
+}
+
+public void reloadColumn(int column) {
+ OS.objc_msgSend(this.id, OS.sel_reloadColumn_1, column);
+}
+
+public static void removeSavedColumnsWithAutosaveName(NSString name) {
+ OS.objc_msgSend(OS.class_NSBrowser, OS.sel_removeSavedColumnsWithAutosaveName_1, name != null ? name.id : 0);
+}
+
+public boolean reusesColumns() {
+ return OS.objc_msgSend(this.id, OS.sel_reusesColumns) != 0;
+}
+
+public void scrollColumnToVisible(int column) {
+ OS.objc_msgSend(this.id, OS.sel_scrollColumnToVisible_1, column);
+}
+
+public void scrollColumnsLeftBy(int shiftAmount) {
+ OS.objc_msgSend(this.id, OS.sel_scrollColumnsLeftBy_1, shiftAmount);
+}
+
+public void scrollColumnsRightBy(int shiftAmount) {
+ OS.objc_msgSend(this.id, OS.sel_scrollColumnsRightBy_1, shiftAmount);
+}
+
+public void scrollViaScroller(NSScroller sender) {
+ OS.objc_msgSend(this.id, OS.sel_scrollViaScroller_1, sender != null ? sender.id : 0);
+}
+
+public void selectAll(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectAll_1, sender != null ? sender.id : 0);
+}
+
+public void selectRow(int row, int column) {
+ OS.objc_msgSend(this.id, OS.sel_selectRow_1inColumn_1, row, column);
+}
+
+public void selectRowIndexes(NSIndexSet indexes, int column) {
+ OS.objc_msgSend(this.id, OS.sel_selectRowIndexes_1inColumn_1, indexes != null ? indexes.id : 0, column);
+}
+
+public id selectedCell() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedCell);
+ return result != 0 ? new id(result) : null;
+}
+
+public id selectedCellInColumn(int column) {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedCellInColumn_1, column);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSArray selectedCells() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedCells);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public int selectedColumn() {
+ return OS.objc_msgSend(this.id, OS.sel_selectedColumn);
+}
+
+public int selectedRowInColumn(int column) {
+ return OS.objc_msgSend(this.id, OS.sel_selectedRowInColumn_1, column);
+}
+
+public NSIndexSet selectedRowIndexesInColumn(int column) {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedRowIndexesInColumn_1, column);
+ return result != 0 ? new NSIndexSet(result) : null;
+}
+
+public boolean sendAction() {
+ return OS.objc_msgSend(this.id, OS.sel_sendAction) != 0;
+}
+
+public boolean sendsActionOnArrowKeys() {
+ return OS.objc_msgSend(this.id, OS.sel_sendsActionOnArrowKeys) != 0;
+}
+
+public boolean separatesColumns() {
+ return OS.objc_msgSend(this.id, OS.sel_separatesColumns) != 0;
+}
+
+public void setAcceptsArrowKeys(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAcceptsArrowKeys_1, flag);
+}
+
+public void setAllowsBranchSelection(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsBranchSelection_1, flag);
+}
+
+public void setAllowsEmptySelection(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsEmptySelection_1, flag);
+}
+
+public void setAllowsMultipleSelection(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsMultipleSelection_1, flag);
+}
+
+public void setAllowsTypeSelect(boolean value) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsTypeSelect_1, value);
+}
+
+public void setBackgroundColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color != null ? color.id : 0);
+}
+
+//public void setCellClass(int factoryId) {
+// OS.objc_msgSend(this.id, OS.sel_setCellClass_1, factoryId);
+//}
+
+public void setCellPrototype(NSCell aCell) {
+ OS.objc_msgSend(this.id, OS.sel_setCellPrototype_1, aCell != null ? aCell.id : 0);
+}
+
+public void setColumnResizingType(int columnResizingType) {
+ OS.objc_msgSend(this.id, OS.sel_setColumnResizingType_1, columnResizingType);
+}
+
+public void setColumnsAutosaveName(NSString name) {
+ OS.objc_msgSend(this.id, OS.sel_setColumnsAutosaveName_1, name != null ? name.id : 0);
+}
+
+public void setDelegate(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
+}
+
+public void setDoubleAction(int aSelector) {
+ OS.objc_msgSend(this.id, OS.sel_setDoubleAction_1, aSelector);
+}
+
+public void setDraggingSourceOperationMask(int mask, boolean isLocal) {
+ OS.objc_msgSend(this.id, OS.sel_setDraggingSourceOperationMask_1forLocal_1, mask, isLocal);
+}
+
+public void setHasHorizontalScroller(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setHasHorizontalScroller_1, flag);
+}
+
+public void setLastColumn(int column) {
+ OS.objc_msgSend(this.id, OS.sel_setLastColumn_1, column);
+}
+
+public void setMatrixClass(int factoryId) {
+ OS.objc_msgSend(this.id, OS.sel_setMatrixClass_1, factoryId);
+}
+
+public void setMaxVisibleColumns(int columnCount) {
+ OS.objc_msgSend(this.id, OS.sel_setMaxVisibleColumns_1, columnCount);
+}
+
+public void setMinColumnWidth(float columnWidth) {
+ OS.objc_msgSend(this.id, OS.sel_setMinColumnWidth_1, columnWidth);
+}
+
+public boolean setPath(NSString path) {
+ return OS.objc_msgSend(this.id, OS.sel_setPath_1, path != null ? path.id : 0) != 0;
+}
+
+public void setPathSeparator(NSString newString) {
+ OS.objc_msgSend(this.id, OS.sel_setPathSeparator_1, newString != null ? newString.id : 0);
+}
+
+public void setPrefersAllColumnUserResizing(boolean prefersAllColumnResizing) {
+ OS.objc_msgSend(this.id, OS.sel_setPrefersAllColumnUserResizing_1, prefersAllColumnResizing);
+}
+
+public void setReusesColumns(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setReusesColumns_1, flag);
+}
+
+public void setSendsActionOnArrowKeys(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setSendsActionOnArrowKeys_1, flag);
+}
+
+public void setSeparatesColumns(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setSeparatesColumns_1, flag);
+}
+
+public void setTakesTitleFromPreviousColumn(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setTakesTitleFromPreviousColumn_1, flag);
+}
+
+public void setTitle(NSString aString, int column) {
+ OS.objc_msgSend(this.id, OS.sel_setTitle_1ofColumn_1, aString != null ? aString.id : 0, column);
+}
+
+public void setTitled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setTitled_1, flag);
+}
+
+public void setWidth(float columnWidth, int columnIndex) {
+ OS.objc_msgSend(this.id, OS.sel_setWidth_1ofColumn_1, columnWidth, columnIndex);
+}
+
+public boolean takesTitleFromPreviousColumn() {
+ return OS.objc_msgSend(this.id, OS.sel_takesTitleFromPreviousColumn) != 0;
+}
+
+public void tile() {
+ OS.objc_msgSend(this.id, OS.sel_tile);
+}
+
+public NSRect titleFrameOfColumn(int column) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_titleFrameOfColumn_1, column);
+ return result;
+}
+
+public float titleHeight() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_titleHeight);
+}
+
+public NSString titleOfColumn(int column) {
+ int result = OS.objc_msgSend(this.id, OS.sel_titleOfColumn_1, column);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void updateScroller() {
+ OS.objc_msgSend(this.id, OS.sel_updateScroller);
+}
+
+public void validateVisibleColumns() {
+ OS.objc_msgSend(this.id, OS.sel_validateVisibleColumns);
+}
+
+public float widthOfColumn(int column) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_widthOfColumn_1, column);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBrowserCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBrowserCell.java
new file mode 100644
index 0000000000..a7f1e79471
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBrowserCell.java
@@ -0,0 +1,70 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSBrowserCell extends NSCell {
+
+public NSBrowserCell() {
+ super();
+}
+
+public NSBrowserCell(int id) {
+ super(id);
+}
+
+public NSImage alternateImage() {
+ int result = OS.objc_msgSend(this.id, OS.sel_alternateImage);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public static NSImage branchImage() {
+ int result = OS.objc_msgSend(OS.class_NSBrowserCell, OS.sel_branchImage);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public NSColor highlightColorInView(NSView controlView) {
+ int result = OS.objc_msgSend(this.id, OS.sel_highlightColorInView_1, controlView != null ? controlView.id : 0);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSImage highlightedBranchImage() {
+ int result = OS.objc_msgSend(OS.class_NSBrowserCell, OS.sel_highlightedBranchImage);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public NSImage image() {
+ int result = OS.objc_msgSend(this.id, OS.sel_image);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public boolean isLeaf() {
+ return OS.objc_msgSend(this.id, OS.sel_isLeaf) != 0;
+}
+
+public boolean isLoaded() {
+ return OS.objc_msgSend(this.id, OS.sel_isLoaded) != 0;
+}
+
+public void reset() {
+ OS.objc_msgSend(this.id, OS.sel_reset);
+}
+
+public void set() {
+ OS.objc_msgSend(this.id, OS.sel_set);
+}
+
+public void setAlternateImage(NSImage newAltImage) {
+ OS.objc_msgSend(this.id, OS.sel_setAlternateImage_1, newAltImage != null ? newAltImage.id : 0);
+}
+
+public void setImage(NSImage image) {
+ OS.objc_msgSend(this.id, OS.sel_setImage_1, image != null ? image.id : 0);
+}
+
+public void setLeaf(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setLeaf_1, flag);
+}
+
+public void setLoaded(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setLoaded_1, flag);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBundle.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBundle.java
new file mode 100644
index 0000000000..b3ec283b42
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBundle.java
@@ -0,0 +1,206 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSBundle extends NSObject {
+
+public NSBundle() {
+ super();
+}
+
+public NSBundle(int id) {
+ super(id);
+}
+
+public static NSArray allBundles() {
+ int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_allBundles);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray allFrameworks() {
+ int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_allFrameworks);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString builtInPlugInsPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_builtInPlugInsPath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSBundle bundleForClass(int aClass) {
+ int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_bundleForClass_1, aClass);
+ return result != 0 ? new NSBundle(result) : null;
+}
+
+public NSString bundleIdentifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_bundleIdentifier);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString bundlePath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_bundlePath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSBundle bundleWithIdentifier(NSString identifier) {
+ int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_bundleWithIdentifier_1, identifier != null ? identifier.id : 0);
+ return result != 0 ? new NSBundle(result) : null;
+}
+
+public static NSBundle bundleWithPath(NSString path) {
+ int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_bundleWithPath_1, path != null ? path.id : 0);
+ return result != 0 ? new NSBundle(result) : null;
+}
+
+public int classNamed(NSString className) {
+ return OS.objc_msgSend(this.id, OS.sel_classNamed_1, className != null ? className.id : 0);
+}
+
+public NSString developmentLocalization() {
+ int result = OS.objc_msgSend(this.id, OS.sel_developmentLocalization);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSArray executableArchitectures() {
+ int result = OS.objc_msgSend(this.id, OS.sel_executableArchitectures);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString executablePath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_executablePath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSDictionary infoDictionary() {
+ int result = OS.objc_msgSend(this.id, OS.sel_infoDictionary);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSBundle initWithPath(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithPath_1, path != null ? path.id : 0);
+ return result != 0 ? this : null;
+}
+
+public boolean isLoaded() {
+ return OS.objc_msgSend(this.id, OS.sel_isLoaded) != 0;
+}
+
+//public boolean load() {
+// return OS.objc_msgSend(this.id, OS.sel_load) != 0;
+//}
+
+public boolean loadAndReturnError(int error) {
+ return OS.objc_msgSend(this.id, OS.sel_loadAndReturnError_1, error) != 0;
+}
+
+public NSArray localizations() {
+ int result = OS.objc_msgSend(this.id, OS.sel_localizations);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSDictionary localizedInfoDictionary() {
+ int result = OS.objc_msgSend(this.id, OS.sel_localizedInfoDictionary);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSString localizedStringForKey(NSString key, NSString value, NSString tableName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_localizedStringForKey_1value_1table_1, key != null ? key.id : 0, value != null ? value.id : 0, tableName != null ? tableName.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSBundle mainBundle() {
+ int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_mainBundle);
+ return result != 0 ? new NSBundle(result) : null;
+}
+
+public id objectForInfoDictionaryKey(NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectForInfoDictionaryKey_1, key != null ? key.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString pathForAuxiliaryExecutable(NSString executableName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_pathForAuxiliaryExecutable_1, executableName != null ? executableName.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString pathForResource_ofType_(NSString name, NSString ext) {
+ int result = OS.objc_msgSend(this.id, OS.sel_pathForResource_1ofType_1, name != null ? name.id : 0, ext != null ? ext.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString pathForResource_ofType_inDirectory_(NSString name, NSString ext, NSString subpath) {
+ int result = OS.objc_msgSend(this.id, OS.sel_pathForResource_1ofType_1inDirectory_1, name != null ? name.id : 0, ext != null ? ext.id : 0, subpath != null ? subpath.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSString static_pathForResource_ofType_inDirectory_(NSString name, NSString ext, NSString bundlePath) {
+ int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_pathForResource_1ofType_1inDirectory_1, name != null ? name.id : 0, ext != null ? ext.id : 0, bundlePath != null ? bundlePath.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString pathForResource_ofType_inDirectory_forLocalization_(NSString name, NSString ext, NSString subpath, NSString localizationName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_pathForResource_1ofType_1inDirectory_1forLocalization_1, name != null ? name.id : 0, ext != null ? ext.id : 0, subpath != null ? subpath.id : 0, localizationName != null ? localizationName.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSArray static_pathsForResourcesOfType_inDirectory_(NSString ext, NSString bundlePath) {
+ int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_pathsForResourcesOfType_1inDirectory_1, ext != null ? ext.id : 0, bundlePath != null ? bundlePath.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray pathsForResourcesOfType_inDirectory_(NSString ext, NSString subpath) {
+ int result = OS.objc_msgSend(this.id, OS.sel_pathsForResourcesOfType_1inDirectory_1, ext != null ? ext.id : 0, subpath != null ? subpath.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray pathsForResourcesOfType_inDirectory_forLocalization_(NSString ext, NSString subpath, NSString localizationName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_pathsForResourcesOfType_1inDirectory_1forLocalization_1, ext != null ? ext.id : 0, subpath != null ? subpath.id : 0, localizationName != null ? localizationName.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray preferredLocalizations() {
+ int result = OS.objc_msgSend(this.id, OS.sel_preferredLocalizations);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray static_preferredLocalizationsFromArray_(NSArray localizationsArray) {
+ int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_preferredLocalizationsFromArray_1, localizationsArray != null ? localizationsArray.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray static_preferredLocalizationsFromArray_forPreferences_(NSArray localizationsArray, NSArray preferencesArray) {
+ int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_preferredLocalizationsFromArray_1forPreferences_1, localizationsArray != null ? localizationsArray.id : 0, preferencesArray != null ? preferencesArray.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean preflightAndReturnError(int error) {
+ return OS.objc_msgSend(this.id, OS.sel_preflightAndReturnError_1, error) != 0;
+}
+
+public int principalClass() {
+ return OS.objc_msgSend(this.id, OS.sel_principalClass);
+}
+
+public NSString privateFrameworksPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_privateFrameworksPath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString resourcePath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_resourcePath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString sharedFrameworksPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_sharedFrameworksPath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString sharedSupportPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_sharedSupportPath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean unload() {
+ return OS.objc_msgSend(this.id, OS.sel_unload) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButton.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButton.java
new file mode 100644
index 0000000000..2a0935d152
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButton.java
@@ -0,0 +1,177 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSButton extends NSControl {
+
+public NSButton() {
+ super();
+}
+
+public NSButton(int id) {
+ super(id);
+}
+
+public boolean allowsMixedState() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsMixedState) != 0;
+}
+
+public NSImage alternateImage() {
+ int result = OS.objc_msgSend(this.id, OS.sel_alternateImage);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public NSString alternateTitle() {
+ int result = OS.objc_msgSend(this.id, OS.sel_alternateTitle);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSAttributedString attributedAlternateTitle() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributedAlternateTitle);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public NSAttributedString attributedTitle() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributedTitle);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public int bezelStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_bezelStyle);
+}
+
+public void getPeriodicDelay(int delay, int interval) {
+ OS.objc_msgSend(this.id, OS.sel_getPeriodicDelay_1interval_1, delay, interval);
+}
+
+public void highlight(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_highlight_1, flag);
+}
+
+public NSImage image() {
+ int result = OS.objc_msgSend(this.id, OS.sel_image);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public int imagePosition() {
+ return OS.objc_msgSend(this.id, OS.sel_imagePosition);
+}
+
+public boolean isBordered() {
+ return OS.objc_msgSend(this.id, OS.sel_isBordered) != 0;
+}
+
+public boolean isTransparent() {
+ return OS.objc_msgSend(this.id, OS.sel_isTransparent) != 0;
+}
+
+public NSString keyEquivalent() {
+ int result = OS.objc_msgSend(this.id, OS.sel_keyEquivalent);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int keyEquivalentModifierMask() {
+ return OS.objc_msgSend(this.id, OS.sel_keyEquivalentModifierMask);
+}
+
+public boolean performKeyEquivalent(NSEvent key) {
+ return OS.objc_msgSend(this.id, OS.sel_performKeyEquivalent_1, key != null ? key.id : 0) != 0;
+}
+
+public void setAllowsMixedState(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsMixedState_1, flag);
+}
+
+public void setAlternateImage(NSImage image) {
+ OS.objc_msgSend(this.id, OS.sel_setAlternateImage_1, image != null ? image.id : 0);
+}
+
+public void setAlternateTitle(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setAlternateTitle_1, aString != null ? aString.id : 0);
+}
+
+public void setAttributedAlternateTitle(NSAttributedString obj) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributedAlternateTitle_1, obj != null ? obj.id : 0);
+}
+
+public void setAttributedTitle(NSAttributedString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributedTitle_1, aString != null ? aString.id : 0);
+}
+
+public void setBezelStyle(int bezelStyle) {
+ OS.objc_msgSend(this.id, OS.sel_setBezelStyle_1, bezelStyle);
+}
+
+public void setBordered(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setBordered_1, flag);
+}
+
+public void setButtonType(int aType) {
+ OS.objc_msgSend(this.id, OS.sel_setButtonType_1, aType);
+}
+
+public void setImage(NSImage image) {
+ OS.objc_msgSend(this.id, OS.sel_setImage_1, image != null ? image.id : 0);
+}
+
+public void setImagePosition(int aPosition) {
+ OS.objc_msgSend(this.id, OS.sel_setImagePosition_1, aPosition);
+}
+
+public void setKeyEquivalent(NSString charCode) {
+ OS.objc_msgSend(this.id, OS.sel_setKeyEquivalent_1, charCode != null ? charCode.id : 0);
+}
+
+public void setKeyEquivalentModifierMask(int mask) {
+ OS.objc_msgSend(this.id, OS.sel_setKeyEquivalentModifierMask_1, mask);
+}
+
+public void setNextState() {
+ OS.objc_msgSend(this.id, OS.sel_setNextState);
+}
+
+public void setPeriodicDelay(float delay, float interval) {
+ OS.objc_msgSend(this.id, OS.sel_setPeriodicDelay_1interval_1, delay, interval);
+}
+
+public void setShowsBorderOnlyWhileMouseInside(boolean show) {
+ OS.objc_msgSend(this.id, OS.sel_setShowsBorderOnlyWhileMouseInside_1, show);
+}
+
+public void setSound(NSSound aSound) {
+ OS.objc_msgSend(this.id, OS.sel_setSound_1, aSound != null ? aSound.id : 0);
+}
+
+public void setState(int value) {
+ OS.objc_msgSend(this.id, OS.sel_setState_1, value);
+}
+
+public void setTitle(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString != null ? aString.id : 0);
+}
+
+public void setTitleWithMnemonic(NSString stringWithAmpersand) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleWithMnemonic_1, stringWithAmpersand != null ? stringWithAmpersand.id : 0);
+}
+
+public void setTransparent(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setTransparent_1, flag);
+}
+
+public boolean showsBorderOnlyWhileMouseInside() {
+ return OS.objc_msgSend(this.id, OS.sel_showsBorderOnlyWhileMouseInside) != 0;
+}
+
+public NSSound sound() {
+ int result = OS.objc_msgSend(this.id, OS.sel_sound);
+ return result != 0 ? new NSSound(result) : null;
+}
+
+public int state() {
+ return OS.objc_msgSend(this.id, OS.sel_state);
+}
+
+public NSString title() {
+ int result = OS.objc_msgSend(this.id, OS.sel_title);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButtonCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButtonCell.java
new file mode 100644
index 0000000000..2e6bed59c5
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSButtonCell.java
@@ -0,0 +1,245 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSButtonCell extends NSActionCell {
+
+public NSButtonCell() {
+ super();
+}
+
+public NSButtonCell(int id) {
+ super(id);
+}
+
+public NSImage alternateImage() {
+ int result = OS.objc_msgSend(this.id, OS.sel_alternateImage);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public NSString alternateMnemonic() {
+ int result = OS.objc_msgSend(this.id, OS.sel_alternateMnemonic);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int alternateMnemonicLocation() {
+ return OS.objc_msgSend(this.id, OS.sel_alternateMnemonicLocation);
+}
+
+public NSString alternateTitle() {
+ int result = OS.objc_msgSend(this.id, OS.sel_alternateTitle);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSAttributedString attributedAlternateTitle() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributedAlternateTitle);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public NSAttributedString attributedTitle() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributedTitle);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public NSColor backgroundColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public int bezelStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_bezelStyle);
+}
+
+public void drawBezelWithFrame(NSRect frame, NSView controlView) {
+ OS.objc_msgSend(this.id, OS.sel_drawBezelWithFrame_1inView_1, frame, controlView != null ? controlView.id : 0);
+}
+
+public void drawImage(NSImage image, NSRect frame, NSView controlView) {
+ OS.objc_msgSend(this.id, OS.sel_drawImage_1withFrame_1inView_1, image != null ? image.id : 0, frame, controlView != null ? controlView.id : 0);
+}
+
+public NSRect drawTitle(NSAttributedString title, NSRect frame, NSView controlView) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_drawTitle_1withFrame_1inView_1, title != null ? title.id : 0, frame, controlView != null ? controlView.id : 0);
+ return result;
+}
+
+public void getPeriodicDelay(int delay, int interval) {
+ OS.objc_msgSend(this.id, OS.sel_getPeriodicDelay_1interval_1, delay, interval);
+}
+
+public int gradientType() {
+ return OS.objc_msgSend(this.id, OS.sel_gradientType);
+}
+
+public int highlightsBy() {
+ return OS.objc_msgSend(this.id, OS.sel_highlightsBy);
+}
+
+public boolean imageDimsWhenDisabled() {
+ return OS.objc_msgSend(this.id, OS.sel_imageDimsWhenDisabled) != 0;
+}
+
+public int imagePosition() {
+ return OS.objc_msgSend(this.id, OS.sel_imagePosition);
+}
+
+public int imageScaling() {
+ return OS.objc_msgSend(this.id, OS.sel_imageScaling);
+}
+
+public boolean isOpaque() {
+ return OS.objc_msgSend(this.id, OS.sel_isOpaque) != 0;
+}
+
+public boolean isTransparent() {
+ return OS.objc_msgSend(this.id, OS.sel_isTransparent) != 0;
+}
+
+public NSString keyEquivalent() {
+ int result = OS.objc_msgSend(this.id, OS.sel_keyEquivalent);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSFont keyEquivalentFont() {
+ int result = OS.objc_msgSend(this.id, OS.sel_keyEquivalentFont);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public int keyEquivalentModifierMask() {
+ return OS.objc_msgSend(this.id, OS.sel_keyEquivalentModifierMask);
+}
+
+public void mouseEntered(NSEvent event) {
+ OS.objc_msgSend(this.id, OS.sel_mouseEntered_1, event != null ? event.id : 0);
+}
+
+public void mouseExited(NSEvent event) {
+ OS.objc_msgSend(this.id, OS.sel_mouseExited_1, event != null ? event.id : 0);
+}
+
+public void performClick(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_performClick_1, sender != null ? sender.id : 0);
+}
+
+public void setAlternateImage(NSImage image) {
+ OS.objc_msgSend(this.id, OS.sel_setAlternateImage_1, image != null ? image.id : 0);
+}
+
+public void setAlternateMnemonicLocation(int location) {
+ OS.objc_msgSend(this.id, OS.sel_setAlternateMnemonicLocation_1, location);
+}
+
+public void setAlternateTitle(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setAlternateTitle_1, aString != null ? aString.id : 0);
+}
+
+public void setAlternateTitleWithMnemonic(NSString stringWithAmpersand) {
+ OS.objc_msgSend(this.id, OS.sel_setAlternateTitleWithMnemonic_1, stringWithAmpersand != null ? stringWithAmpersand.id : 0);
+}
+
+public void setAttributedAlternateTitle(NSAttributedString obj) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributedAlternateTitle_1, obj != null ? obj.id : 0);
+}
+
+public void setAttributedTitle(NSAttributedString obj) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributedTitle_1, obj != null ? obj.id : 0);
+}
+
+public void setBackgroundColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color != null ? color.id : 0);
+}
+
+public void setBezelStyle(int bezelStyle) {
+ OS.objc_msgSend(this.id, OS.sel_setBezelStyle_1, bezelStyle);
+}
+
+public void setButtonType(int aType) {
+ OS.objc_msgSend(this.id, OS.sel_setButtonType_1, aType);
+}
+
+public void setFont(NSFont fontObj) {
+ OS.objc_msgSend(this.id, OS.sel_setFont_1, fontObj != null ? fontObj.id : 0);
+}
+
+public void setGradientType(int type) {
+ OS.objc_msgSend(this.id, OS.sel_setGradientType_1, type);
+}
+
+public void setHighlightsBy(int aType) {
+ OS.objc_msgSend(this.id, OS.sel_setHighlightsBy_1, aType);
+}
+
+public void setImageDimsWhenDisabled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setImageDimsWhenDisabled_1, flag);
+}
+
+public void setImagePosition(int aPosition) {
+ OS.objc_msgSend(this.id, OS.sel_setImagePosition_1, aPosition);
+}
+
+public void setImageScaling(int scaling) {
+ OS.objc_msgSend(this.id, OS.sel_setImageScaling_1, scaling);
+}
+
+public void setKeyEquivalent(NSString aKeyEquivalent) {
+ OS.objc_msgSend(this.id, OS.sel_setKeyEquivalent_1, aKeyEquivalent != null ? aKeyEquivalent.id : 0);
+}
+
+public void setKeyEquivalentFont_(NSFont fontObj) {
+ OS.objc_msgSend(this.id, OS.sel_setKeyEquivalentFont_1, fontObj != null ? fontObj.id : 0);
+}
+
+public void setKeyEquivalentFont_size_(NSString fontName, float fontSize) {
+ OS.objc_msgSend(this.id, OS.sel_setKeyEquivalentFont_1size_1, fontName != null ? fontName.id : 0, fontSize);
+}
+
+public void setKeyEquivalentModifierMask(int mask) {
+ OS.objc_msgSend(this.id, OS.sel_setKeyEquivalentModifierMask_1, mask);
+}
+
+public void setPeriodicDelay(float delay, float interval) {
+ OS.objc_msgSend(this.id, OS.sel_setPeriodicDelay_1interval_1, delay, interval);
+}
+
+public void setShowsBorderOnlyWhileMouseInside(boolean show) {
+ OS.objc_msgSend(this.id, OS.sel_setShowsBorderOnlyWhileMouseInside_1, show);
+}
+
+public void setShowsStateBy(int aType) {
+ OS.objc_msgSend(this.id, OS.sel_setShowsStateBy_1, aType);
+}
+
+public void setSound(NSSound aSound) {
+ OS.objc_msgSend(this.id, OS.sel_setSound_1, aSound != null ? aSound.id : 0);
+}
+
+public void setTitle(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString != null ? aString.id : 0);
+}
+
+public void setTitleWithMnemonic(NSString stringWithAmpersand) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleWithMnemonic_1, stringWithAmpersand != null ? stringWithAmpersand.id : 0);
+}
+
+public void setTransparent(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setTransparent_1, flag);
+}
+
+public boolean showsBorderOnlyWhileMouseInside() {
+ return OS.objc_msgSend(this.id, OS.sel_showsBorderOnlyWhileMouseInside) != 0;
+}
+
+public int showsStateBy() {
+ return OS.objc_msgSend(this.id, OS.sel_showsStateBy);
+}
+
+public NSSound sound() {
+ int result = OS.objc_msgSend(this.id, OS.sel_sound);
+ return result != 0 ? new NSSound(result) : null;
+}
+
+public NSString title() {
+ int result = OS.objc_msgSend(this.id, OS.sel_title);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCIImageRep.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCIImageRep.java
new file mode 100644
index 0000000000..f3004ae801
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCIImageRep.java
@@ -0,0 +1,28 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSCIImageRep extends NSImageRep {
+
+public NSCIImageRep() {
+ super();
+}
+
+public NSCIImageRep(int id) {
+ super(id);
+}
+
+public CIImage CIImage() {
+ int result = OS.objc_msgSend(this.id, OS.sel_CIImage);
+ return result != 0 ? new CIImage(result) : null;
+}
+
+public static id imageRepWithCIImage(CIImage image) {
+ int result = OS.objc_msgSend(OS.class_NSCIImageRep, OS.sel_imageRepWithCIImage_1, image != null ? image.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSCIImageRep initWithCIImage(CIImage image) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCIImage_1, image != null ? image.id : 0);
+ return result != 0 ? this : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCachedImageRep.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCachedImageRep.java
new file mode 100644
index 0000000000..59834e7e54
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCachedImageRep.java
@@ -0,0 +1,34 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSCachedImageRep extends NSImageRep {
+
+public NSCachedImageRep() {
+ super();
+}
+
+public NSCachedImageRep(int id) {
+ super(id);
+}
+
+public NSCachedImageRep initWithSize(NSSize size, int depth, boolean flag, boolean alpha) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithSize_1depth_1separate_1alpha_1, size, depth, flag, alpha);
+ return result != 0 ? this : null;
+}
+
+public NSCachedImageRep initWithWindow(NSWindow win, NSRect rect) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithWindow_1rect_1, win != null ? win.id : 0, rect);
+ return result != 0 ? this : null;
+}
+
+public NSRect rect() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rect);
+ return result;
+}
+
+public NSWindow window() {
+ int result = OS.objc_msgSend(this.id, OS.sel_window);
+ return result != 0 ? new NSWindow(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCachedURLResponse.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCachedURLResponse.java
new file mode 100644
index 0000000000..8510c5bee2
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCachedURLResponse.java
@@ -0,0 +1,42 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSCachedURLResponse extends NSObject {
+
+public NSCachedURLResponse() {
+ super();
+}
+
+public NSCachedURLResponse(int id) {
+ super(id);
+}
+
+public NSData data() {
+ int result = OS.objc_msgSend(this.id, OS.sel_data);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSCachedURLResponse initWithResponse_data_(NSURLResponse response, NSData data) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithResponse_1data_1, response != null ? response.id : 0, data != null ? data.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSCachedURLResponse initWithResponse_data_userInfo_storagePolicy_(NSURLResponse response, NSData data, NSDictionary userInfo, int storagePolicy) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithResponse_1data_1userInfo_1storagePolicy_1, response != null ? response.id : 0, data != null ? data.id : 0, userInfo != null ? userInfo.id : 0, storagePolicy);
+ return result != 0 ? this : null;
+}
+
+public NSURLResponse response() {
+ int result = OS.objc_msgSend(this.id, OS.sel_response);
+ return result != 0 ? new NSURLResponse(result) : null;
+}
+
+public int storagePolicy() {
+ return OS.objc_msgSend(this.id, OS.sel_storagePolicy);
+}
+
+public NSDictionary userInfo() {
+ int result = OS.objc_msgSend(this.id, OS.sel_userInfo);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCalendar.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCalendar.java
new file mode 100644
index 0000000000..da29d84c29
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCalendar.java
@@ -0,0 +1,113 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSCalendar extends NSObject {
+
+public NSCalendar() {
+ super();
+}
+
+public NSCalendar(int id) {
+ super(id);
+}
+
+public static id autoupdatingCurrentCalendar() {
+ int result = OS.objc_msgSend(OS.class_NSCalendar, OS.sel_autoupdatingCurrentCalendar);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString calendarIdentifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_calendarIdentifier);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSDateComponents components_fromDate_(int unitFlags, NSDate date) {
+ int result = OS.objc_msgSend(this.id, OS.sel_components_1fromDate_1, unitFlags, date != null ? date.id : 0);
+ return result != 0 ? new NSDateComponents(result) : null;
+}
+
+public NSDateComponents components_fromDate_toDate_options_(int unitFlags, NSDate startingDate, NSDate resultDate, int opts) {
+ int result = OS.objc_msgSend(this.id, OS.sel_components_1fromDate_1toDate_1options_1, unitFlags, startingDate != null ? startingDate.id : 0, resultDate != null ? resultDate.id : 0, opts);
+ return result != 0 ? new NSDateComponents(result) : null;
+}
+
+public static id currentCalendar() {
+ int result = OS.objc_msgSend(OS.class_NSCalendar, OS.sel_currentCalendar);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSDate dateByAddingComponents(NSDateComponents comps, NSDate date, int opts) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dateByAddingComponents_1toDate_1options_1, comps != null ? comps.id : 0, date != null ? date.id : 0, opts);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public NSDate dateFromComponents(NSDateComponents comps) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dateFromComponents_1, comps != null ? comps.id : 0);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public int firstWeekday() {
+ return OS.objc_msgSend(this.id, OS.sel_firstWeekday);
+}
+
+public NSCalendar initWithCalendarIdentifier(NSString ident) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCalendarIdentifier_1, ident != null ? ident.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSLocale locale() {
+ int result = OS.objc_msgSend(this.id, OS.sel_locale);
+ return result != 0 ? new NSLocale(result) : null;
+}
+
+public NSRange maximumRangeOfUnit(int unit) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_maximumRangeOfUnit_1, unit);
+ return result;
+}
+
+public int minimumDaysInFirstWeek() {
+ return OS.objc_msgSend(this.id, OS.sel_minimumDaysInFirstWeek);
+}
+
+public NSRange minimumRangeOfUnit(int unit) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_minimumRangeOfUnit_1, unit);
+ return result;
+}
+
+public int ordinalityOfUnit(int smaller, int larger, NSDate date) {
+ return OS.objc_msgSend(this.id, OS.sel_ordinalityOfUnit_1inUnit_1forDate_1, smaller, larger, date != null ? date.id : 0);
+}
+
+public NSRange rangeOfUnit_inUnit_forDate_(int smaller, int larger, NSDate date) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfUnit_1inUnit_1forDate_1, smaller, larger, date != null ? date.id : 0);
+ return result;
+}
+
+public boolean rangeOfUnit_startDate_interval_forDate_(int unit, int datep, int tip, NSDate date) {
+ return OS.objc_msgSend(this.id, OS.sel_rangeOfUnit_1startDate_1interval_1forDate_1, unit, datep, tip, date != null ? date.id : 0) != 0;
+}
+
+public void setFirstWeekday(int weekday) {
+ OS.objc_msgSend(this.id, OS.sel_setFirstWeekday_1, weekday);
+}
+
+public void setLocale(NSLocale locale) {
+ OS.objc_msgSend(this.id, OS.sel_setLocale_1, locale != null ? locale.id : 0);
+}
+
+public void setMinimumDaysInFirstWeek(int mdw) {
+ OS.objc_msgSend(this.id, OS.sel_setMinimumDaysInFirstWeek_1, mdw);
+}
+
+public void setTimeZone(NSTimeZone tz) {
+ OS.objc_msgSend(this.id, OS.sel_setTimeZone_1, tz != null ? tz.id : 0);
+}
+
+public NSTimeZone timeZone() {
+ int result = OS.objc_msgSend(this.id, OS.sel_timeZone);
+ return result != 0 ? new NSTimeZone(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCalendarDate.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCalendarDate.java
new file mode 100644
index 0000000000..320a4dd437
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCalendarDate.java
@@ -0,0 +1,136 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSCalendarDate extends NSDate {
+
+public NSCalendarDate() {
+ super();
+}
+
+public NSCalendarDate(int id) {
+ super(id);
+}
+
+public static NSCalendarDate calendarDate() {
+ int result = OS.objc_msgSend(OS.class_NSCalendarDate, OS.sel_calendarDate);
+ return result != 0 ? new NSCalendarDate(result) : null;
+}
+
+public NSString calendarFormat() {
+ int result = OS.objc_msgSend(this.id, OS.sel_calendarFormat);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSCalendarDate dateByAddingYears(int year, int month, int day, int hour, int minute, int second) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dateByAddingYears_1months_1days_1hours_1minutes_1seconds_1, year, month, day, hour, minute, second);
+ return result == this.id ? this : (result != 0 ? new NSCalendarDate(result) : null);
+}
+
+public static id static_dateWithString_calendarFormat_(NSString description, NSString format) {
+ int result = OS.objc_msgSend(OS.class_NSCalendarDate, OS.sel_dateWithString_1calendarFormat_1, description != null ? description.id : 0, format != null ? format.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_dateWithString_calendarFormat_locale_(NSString description, NSString format, id locale) {
+ int result = OS.objc_msgSend(OS.class_NSCalendarDate, OS.sel_dateWithString_1calendarFormat_1locale_1, description != null ? description.id : 0, format != null ? format.id : 0, locale != null ? locale.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static NSCalendarDate dateWithYear(int year, int month, int day, int hour, int minute, int second, NSTimeZone aTimeZone) {
+ int result = OS.objc_msgSend(OS.class_NSCalendarDate, OS.sel_dateWithYear_1month_1day_1hour_1minute_1second_1timeZone_1, year, month, day, hour, minute, second, aTimeZone != null ? aTimeZone.id : 0);
+ return result != 0 ? new NSCalendarDate(result) : null;
+}
+
+public int dayOfCommonEra() {
+ return OS.objc_msgSend(this.id, OS.sel_dayOfCommonEra);
+}
+
+public int dayOfMonth() {
+ return OS.objc_msgSend(this.id, OS.sel_dayOfMonth);
+}
+
+public int dayOfWeek() {
+ return OS.objc_msgSend(this.id, OS.sel_dayOfWeek);
+}
+
+public int dayOfYear() {
+ return OS.objc_msgSend(this.id, OS.sel_dayOfYear);
+}
+
+public NSString description() {
+ int result = OS.objc_msgSend(this.id, OS.sel_description);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString descriptionWithCalendarFormat_(NSString format) {
+ int result = OS.objc_msgSend(this.id, OS.sel_descriptionWithCalendarFormat_1, format != null ? format.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString descriptionWithCalendarFormat_locale_(NSString format, id locale) {
+ int result = OS.objc_msgSend(this.id, OS.sel_descriptionWithCalendarFormat_1locale_1, format != null ? format.id : 0, locale != null ? locale.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString descriptionWithLocale(id locale) {
+ int result = OS.objc_msgSend(this.id, OS.sel_descriptionWithLocale_1, locale != null ? locale.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int hourOfDay() {
+ return OS.objc_msgSend(this.id, OS.sel_hourOfDay);
+}
+
+public NSCalendarDate initWithString_(NSString description) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithString_1, description != null ? description.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSCalendarDate initWithString_calendarFormat_(NSString description, NSString format) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithString_1calendarFormat_1, description != null ? description.id : 0, format != null ? format.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSCalendarDate initWithString_calendarFormat_locale_(NSString description, NSString format, id locale) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithString_1calendarFormat_1locale_1, description != null ? description.id : 0, format != null ? format.id : 0, locale != null ? locale.id : 0);
+ return result != 0 ? this : null;
+}
+
+public id initWithYear(int year, int month, int day, int hour, int minute, int second, NSTimeZone aTimeZone) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithYear_1month_1day_1hour_1minute_1second_1timeZone_1, year, month, day, hour, minute, second, aTimeZone != null ? aTimeZone.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public int minuteOfHour() {
+ return OS.objc_msgSend(this.id, OS.sel_minuteOfHour);
+}
+
+public int monthOfYear() {
+ return OS.objc_msgSend(this.id, OS.sel_monthOfYear);
+}
+
+public int secondOfMinute() {
+ return OS.objc_msgSend(this.id, OS.sel_secondOfMinute);
+}
+
+public void setCalendarFormat(NSString format) {
+ OS.objc_msgSend(this.id, OS.sel_setCalendarFormat_1, format != null ? format.id : 0);
+}
+
+public void setTimeZone(NSTimeZone aTimeZone) {
+ OS.objc_msgSend(this.id, OS.sel_setTimeZone_1, aTimeZone != null ? aTimeZone.id : 0);
+}
+
+public NSTimeZone timeZone() {
+ int result = OS.objc_msgSend(this.id, OS.sel_timeZone);
+ return result != 0 ? new NSTimeZone(result) : null;
+}
+
+public int yearOfCommonEra() {
+ return OS.objc_msgSend(this.id, OS.sel_yearOfCommonEra);
+}
+
+public void years(int yp, int mop, int dp, int hp, int mip, int sp, NSCalendarDate date) {
+ OS.objc_msgSend(this.id, OS.sel_years_1months_1days_1hours_1minutes_1seconds_1sinceDate_1, yp, mop, dp, hp, mip, sp, date != null ? date.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCell.java
new file mode 100644
index 0000000000..1675d338a8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCell.java
@@ -0,0 +1,616 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSCell extends NSObject {
+
+public NSCell() {
+ super();
+}
+
+public NSCell(int id) {
+ super(id);
+}
+
+public boolean acceptsFirstResponder() {
+ return OS.objc_msgSend(this.id, OS.sel_acceptsFirstResponder) != 0;
+}
+
+public int action() {
+ return OS.objc_msgSend(this.id, OS.sel_action);
+}
+
+public int alignment() {
+ return OS.objc_msgSend(this.id, OS.sel_alignment);
+}
+
+public boolean allowsEditingTextAttributes() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsEditingTextAttributes) != 0;
+}
+
+public boolean allowsMixedState() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsMixedState) != 0;
+}
+
+public boolean allowsUndo() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsUndo) != 0;
+}
+
+public NSAttributedString attributedStringValue() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributedStringValue);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public int backgroundStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_backgroundStyle);
+}
+
+public int baseWritingDirection() {
+ return OS.objc_msgSend(this.id, OS.sel_baseWritingDirection);
+}
+
+public void calcDrawInfo(NSRect aRect) {
+ OS.objc_msgSend(this.id, OS.sel_calcDrawInfo_1, aRect);
+}
+
+public int cellAttribute(int aParameter) {
+ return OS.objc_msgSend(this.id, OS.sel_cellAttribute_1, aParameter);
+}
+
+public NSSize cellSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_struct(result, this.id, OS.sel_cellSize);
+ return result;
+}
+
+public NSSize cellSizeForBounds(NSRect aRect) {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_cellSizeForBounds_1, aRect);
+ return result;
+}
+
+public int compare(id otherCell) {
+ return OS.objc_msgSend(this.id, OS.sel_compare_1, otherCell != null ? otherCell.id : 0);
+}
+
+public boolean continueTracking(NSPoint lastPoint, NSPoint currentPoint, NSView controlView) {
+ return OS.objc_msgSend(this.id, OS.sel_continueTracking_1at_1inView_1, lastPoint, currentPoint, controlView != null ? controlView.id : 0) != 0;
+}
+
+public int controlSize() {
+ return OS.objc_msgSend(this.id, OS.sel_controlSize);
+}
+
+public int controlTint() {
+ return OS.objc_msgSend(this.id, OS.sel_controlTint);
+}
+
+public NSView controlView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_controlView);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public static int defaultFocusRingType() {
+ return OS.objc_msgSend(OS.class_NSCell, OS.sel_defaultFocusRingType);
+}
+
+public static NSMenu defaultMenu() {
+ int result = OS.objc_msgSend(OS.class_NSCell, OS.sel_defaultMenu);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+public double doubleValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_doubleValue);
+}
+
+public void drawInteriorWithFrame(NSRect cellFrame, NSView controlView) {
+ OS.objc_msgSend(this.id, OS.sel_drawInteriorWithFrame_1inView_1, cellFrame, controlView != null ? controlView.id : 0);
+}
+
+public void drawWithExpansionFrame(NSRect cellFrame, NSView view) {
+ OS.objc_msgSend(this.id, OS.sel_drawWithExpansionFrame_1inView_1, cellFrame, view != null ? view.id : 0);
+}
+
+public void drawWithFrame(NSRect cellFrame, NSView controlView) {
+ OS.objc_msgSend(this.id, OS.sel_drawWithFrame_1inView_1, cellFrame, controlView != null ? controlView.id : 0);
+}
+
+public NSRect drawingRectForBounds(NSRect theRect) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_drawingRectForBounds_1, theRect);
+ return result;
+}
+
+public void editWithFrame(NSRect aRect, NSView controlView, NSText textObj, id anObject, NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_editWithFrame_1inView_1editor_1delegate_1event_1, aRect, controlView != null ? controlView.id : 0, textObj != null ? textObj.id : 0, anObject != null ? anObject.id : 0, theEvent != null ? theEvent.id : 0);
+}
+
+public void endEditing(NSText textObj) {
+ OS.objc_msgSend(this.id, OS.sel_endEditing_1, textObj != null ? textObj.id : 0);
+}
+
+public int entryType() {
+ return OS.objc_msgSend(this.id, OS.sel_entryType);
+}
+
+public NSRect expansionFrameWithFrame(NSRect cellFrame, NSView view) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_expansionFrameWithFrame_1inView_1, cellFrame, view != null ? view.id : 0);
+ return result;
+}
+
+public float floatValue() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_floatValue);
+}
+
+public int focusRingType() {
+ return OS.objc_msgSend(this.id, OS.sel_focusRingType);
+}
+
+public NSFont font() {
+ int result = OS.objc_msgSend(this.id, OS.sel_font);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public id formatter() {
+ int result = OS.objc_msgSend(this.id, OS.sel_formatter);
+ return result != 0 ? new id(result) : null;
+}
+
+public void getPeriodicDelay(int delay, int interval) {
+ OS.objc_msgSend(this.id, OS.sel_getPeriodicDelay_1interval_1, delay, interval);
+}
+
+public boolean hasValidObjectValue() {
+ return OS.objc_msgSend(this.id, OS.sel_hasValidObjectValue) != 0;
+}
+
+public void highlight(boolean flag, NSRect cellFrame, NSView controlView) {
+ OS.objc_msgSend(this.id, OS.sel_highlight_1withFrame_1inView_1, flag, cellFrame, controlView != null ? controlView.id : 0);
+}
+
+public NSColor highlightColorWithFrame(NSRect cellFrame, NSView controlView) {
+ int result = OS.objc_msgSend(this.id, OS.sel_highlightColorWithFrame_1inView_1, cellFrame, controlView != null ? controlView.id : 0);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public int hitTestForEvent(NSEvent event, NSRect cellFrame, NSView controlView) {
+ return OS.objc_msgSend(this.id, OS.sel_hitTestForEvent_1inRect_1ofView_1, event != null ? event.id : 0, cellFrame, controlView != null ? controlView.id : 0);
+}
+
+public NSImage image() {
+ int result = OS.objc_msgSend(this.id, OS.sel_image);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public NSRect imageRectForBounds(NSRect theRect) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_imageRectForBounds_1, theRect);
+ return result;
+}
+
+public boolean importsGraphics() {
+ return OS.objc_msgSend(this.id, OS.sel_importsGraphics) != 0;
+}
+
+public NSCell initImageCell(NSImage image) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initImageCell_1, image != null ? image.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSCell initTextCell(NSString aString) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initTextCell_1, aString != null ? aString.id : 0);
+ return result != 0 ? this : null;
+}
+
+public int intValue() {
+ return OS.objc_msgSend(this.id, OS.sel_intValue);
+}
+
+public int integerValue() {
+ return OS.objc_msgSend(this.id, OS.sel_integerValue);
+}
+
+public int interiorBackgroundStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_interiorBackgroundStyle);
+}
+
+public boolean isBezeled() {
+ return OS.objc_msgSend(this.id, OS.sel_isBezeled) != 0;
+}
+
+public boolean isBordered() {
+ return OS.objc_msgSend(this.id, OS.sel_isBordered) != 0;
+}
+
+public boolean isContinuous() {
+ return OS.objc_msgSend(this.id, OS.sel_isContinuous) != 0;
+}
+
+public boolean isEditable() {
+ return OS.objc_msgSend(this.id, OS.sel_isEditable) != 0;
+}
+
+public boolean isEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_isEnabled) != 0;
+}
+
+public boolean isEntryAcceptable(NSString aString) {
+ return OS.objc_msgSend(this.id, OS.sel_isEntryAcceptable_1, aString != null ? aString.id : 0) != 0;
+}
+
+public boolean isHighlighted() {
+ return OS.objc_msgSend(this.id, OS.sel_isHighlighted) != 0;
+}
+
+public boolean isOpaque() {
+ return OS.objc_msgSend(this.id, OS.sel_isOpaque) != 0;
+}
+
+public boolean isScrollable() {
+ return OS.objc_msgSend(this.id, OS.sel_isScrollable) != 0;
+}
+
+public boolean isSelectable() {
+ return OS.objc_msgSend(this.id, OS.sel_isSelectable) != 0;
+}
+
+public NSString keyEquivalent() {
+ int result = OS.objc_msgSend(this.id, OS.sel_keyEquivalent);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int lineBreakMode() {
+ return OS.objc_msgSend(this.id, OS.sel_lineBreakMode);
+}
+
+public NSMenu menu() {
+ int result = OS.objc_msgSend(this.id, OS.sel_menu);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+public NSMenu menuForEvent(NSEvent event, NSRect cellFrame, NSView view) {
+ int result = OS.objc_msgSend(this.id, OS.sel_menuForEvent_1inRect_1ofView_1, event != null ? event.id : 0, cellFrame, view != null ? view.id : 0);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+public NSString mnemonic() {
+ int result = OS.objc_msgSend(this.id, OS.sel_mnemonic);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int mnemonicLocation() {
+ return OS.objc_msgSend(this.id, OS.sel_mnemonicLocation);
+}
+
+public int mouseDownFlags() {
+ return OS.objc_msgSend(this.id, OS.sel_mouseDownFlags);
+}
+
+public int nextState() {
+ return OS.objc_msgSend(this.id, OS.sel_nextState);
+}
+
+public id objectValue() {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectValue);
+ return result != 0 ? new id(result) : null;
+}
+
+public void performClick(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_performClick_1, sender != null ? sender.id : 0);
+}
+
+public static boolean prefersTrackingUntilMouseUp() {
+ return OS.objc_msgSend(OS.class_NSCell, OS.sel_prefersTrackingUntilMouseUp) != 0;
+}
+
+public boolean refusesFirstResponder() {
+ return OS.objc_msgSend(this.id, OS.sel_refusesFirstResponder) != 0;
+}
+
+public id representedObject() {
+ int result = OS.objc_msgSend(this.id, OS.sel_representedObject);
+ return result != 0 ? new id(result) : null;
+}
+
+public void resetCursorRect(NSRect cellFrame, NSView controlView) {
+ OS.objc_msgSend(this.id, OS.sel_resetCursorRect_1inView_1, cellFrame, controlView != null ? controlView.id : 0);
+}
+
+public void selectWithFrame(NSRect aRect, NSView controlView, NSText textObj, id anObject, int selStart, int selLength) {
+ OS.objc_msgSend(this.id, OS.sel_selectWithFrame_1inView_1editor_1delegate_1start_1length_1, aRect, controlView != null ? controlView.id : 0, textObj != null ? textObj.id : 0, anObject != null ? anObject.id : 0, selStart, selLength);
+}
+
+public int sendActionOn(int mask) {
+ return OS.objc_msgSend(this.id, OS.sel_sendActionOn_1, mask);
+}
+
+public boolean sendsActionOnEndEditing() {
+ return OS.objc_msgSend(this.id, OS.sel_sendsActionOnEndEditing) != 0;
+}
+
+public void setAction(int aSelector) {
+ OS.objc_msgSend(this.id, OS.sel_setAction_1, aSelector);
+}
+
+public void setAlignment(int mode) {
+ OS.objc_msgSend(this.id, OS.sel_setAlignment_1, mode);
+}
+
+public void setAllowsEditingTextAttributes(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsEditingTextAttributes_1, flag);
+}
+
+public void setAllowsMixedState(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsMixedState_1, flag);
+}
+
+public void setAllowsUndo(boolean allowsUndo) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsUndo_1, allowsUndo);
+}
+
+public void setAttributedStringValue(NSAttributedString obj) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributedStringValue_1, obj != null ? obj.id : 0);
+}
+
+public void setBackgroundStyle(int style) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundStyle_1, style);
+}
+
+public void setBaseWritingDirection(int writingDirection) {
+ OS.objc_msgSend(this.id, OS.sel_setBaseWritingDirection_1, writingDirection);
+}
+
+public void setBezeled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setBezeled_1, flag);
+}
+
+public void setBordered(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setBordered_1, flag);
+}
+
+public void setCellAttribute(int aParameter, int value) {
+ OS.objc_msgSend(this.id, OS.sel_setCellAttribute_1to_1, aParameter, value);
+}
+
+public void setContinuous(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setContinuous_1, flag);
+}
+
+public void setControlSize(int size) {
+ OS.objc_msgSend(this.id, OS.sel_setControlSize_1, size);
+}
+
+public void setControlTint(int controlTint) {
+ OS.objc_msgSend(this.id, OS.sel_setControlTint_1, controlTint);
+}
+
+public void setControlView(NSView view) {
+ OS.objc_msgSend(this.id, OS.sel_setControlView_1, view != null ? view.id : 0);
+}
+
+public void setDoubleValue(double aDouble) {
+ OS.objc_msgSend(this.id, OS.sel_setDoubleValue_1, aDouble);
+}
+
+public void setEditable(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setEditable_1, flag);
+}
+
+public void setEnabled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setEnabled_1, flag);
+}
+
+public void setEntryType(int aType) {
+ OS.objc_msgSend(this.id, OS.sel_setEntryType_1, aType);
+}
+
+public void setFloatValue(float aFloat) {
+ OS.objc_msgSend(this.id, OS.sel_setFloatValue_1, aFloat);
+}
+
+public void setFloatingPointFormat(boolean autoRange, int leftDigits, int rightDigits) {
+ OS.objc_msgSend(this.id, OS.sel_setFloatingPointFormat_1left_1right_1, autoRange, leftDigits, rightDigits);
+}
+
+public void setFocusRingType(int focusRingType) {
+ OS.objc_msgSend(this.id, OS.sel_setFocusRingType_1, focusRingType);
+}
+
+public void setFont(NSFont fontObj) {
+ OS.objc_msgSend(this.id, OS.sel_setFont_1, fontObj != null ? fontObj.id : 0);
+}
+
+public void setFormatter(NSFormatter newFormatter) {
+ OS.objc_msgSend(this.id, OS.sel_setFormatter_1, newFormatter != null ? newFormatter.id : 0);
+}
+
+public void setHighlighted(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setHighlighted_1, flag);
+}
+
+public void setImage(NSImage image) {
+ OS.objc_msgSend(this.id, OS.sel_setImage_1, image != null ? image.id : 0);
+}
+
+public void setImportsGraphics(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setImportsGraphics_1, flag);
+}
+
+public void setIntValue(int anInt) {
+ OS.objc_msgSend(this.id, OS.sel_setIntValue_1, anInt);
+}
+
+public void setIntegerValue(int anInteger) {
+ OS.objc_msgSend(this.id, OS.sel_setIntegerValue_1, anInteger);
+}
+
+public void setLineBreakMode(int mode) {
+ OS.objc_msgSend(this.id, OS.sel_setLineBreakMode_1, mode);
+}
+
+public void setMenu(NSMenu aMenu) {
+ OS.objc_msgSend(this.id, OS.sel_setMenu_1, aMenu != null ? aMenu.id : 0);
+}
+
+public void setMnemonicLocation(int location) {
+ OS.objc_msgSend(this.id, OS.sel_setMnemonicLocation_1, location);
+}
+
+public void setNextState() {
+ OS.objc_msgSend(this.id, OS.sel_setNextState);
+}
+
+public void setObjectValue(id obj) {
+ OS.objc_msgSend(this.id, OS.sel_setObjectValue_1, obj != null ? obj.id : 0);
+}
+
+public void setRefusesFirstResponder(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setRefusesFirstResponder_1, flag);
+}
+
+public void setRepresentedObject(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setRepresentedObject_1, anObject != null ? anObject.id : 0);
+}
+
+public void setScrollable(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setScrollable_1, flag);
+}
+
+public void setSelectable(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectable_1, flag);
+}
+
+public void setSendsActionOnEndEditing(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setSendsActionOnEndEditing_1, flag);
+}
+
+public void setShowsFirstResponder(boolean showFR) {
+ OS.objc_msgSend(this.id, OS.sel_setShowsFirstResponder_1, showFR);
+}
+
+public void setState(int value) {
+ OS.objc_msgSend(this.id, OS.sel_setState_1, value);
+}
+
+public void setStringValue(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setStringValue_1, aString != null ? aString.id : 0);
+}
+
+public void setTag(int anInt) {
+ OS.objc_msgSend(this.id, OS.sel_setTag_1, anInt);
+}
+
+public void setTarget(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setTarget_1, anObject != null ? anObject.id : 0);
+}
+
+public void setTitle(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString != null ? aString.id : 0);
+}
+
+public void setTitleWithMnemonic(NSString stringWithAmpersand) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleWithMnemonic_1, stringWithAmpersand != null ? stringWithAmpersand.id : 0);
+}
+
+public void setTruncatesLastVisibleLine(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setTruncatesLastVisibleLine_1, flag);
+}
+
+public void setType(int aType) {
+ OS.objc_msgSend(this.id, OS.sel_setType_1, aType);
+}
+
+public NSText setUpFieldEditorAttributes(NSText textObj) {
+ int result = OS.objc_msgSend(this.id, OS.sel_setUpFieldEditorAttributes_1, textObj != null ? textObj.id : 0);
+ return result != 0 ? new NSText(result) : null;
+}
+
+public void setWraps(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setWraps_1, flag);
+}
+
+public boolean showsFirstResponder() {
+ return OS.objc_msgSend(this.id, OS.sel_showsFirstResponder) != 0;
+}
+
+public boolean startTrackingAt(NSPoint startPoint, NSView controlView) {
+ return OS.objc_msgSend(this.id, OS.sel_startTrackingAt_1inView_1, startPoint, controlView != null ? controlView.id : 0) != 0;
+}
+
+public int state() {
+ return OS.objc_msgSend(this.id, OS.sel_state);
+}
+
+public void stopTracking(NSPoint lastPoint, NSPoint stopPoint, NSView controlView, boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_stopTracking_1at_1inView_1mouseIsUp_1, lastPoint, stopPoint, controlView != null ? controlView.id : 0, flag);
+}
+
+public NSString stringValue() {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringValue);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int tag() {
+ return OS.objc_msgSend(this.id, OS.sel_tag);
+}
+
+public void takeDoubleValueFrom(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_takeDoubleValueFrom_1, sender != null ? sender.id : 0);
+}
+
+public void takeFloatValueFrom(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_takeFloatValueFrom_1, sender != null ? sender.id : 0);
+}
+
+public void takeIntValueFrom(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_takeIntValueFrom_1, sender != null ? sender.id : 0);
+}
+
+public void takeIntegerValueFrom(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_takeIntegerValueFrom_1, sender != null ? sender.id : 0);
+}
+
+public void takeObjectValueFrom(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_takeObjectValueFrom_1, sender != null ? sender.id : 0);
+}
+
+public void takeStringValueFrom(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_takeStringValueFrom_1, sender != null ? sender.id : 0);
+}
+
+public id target() {
+ int result = OS.objc_msgSend(this.id, OS.sel_target);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString title() {
+ int result = OS.objc_msgSend(this.id, OS.sel_title);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSRect titleRectForBounds(NSRect theRect) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_titleRectForBounds_1, theRect);
+ return result;
+}
+
+public boolean trackMouse(NSEvent theEvent, NSRect cellFrame, NSView controlView, boolean flag) {
+ return OS.objc_msgSend(this.id, OS.sel_trackMouse_1inRect_1ofView_1untilMouseUp_1, theEvent != null ? theEvent.id : 0, cellFrame, controlView != null ? controlView.id : 0, flag) != 0;
+}
+
+public boolean truncatesLastVisibleLine() {
+ return OS.objc_msgSend(this.id, OS.sel_truncatesLastVisibleLine) != 0;
+}
+
+public int type() {
+ return OS.objc_msgSend(this.id, OS.sel_type);
+}
+
+public boolean wantsNotificationForMarkedText() {
+ return OS.objc_msgSend(this.id, OS.sel_wantsNotificationForMarkedText) != 0;
+}
+
+public boolean wraps() {
+ return OS.objc_msgSend(this.id, OS.sel_wraps) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCharacterSet.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCharacterSet.java
new file mode 100644
index 0000000000..f9e61b47d9
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCharacterSet.java
@@ -0,0 +1,134 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSCharacterSet extends NSObject {
+
+public NSCharacterSet() {
+ super();
+}
+
+public NSCharacterSet(int id) {
+ super(id);
+}
+
+public static id alphanumericCharacterSet() {
+ int result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_alphanumericCharacterSet);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSData bitmapRepresentation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_bitmapRepresentation);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public static id capitalizedLetterCharacterSet() {
+ int result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_capitalizedLetterCharacterSet);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean characterIsMember(short aCharacter) {
+ return OS.objc_msgSend(this.id, OS.sel_characterIsMember_1, aCharacter) != 0;
+}
+
+public static id characterSetWithBitmapRepresentation(NSData data) {
+ int result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_characterSetWithBitmapRepresentation_1, data != null ? data.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id characterSetWithCharactersInString(NSString aString) {
+ int result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_characterSetWithCharactersInString_1, aString != null ? aString.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id characterSetWithContentsOfFile(NSString fName) {
+ int result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_characterSetWithContentsOfFile_1, fName != null ? fName.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id characterSetWithRange(NSRange aRange) {
+ int result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_characterSetWithRange_1, aRange);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id controlCharacterSet() {
+ int result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_controlCharacterSet);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id decimalDigitCharacterSet() {
+ int result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_decimalDigitCharacterSet);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id decomposableCharacterSet() {
+ int result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_decomposableCharacterSet);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean hasMemberInPlane(byte thePlane) {
+ return OS.objc_msgSend(this.id, OS.sel_hasMemberInPlane_1, thePlane) != 0;
+}
+
+public static id illegalCharacterSet() {
+ int result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_illegalCharacterSet);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSCharacterSet invertedSet() {
+ int result = OS.objc_msgSend(this.id, OS.sel_invertedSet);
+ return result == this.id ? this : (result != 0 ? new NSCharacterSet(result) : null);
+}
+
+public boolean isSupersetOfSet(NSCharacterSet theOtherSet) {
+ return OS.objc_msgSend(this.id, OS.sel_isSupersetOfSet_1, theOtherSet != null ? theOtherSet.id : 0) != 0;
+}
+
+public static id letterCharacterSet() {
+ int result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_letterCharacterSet);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean longCharacterIsMember(int theLongChar) {
+ return OS.objc_msgSend(this.id, OS.sel_longCharacterIsMember_1, theLongChar) != 0;
+}
+
+public static id lowercaseLetterCharacterSet() {
+ int result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_lowercaseLetterCharacterSet);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id newlineCharacterSet() {
+ int result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_newlineCharacterSet);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id nonBaseCharacterSet() {
+ int result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_nonBaseCharacterSet);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id punctuationCharacterSet() {
+ int result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_punctuationCharacterSet);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id symbolCharacterSet() {
+ int result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_symbolCharacterSet);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id uppercaseLetterCharacterSet() {
+ int result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_uppercaseLetterCharacterSet);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id whitespaceAndNewlineCharacterSet() {
+ int result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_whitespaceAndNewlineCharacterSet);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id whitespaceCharacterSet() {
+ int result = OS.objc_msgSend(OS.class_NSCharacterSet, OS.sel_whitespaceCharacterSet);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSClassDescription.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSClassDescription.java
new file mode 100644
index 0000000000..5ad30b3433
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSClassDescription.java
@@ -0,0 +1,46 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSClassDescription extends NSObject {
+
+public NSClassDescription() {
+ super();
+}
+
+public NSClassDescription(int id) {
+ super(id);
+}
+
+public NSArray attributeKeys() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributeKeys);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSClassDescription classDescriptionForClass(int aClass) {
+ int result = OS.objc_msgSend(OS.class_NSClassDescription, OS.sel_classDescriptionForClass_1, aClass);
+ return result != 0 ? new NSClassDescription(result) : null;
+}
+
+public static void invalidateClassDescriptionCache() {
+ OS.objc_msgSend(OS.class_NSClassDescription, OS.sel_invalidateClassDescriptionCache);
+}
+
+public NSString inverseForRelationshipKey(NSString relationshipKey) {
+ int result = OS.objc_msgSend(this.id, OS.sel_inverseForRelationshipKey_1, relationshipKey != null ? relationshipKey.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static void registerClassDescription(NSClassDescription description, int aClass) {
+ OS.objc_msgSend(OS.class_NSClassDescription, OS.sel_registerClassDescription_1forClass_1, description != null ? description.id : 0, aClass);
+}
+
+public NSArray toManyRelationshipKeys() {
+ int result = OS.objc_msgSend(this.id, OS.sel_toManyRelationshipKeys);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray toOneRelationshipKeys() {
+ int result = OS.objc_msgSend(this.id, OS.sel_toOneRelationshipKeys);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSClipView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSClipView.java
new file mode 100644
index 0000000000..aaf5eac077
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSClipView.java
@@ -0,0 +1,90 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSClipView extends NSView {
+
+public NSClipView() {
+ super();
+}
+
+public NSClipView(int id) {
+ super(id);
+}
+
+public boolean autoscroll(NSEvent theEvent) {
+ return OS.objc_msgSend(this.id, OS.sel_autoscroll_1, theEvent != null ? theEvent.id : 0) != 0;
+}
+
+public NSColor backgroundColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public NSPoint constrainScrollPoint(NSPoint newOrigin) {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_constrainScrollPoint_1, newOrigin);
+ return result;
+}
+
+public boolean copiesOnScroll() {
+ return OS.objc_msgSend(this.id, OS.sel_copiesOnScroll) != 0;
+}
+
+public NSCursor documentCursor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_documentCursor);
+ return result != 0 ? new NSCursor(result) : null;
+}
+
+public NSRect documentRect() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_documentRect);
+ return result;
+}
+
+public id documentView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_documentView);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSRect documentVisibleRect() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_documentVisibleRect);
+ return result;
+}
+
+public boolean drawsBackground() {
+ return OS.objc_msgSend(this.id, OS.sel_drawsBackground) != 0;
+}
+
+public void scrollToPoint(NSPoint newOrigin) {
+ OS.objc_msgSend(this.id, OS.sel_scrollToPoint_1, newOrigin);
+}
+
+public void setBackgroundColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color != null ? color.id : 0);
+}
+
+public void setCopiesOnScroll(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setCopiesOnScroll_1, flag);
+}
+
+public void setDocumentCursor(NSCursor anObj) {
+ OS.objc_msgSend(this.id, OS.sel_setDocumentCursor_1, anObj != null ? anObj.id : 0);
+}
+
+public void setDocumentView(NSView aView) {
+ OS.objc_msgSend(this.id, OS.sel_setDocumentView_1, aView != null ? aView.id : 0);
+}
+
+public void setDrawsBackground(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setDrawsBackground_1, flag);
+}
+
+public void viewBoundsChanged(NSNotification notification) {
+ OS.objc_msgSend(this.id, OS.sel_viewBoundsChanged_1, notification != null ? notification.id : 0);
+}
+
+public void viewFrameChanged(NSNotification notification) {
+ OS.objc_msgSend(this.id, OS.sel_viewFrameChanged_1, notification != null ? notification.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCloneCommand.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCloneCommand.java
new file mode 100644
index 0000000000..f171bd39c0
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCloneCommand.java
@@ -0,0 +1,22 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSCloneCommand extends NSScriptCommand {
+
+public NSCloneCommand() {
+ super();
+}
+
+public NSCloneCommand(int id) {
+ super(id);
+}
+
+public NSScriptObjectSpecifier keySpecifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_keySpecifier);
+ return result != 0 ? new NSScriptObjectSpecifier(result) : null;
+}
+
+public void setReceiversSpecifier(NSScriptObjectSpecifier receiversRef) {
+ OS.objc_msgSend(this.id, OS.sel_setReceiversSpecifier_1, receiversRef != null ? receiversRef.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCloseCommand.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCloseCommand.java
new file mode 100644
index 0000000000..8b60774f97
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCloseCommand.java
@@ -0,0 +1,17 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSCloseCommand extends NSScriptCommand {
+
+public NSCloseCommand() {
+ super();
+}
+
+public NSCloseCommand(int id) {
+ super(id);
+}
+
+public int saveOptions() {
+ return OS.objc_msgSend(this.id, OS.sel_saveOptions);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCoder.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCoder.java
new file mode 100644
index 0000000000..57672f8c48
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCoder.java
@@ -0,0 +1,258 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSCoder extends NSObject {
+
+public NSCoder() {
+ super();
+}
+
+public NSCoder(int id) {
+ super(id);
+}
+
+public boolean allowsKeyedCoding() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsKeyedCoding) != 0;
+}
+
+public boolean containsValueForKey(NSString key) {
+ return OS.objc_msgSend(this.id, OS.sel_containsValueForKey_1, key != null ? key.id : 0) != 0;
+}
+
+public void decodeArrayOfObjCType(int itemType, int count, int array) {
+ OS.objc_msgSend(this.id, OS.sel_decodeArrayOfObjCType_1count_1at_1, itemType, count, array);
+}
+
+public boolean decodeBoolForKey(NSString key) {
+ return OS.objc_msgSend(this.id, OS.sel_decodeBoolForKey_1, key != null ? key.id : 0) != 0;
+}
+
+public int decodeBytesForKey(NSString key, int lengthp) {
+ return OS.objc_msgSend(this.id, OS.sel_decodeBytesForKey_1returnedLength_1, key != null ? key.id : 0, lengthp);
+}
+
+public int decodeBytesWithReturnedLength(int lengthp) {
+ return OS.objc_msgSend(this.id, OS.sel_decodeBytesWithReturnedLength_1, lengthp);
+}
+
+public NSData decodeDataObject() {
+ int result = OS.objc_msgSend(this.id, OS.sel_decodeDataObject);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public double decodeDoubleForKey(NSString key) {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_decodeDoubleForKey_1, key != null ? key.id : 0);
+}
+
+public float decodeFloatForKey(NSString key) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_decodeFloatForKey_1, key != null ? key.id : 0);
+}
+
+public int decodeInt32ForKey(NSString key) {
+ return OS.objc_msgSend(this.id, OS.sel_decodeInt32ForKey_1, key != null ? key.id : 0);
+}
+
+public long decodeInt64ForKey(NSString key) {
+ return (long)OS.objc_msgSend(this.id, OS.sel_decodeInt64ForKey_1, key != null ? key.id : 0);
+}
+
+public int decodeIntForKey(NSString key) {
+ return OS.objc_msgSend(this.id, OS.sel_decodeIntForKey_1, key != null ? key.id : 0);
+}
+
+public int decodeIntegerForKey(NSString key) {
+ return OS.objc_msgSend(this.id, OS.sel_decodeIntegerForKey_1, key != null ? key.id : 0);
+}
+
+public id decodeNXObject() {
+ int result = OS.objc_msgSend(this.id, OS.sel_decodeNXObject);
+ return result != 0 ? new id(result) : null;
+}
+
+public id decodeObject() {
+ int result = OS.objc_msgSend(this.id, OS.sel_decodeObject);
+ return result != 0 ? new id(result) : null;
+}
+
+public id decodeObjectForKey(NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_decodeObjectForKey_1, key != null ? key.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSPoint decodePoint() {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_decodePoint);
+ return result;
+}
+
+public NSPoint decodePointForKey(NSString key) {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_decodePointForKey_1, key != null ? key.id : 0);
+ return result;
+}
+
+public id decodePropertyList() {
+ int result = OS.objc_msgSend(this.id, OS.sel_decodePropertyList);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSRect decodeRect() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_decodeRect);
+ return result;
+}
+
+public NSRect decodeRectForKey(NSString key) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_decodeRectForKey_1, key != null ? key.id : 0);
+ return result;
+}
+
+public NSSize decodeSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_decodeSize);
+ return result;
+}
+
+public NSSize decodeSizeForKey(NSString key) {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_decodeSizeForKey_1, key != null ? key.id : 0);
+ return result;
+}
+
+public void decodeValueOfObjCType(int type, int data) {
+ OS.objc_msgSend(this.id, OS.sel_decodeValueOfObjCType_1at_1, type, data);
+}
+
+public void decodeValuesOfObjCTypes(int decodeValuesOfObjCTypes) {
+ OS.objc_msgSend(this.id, OS.sel_decodeValuesOfObjCTypes_1, decodeValuesOfObjCTypes);
+}
+
+public void encodeArrayOfObjCType(int type, int count, int array) {
+ OS.objc_msgSend(this.id, OS.sel_encodeArrayOfObjCType_1count_1at_1, type, count, array);
+}
+
+public void encodeBool(boolean boolv, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeBool_1forKey_1, boolv, key != null ? key.id : 0);
+}
+
+public void encodeBycopyObject(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_encodeBycopyObject_1, anObject != null ? anObject.id : 0);
+}
+
+public void encodeByrefObject(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_encodeByrefObject_1, anObject != null ? anObject.id : 0);
+}
+
+public void encodeBytes_length_(int byteaddr, int length) {
+ OS.objc_msgSend(this.id, OS.sel_encodeBytes_1length_1, byteaddr, length);
+}
+
+public void encodeBytes_length_forKey_(int bytesp, int lenv, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeBytes_1length_1forKey_1, bytesp, lenv, key != null ? key.id : 0);
+}
+
+public void encodeConditionalObject_(id object) {
+ OS.objc_msgSend(this.id, OS.sel_encodeConditionalObject_1, object != null ? object.id : 0);
+}
+
+public void encodeConditionalObject_forKey_(id objv, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeConditionalObject_1forKey_1, objv != null ? objv.id : 0, key != null ? key.id : 0);
+}
+
+public void encodeDataObject(NSData data) {
+ OS.objc_msgSend(this.id, OS.sel_encodeDataObject_1, data != null ? data.id : 0);
+}
+
+public void encodeDouble(double realv, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeDouble_1forKey_1, realv, key != null ? key.id : 0);
+}
+
+public void encodeFloat(float realv, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeFloat_1forKey_1, realv, key != null ? key.id : 0);
+}
+
+public void encodeInt32(int intv, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeInt32_1forKey_1, intv, key != null ? key.id : 0);
+}
+
+public void encodeInt64(long intv, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeInt64_1forKey_1, intv, key != null ? key.id : 0);
+}
+
+public void encodeInt(int intv, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeInt_1forKey_1, intv, key != null ? key.id : 0);
+}
+
+public void encodeInteger(int intv, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeInteger_1forKey_1, intv, key != null ? key.id : 0);
+}
+
+public void encodeNXObject(id object) {
+ OS.objc_msgSend(this.id, OS.sel_encodeNXObject_1, object != null ? object.id : 0);
+}
+
+public void encodeObject_(id object) {
+ OS.objc_msgSend(this.id, OS.sel_encodeObject_1, object != null ? object.id : 0);
+}
+
+public void encodeObject_forKey_(id objv, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeObject_1forKey_1, objv != null ? objv.id : 0, key != null ? key.id : 0);
+}
+
+public void encodePoint_(NSPoint point) {
+ OS.objc_msgSend(this.id, OS.sel_encodePoint_1, point);
+}
+
+public void encodePoint_forKey_(NSPoint point, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodePoint_1forKey_1, point, key != null ? key.id : 0);
+}
+
+public void encodePropertyList(id aPropertyList) {
+ OS.objc_msgSend(this.id, OS.sel_encodePropertyList_1, aPropertyList != null ? aPropertyList.id : 0);
+}
+
+public void encodeRect_(NSRect rect) {
+ OS.objc_msgSend(this.id, OS.sel_encodeRect_1, rect);
+}
+
+public void encodeRect_forKey_(NSRect rect, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeRect_1forKey_1, rect, key != null ? key.id : 0);
+}
+
+public void encodeRootObject(id rootObject) {
+ OS.objc_msgSend(this.id, OS.sel_encodeRootObject_1, rootObject != null ? rootObject.id : 0);
+}
+
+public void encodeSize_(NSSize size) {
+ OS.objc_msgSend(this.id, OS.sel_encodeSize_1, size);
+}
+
+public void encodeSize_forKey_(NSSize size, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeSize_1forKey_1, size, key != null ? key.id : 0);
+}
+
+public void encodeValueOfObjCType(int type, int addr) {
+ OS.objc_msgSend(this.id, OS.sel_encodeValueOfObjCType_1at_1, type, addr);
+}
+
+public void encodeValuesOfObjCTypes(int encodeValuesOfObjCTypes) {
+ OS.objc_msgSend(this.id, OS.sel_encodeValuesOfObjCTypes_1, encodeValuesOfObjCTypes);
+}
+
+public int objectZone() {
+ return OS.objc_msgSend(this.id, OS.sel_objectZone);
+}
+
+public void setObjectZone(int zone) {
+ OS.objc_msgSend(this.id, OS.sel_setObjectZone_1, zone);
+}
+
+public int systemVersion() {
+ return OS.objc_msgSend(this.id, OS.sel_systemVersion);
+}
+
+public int versionForClassName(NSString className) {
+ return OS.objc_msgSend(this.id, OS.sel_versionForClassName_1, className != null ? className.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCollectionView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCollectionView.java
new file mode 100644
index 0000000000..9e93f8f3e8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCollectionView.java
@@ -0,0 +1,110 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSCollectionView extends NSView {
+
+public NSCollectionView() {
+ super();
+}
+
+public NSCollectionView(int id) {
+ super(id);
+}
+
+public boolean allowsMultipleSelection() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsMultipleSelection) != 0;
+}
+
+public NSArray backgroundColors() {
+ int result = OS.objc_msgSend(this.id, OS.sel_backgroundColors);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray content() {
+ int result = OS.objc_msgSend(this.id, OS.sel_content);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean isFirstResponder() {
+ return OS.objc_msgSend(this.id, OS.sel_isFirstResponder) != 0;
+}
+
+public boolean isSelectable() {
+ return OS.objc_msgSend(this.id, OS.sel_isSelectable) != 0;
+}
+
+public NSCollectionViewItem itemPrototype() {
+ int result = OS.objc_msgSend(this.id, OS.sel_itemPrototype);
+ return result != 0 ? new NSCollectionViewItem(result) : null;
+}
+
+public NSSize maxItemSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_maxItemSize);
+ return result;
+}
+
+public int maxNumberOfColumns() {
+ return OS.objc_msgSend(this.id, OS.sel_maxNumberOfColumns);
+}
+
+public int maxNumberOfRows() {
+ return OS.objc_msgSend(this.id, OS.sel_maxNumberOfRows);
+}
+
+public NSSize minItemSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_minItemSize);
+ return result;
+}
+
+public NSCollectionViewItem newItemForRepresentedObject(id object) {
+ int result = OS.objc_msgSend(this.id, OS.sel_newItemForRepresentedObject_1, object != null ? object.id : 0);
+ return result != 0 ? new NSCollectionViewItem(result) : null;
+}
+
+public NSIndexSet selectionIndexes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectionIndexes);
+ return result != 0 ? new NSIndexSet(result) : null;
+}
+
+public void setAllowsMultipleSelection(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsMultipleSelection_1, flag);
+}
+
+public void setBackgroundColors(NSArray colors) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundColors_1, colors != null ? colors.id : 0);
+}
+
+public void setContent(NSArray content) {
+ OS.objc_msgSend(this.id, OS.sel_setContent_1, content != null ? content.id : 0);
+}
+
+public void setItemPrototype(NSCollectionViewItem prototype) {
+ OS.objc_msgSend(this.id, OS.sel_setItemPrototype_1, prototype != null ? prototype.id : 0);
+}
+
+public void setMaxItemSize(NSSize size) {
+ OS.objc_msgSend(this.id, OS.sel_setMaxItemSize_1, size);
+}
+
+public void setMaxNumberOfColumns(int number) {
+ OS.objc_msgSend(this.id, OS.sel_setMaxNumberOfColumns_1, number);
+}
+
+public void setMaxNumberOfRows(int number) {
+ OS.objc_msgSend(this.id, OS.sel_setMaxNumberOfRows_1, number);
+}
+
+public void setMinItemSize(NSSize size) {
+ OS.objc_msgSend(this.id, OS.sel_setMinItemSize_1, size);
+}
+
+public void setSelectable(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectable_1, flag);
+}
+
+public void setSelectionIndexes(NSIndexSet indexes) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectionIndexes_1, indexes != null ? indexes.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCollectionViewItem.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCollectionViewItem.java
new file mode 100644
index 0000000000..66925e7242
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCollectionViewItem.java
@@ -0,0 +1,44 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSCollectionViewItem extends NSObject {
+
+public NSCollectionViewItem() {
+ super();
+}
+
+public NSCollectionViewItem(int id) {
+ super(id);
+}
+
+public NSCollectionView collectionView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_collectionView);
+ return result != 0 ? new NSCollectionView(result) : null;
+}
+
+public boolean isSelected() {
+ return OS.objc_msgSend(this.id, OS.sel_isSelected) != 0;
+}
+
+public id representedObject() {
+ int result = OS.objc_msgSend(this.id, OS.sel_representedObject);
+ return result != 0 ? new id(result) : null;
+}
+
+public void setRepresentedObject(id object) {
+ OS.objc_msgSend(this.id, OS.sel_setRepresentedObject_1, object != null ? object.id : 0);
+}
+
+public void setSelected(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setSelected_1, flag);
+}
+
+public void setView(NSView view) {
+ OS.objc_msgSend(this.id, OS.sel_setView_1, view != null ? view.id : 0);
+}
+
+public NSView view() {
+ int result = OS.objc_msgSend(this.id, OS.sel_view);
+ return result != 0 ? new NSView(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColor.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColor.java
new file mode 100644
index 0000000000..9e83b2fbb9
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColor.java
@@ -0,0 +1,487 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSColor extends NSObject {
+
+public NSColor() {
+ super();
+}
+
+public NSColor(int id) {
+ super(id);
+}
+
+public float alphaComponent() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_alphaComponent);
+}
+
+public static NSColor alternateSelectedControlColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_alternateSelectedControlColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor alternateSelectedControlTextColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_alternateSelectedControlTextColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor blackColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_blackColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public float blackComponent() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_blackComponent);
+}
+
+public NSColor blendedColorWithFraction(float fraction, NSColor color) {
+ int result = OS.objc_msgSend(this.id, OS.sel_blendedColorWithFraction_1ofColor_1, fraction, color != null ? color.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSColor(result) : null);
+}
+
+public static NSColor blueColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_blueColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public float blueComponent() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_blueComponent);
+}
+
+public float brightnessComponent() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_brightnessComponent);
+}
+
+public static NSColor brownColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_brownColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public NSString catalogNameComponent() {
+ int result = OS.objc_msgSend(this.id, OS.sel_catalogNameComponent);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSColor clearColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_clearColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor colorForControlTint(int controlTint) {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorForControlTint_1, controlTint);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor colorFromPasteboard(NSPasteboard pasteBoard) {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorFromPasteboard_1, pasteBoard != null ? pasteBoard.id : 0);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public NSString colorNameComponent() {
+ int result = OS.objc_msgSend(this.id, OS.sel_colorNameComponent);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSColorSpace colorSpace() {
+ int result = OS.objc_msgSend(this.id, OS.sel_colorSpace);
+ return result != 0 ? new NSColorSpace(result) : null;
+}
+
+public NSString colorSpaceName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_colorSpaceName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSColor colorUsingColorSpace(NSColorSpace space) {
+ int result = OS.objc_msgSend(this.id, OS.sel_colorUsingColorSpace_1, space != null ? space.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSColor(result) : null);
+}
+
+public NSColor colorUsingColorSpaceName_(NSString colorSpace) {
+ int result = OS.objc_msgSend(this.id, OS.sel_colorUsingColorSpaceName_1, colorSpace != null ? colorSpace.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSColor(result) : null);
+}
+
+public NSColor colorUsingColorSpaceName_device_(NSString colorSpace, NSDictionary deviceDescription) {
+ int result = OS.objc_msgSend(this.id, OS.sel_colorUsingColorSpaceName_1device_1, colorSpace != null ? colorSpace.id : 0, deviceDescription != null ? deviceDescription.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSColor(result) : null);
+}
+
+public NSColor colorWithAlphaComponent(float alpha) {
+ int result = OS.objc_msgSend(this.id, OS.sel_colorWithAlphaComponent_1, alpha);
+ return result == this.id ? this : (result != 0 ? new NSColor(result) : null);
+}
+
+public static NSColor colorWithCIColor(CIColor color) {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithCIColor_1, color != null ? color.id : 0);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor colorWithCalibratedHue(float hue, float saturation, float brightness, float alpha) {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithCalibratedHue_1saturation_1brightness_1alpha_1, hue, saturation, brightness, alpha);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor colorWithCalibratedRed(float red, float green, float blue, float alpha) {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithCalibratedRed_1green_1blue_1alpha_1, red, green, blue, alpha);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor colorWithCalibratedWhite(float white, float alpha) {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithCalibratedWhite_1alpha_1, white, alpha);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor colorWithCatalogName(NSString listName, NSString colorName) {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithCatalogName_1colorName_1, listName != null ? listName.id : 0, colorName != null ? colorName.id : 0);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor colorWithColorSpace(NSColorSpace space, int components, int numberOfComponents) {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithColorSpace_1components_1count_1, space != null ? space.id : 0, components, numberOfComponents);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor colorWithDeviceCyan(float cyan, float magenta, float yellow, float black, float alpha) {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithDeviceCyan_1magenta_1yellow_1black_1alpha_1, cyan, magenta, yellow, black, alpha);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor colorWithDeviceHue(float hue, float saturation, float brightness, float alpha) {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithDeviceHue_1saturation_1brightness_1alpha_1, hue, saturation, brightness, alpha);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor colorWithDeviceRed(float red, float green, float blue, float alpha) {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithDeviceRed_1green_1blue_1alpha_1, red, green, blue, alpha);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor colorWithDeviceWhite(float white, float alpha) {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithDeviceWhite_1alpha_1, white, alpha);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor colorWithPatternImage(NSImage image) {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_colorWithPatternImage_1, image != null ? image.id : 0);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSArray controlAlternatingRowBackgroundColors() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlAlternatingRowBackgroundColors);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSColor controlBackgroundColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlBackgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor controlColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor controlDarkShadowColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlDarkShadowColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor controlHighlightColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlHighlightColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor controlLightHighlightColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlLightHighlightColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor controlShadowColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlShadowColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor controlTextColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_controlTextColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static int currentControlTint() {
+ return OS.objc_msgSend(OS.class_NSColor, OS.sel_currentControlTint);
+}
+
+public static NSColor cyanColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_cyanColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public float cyanComponent() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_cyanComponent);
+}
+
+public static NSColor darkGrayColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_darkGrayColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor disabledControlTextColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_disabledControlTextColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public void drawSwatchInRect(NSRect rect) {
+ OS.objc_msgSend(this.id, OS.sel_drawSwatchInRect_1, rect);
+}
+
+public void getComponents(float[] components) {
+ OS.objc_msgSend(this.id, OS.sel_getComponents_1, components);
+}
+
+public void getCyan(int cyan, int magenta, int yellow, int black, int alpha) {
+ OS.objc_msgSend(this.id, OS.sel_getCyan_1magenta_1yellow_1black_1alpha_1, cyan, magenta, yellow, black, alpha);
+}
+
+public void getHue(int hue, int saturation, int brightness, int alpha) {
+ OS.objc_msgSend(this.id, OS.sel_getHue_1saturation_1brightness_1alpha_1, hue, saturation, brightness, alpha);
+}
+
+public void getRed(int red, int green, int blue, int alpha) {
+ OS.objc_msgSend(this.id, OS.sel_getRed_1green_1blue_1alpha_1, red, green, blue, alpha);
+}
+
+public void getWhite(int white, int alpha) {
+ OS.objc_msgSend(this.id, OS.sel_getWhite_1alpha_1, white, alpha);
+}
+
+public static NSColor grayColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_grayColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor greenColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_greenColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public float greenComponent() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_greenComponent);
+}
+
+public static NSColor gridColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_gridColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor headerColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_headerColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor headerTextColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_headerTextColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor highlightColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_highlightColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public NSColor highlightWithLevel(float val) {
+ int result = OS.objc_msgSend(this.id, OS.sel_highlightWithLevel_1, val);
+ return result == this.id ? this : (result != 0 ? new NSColor(result) : null);
+}
+
+public float hueComponent() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_hueComponent);
+}
+
+public static boolean ignoresAlpha() {
+ return OS.objc_msgSend(OS.class_NSColor, OS.sel_ignoresAlpha) != 0;
+}
+
+public static NSColor keyboardFocusIndicatorColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_keyboardFocusIndicatorColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor knobColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_knobColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor lightGrayColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_lightGrayColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public NSString localizedCatalogNameComponent() {
+ int result = OS.objc_msgSend(this.id, OS.sel_localizedCatalogNameComponent);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString localizedColorNameComponent() {
+ int result = OS.objc_msgSend(this.id, OS.sel_localizedColorNameComponent);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSColor magentaColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_magentaColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public float magentaComponent() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_magentaComponent);
+}
+
+public int numberOfComponents() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfComponents);
+}
+
+public static NSColor orangeColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_orangeColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public NSImage patternImage() {
+ int result = OS.objc_msgSend(this.id, OS.sel_patternImage);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public static NSColor purpleColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_purpleColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor redColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_redColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public float redComponent() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_redComponent);
+}
+
+public float saturationComponent() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_saturationComponent);
+}
+
+public static NSColor scrollBarColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_scrollBarColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor secondarySelectedControlColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_secondarySelectedControlColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor selectedControlColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_selectedControlColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor selectedControlTextColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_selectedControlTextColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor selectedKnobColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_selectedKnobColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor selectedMenuItemColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_selectedMenuItemColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor selectedMenuItemTextColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_selectedMenuItemTextColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor selectedTextBackgroundColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_selectedTextBackgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor selectedTextColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_selectedTextColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public void set() {
+ OS.objc_msgSend(this.id, OS.sel_set);
+}
+
+public void setFill() {
+ OS.objc_msgSend(this.id, OS.sel_setFill);
+}
+
+public static void setIgnoresAlpha(boolean flag) {
+ OS.objc_msgSend(OS.class_NSColor, OS.sel_setIgnoresAlpha_1, flag);
+}
+
+public void setStroke() {
+ OS.objc_msgSend(this.id, OS.sel_setStroke);
+}
+
+public static NSColor shadowColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_shadowColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public NSColor shadowWithLevel(float val) {
+ int result = OS.objc_msgSend(this.id, OS.sel_shadowWithLevel_1, val);
+ return result == this.id ? this : (result != 0 ? new NSColor(result) : null);
+}
+
+public static NSColor textBackgroundColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_textBackgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor textColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_textColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor whiteColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_whiteColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public float whiteComponent() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_whiteComponent);
+}
+
+public static NSColor windowBackgroundColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_windowBackgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor windowFrameColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_windowFrameColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public static NSColor windowFrameTextColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_windowFrameTextColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public void writeToPasteboard(NSPasteboard pasteBoard) {
+ OS.objc_msgSend(this.id, OS.sel_writeToPasteboard_1, pasteBoard != null ? pasteBoard.id : 0);
+}
+
+public static NSColor yellowColor() {
+ int result = OS.objc_msgSend(OS.class_NSColor, OS.sel_yellowColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public float yellowComponent() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_yellowComponent);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorList.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorList.java
new file mode 100644
index 0000000000..55dbf32bfa
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorList.java
@@ -0,0 +1,72 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSColorList extends NSObject {
+
+public NSColorList() {
+ super();
+}
+
+public NSColorList(int id) {
+ super(id);
+}
+
+public NSArray allKeys() {
+ int result = OS.objc_msgSend(this.id, OS.sel_allKeys);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray availableColorLists() {
+ int result = OS.objc_msgSend(OS.class_NSColorList, OS.sel_availableColorLists);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSColorList colorListNamed(NSString name) {
+ int result = OS.objc_msgSend(OS.class_NSColorList, OS.sel_colorListNamed_1, name != null ? name.id : 0);
+ return result != 0 ? new NSColorList(result) : null;
+}
+
+public NSColor colorWithKey(NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_colorWithKey_1, key != null ? key.id : 0);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public NSColorList initWithName_(NSString name) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithName_1, name != null ? name.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSColorList initWithName_fromFile_(NSString name, NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithName_1fromFile_1, name != null ? name.id : 0, path != null ? path.id : 0);
+ return result != 0 ? this : null;
+}
+
+public void insertColor(NSColor color, NSString key, int loc) {
+ OS.objc_msgSend(this.id, OS.sel_insertColor_1key_1atIndex_1, color != null ? color.id : 0, key != null ? key.id : 0, loc);
+}
+
+public boolean isEditable() {
+ return OS.objc_msgSend(this.id, OS.sel_isEditable) != 0;
+}
+
+public NSString name() {
+ int result = OS.objc_msgSend(this.id, OS.sel_name);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void removeColorWithKey(NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_removeColorWithKey_1, key != null ? key.id : 0);
+}
+
+public void removeFile() {
+ OS.objc_msgSend(this.id, OS.sel_removeFile);
+}
+
+public void setColor(NSColor color, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_setColor_1forKey_1, color != null ? color.id : 0, key != null ? key.id : 0);
+}
+
+public boolean writeToFile(NSString path) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToFile_1, path != null ? path.id : 0) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorPanel.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorPanel.java
new file mode 100644
index 0000000000..3ee33103e6
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorPanel.java
@@ -0,0 +1,96 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSColorPanel extends NSPanel {
+
+public NSColorPanel() {
+ super();
+}
+
+public NSColorPanel(int id) {
+ super(id);
+}
+
+public NSView accessoryView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_accessoryView);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public float alpha() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_alpha);
+}
+
+public void attachColorList(NSColorList colorList) {
+ OS.objc_msgSend(this.id, OS.sel_attachColorList_1, colorList != null ? colorList.id : 0);
+}
+
+public NSColor color() {
+ int result = OS.objc_msgSend(this.id, OS.sel_color);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public void detachColorList(NSColorList colorList) {
+ OS.objc_msgSend(this.id, OS.sel_detachColorList_1, colorList != null ? colorList.id : 0);
+}
+
+public static boolean dragColor(NSColor color, NSEvent theEvent, NSView sourceView) {
+ return OS.objc_msgSend(OS.class_NSColorPanel, OS.sel_dragColor_1withEvent_1fromView_1, color != null ? color.id : 0, theEvent != null ? theEvent.id : 0, sourceView != null ? sourceView.id : 0) != 0;
+}
+
+public boolean isContinuous() {
+ return OS.objc_msgSend(this.id, OS.sel_isContinuous) != 0;
+}
+
+public int mode() {
+ return OS.objc_msgSend(this.id, OS.sel_mode);
+}
+
+public void setAccessoryView(NSView aView) {
+ OS.objc_msgSend(this.id, OS.sel_setAccessoryView_1, aView != null ? aView.id : 0);
+}
+
+public void setAction(int aSelector) {
+ OS.objc_msgSend(this.id, OS.sel_setAction_1, aSelector);
+}
+
+public void setColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setColor_1, color != null ? color.id : 0);
+}
+
+public void setContinuous(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setContinuous_1, flag);
+}
+
+public void setMode(int mode) {
+ OS.objc_msgSend(this.id, OS.sel_setMode_1, mode);
+}
+
+public static void setPickerMask(int mask) {
+ OS.objc_msgSend(OS.class_NSColorPanel, OS.sel_setPickerMask_1, mask);
+}
+
+public static void setPickerMode(int mode) {
+ OS.objc_msgSend(OS.class_NSColorPanel, OS.sel_setPickerMode_1, mode);
+}
+
+public void setShowsAlpha(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setShowsAlpha_1, flag);
+}
+
+public void setTarget(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setTarget_1, anObject != null ? anObject.id : 0);
+}
+
+public static NSColorPanel sharedColorPanel() {
+ int result = OS.objc_msgSend(OS.class_NSColorPanel, OS.sel_sharedColorPanel);
+ return result != 0 ? new NSColorPanel(result) : null;
+}
+
+public static boolean sharedColorPanelExists() {
+ return OS.objc_msgSend(OS.class_NSColorPanel, OS.sel_sharedColorPanelExists) != 0;
+}
+
+public boolean showsAlpha() {
+ return OS.objc_msgSend(this.id, OS.sel_showsAlpha) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorPicker.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorPicker.java
new file mode 100644
index 0000000000..913512c7d6
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorPicker.java
@@ -0,0 +1,59 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSColorPicker extends NSObject {
+
+public NSColorPicker() {
+ super();
+}
+
+public NSColorPicker(int id) {
+ super(id);
+}
+
+public void attachColorList(NSColorList colorList) {
+ OS.objc_msgSend(this.id, OS.sel_attachColorList_1, colorList != null ? colorList.id : 0);
+}
+
+public NSString buttonToolTip() {
+ int result = OS.objc_msgSend(this.id, OS.sel_buttonToolTip);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSColorPanel colorPanel() {
+ int result = OS.objc_msgSend(this.id, OS.sel_colorPanel);
+ return result != 0 ? new NSColorPanel(result) : null;
+}
+
+public void detachColorList(NSColorList colorList) {
+ OS.objc_msgSend(this.id, OS.sel_detachColorList_1, colorList != null ? colorList.id : 0);
+}
+
+public NSColorPicker initWithPickerMask(int mask, NSColorPanel owningColorPanel) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithPickerMask_1colorPanel_1, mask, owningColorPanel != null ? owningColorPanel.id : 0);
+ return result != 0 ? this : null;
+}
+
+public void insertNewButtonImage(NSImage newButtonImage, NSButtonCell buttonCell) {
+ OS.objc_msgSend(this.id, OS.sel_insertNewButtonImage_1in_1, newButtonImage != null ? newButtonImage.id : 0, buttonCell != null ? buttonCell.id : 0);
+}
+
+public NSSize minContentSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_minContentSize);
+ return result;
+}
+
+public NSImage provideNewButtonImage() {
+ int result = OS.objc_msgSend(this.id, OS.sel_provideNewButtonImage);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public void setMode(int mode) {
+ OS.objc_msgSend(this.id, OS.sel_setMode_1, mode);
+}
+
+public void viewSizeChanged(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_viewSizeChanged_1, sender != null ? sender.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorSpace.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorSpace.java
new file mode 100644
index 0000000000..f57549d158
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorSpace.java
@@ -0,0 +1,94 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSColorSpace extends NSObject {
+
+public NSColorSpace() {
+ super();
+}
+
+public NSColorSpace(int id) {
+ super(id);
+}
+
+public int CGColorSpace() {
+ return OS.objc_msgSend(this.id, OS.sel_CGColorSpace);
+}
+
+public NSData ICCProfileData() {
+ int result = OS.objc_msgSend(this.id, OS.sel_ICCProfileData);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public static NSColorSpace adobeRGB1998ColorSpace() {
+ int result = OS.objc_msgSend(OS.class_NSColorSpace, OS.sel_adobeRGB1998ColorSpace);
+ return result != 0 ? new NSColorSpace(result) : null;
+}
+
+public int colorSpaceModel() {
+ return OS.objc_msgSend(this.id, OS.sel_colorSpaceModel);
+}
+
+public int colorSyncProfile() {
+ return OS.objc_msgSend(this.id, OS.sel_colorSyncProfile);
+}
+
+public static NSColorSpace deviceCMYKColorSpace() {
+ int result = OS.objc_msgSend(OS.class_NSColorSpace, OS.sel_deviceCMYKColorSpace);
+ return result != 0 ? new NSColorSpace(result) : null;
+}
+
+public static NSColorSpace deviceGrayColorSpace() {
+ int result = OS.objc_msgSend(OS.class_NSColorSpace, OS.sel_deviceGrayColorSpace);
+ return result != 0 ? new NSColorSpace(result) : null;
+}
+
+public static NSColorSpace deviceRGBColorSpace() {
+ int result = OS.objc_msgSend(OS.class_NSColorSpace, OS.sel_deviceRGBColorSpace);
+ return result != 0 ? new NSColorSpace(result) : null;
+}
+
+public static NSColorSpace genericCMYKColorSpace() {
+ int result = OS.objc_msgSend(OS.class_NSColorSpace, OS.sel_genericCMYKColorSpace);
+ return result != 0 ? new NSColorSpace(result) : null;
+}
+
+public static NSColorSpace genericGrayColorSpace() {
+ int result = OS.objc_msgSend(OS.class_NSColorSpace, OS.sel_genericGrayColorSpace);
+ return result != 0 ? new NSColorSpace(result) : null;
+}
+
+public static NSColorSpace genericRGBColorSpace() {
+ int result = OS.objc_msgSend(OS.class_NSColorSpace, OS.sel_genericRGBColorSpace);
+ return result != 0 ? new NSColorSpace(result) : null;
+}
+
+public NSColorSpace initWithCGColorSpace(int cgColorSpace) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCGColorSpace_1, cgColorSpace);
+ return result != 0 ? this : null;
+}
+
+public NSColorSpace initWithColorSyncProfile(int prof) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithColorSyncProfile_1, prof);
+ return result != 0 ? this : null;
+}
+
+public NSColorSpace initWithICCProfileData(NSData iccData) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithICCProfileData_1, iccData != null ? iccData.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSString localizedName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_localizedName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int numberOfColorComponents() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfColorComponents);
+}
+
+public static NSColorSpace sRGBColorSpace() {
+ int result = OS.objc_msgSend(OS.class_NSColorSpace, OS.sel_sRGBColorSpace);
+ return result != 0 ? new NSColorSpace(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorWell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorWell.java
new file mode 100644
index 0000000000..ebea6d2161
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSColorWell.java
@@ -0,0 +1,50 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSColorWell extends NSControl {
+
+public NSColorWell() {
+ super();
+}
+
+public NSColorWell(int id) {
+ super(id);
+}
+
+public void activate(boolean exclusive) {
+ OS.objc_msgSend(this.id, OS.sel_activate_1, exclusive);
+}
+
+public NSColor color() {
+ int result = OS.objc_msgSend(this.id, OS.sel_color);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public void deactivate() {
+ OS.objc_msgSend(this.id, OS.sel_deactivate);
+}
+
+public void drawWellInside(NSRect insideRect) {
+ OS.objc_msgSend(this.id, OS.sel_drawWellInside_1, insideRect);
+}
+
+public boolean isActive() {
+ return OS.objc_msgSend(this.id, OS.sel_isActive) != 0;
+}
+
+public boolean isBordered() {
+ return OS.objc_msgSend(this.id, OS.sel_isBordered) != 0;
+}
+
+public void setBordered(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setBordered_1, flag);
+}
+
+public void setColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setColor_1, color != null ? color.id : 0);
+}
+
+public void takeColorFrom(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_takeColorFrom_1, sender != null ? sender.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSComboBox.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSComboBox.java
new file mode 100644
index 0000000000..ebbf3a8318
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSComboBox.java
@@ -0,0 +1,159 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSComboBox extends NSTextField {
+
+public NSComboBox() {
+ super();
+}
+
+public NSComboBox(int id) {
+ super(id);
+}
+
+public void addItemWithObjectValue(id object) {
+ OS.objc_msgSend(this.id, OS.sel_addItemWithObjectValue_1, object != null ? object.id : 0);
+}
+
+public void addItemsWithObjectValues(NSArray objects) {
+ OS.objc_msgSend(this.id, OS.sel_addItemsWithObjectValues_1, objects != null ? objects.id : 0);
+}
+
+public boolean completes() {
+ return OS.objc_msgSend(this.id, OS.sel_completes) != 0;
+}
+
+public id dataSource() {
+ int result = OS.objc_msgSend(this.id, OS.sel_dataSource);
+ return result != 0 ? new id(result) : null;
+}
+
+public void deselectItemAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_deselectItemAtIndex_1, index);
+}
+
+public boolean hasVerticalScroller() {
+ return OS.objc_msgSend(this.id, OS.sel_hasVerticalScroller) != 0;
+}
+
+public int indexOfItemWithObjectValue(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfItemWithObjectValue_1, object != null ? object.id : 0);
+}
+
+public int indexOfSelectedItem() {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfSelectedItem);
+}
+
+public void insertItemWithObjectValue(id object, int index) {
+ OS.objc_msgSend(this.id, OS.sel_insertItemWithObjectValue_1atIndex_1, object != null ? object.id : 0, index);
+}
+
+public NSSize intercellSpacing() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_intercellSpacing);
+ return result;
+}
+
+public boolean isButtonBordered() {
+ return OS.objc_msgSend(this.id, OS.sel_isButtonBordered) != 0;
+}
+
+public float itemHeight() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_itemHeight);
+}
+
+public int itemObjectValueAtIndex(int index) {
+ int result = OS.objc_msgSend(this.id, OS.sel_itemObjectValueAtIndex_1, index);
+ return result != 0 ? result : 0;
+}
+
+public void noteNumberOfItemsChanged() {
+ OS.objc_msgSend(this.id, OS.sel_noteNumberOfItemsChanged);
+}
+
+public int numberOfItems() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfItems);
+}
+
+public int numberOfVisibleItems() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfVisibleItems);
+}
+
+public id objectValueOfSelectedItem() {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectValueOfSelectedItem);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSArray objectValues() {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectValues);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void reloadData() {
+ OS.objc_msgSend(this.id, OS.sel_reloadData);
+}
+
+public void removeAllItems() {
+ OS.objc_msgSend(this.id, OS.sel_removeAllItems);
+}
+
+public void removeItemAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_removeItemAtIndex_1, index);
+}
+
+public void removeItemWithObjectValue(id object) {
+ OS.objc_msgSend(this.id, OS.sel_removeItemWithObjectValue_1, object != null ? object.id : 0);
+}
+
+public void scrollItemAtIndexToTop(int index) {
+ OS.objc_msgSend(this.id, OS.sel_scrollItemAtIndexToTop_1, index);
+}
+
+public void scrollItemAtIndexToVisible(int index) {
+ OS.objc_msgSend(this.id, OS.sel_scrollItemAtIndexToVisible_1, index);
+}
+
+public void selectItemAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_selectItemAtIndex_1, index);
+}
+
+public void selectItemWithObjectValue(id object) {
+ OS.objc_msgSend(this.id, OS.sel_selectItemWithObjectValue_1, object != null ? object.id : 0);
+}
+
+public void setButtonBordered(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setButtonBordered_1, flag);
+}
+
+public void setCompletes(boolean completes) {
+ OS.objc_msgSend(this.id, OS.sel_setCompletes_1, completes);
+}
+
+public void setDataSource(id aSource) {
+ OS.objc_msgSend(this.id, OS.sel_setDataSource_1, aSource != null ? aSource.id : 0);
+}
+
+public void setHasVerticalScroller(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setHasVerticalScroller_1, flag);
+}
+
+public void setIntercellSpacing(NSSize aSize) {
+ OS.objc_msgSend(this.id, OS.sel_setIntercellSpacing_1, aSize);
+}
+
+public void setItemHeight(float itemHeight) {
+ OS.objc_msgSend(this.id, OS.sel_setItemHeight_1, itemHeight);
+}
+
+public void setNumberOfVisibleItems(int visibleItems) {
+ OS.objc_msgSend(this.id, OS.sel_setNumberOfVisibleItems_1, visibleItems);
+}
+
+public void setUsesDataSource(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setUsesDataSource_1, flag);
+}
+
+public boolean usesDataSource() {
+ return OS.objc_msgSend(this.id, OS.sel_usesDataSource) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSComboBoxCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSComboBoxCell.java
new file mode 100644
index 0000000000..ff23c3b385
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSComboBoxCell.java
@@ -0,0 +1,164 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSComboBoxCell extends NSTextFieldCell {
+
+public NSComboBoxCell() {
+ super();
+}
+
+public NSComboBoxCell(int id) {
+ super(id);
+}
+
+public void addItemWithObjectValue(id object) {
+ OS.objc_msgSend(this.id, OS.sel_addItemWithObjectValue_1, object != null ? object.id : 0);
+}
+
+public void addItemsWithObjectValues(NSArray objects) {
+ OS.objc_msgSend(this.id, OS.sel_addItemsWithObjectValues_1, objects != null ? objects.id : 0);
+}
+
+public NSString completedString(NSString string) {
+ int result = OS.objc_msgSend(this.id, OS.sel_completedString_1, string != null ? string.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean completes() {
+ return OS.objc_msgSend(this.id, OS.sel_completes) != 0;
+}
+
+public id dataSource() {
+ int result = OS.objc_msgSend(this.id, OS.sel_dataSource);
+ return result != 0 ? new id(result) : null;
+}
+
+public void deselectItemAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_deselectItemAtIndex_1, index);
+}
+
+public boolean hasVerticalScroller() {
+ return OS.objc_msgSend(this.id, OS.sel_hasVerticalScroller) != 0;
+}
+
+public int indexOfItemWithObjectValue(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfItemWithObjectValue_1, object != null ? object.id : 0);
+}
+
+public int indexOfSelectedItem() {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfSelectedItem);
+}
+
+public void insertItemWithObjectValue(id object, int index) {
+ OS.objc_msgSend(this.id, OS.sel_insertItemWithObjectValue_1atIndex_1, object != null ? object.id : 0, index);
+}
+
+public NSSize intercellSpacing() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_intercellSpacing);
+ return result;
+}
+
+public boolean isButtonBordered() {
+ return OS.objc_msgSend(this.id, OS.sel_isButtonBordered) != 0;
+}
+
+public float itemHeight() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_itemHeight);
+}
+
+public id itemObjectValueAtIndex(int index) {
+ int result = OS.objc_msgSend(this.id, OS.sel_itemObjectValueAtIndex_1, index);
+ return result != 0 ? new id(result) : null;
+}
+
+public void noteNumberOfItemsChanged() {
+ OS.objc_msgSend(this.id, OS.sel_noteNumberOfItemsChanged);
+}
+
+public int numberOfItems() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfItems);
+}
+
+public int numberOfVisibleItems() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfVisibleItems);
+}
+
+public id objectValueOfSelectedItem() {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectValueOfSelectedItem);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSArray objectValues() {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectValues);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void reloadData() {
+ OS.objc_msgSend(this.id, OS.sel_reloadData);
+}
+
+public void removeAllItems() {
+ OS.objc_msgSend(this.id, OS.sel_removeAllItems);
+}
+
+public void removeItemAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_removeItemAtIndex_1, index);
+}
+
+public void removeItemWithObjectValue(id object) {
+ OS.objc_msgSend(this.id, OS.sel_removeItemWithObjectValue_1, object != null ? object.id : 0);
+}
+
+public void scrollItemAtIndexToTop(int index) {
+ OS.objc_msgSend(this.id, OS.sel_scrollItemAtIndexToTop_1, index);
+}
+
+public void scrollItemAtIndexToVisible(int index) {
+ OS.objc_msgSend(this.id, OS.sel_scrollItemAtIndexToVisible_1, index);
+}
+
+public void selectItemAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_selectItemAtIndex_1, index);
+}
+
+public void selectItemWithObjectValue(id object) {
+ OS.objc_msgSend(this.id, OS.sel_selectItemWithObjectValue_1, object != null ? object.id : 0);
+}
+
+public void setButtonBordered(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setButtonBordered_1, flag);
+}
+
+public void setCompletes(boolean completes) {
+ OS.objc_msgSend(this.id, OS.sel_setCompletes_1, completes);
+}
+
+public void setDataSource(id aSource) {
+ OS.objc_msgSend(this.id, OS.sel_setDataSource_1, aSource != null ? aSource.id : 0);
+}
+
+public void setHasVerticalScroller(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setHasVerticalScroller_1, flag);
+}
+
+public void setIntercellSpacing(NSSize aSize) {
+ OS.objc_msgSend(this.id, OS.sel_setIntercellSpacing_1, aSize);
+}
+
+public void setItemHeight(float itemHeight) {
+ OS.objc_msgSend(this.id, OS.sel_setItemHeight_1, itemHeight);
+}
+
+public void setNumberOfVisibleItems(int visibleItems) {
+ OS.objc_msgSend(this.id, OS.sel_setNumberOfVisibleItems_1, visibleItems);
+}
+
+public void setUsesDataSource(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setUsesDataSource_1, flag);
+}
+
+public boolean usesDataSource() {
+ return OS.objc_msgSend(this.id, OS.sel_usesDataSource) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSComparisonPredicate.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSComparisonPredicate.java
new file mode 100644
index 0000000000..9093de9584
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSComparisonPredicate.java
@@ -0,0 +1,59 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSComparisonPredicate extends NSPredicate {
+
+public NSComparisonPredicate() {
+ super();
+}
+
+public NSComparisonPredicate(int id) {
+ super(id);
+}
+
+public int comparisonPredicateModifier() {
+ return OS.objc_msgSend(this.id, OS.sel_comparisonPredicateModifier);
+}
+
+public int customSelector() {
+ return OS.objc_msgSend(this.id, OS.sel_customSelector);
+}
+
+public NSComparisonPredicate initWithLeftExpression_rightExpression_customSelector_(NSExpression lhs, NSExpression rhs, int selector) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithLeftExpression_1rightExpression_1customSelector_1, lhs != null ? lhs.id : 0, rhs != null ? rhs.id : 0, selector);
+ return result != 0 ? this : null;
+}
+
+public NSComparisonPredicate initWithLeftExpression_rightExpression_modifier_type_options_(NSExpression lhs, NSExpression rhs, int modifier, int type, int options) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithLeftExpression_1rightExpression_1modifier_1type_1options_1, lhs != null ? lhs.id : 0, rhs != null ? rhs.id : 0, modifier, type, options);
+ return result != 0 ? this : null;
+}
+
+public NSExpression leftExpression() {
+ int result = OS.objc_msgSend(this.id, OS.sel_leftExpression);
+ return result != 0 ? new NSExpression(result) : null;
+}
+
+public int options() {
+ return OS.objc_msgSend(this.id, OS.sel_options);
+}
+
+public int predicateOperatorType() {
+ return OS.objc_msgSend(this.id, OS.sel_predicateOperatorType);
+}
+
+public static NSPredicate static_predicateWithLeftExpression_rightExpression_customSelector_(NSExpression lhs, NSExpression rhs, int selector) {
+ int result = OS.objc_msgSend(OS.class_NSComparisonPredicate, OS.sel_predicateWithLeftExpression_1rightExpression_1customSelector_1, lhs != null ? lhs.id : 0, rhs != null ? rhs.id : 0, selector);
+ return result != 0 ? new NSPredicate(result) : null;
+}
+
+public static NSPredicate static_predicateWithLeftExpression_rightExpression_modifier_type_options_(NSExpression lhs, NSExpression rhs, int modifier, int type, int options) {
+ int result = OS.objc_msgSend(OS.class_NSComparisonPredicate, OS.sel_predicateWithLeftExpression_1rightExpression_1modifier_1type_1options_1, lhs != null ? lhs.id : 0, rhs != null ? rhs.id : 0, modifier, type, options);
+ return result != 0 ? new NSPredicate(result) : null;
+}
+
+public NSExpression rightExpression() {
+ int result = OS.objc_msgSend(this.id, OS.sel_rightExpression);
+ return result != 0 ? new NSExpression(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCompoundPredicate.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCompoundPredicate.java
new file mode 100644
index 0000000000..4fa28efabd
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCompoundPredicate.java
@@ -0,0 +1,42 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSCompoundPredicate extends NSPredicate {
+
+public NSCompoundPredicate() {
+ super();
+}
+
+public NSCompoundPredicate(int id) {
+ super(id);
+}
+
+public static NSPredicate andPredicateWithSubpredicates(NSArray subpredicates) {
+ int result = OS.objc_msgSend(OS.class_NSCompoundPredicate, OS.sel_andPredicateWithSubpredicates_1, subpredicates != null ? subpredicates.id : 0);
+ return result != 0 ? new NSPredicate(result) : null;
+}
+
+public int compoundPredicateType() {
+ return OS.objc_msgSend(this.id, OS.sel_compoundPredicateType);
+}
+
+public id initWithType(int type, NSArray subpredicates) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithType_1subpredicates_1, type, subpredicates != null ? subpredicates.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static NSPredicate notPredicateWithSubpredicate(NSPredicate predicate) {
+ int result = OS.objc_msgSend(OS.class_NSCompoundPredicate, OS.sel_notPredicateWithSubpredicate_1, predicate != null ? predicate.id : 0);
+ return result != 0 ? new NSPredicate(result) : null;
+}
+
+public static NSPredicate orPredicateWithSubpredicates(NSArray subpredicates) {
+ int result = OS.objc_msgSend(OS.class_NSCompoundPredicate, OS.sel_orPredicateWithSubpredicates_1, subpredicates != null ? subpredicates.id : 0);
+ return result != 0 ? new NSPredicate(result) : null;
+}
+
+public NSArray subpredicates() {
+ int result = OS.objc_msgSend(this.id, OS.sel_subpredicates);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCondition.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCondition.java
new file mode 100644
index 0000000000..323194958a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCondition.java
@@ -0,0 +1,38 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSCondition extends NSObject {
+
+public NSCondition() {
+ super();
+}
+
+public NSCondition(int id) {
+ super(id);
+}
+
+public void broadcast() {
+ OS.objc_msgSend(this.id, OS.sel_broadcast);
+}
+
+public NSString name() {
+ int result = OS.objc_msgSend(this.id, OS.sel_name);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void setName(NSString n) {
+ OS.objc_msgSend(this.id, OS.sel_setName_1, n != null ? n.id : 0);
+}
+
+public void signal() {
+ OS.objc_msgSend(this.id, OS.sel_signal);
+}
+
+//public void wait() {
+// OS.objc_msgSend(this.id, OS.sel_wait);
+//}
+
+public boolean waitUntilDate(NSDate limit) {
+ return OS.objc_msgSend(this.id, OS.sel_waitUntilDate_1, limit != null ? limit.id : 0) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSConditionLock.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSConditionLock.java
new file mode 100644
index 0000000000..681ccfe111
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSConditionLock.java
@@ -0,0 +1,55 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSConditionLock extends NSObject {
+
+public NSConditionLock() {
+ super();
+}
+
+public NSConditionLock(int id) {
+ super(id);
+}
+
+public int condition() {
+ return OS.objc_msgSend(this.id, OS.sel_condition);
+}
+
+public id initWithCondition(int condition) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCondition_1, condition);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean lockBeforeDate(NSDate limit) {
+ return OS.objc_msgSend(this.id, OS.sel_lockBeforeDate_1, limit != null ? limit.id : 0) != 0;
+}
+
+public void lockWhenCondition_(int condition) {
+ OS.objc_msgSend(this.id, OS.sel_lockWhenCondition_1, condition);
+}
+
+public boolean lockWhenCondition_beforeDate_(int condition, NSDate limit) {
+ return OS.objc_msgSend(this.id, OS.sel_lockWhenCondition_1beforeDate_1, condition, limit != null ? limit.id : 0) != 0;
+}
+
+public NSString name() {
+ int result = OS.objc_msgSend(this.id, OS.sel_name);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void setName(NSString n) {
+ OS.objc_msgSend(this.id, OS.sel_setName_1, n != null ? n.id : 0);
+}
+
+public boolean tryLock() {
+ return OS.objc_msgSend(this.id, OS.sel_tryLock) != 0;
+}
+
+public boolean tryLockWhenCondition(int condition) {
+ return OS.objc_msgSend(this.id, OS.sel_tryLockWhenCondition_1, condition) != 0;
+}
+
+public void unlockWithCondition(int condition) {
+ OS.objc_msgSend(this.id, OS.sel_unlockWithCondition_1, condition);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSConnection.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSConnection.java
new file mode 100644
index 0000000000..37c36326f8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSConnection.java
@@ -0,0 +1,189 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSConnection extends NSObject {
+
+public NSConnection() {
+ super();
+}
+
+public NSConnection(int id) {
+ super(id);
+}
+
+public void addRequestMode(NSString rmode) {
+ OS.objc_msgSend(this.id, OS.sel_addRequestMode_1, rmode != null ? rmode.id : 0);
+}
+
+public void addRunLoop(NSRunLoop runloop) {
+ OS.objc_msgSend(this.id, OS.sel_addRunLoop_1, runloop != null ? runloop.id : 0);
+}
+
+public static NSArray allConnections() {
+ int result = OS.objc_msgSend(OS.class_NSConnection, OS.sel_allConnections);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static id connectionWithReceivePort(NSPort receivePort, NSPort sendPort) {
+ int result = OS.objc_msgSend(OS.class_NSConnection, OS.sel_connectionWithReceivePort_1sendPort_1, receivePort != null ? receivePort.id : 0, sendPort != null ? sendPort.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_connectionWithRegisteredName_host_(NSString name, NSString hostName) {
+ int result = OS.objc_msgSend(OS.class_NSConnection, OS.sel_connectionWithRegisteredName_1host_1, name != null ? name.id : 0, hostName != null ? hostName.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_connectionWithRegisteredName_host_usingNameServer_(NSString name, NSString hostName, NSPortNameServer server) {
+ int result = OS.objc_msgSend(OS.class_NSConnection, OS.sel_connectionWithRegisteredName_1host_1usingNameServer_1, name != null ? name.id : 0, hostName != null ? hostName.id : 0, server != null ? server.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id currentConversation() {
+ int result = OS.objc_msgSend(OS.class_NSConnection, OS.sel_currentConversation);
+ return result != 0 ? new id(result) : null;
+}
+
+public static NSConnection defaultConnection() {
+ int result = OS.objc_msgSend(OS.class_NSConnection, OS.sel_defaultConnection);
+ return result != 0 ? new NSConnection(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public void enableMultipleThreads() {
+ OS.objc_msgSend(this.id, OS.sel_enableMultipleThreads);
+}
+
+public boolean independentConversationQueueing() {
+ return OS.objc_msgSend(this.id, OS.sel_independentConversationQueueing) != 0;
+}
+
+public id initWithReceivePort(NSPort receivePort, NSPort sendPort) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithReceivePort_1sendPort_1, receivePort != null ? receivePort.id : 0, sendPort != null ? sendPort.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void invalidate() {
+ OS.objc_msgSend(this.id, OS.sel_invalidate);
+}
+
+public boolean isValid() {
+ return OS.objc_msgSend(this.id, OS.sel_isValid) != 0;
+}
+
+public NSArray localObjects() {
+ int result = OS.objc_msgSend(this.id, OS.sel_localObjects);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean multipleThreadsEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_multipleThreadsEnabled) != 0;
+}
+
+public NSPort receivePort() {
+ int result = OS.objc_msgSend(this.id, OS.sel_receivePort);
+ return result != 0 ? new NSPort(result) : null;
+}
+
+public boolean registerName_(NSString name) {
+ return OS.objc_msgSend(this.id, OS.sel_registerName_1, name != null ? name.id : 0) != 0;
+}
+
+public boolean registerName_withNameServer_(NSString name, NSPortNameServer server) {
+ return OS.objc_msgSend(this.id, OS.sel_registerName_1withNameServer_1, name != null ? name.id : 0, server != null ? server.id : 0) != 0;
+}
+
+public NSArray remoteObjects() {
+ int result = OS.objc_msgSend(this.id, OS.sel_remoteObjects);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void removeRequestMode(NSString rmode) {
+ OS.objc_msgSend(this.id, OS.sel_removeRequestMode_1, rmode != null ? rmode.id : 0);
+}
+
+public void removeRunLoop(NSRunLoop runloop) {
+ OS.objc_msgSend(this.id, OS.sel_removeRunLoop_1, runloop != null ? runloop.id : 0);
+}
+
+public double replyTimeout() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_replyTimeout);
+}
+
+public NSArray requestModes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_requestModes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public double requestTimeout() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_requestTimeout);
+}
+
+public id rootObject() {
+ int result = OS.objc_msgSend(this.id, OS.sel_rootObject);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSDistantObject rootProxy() {
+ int result = OS.objc_msgSend(this.id, OS.sel_rootProxy);
+ return result != 0 ? new NSDistantObject(result) : null;
+}
+
+public static NSDistantObject static_rootProxyForConnectionWithRegisteredName_host_(NSString name, NSString hostName) {
+ int result = OS.objc_msgSend(OS.class_NSConnection, OS.sel_rootProxyForConnectionWithRegisteredName_1host_1, name != null ? name.id : 0, hostName != null ? hostName.id : 0);
+ return result != 0 ? new NSDistantObject(result) : null;
+}
+
+public static NSDistantObject static_rootProxyForConnectionWithRegisteredName_host_usingNameServer_(NSString name, NSString hostName, NSPortNameServer server) {
+ int result = OS.objc_msgSend(OS.class_NSConnection, OS.sel_rootProxyForConnectionWithRegisteredName_1host_1usingNameServer_1, name != null ? name.id : 0, hostName != null ? hostName.id : 0, server != null ? server.id : 0);
+ return result != 0 ? new NSDistantObject(result) : null;
+}
+
+public void runInNewThread() {
+ OS.objc_msgSend(this.id, OS.sel_runInNewThread);
+}
+
+public NSPort sendPort() {
+ int result = OS.objc_msgSend(this.id, OS.sel_sendPort);
+ return result != 0 ? new NSPort(result) : null;
+}
+
+public static id static_serviceConnectionWithName_rootObject_(NSString name, id root) {
+ int result = OS.objc_msgSend(OS.class_NSConnection, OS.sel_serviceConnectionWithName_1rootObject_1, name != null ? name.id : 0, root != null ? root.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_serviceConnectionWithName_rootObject_usingNameServer_(NSString name, id root, NSPortNameServer server) {
+ int result = OS.objc_msgSend(OS.class_NSConnection, OS.sel_serviceConnectionWithName_1rootObject_1usingNameServer_1, name != null ? name.id : 0, root != null ? root.id : 0, server != null ? server.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void setDelegate(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
+}
+
+public void setIndependentConversationQueueing(boolean yorn) {
+ OS.objc_msgSend(this.id, OS.sel_setIndependentConversationQueueing_1, yorn);
+}
+
+public void setReplyTimeout(double ti) {
+ OS.objc_msgSend(this.id, OS.sel_setReplyTimeout_1, ti);
+}
+
+public void setRequestTimeout(double ti) {
+ OS.objc_msgSend(this.id, OS.sel_setRequestTimeout_1, ti);
+}
+
+public void setRootObject(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setRootObject_1, anObject != null ? anObject.id : 0);
+}
+
+public NSDictionary statistics() {
+ int result = OS.objc_msgSend(this.id, OS.sel_statistics);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSControl.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSControl.java
new file mode 100644
index 0000000000..809a13f666
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSControl.java
@@ -0,0 +1,278 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSControl extends NSView {
+
+public NSControl() {
+ super();
+}
+
+public NSControl(int id) {
+ super(id);
+}
+
+public boolean abortEditing() {
+ return OS.objc_msgSend(this.id, OS.sel_abortEditing) != 0;
+}
+
+public int action() {
+ return OS.objc_msgSend(this.id, OS.sel_action);
+}
+
+public int alignment() {
+ return OS.objc_msgSend(this.id, OS.sel_alignment);
+}
+
+public NSAttributedString attributedStringValue() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributedStringValue);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public int baseWritingDirection() {
+ return OS.objc_msgSend(this.id, OS.sel_baseWritingDirection);
+}
+
+public void calcSize() {
+ OS.objc_msgSend(this.id, OS.sel_calcSize);
+}
+
+public int cell() {
+ int result = OS.objc_msgSend(this.id, OS.sel_cell);
+ return result != 0 ? result : 0;
+}
+
+public static int cellClass() {
+ return OS.objc_msgSend(OS.class_NSControl, OS.sel_cellClass);
+}
+
+public NSText currentEditor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_currentEditor);
+ return result != 0 ? new NSText(result) : null;
+}
+
+public double doubleValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_doubleValue);
+}
+
+public void drawCell(NSCell aCell) {
+ OS.objc_msgSend(this.id, OS.sel_drawCell_1, aCell != null ? aCell.id : 0);
+}
+
+public void drawCellInside(NSCell aCell) {
+ OS.objc_msgSend(this.id, OS.sel_drawCellInside_1, aCell != null ? aCell.id : 0);
+}
+
+public float floatValue() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_floatValue);
+}
+
+public NSFont font() {
+ int result = OS.objc_msgSend(this.id, OS.sel_font);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public id formatter() {
+ int result = OS.objc_msgSend(this.id, OS.sel_formatter);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean ignoresMultiClick() {
+ return OS.objc_msgSend(this.id, OS.sel_ignoresMultiClick) != 0;
+}
+
+public int intValue() {
+ return OS.objc_msgSend(this.id, OS.sel_intValue);
+}
+
+public int integerValue() {
+ return OS.objc_msgSend(this.id, OS.sel_integerValue);
+}
+
+public boolean isContinuous() {
+ return OS.objc_msgSend(this.id, OS.sel_isContinuous) != 0;
+}
+
+public boolean isEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_isEnabled) != 0;
+}
+
+public void mouseDown(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_mouseDown_1, theEvent != null ? theEvent.id : 0);
+}
+
+public id objectValue() {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectValue);
+ return result != 0 ? new id(result) : null;
+}
+
+public void performClick(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_performClick_1, sender != null ? sender.id : 0);
+}
+
+public boolean refusesFirstResponder() {
+ return OS.objc_msgSend(this.id, OS.sel_refusesFirstResponder) != 0;
+}
+
+public void selectCell(NSCell aCell) {
+ OS.objc_msgSend(this.id, OS.sel_selectCell_1, aCell != null ? aCell.id : 0);
+}
+
+public id selectedCell() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedCell);
+ return result != 0 ? new id(result) : null;
+}
+
+public int selectedTag() {
+ return OS.objc_msgSend(this.id, OS.sel_selectedTag);
+}
+
+public boolean sendAction(int theAction, id theTarget) {
+ return OS.objc_msgSend(this.id, OS.sel_sendAction_1to_1, theAction, theTarget != null ? theTarget.id : 0) != 0;
+}
+
+public int sendActionOn(int mask) {
+ return OS.objc_msgSend(this.id, OS.sel_sendActionOn_1, mask);
+}
+
+public void setAction(int aSelector) {
+ OS.objc_msgSend(this.id, OS.sel_setAction_1, aSelector);
+}
+
+public void setAlignment(int mode) {
+ OS.objc_msgSend(this.id, OS.sel_setAlignment_1, mode);
+}
+
+public void setAttributedStringValue(NSAttributedString obj) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributedStringValue_1, obj != null ? obj.id : 0);
+}
+
+public void setBaseWritingDirection(int writingDirection) {
+ OS.objc_msgSend(this.id, OS.sel_setBaseWritingDirection_1, writingDirection);
+}
+
+public void setCell(NSCell aCell) {
+ OS.objc_msgSend(this.id, OS.sel_setCell_1, aCell != null ? aCell.id : 0);
+}
+
+public static void setCellClass(int factoryId) {
+ OS.objc_msgSend(OS.class_NSControl, OS.sel_setCellClass_1, factoryId);
+}
+
+public void setContinuous(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setContinuous_1, flag);
+}
+
+public void setDoubleValue(double aDouble) {
+ OS.objc_msgSend(this.id, OS.sel_setDoubleValue_1, aDouble);
+}
+
+public void setEnabled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setEnabled_1, flag);
+}
+
+public void setFloatValue(float aFloat) {
+ OS.objc_msgSend(this.id, OS.sel_setFloatValue_1, aFloat);
+}
+
+public void setFloatingPointFormat(boolean autoRange, int leftDigits, int rightDigits) {
+ OS.objc_msgSend(this.id, OS.sel_setFloatingPointFormat_1left_1right_1, autoRange, leftDigits, rightDigits);
+}
+
+public void setFont(NSFont fontObj) {
+ OS.objc_msgSend(this.id, OS.sel_setFont_1, fontObj != null ? fontObj.id : 0);
+}
+
+public void setFormatter(NSFormatter newFormatter) {
+ OS.objc_msgSend(this.id, OS.sel_setFormatter_1, newFormatter != null ? newFormatter.id : 0);
+}
+
+public void setIgnoresMultiClick(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setIgnoresMultiClick_1, flag);
+}
+
+public void setIntValue(int anInt) {
+ OS.objc_msgSend(this.id, OS.sel_setIntValue_1, anInt);
+}
+
+public void setIntegerValue(int anInteger) {
+ OS.objc_msgSend(this.id, OS.sel_setIntegerValue_1, anInteger);
+}
+
+public void setNeedsDisplay() {
+ OS.objc_msgSend(this.id, OS.sel_setNeedsDisplay);
+}
+
+public void setObjectValue(id obj) {
+ OS.objc_msgSend(this.id, OS.sel_setObjectValue_1, obj != null ? obj.id : 0);
+}
+
+public void setRefusesFirstResponder(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setRefusesFirstResponder_1, flag);
+}
+
+public void setStringValue(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setStringValue_1, aString != null ? aString.id : 0);
+}
+
+public void setTag(int anInt) {
+ OS.objc_msgSend(this.id, OS.sel_setTag_1, anInt);
+}
+
+public void setTarget(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setTarget_1, anObject != null ? anObject.id : 0);
+}
+
+public void sizeToFit() {
+ OS.objc_msgSend(this.id, OS.sel_sizeToFit);
+}
+
+public NSString stringValue() {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringValue);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int tag() {
+ return OS.objc_msgSend(this.id, OS.sel_tag);
+}
+
+public void takeDoubleValueFrom(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_takeDoubleValueFrom_1, sender != null ? sender.id : 0);
+}
+
+public void takeFloatValueFrom(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_takeFloatValueFrom_1, sender != null ? sender.id : 0);
+}
+
+public void takeIntValueFrom(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_takeIntValueFrom_1, sender != null ? sender.id : 0);
+}
+
+public void takeIntegerValueFrom(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_takeIntegerValueFrom_1, sender != null ? sender.id : 0);
+}
+
+public void takeObjectValueFrom(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_takeObjectValueFrom_1, sender != null ? sender.id : 0);
+}
+
+public void takeStringValueFrom(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_takeStringValueFrom_1, sender != null ? sender.id : 0);
+}
+
+public id target() {
+ int result = OS.objc_msgSend(this.id, OS.sel_target);
+ return result != 0 ? new id(result) : null;
+}
+
+public void updateCell(NSCell aCell) {
+ OS.objc_msgSend(this.id, OS.sel_updateCell_1, aCell != null ? aCell.id : 0);
+}
+
+public void updateCellInside(NSCell aCell) {
+ OS.objc_msgSend(this.id, OS.sel_updateCellInside_1, aCell != null ? aCell.id : 0);
+}
+
+public void validateEditing() {
+ OS.objc_msgSend(this.id, OS.sel_validateEditing);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSController.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSController.java
new file mode 100644
index 0000000000..7d2d18f3a8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSController.java
@@ -0,0 +1,37 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSController extends NSObject {
+
+public NSController() {
+ super();
+}
+
+public NSController(int id) {
+ super(id);
+}
+
+public boolean commitEditing() {
+ return OS.objc_msgSend(this.id, OS.sel_commitEditing) != 0;
+}
+
+public void commitEditingWithDelegate(id delegate, int didCommitSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_commitEditingWithDelegate_1didCommitSelector_1contextInfo_1, delegate != null ? delegate.id : 0, didCommitSelector, contextInfo);
+}
+
+public void discardEditing() {
+ OS.objc_msgSend(this.id, OS.sel_discardEditing);
+}
+
+public boolean isEditing() {
+ return OS.objc_msgSend(this.id, OS.sel_isEditing) != 0;
+}
+
+public void objectDidBeginEditing(id editor) {
+ OS.objc_msgSend(this.id, OS.sel_objectDidBeginEditing_1, editor != null ? editor.id : 0);
+}
+
+public void objectDidEndEditing(id editor) {
+ OS.objc_msgSend(this.id, OS.sel_objectDidEndEditing_1, editor != null ? editor.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCountedSet.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCountedSet.java
new file mode 100644
index 0000000000..52363d714e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCountedSet.java
@@ -0,0 +1,35 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSCountedSet extends NSMutableSet {
+
+public NSCountedSet() {
+ super();
+}
+
+public NSCountedSet(int id) {
+ super(id);
+}
+
+public void addObject(id object) {
+ OS.objc_msgSend(this.id, OS.sel_addObject_1, object != null ? object.id : 0);
+}
+
+public int countForObject(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_countForObject_1, object != null ? object.id : 0);
+}
+
+public NSCountedSet initWithSet(NSSet set) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithSet_1, set != null ? set.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSEnumerator objectEnumerator() {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectEnumerator);
+ return result != 0 ? new NSEnumerator(result) : null;
+}
+
+public void removeObject(id object) {
+ OS.objc_msgSend(this.id, OS.sel_removeObject_1, object != null ? object.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCreateCommand.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCreateCommand.java
new file mode 100644
index 0000000000..b1bbd483d3
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCreateCommand.java
@@ -0,0 +1,23 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSCreateCommand extends NSScriptCommand {
+
+public NSCreateCommand() {
+ super();
+}
+
+public NSCreateCommand(int id) {
+ super(id);
+}
+
+public NSScriptClassDescription createClassDescription() {
+ int result = OS.objc_msgSend(this.id, OS.sel_createClassDescription);
+ return result != 0 ? new NSScriptClassDescription(result) : null;
+}
+
+public NSDictionary resolvedKeyDictionary() {
+ int result = OS.objc_msgSend(this.id, OS.sel_resolvedKeyDictionary);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCursor.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCursor.java
new file mode 100644
index 0000000000..4f15b9ada5
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCursor.java
@@ -0,0 +1,156 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSCursor extends NSObject {
+
+public NSCursor() {
+ super();
+}
+
+public NSCursor(int id) {
+ super(id);
+}
+
+public static NSCursor IBeamCursor() {
+ int result = OS.objc_msgSend(OS.class_NSCursor, OS.sel_IBeamCursor);
+ return result != 0 ? new NSCursor(result) : null;
+}
+
+public static NSCursor arrowCursor() {
+ int result = OS.objc_msgSend(OS.class_NSCursor, OS.sel_arrowCursor);
+ return result != 0 ? new NSCursor(result) : null;
+}
+
+public static NSCursor closedHandCursor() {
+ int result = OS.objc_msgSend(OS.class_NSCursor, OS.sel_closedHandCursor);
+ return result != 0 ? new NSCursor(result) : null;
+}
+
+public static NSCursor crosshairCursor() {
+ int result = OS.objc_msgSend(OS.class_NSCursor, OS.sel_crosshairCursor);
+ return result != 0 ? new NSCursor(result) : null;
+}
+
+public static NSCursor currentCursor() {
+ int result = OS.objc_msgSend(OS.class_NSCursor, OS.sel_currentCursor);
+ return result != 0 ? new NSCursor(result) : null;
+}
+
+public static NSCursor disappearingItemCursor() {
+ int result = OS.objc_msgSend(OS.class_NSCursor, OS.sel_disappearingItemCursor);
+ return result != 0 ? new NSCursor(result) : null;
+}
+
+public static void hide() {
+ OS.objc_msgSend(OS.class_NSCursor, OS.sel_hide);
+}
+
+public NSPoint hotSpot() {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_hotSpot);
+ return result;
+}
+
+public NSImage image() {
+ int result = OS.objc_msgSend(this.id, OS.sel_image);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public NSCursor initWithImage_foregroundColorHint_backgroundColorHint_hotSpot_(NSImage newImage, NSColor fg, NSColor bg, NSPoint hotSpot) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithImage_1foregroundColorHint_1backgroundColorHint_1hotSpot_1, newImage != null ? newImage.id : 0, fg != null ? fg.id : 0, bg != null ? bg.id : 0, hotSpot);
+ return result != 0 ? this : null;
+}
+
+public NSCursor initWithImage_hotSpot_(NSImage newImage, NSPoint aPoint) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithImage_1hotSpot_1, newImage != null ? newImage.id : 0, aPoint);
+ return result != 0 ? this : null;
+}
+
+public boolean isSetOnMouseEntered() {
+ return OS.objc_msgSend(this.id, OS.sel_isSetOnMouseEntered) != 0;
+}
+
+public boolean isSetOnMouseExited() {
+ return OS.objc_msgSend(this.id, OS.sel_isSetOnMouseExited) != 0;
+}
+
+public void mouseEntered(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_mouseEntered_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void mouseExited(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_mouseExited_1, theEvent != null ? theEvent.id : 0);
+}
+
+public static NSCursor openHandCursor() {
+ int result = OS.objc_msgSend(OS.class_NSCursor, OS.sel_openHandCursor);
+ return result != 0 ? new NSCursor(result) : null;
+}
+
+public static NSCursor pointingHandCursor() {
+ int result = OS.objc_msgSend(OS.class_NSCursor, OS.sel_pointingHandCursor);
+ return result != 0 ? new NSCursor(result) : null;
+}
+
+public void pop() {
+ OS.objc_msgSend(this.id, OS.sel_pop);
+}
+
+public static void static_pop() {
+ OS.objc_msgSend(OS.class_NSCursor, OS.sel_pop);
+}
+
+public void push() {
+ OS.objc_msgSend(this.id, OS.sel_push);
+}
+
+public static NSCursor resizeDownCursor() {
+ int result = OS.objc_msgSend(OS.class_NSCursor, OS.sel_resizeDownCursor);
+ return result != 0 ? new NSCursor(result) : null;
+}
+
+public static NSCursor resizeLeftCursor() {
+ int result = OS.objc_msgSend(OS.class_NSCursor, OS.sel_resizeLeftCursor);
+ return result != 0 ? new NSCursor(result) : null;
+}
+
+public static NSCursor resizeLeftRightCursor() {
+ int result = OS.objc_msgSend(OS.class_NSCursor, OS.sel_resizeLeftRightCursor);
+ return result != 0 ? new NSCursor(result) : null;
+}
+
+public static NSCursor resizeRightCursor() {
+ int result = OS.objc_msgSend(OS.class_NSCursor, OS.sel_resizeRightCursor);
+ return result != 0 ? new NSCursor(result) : null;
+}
+
+public static NSCursor resizeUpCursor() {
+ int result = OS.objc_msgSend(OS.class_NSCursor, OS.sel_resizeUpCursor);
+ return result != 0 ? new NSCursor(result) : null;
+}
+
+public static NSCursor resizeUpDownCursor() {
+ int result = OS.objc_msgSend(OS.class_NSCursor, OS.sel_resizeUpDownCursor);
+ return result != 0 ? new NSCursor(result) : null;
+}
+
+public void set() {
+ OS.objc_msgSend(this.id, OS.sel_set);
+}
+
+public static void setHiddenUntilMouseMoves(boolean flag) {
+ OS.objc_msgSend(OS.class_NSCursor, OS.sel_setHiddenUntilMouseMoves_1, flag);
+}
+
+public void setOnMouseEntered(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setOnMouseEntered_1, flag);
+}
+
+public void setOnMouseExited(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setOnMouseExited_1, flag);
+}
+
+public static void unhide() {
+ OS.objc_msgSend(OS.class_NSCursor, OS.sel_unhide);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCustomImageRep.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCustomImageRep.java
new file mode 100644
index 0000000000..372b7df5db
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSCustomImageRep.java
@@ -0,0 +1,27 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSCustomImageRep extends NSImageRep {
+
+public NSCustomImageRep() {
+ super();
+}
+
+public NSCustomImageRep(int id) {
+ super(id);
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public int drawSelector() {
+ return OS.objc_msgSend(this.id, OS.sel_drawSelector);
+}
+
+public NSCustomImageRep initWithDrawSelector(int aMethod, id anObject) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithDrawSelector_1delegate_1, aMethod, anObject != null ? anObject.id : 0);
+ return result != 0 ? this : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSData.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSData.java
new file mode 100644
index 0000000000..9b47d4a3c0
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSData.java
@@ -0,0 +1,158 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSData extends NSObject {
+
+public NSData() {
+ super();
+}
+
+public NSData(int id) {
+ super(id);
+}
+
+public int bytes() {
+ return OS.objc_msgSend(this.id, OS.sel_bytes);
+}
+
+public static id data() {
+ int result = OS.objc_msgSend(OS.class_NSData, OS.sel_data);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id dataWithBytes(int bytes, int length) {
+ int result = OS.objc_msgSend(OS.class_NSData, OS.sel_dataWithBytes_1length_1, bytes, length);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_dataWithBytesNoCopy_length_(int bytes, int length) {
+ int result = OS.objc_msgSend(OS.class_NSData, OS.sel_dataWithBytesNoCopy_1length_1, bytes, length);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_dataWithBytesNoCopy_length_freeWhenDone_(int bytes, int length, boolean b) {
+ int result = OS.objc_msgSend(OS.class_NSData, OS.sel_dataWithBytesNoCopy_1length_1freeWhenDone_1, bytes, length, b);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_dataWithContentsOfFile_(NSString path) {
+ int result = OS.objc_msgSend(OS.class_NSData, OS.sel_dataWithContentsOfFile_1, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_dataWithContentsOfFile_options_error_(NSString path, int readOptionsMask, int errorPtr) {
+ int result = OS.objc_msgSend(OS.class_NSData, OS.sel_dataWithContentsOfFile_1options_1error_1, path != null ? path.id : 0, readOptionsMask, errorPtr);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id dataWithContentsOfMappedFile(NSString path) {
+ int result = OS.objc_msgSend(OS.class_NSData, OS.sel_dataWithContentsOfMappedFile_1, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_dataWithContentsOfURL_(NSURL url) {
+ int result = OS.objc_msgSend(OS.class_NSData, OS.sel_dataWithContentsOfURL_1, url != null ? url.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_dataWithContentsOfURL_options_error_(NSURL url, int readOptionsMask, int errorPtr) {
+ int result = OS.objc_msgSend(OS.class_NSData, OS.sel_dataWithContentsOfURL_1options_1error_1, url != null ? url.id : 0, readOptionsMask, errorPtr);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id dataWithData(NSData data) {
+ int result = OS.objc_msgSend(OS.class_NSData, OS.sel_dataWithData_1, data != null ? data.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString description() {
+ int result = OS.objc_msgSend(this.id, OS.sel_description);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void getBytes_(int buffer) {
+ OS.objc_msgSend(this.id, OS.sel_getBytes_1, buffer);
+}
+
+public void getBytes_length_(int buffer, int length) {
+ OS.objc_msgSend(this.id, OS.sel_getBytes_1length_1, buffer, length);
+}
+
+public void getBytes_range_(int buffer, NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_getBytes_1range_1, buffer, range);
+}
+
+public NSData initWithBytes(int bytes, int length) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithBytes_1length_1, bytes, length);
+ return result != 0 ? this : null;
+}
+
+public NSData initWithBytesNoCopy_length_(int bytes, int length) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithBytesNoCopy_1length_1, bytes, length);
+ return result != 0 ? this : null;
+}
+
+public NSData initWithBytesNoCopy_length_freeWhenDone_(int bytes, int length, boolean b) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithBytesNoCopy_1length_1freeWhenDone_1, bytes, length, b);
+ return result != 0 ? this : null;
+}
+
+public NSData initWithContentsOfFile_(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfFile_1, path != null ? path.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSData initWithContentsOfFile_options_error_(NSString path, int readOptionsMask, int errorPtr) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfFile_1options_1error_1, path != null ? path.id : 0, readOptionsMask, errorPtr);
+ return result != 0 ? this : null;
+}
+
+public NSData initWithContentsOfMappedFile(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfMappedFile_1, path != null ? path.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSData initWithContentsOfURL_(NSURL url) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1, url != null ? url.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSData initWithContentsOfURL_options_error_(NSURL url, int readOptionsMask, int errorPtr) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1options_1error_1, url != null ? url.id : 0, readOptionsMask, errorPtr);
+ return result != 0 ? this : null;
+}
+
+public NSData initWithData(NSData data) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithData_1, data != null ? data.id : 0);
+ return result != 0 ? this : null;
+}
+
+public boolean isEqualToData(NSData other) {
+ return OS.objc_msgSend(this.id, OS.sel_isEqualToData_1, other != null ? other.id : 0) != 0;
+}
+
+public int length() {
+ return OS.objc_msgSend(this.id, OS.sel_length);
+}
+
+public NSData subdataWithRange(NSRange range) {
+ int result = OS.objc_msgSend(this.id, OS.sel_subdataWithRange_1, range);
+ return result == this.id ? this : (result != 0 ? new NSData(result) : null);
+}
+
+public boolean writeToFile_atomically_(NSString path, boolean useAuxiliaryFile) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToFile_1atomically_1, path != null ? path.id : 0, useAuxiliaryFile) != 0;
+}
+
+public boolean writeToFile_options_error_(NSString path, int writeOptionsMask, int errorPtr) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToFile_1options_1error_1, path != null ? path.id : 0, writeOptionsMask, errorPtr) != 0;
+}
+
+public boolean writeToURL_atomically_(NSURL url, boolean atomically) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToURL_1atomically_1, url != null ? url.id : 0, atomically) != 0;
+}
+
+public boolean writeToURL_options_error_(NSURL url, int writeOptionsMask, int errorPtr) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToURL_1options_1error_1, url != null ? url.id : 0, writeOptionsMask, errorPtr) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDate.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDate.java
new file mode 100644
index 0000000000..3408adba92
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDate.java
@@ -0,0 +1,141 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDate extends NSObject {
+
+public NSDate() {
+ super();
+}
+
+public NSDate(int id) {
+ super(id);
+}
+
+public id addTimeInterval(double seconds) {
+ int result = OS.objc_msgSend(this.id, OS.sel_addTimeInterval_1, seconds);
+ return result != 0 ? new id(result) : null;
+}
+
+public int compare(NSDate other) {
+ return OS.objc_msgSend(this.id, OS.sel_compare_1, other != null ? other.id : 0);
+}
+
+public static NSDate date() {
+ int result = OS.objc_msgSend(OS.class_NSDate, OS.sel_date);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public NSCalendarDate dateWithCalendarFormat(NSString format, NSTimeZone aTimeZone) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dateWithCalendarFormat_1timeZone_1, format != null ? format.id : 0, aTimeZone != null ? aTimeZone.id : 0);
+ return result != 0 ? new NSCalendarDate(result) : null;
+}
+
+public static id static_dateWithNaturalLanguageString_(NSString string) {
+ int result = OS.objc_msgSend(OS.class_NSDate, OS.sel_dateWithNaturalLanguageString_1, string != null ? string.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_dateWithNaturalLanguageString_locale_(NSString string, id locale) {
+ int result = OS.objc_msgSend(OS.class_NSDate, OS.sel_dateWithNaturalLanguageString_1locale_1, string != null ? string.id : 0, locale != null ? locale.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id dateWithString(NSString aString) {
+ int result = OS.objc_msgSend(OS.class_NSDate, OS.sel_dateWithString_1, aString != null ? aString.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id dateWithTimeIntervalSince1970(double secs) {
+ int result = OS.objc_msgSend(OS.class_NSDate, OS.sel_dateWithTimeIntervalSince1970_1, secs);
+ return result != 0 ? new id(result) : null;
+}
+
+public static NSDate dateWithTimeIntervalSinceNow(double secs) {
+ int result = OS.objc_msgSend(OS.class_NSDate, OS.sel_dateWithTimeIntervalSinceNow_1, secs);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public static id dateWithTimeIntervalSinceReferenceDate(double secs) {
+ int result = OS.objc_msgSend(OS.class_NSDate, OS.sel_dateWithTimeIntervalSinceReferenceDate_1, secs);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString description() {
+ int result = OS.objc_msgSend(this.id, OS.sel_description);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString descriptionWithCalendarFormat(NSString format, NSTimeZone aTimeZone, id locale) {
+ int result = OS.objc_msgSend(this.id, OS.sel_descriptionWithCalendarFormat_1timeZone_1locale_1, format != null ? format.id : 0, aTimeZone != null ? aTimeZone.id : 0, locale != null ? locale.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString descriptionWithLocale(id locale) {
+ int result = OS.objc_msgSend(this.id, OS.sel_descriptionWithLocale_1, locale != null ? locale.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSDate distantFuture() {
+ int result = OS.objc_msgSend(OS.class_NSDate, OS.sel_distantFuture);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public static NSDate distantPast() {
+ int result = OS.objc_msgSend(OS.class_NSDate, OS.sel_distantPast);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public NSDate earlierDate(NSDate anotherDate) {
+ int result = OS.objc_msgSend(this.id, OS.sel_earlierDate_1, anotherDate != null ? anotherDate.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSDate(result) : null);
+}
+
+public NSDate initWithString(NSString description) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithString_1, description != null ? description.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSDate initWithTimeInterval(double secsToBeAdded, NSDate anotherDate) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithTimeInterval_1sinceDate_1, secsToBeAdded, anotherDate != null ? anotherDate.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSDate initWithTimeIntervalSinceNow(double secsToBeAddedToNow) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithTimeIntervalSinceNow_1, secsToBeAddedToNow);
+ return result != 0 ? this : null;
+}
+
+public NSDate initWithTimeIntervalSinceReferenceDate(double secsToBeAdded) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithTimeIntervalSinceReferenceDate_1, secsToBeAdded);
+ return result != 0 ? this : null;
+}
+
+public boolean isEqualToDate(NSDate otherDate) {
+ return OS.objc_msgSend(this.id, OS.sel_isEqualToDate_1, otherDate != null ? otherDate.id : 0) != 0;
+}
+
+public NSDate laterDate(NSDate anotherDate) {
+ int result = OS.objc_msgSend(this.id, OS.sel_laterDate_1, anotherDate != null ? anotherDate.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSDate(result) : null);
+}
+
+public double timeIntervalSince1970() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_timeIntervalSince1970);
+}
+
+public double timeIntervalSinceDate(NSDate anotherDate) {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_timeIntervalSinceDate_1, anotherDate != null ? anotherDate.id : 0);
+}
+
+public double timeIntervalSinceNow() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_timeIntervalSinceNow);
+}
+
+public static double static_timeIntervalSinceReferenceDate() {
+ return OS.objc_msgSend_fpret(OS.class_NSDate, OS.sel_timeIntervalSinceReferenceDate);
+}
+
+public double timeIntervalSinceReferenceDate() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_timeIntervalSinceReferenceDate);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDateComponents.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDateComponents.java
new file mode 100644
index 0000000000..0dd5fcdcfc
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDateComponents.java
@@ -0,0 +1,93 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDateComponents extends NSObject {
+
+public NSDateComponents() {
+ super();
+}
+
+public NSDateComponents(int id) {
+ super(id);
+}
+
+public int day() {
+ return OS.objc_msgSend(this.id, OS.sel_day);
+}
+
+public int era() {
+ return OS.objc_msgSend(this.id, OS.sel_era);
+}
+
+public int hour() {
+ return OS.objc_msgSend(this.id, OS.sel_hour);
+}
+
+public int minute() {
+ return OS.objc_msgSend(this.id, OS.sel_minute);
+}
+
+public int month() {
+ return OS.objc_msgSend(this.id, OS.sel_month);
+}
+
+public int second() {
+ return OS.objc_msgSend(this.id, OS.sel_second);
+}
+
+public void setDay(int v) {
+ OS.objc_msgSend(this.id, OS.sel_setDay_1, v);
+}
+
+public void setEra(int v) {
+ OS.objc_msgSend(this.id, OS.sel_setEra_1, v);
+}
+
+public void setHour(int v) {
+ OS.objc_msgSend(this.id, OS.sel_setHour_1, v);
+}
+
+public void setMinute(int v) {
+ OS.objc_msgSend(this.id, OS.sel_setMinute_1, v);
+}
+
+public void setMonth(int v) {
+ OS.objc_msgSend(this.id, OS.sel_setMonth_1, v);
+}
+
+public void setSecond(int v) {
+ OS.objc_msgSend(this.id, OS.sel_setSecond_1, v);
+}
+
+public void setWeek(int v) {
+ OS.objc_msgSend(this.id, OS.sel_setWeek_1, v);
+}
+
+public void setWeekday(int v) {
+ OS.objc_msgSend(this.id, OS.sel_setWeekday_1, v);
+}
+
+public void setWeekdayOrdinal(int v) {
+ OS.objc_msgSend(this.id, OS.sel_setWeekdayOrdinal_1, v);
+}
+
+public void setYear(int v) {
+ OS.objc_msgSend(this.id, OS.sel_setYear_1, v);
+}
+
+public int week() {
+ return OS.objc_msgSend(this.id, OS.sel_week);
+}
+
+public int weekday() {
+ return OS.objc_msgSend(this.id, OS.sel_weekday);
+}
+
+public int weekdayOrdinal() {
+ return OS.objc_msgSend(this.id, OS.sel_weekdayOrdinal);
+}
+
+public int year() {
+ return OS.objc_msgSend(this.id, OS.sel_year);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDateFormatter.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDateFormatter.java
new file mode 100644
index 0000000000..19f8b13164
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDateFormatter.java
@@ -0,0 +1,327 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDateFormatter extends NSFormatter {
+
+public NSDateFormatter() {
+ super();
+}
+
+public NSDateFormatter(int id) {
+ super(id);
+}
+
+public NSString AMSymbol() {
+ int result = OS.objc_msgSend(this.id, OS.sel_AMSymbol);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString PMSymbol() {
+ int result = OS.objc_msgSend(this.id, OS.sel_PMSymbol);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean allowsNaturalLanguage() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsNaturalLanguage) != 0;
+}
+
+public NSCalendar calendar() {
+ int result = OS.objc_msgSend(this.id, OS.sel_calendar);
+ return result != 0 ? new NSCalendar(result) : null;
+}
+
+public NSString dateFormat() {
+ int result = OS.objc_msgSend(this.id, OS.sel_dateFormat);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSDate dateFromString(NSString string) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dateFromString_1, string != null ? string.id : 0);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public int dateStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_dateStyle);
+}
+
+public NSDate defaultDate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_defaultDate);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public static int defaultFormatterBehavior() {
+ return OS.objc_msgSend(OS.class_NSDateFormatter, OS.sel_defaultFormatterBehavior);
+}
+
+public NSArray eraSymbols() {
+ int result = OS.objc_msgSend(this.id, OS.sel_eraSymbols);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public int formatterBehavior() {
+ return OS.objc_msgSend(this.id, OS.sel_formatterBehavior);
+}
+
+public boolean generatesCalendarDates() {
+ return OS.objc_msgSend(this.id, OS.sel_generatesCalendarDates) != 0;
+}
+
+public boolean getObjectValue(int obj, NSString string, int rangep, int error) {
+ return OS.objc_msgSend(this.id, OS.sel_getObjectValue_1forString_1range_1error_1, obj, string != null ? string.id : 0, rangep, error) != 0;
+}
+
+public NSDate gregorianStartDate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_gregorianStartDate);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public id initWithDateFormat(NSString format, boolean flag) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithDateFormat_1allowNaturalLanguage_1, format != null ? format.id : 0, flag);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isLenient() {
+ return OS.objc_msgSend(this.id, OS.sel_isLenient) != 0;
+}
+
+public NSLocale locale() {
+ int result = OS.objc_msgSend(this.id, OS.sel_locale);
+ return result != 0 ? new NSLocale(result) : null;
+}
+
+public NSArray longEraSymbols() {
+ int result = OS.objc_msgSend(this.id, OS.sel_longEraSymbols);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray monthSymbols() {
+ int result = OS.objc_msgSend(this.id, OS.sel_monthSymbols);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray quarterSymbols() {
+ int result = OS.objc_msgSend(this.id, OS.sel_quarterSymbols);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void setAMSymbol(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setAMSymbol_1, string != null ? string.id : 0);
+}
+
+public void setCalendar(NSCalendar calendar) {
+ OS.objc_msgSend(this.id, OS.sel_setCalendar_1, calendar != null ? calendar.id : 0);
+}
+
+public void setDateFormat(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setDateFormat_1, string != null ? string.id : 0);
+}
+
+public void setDateStyle(int style) {
+ OS.objc_msgSend(this.id, OS.sel_setDateStyle_1, style);
+}
+
+public void setDefaultDate(NSDate date) {
+ OS.objc_msgSend(this.id, OS.sel_setDefaultDate_1, date != null ? date.id : 0);
+}
+
+public static void setDefaultFormatterBehavior(int behavior) {
+ OS.objc_msgSend(OS.class_NSDateFormatter, OS.sel_setDefaultFormatterBehavior_1, behavior);
+}
+
+public void setEraSymbols(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setEraSymbols_1, array != null ? array.id : 0);
+}
+
+public void setFormatterBehavior(int behavior) {
+ OS.objc_msgSend(this.id, OS.sel_setFormatterBehavior_1, behavior);
+}
+
+public void setGeneratesCalendarDates(boolean b) {
+ OS.objc_msgSend(this.id, OS.sel_setGeneratesCalendarDates_1, b);
+}
+
+public void setGregorianStartDate(NSDate date) {
+ OS.objc_msgSend(this.id, OS.sel_setGregorianStartDate_1, date != null ? date.id : 0);
+}
+
+public void setLenient(boolean b) {
+ OS.objc_msgSend(this.id, OS.sel_setLenient_1, b);
+}
+
+public void setLocale(NSLocale locale) {
+ OS.objc_msgSend(this.id, OS.sel_setLocale_1, locale != null ? locale.id : 0);
+}
+
+public void setLongEraSymbols(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setLongEraSymbols_1, array != null ? array.id : 0);
+}
+
+public void setMonthSymbols(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setMonthSymbols_1, array != null ? array.id : 0);
+}
+
+public void setPMSymbol(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setPMSymbol_1, string != null ? string.id : 0);
+}
+
+public void setQuarterSymbols(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setQuarterSymbols_1, array != null ? array.id : 0);
+}
+
+public void setShortMonthSymbols(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setShortMonthSymbols_1, array != null ? array.id : 0);
+}
+
+public void setShortQuarterSymbols(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setShortQuarterSymbols_1, array != null ? array.id : 0);
+}
+
+public void setShortStandaloneMonthSymbols(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setShortStandaloneMonthSymbols_1, array != null ? array.id : 0);
+}
+
+public void setShortStandaloneQuarterSymbols(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setShortStandaloneQuarterSymbols_1, array != null ? array.id : 0);
+}
+
+public void setShortStandaloneWeekdaySymbols(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setShortStandaloneWeekdaySymbols_1, array != null ? array.id : 0);
+}
+
+public void setShortWeekdaySymbols(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setShortWeekdaySymbols_1, array != null ? array.id : 0);
+}
+
+public void setStandaloneMonthSymbols(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setStandaloneMonthSymbols_1, array != null ? array.id : 0);
+}
+
+public void setStandaloneQuarterSymbols(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setStandaloneQuarterSymbols_1, array != null ? array.id : 0);
+}
+
+public void setStandaloneWeekdaySymbols(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setStandaloneWeekdaySymbols_1, array != null ? array.id : 0);
+}
+
+public void setTimeStyle(int style) {
+ OS.objc_msgSend(this.id, OS.sel_setTimeStyle_1, style);
+}
+
+public void setTimeZone(NSTimeZone tz) {
+ OS.objc_msgSend(this.id, OS.sel_setTimeZone_1, tz != null ? tz.id : 0);
+}
+
+public void setTwoDigitStartDate(NSDate date) {
+ OS.objc_msgSend(this.id, OS.sel_setTwoDigitStartDate_1, date != null ? date.id : 0);
+}
+
+public void setVeryShortMonthSymbols(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setVeryShortMonthSymbols_1, array != null ? array.id : 0);
+}
+
+public void setVeryShortStandaloneMonthSymbols(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setVeryShortStandaloneMonthSymbols_1, array != null ? array.id : 0);
+}
+
+public void setVeryShortStandaloneWeekdaySymbols(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setVeryShortStandaloneWeekdaySymbols_1, array != null ? array.id : 0);
+}
+
+public void setVeryShortWeekdaySymbols(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setVeryShortWeekdaySymbols_1, array != null ? array.id : 0);
+}
+
+public void setWeekdaySymbols(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setWeekdaySymbols_1, array != null ? array.id : 0);
+}
+
+public NSArray shortMonthSymbols() {
+ int result = OS.objc_msgSend(this.id, OS.sel_shortMonthSymbols);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray shortQuarterSymbols() {
+ int result = OS.objc_msgSend(this.id, OS.sel_shortQuarterSymbols);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray shortStandaloneMonthSymbols() {
+ int result = OS.objc_msgSend(this.id, OS.sel_shortStandaloneMonthSymbols);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray shortStandaloneQuarterSymbols() {
+ int result = OS.objc_msgSend(this.id, OS.sel_shortStandaloneQuarterSymbols);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray shortStandaloneWeekdaySymbols() {
+ int result = OS.objc_msgSend(this.id, OS.sel_shortStandaloneWeekdaySymbols);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray shortWeekdaySymbols() {
+ int result = OS.objc_msgSend(this.id, OS.sel_shortWeekdaySymbols);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray standaloneMonthSymbols() {
+ int result = OS.objc_msgSend(this.id, OS.sel_standaloneMonthSymbols);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray standaloneQuarterSymbols() {
+ int result = OS.objc_msgSend(this.id, OS.sel_standaloneQuarterSymbols);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray standaloneWeekdaySymbols() {
+ int result = OS.objc_msgSend(this.id, OS.sel_standaloneWeekdaySymbols);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString stringFromDate(NSDate date) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringFromDate_1, date != null ? date.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int timeStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_timeStyle);
+}
+
+public NSTimeZone timeZone() {
+ int result = OS.objc_msgSend(this.id, OS.sel_timeZone);
+ return result != 0 ? new NSTimeZone(result) : null;
+}
+
+public NSDate twoDigitStartDate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_twoDigitStartDate);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public NSArray veryShortMonthSymbols() {
+ int result = OS.objc_msgSend(this.id, OS.sel_veryShortMonthSymbols);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray veryShortStandaloneMonthSymbols() {
+ int result = OS.objc_msgSend(this.id, OS.sel_veryShortStandaloneMonthSymbols);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray veryShortStandaloneWeekdaySymbols() {
+ int result = OS.objc_msgSend(this.id, OS.sel_veryShortStandaloneWeekdaySymbols);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray veryShortWeekdaySymbols() {
+ int result = OS.objc_msgSend(this.id, OS.sel_veryShortWeekdaySymbols);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray weekdaySymbols() {
+ int result = OS.objc_msgSend(this.id, OS.sel_weekdaySymbols);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDatePicker.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDatePicker.java
new file mode 100644
index 0000000000..d9cd9c9d01
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDatePicker.java
@@ -0,0 +1,150 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDatePicker extends NSControl {
+
+public NSDatePicker() {
+ super();
+}
+
+public NSDatePicker(int id) {
+ super(id);
+}
+
+public NSColor backgroundColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public NSCalendar calendar() {
+ int result = OS.objc_msgSend(this.id, OS.sel_calendar);
+ return result != 0 ? new NSCalendar(result) : null;
+}
+
+public int datePickerElements() {
+ return OS.objc_msgSend(this.id, OS.sel_datePickerElements);
+}
+
+public int datePickerMode() {
+ return OS.objc_msgSend(this.id, OS.sel_datePickerMode);
+}
+
+public int datePickerStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_datePickerStyle);
+}
+
+public NSDate dateValue() {
+ int result = OS.objc_msgSend(this.id, OS.sel_dateValue);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean drawsBackground() {
+ return OS.objc_msgSend(this.id, OS.sel_drawsBackground) != 0;
+}
+
+public boolean isBezeled() {
+ return OS.objc_msgSend(this.id, OS.sel_isBezeled) != 0;
+}
+
+public boolean isBordered() {
+ return OS.objc_msgSend(this.id, OS.sel_isBordered) != 0;
+}
+
+public NSLocale locale() {
+ int result = OS.objc_msgSend(this.id, OS.sel_locale);
+ return result != 0 ? new NSLocale(result) : null;
+}
+
+public NSDate maxDate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_maxDate);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public NSDate minDate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_minDate);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public void setBackgroundColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color != null ? color.id : 0);
+}
+
+public void setBezeled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setBezeled_1, flag);
+}
+
+public void setBordered(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setBordered_1, flag);
+}
+
+public void setCalendar(NSCalendar newCalendar) {
+ OS.objc_msgSend(this.id, OS.sel_setCalendar_1, newCalendar != null ? newCalendar.id : 0);
+}
+
+public void setDatePickerElements(int elementFlags) {
+ OS.objc_msgSend(this.id, OS.sel_setDatePickerElements_1, elementFlags);
+}
+
+public void setDatePickerMode(int newMode) {
+ OS.objc_msgSend(this.id, OS.sel_setDatePickerMode_1, newMode);
+}
+
+public void setDatePickerStyle(int newStyle) {
+ OS.objc_msgSend(this.id, OS.sel_setDatePickerStyle_1, newStyle);
+}
+
+public void setDateValue(NSDate newStartDate) {
+ OS.objc_msgSend(this.id, OS.sel_setDateValue_1, newStartDate != null ? newStartDate.id : 0);
+}
+
+public void setDelegate(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
+}
+
+public void setDrawsBackground(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setDrawsBackground_1, flag);
+}
+
+public void setLocale(NSLocale newLocale) {
+ OS.objc_msgSend(this.id, OS.sel_setLocale_1, newLocale != null ? newLocale.id : 0);
+}
+
+public void setMaxDate(NSDate date) {
+ OS.objc_msgSend(this.id, OS.sel_setMaxDate_1, date != null ? date.id : 0);
+}
+
+public void setMinDate(NSDate date) {
+ OS.objc_msgSend(this.id, OS.sel_setMinDate_1, date != null ? date.id : 0);
+}
+
+public void setTextColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setTextColor_1, color != null ? color.id : 0);
+}
+
+public void setTimeInterval(double newTimeInterval) {
+ OS.objc_msgSend(this.id, OS.sel_setTimeInterval_1, newTimeInterval);
+}
+
+public void setTimeZone(NSTimeZone newTimeZone) {
+ OS.objc_msgSend(this.id, OS.sel_setTimeZone_1, newTimeZone != null ? newTimeZone.id : 0);
+}
+
+public NSColor textColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public double timeInterval() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_timeInterval);
+}
+
+public NSTimeZone timeZone() {
+ int result = OS.objc_msgSend(this.id, OS.sel_timeZone);
+ return result != 0 ? new NSTimeZone(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDatePickerCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDatePickerCell.java
new file mode 100644
index 0000000000..c5235d27df
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDatePickerCell.java
@@ -0,0 +1,134 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDatePickerCell extends NSActionCell {
+
+public NSDatePickerCell() {
+ super();
+}
+
+public NSDatePickerCell(int id) {
+ super(id);
+}
+
+public NSColor backgroundColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public NSCalendar calendar() {
+ int result = OS.objc_msgSend(this.id, OS.sel_calendar);
+ return result != 0 ? new NSCalendar(result) : null;
+}
+
+public int datePickerElements() {
+ return OS.objc_msgSend(this.id, OS.sel_datePickerElements);
+}
+
+public int datePickerMode() {
+ return OS.objc_msgSend(this.id, OS.sel_datePickerMode);
+}
+
+public int datePickerStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_datePickerStyle);
+}
+
+public NSDate dateValue() {
+ int result = OS.objc_msgSend(this.id, OS.sel_dateValue);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean drawsBackground() {
+ return OS.objc_msgSend(this.id, OS.sel_drawsBackground) != 0;
+}
+
+public NSLocale locale() {
+ int result = OS.objc_msgSend(this.id, OS.sel_locale);
+ return result != 0 ? new NSLocale(result) : null;
+}
+
+public NSDate maxDate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_maxDate);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public NSDate minDate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_minDate);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public void setBackgroundColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color != null ? color.id : 0);
+}
+
+public void setCalendar(NSCalendar newCalendar) {
+ OS.objc_msgSend(this.id, OS.sel_setCalendar_1, newCalendar != null ? newCalendar.id : 0);
+}
+
+public void setDatePickerElements(int elementFlags) {
+ OS.objc_msgSend(this.id, OS.sel_setDatePickerElements_1, elementFlags);
+}
+
+public void setDatePickerMode(int newMode) {
+ OS.objc_msgSend(this.id, OS.sel_setDatePickerMode_1, newMode);
+}
+
+public void setDatePickerStyle(int newStyle) {
+ OS.objc_msgSend(this.id, OS.sel_setDatePickerStyle_1, newStyle);
+}
+
+public void setDateValue(NSDate newStartDate) {
+ OS.objc_msgSend(this.id, OS.sel_setDateValue_1, newStartDate != null ? newStartDate.id : 0);
+}
+
+public void setDelegate(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
+}
+
+public void setDrawsBackground(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setDrawsBackground_1, flag);
+}
+
+public void setLocale(NSLocale newLocale) {
+ OS.objc_msgSend(this.id, OS.sel_setLocale_1, newLocale != null ? newLocale.id : 0);
+}
+
+public void setMaxDate(NSDate date) {
+ OS.objc_msgSend(this.id, OS.sel_setMaxDate_1, date != null ? date.id : 0);
+}
+
+public void setMinDate(NSDate date) {
+ OS.objc_msgSend(this.id, OS.sel_setMinDate_1, date != null ? date.id : 0);
+}
+
+public void setTextColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setTextColor_1, color != null ? color.id : 0);
+}
+
+public void setTimeInterval(double newTimeInterval) {
+ OS.objc_msgSend(this.id, OS.sel_setTimeInterval_1, newTimeInterval);
+}
+
+public void setTimeZone(NSTimeZone newTimeZone) {
+ OS.objc_msgSend(this.id, OS.sel_setTimeZone_1, newTimeZone != null ? newTimeZone.id : 0);
+}
+
+public NSColor textColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public double timeInterval() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_timeInterval);
+}
+
+public NSTimeZone timeZone() {
+ int result = OS.objc_msgSend(this.id, OS.sel_timeZone);
+ return result != 0 ? new NSTimeZone(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDecimal.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDecimal.java
new file mode 100644
index 0000000000..0e86844ebc
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDecimal.java
@@ -0,0 +1,10 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDecimal {
+ public int _exponent;
+ public int _length;
+ public int _isNegative;
+ public int _isCompact;
+ public int _reserved;
+ public short[] _mantissa = new short[OS.NSDecimalMaxSize];
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDecimalNumber.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDecimalNumber.java
new file mode 100644
index 0000000000..0f7828930e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDecimalNumber.java
@@ -0,0 +1,175 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDecimalNumber extends NSNumber {
+
+public NSDecimalNumber() {
+ super();
+}
+
+public NSDecimalNumber(int id) {
+ super(id);
+}
+
+public int compare(NSNumber decimalNumber) {
+ return OS.objc_msgSend(this.id, OS.sel_compare_1, decimalNumber != null ? decimalNumber.id : 0);
+}
+
+public NSDecimalNumber decimalNumberByAdding_(NSDecimalNumber decimalNumber) {
+ int result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByAdding_1, decimalNumber != null ? decimalNumber.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSDecimalNumber(result) : null);
+}
+
+public NSDecimalNumber decimalNumberByAdding_withBehavior_(NSDecimalNumber decimalNumber, id behavior) {
+ int result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByAdding_1withBehavior_1, decimalNumber != null ? decimalNumber.id : 0, behavior != null ? behavior.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSDecimalNumber(result) : null);
+}
+
+public NSDecimalNumber decimalNumberByDividingBy_(NSDecimalNumber decimalNumber) {
+ int result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByDividingBy_1, decimalNumber != null ? decimalNumber.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSDecimalNumber(result) : null);
+}
+
+public NSDecimalNumber decimalNumberByDividingBy_withBehavior_(NSDecimalNumber decimalNumber, id behavior) {
+ int result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByDividingBy_1withBehavior_1, decimalNumber != null ? decimalNumber.id : 0, behavior != null ? behavior.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSDecimalNumber(result) : null);
+}
+
+public NSDecimalNumber decimalNumberByMultiplyingBy_(NSDecimalNumber decimalNumber) {
+ int result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByMultiplyingBy_1, decimalNumber != null ? decimalNumber.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSDecimalNumber(result) : null);
+}
+
+public NSDecimalNumber decimalNumberByMultiplyingBy_withBehavior_(NSDecimalNumber decimalNumber, id behavior) {
+ int result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByMultiplyingBy_1withBehavior_1, decimalNumber != null ? decimalNumber.id : 0, behavior != null ? behavior.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSDecimalNumber(result) : null);
+}
+
+public NSDecimalNumber decimalNumberByMultiplyingByPowerOf10_(short power) {
+ int result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByMultiplyingByPowerOf10_1, power);
+ return result == this.id ? this : (result != 0 ? new NSDecimalNumber(result) : null);
+}
+
+public NSDecimalNumber decimalNumberByMultiplyingByPowerOf10_withBehavior_(short power, id behavior) {
+ int result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByMultiplyingByPowerOf10_1withBehavior_1, power, behavior != null ? behavior.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSDecimalNumber(result) : null);
+}
+
+public NSDecimalNumber decimalNumberByRaisingToPower_(int power) {
+ int result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByRaisingToPower_1, power);
+ return result == this.id ? this : (result != 0 ? new NSDecimalNumber(result) : null);
+}
+
+public NSDecimalNumber decimalNumberByRaisingToPower_withBehavior_(int power, id behavior) {
+ int result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByRaisingToPower_1withBehavior_1, power, behavior != null ? behavior.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSDecimalNumber(result) : null);
+}
+
+public NSDecimalNumber decimalNumberByRoundingAccordingToBehavior(id behavior) {
+ int result = OS.objc_msgSend(this.id, OS.sel_decimalNumberByRoundingAccordingToBehavior_1, behavior != null ? behavior.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSDecimalNumber(result) : null);
+}
+
+public NSDecimalNumber decimalNumberBySubtracting_(NSDecimalNumber decimalNumber) {
+ int result = OS.objc_msgSend(this.id, OS.sel_decimalNumberBySubtracting_1, decimalNumber != null ? decimalNumber.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSDecimalNumber(result) : null);
+}
+
+public NSDecimalNumber decimalNumberBySubtracting_withBehavior_(NSDecimalNumber decimalNumber, id behavior) {
+ int result = OS.objc_msgSend(this.id, OS.sel_decimalNumberBySubtracting_1withBehavior_1, decimalNumber != null ? decimalNumber.id : 0, behavior != null ? behavior.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSDecimalNumber(result) : null);
+}
+
+public static NSDecimalNumber decimalNumberWithDecimal(NSDecimal dcm) {
+ int result = OS.objc_msgSend(OS.class_NSDecimalNumber, OS.sel_decimalNumberWithDecimal_1, dcm);
+ return result != 0 ? new NSDecimalNumber(result) : null;
+}
+
+public static NSDecimalNumber decimalNumberWithMantissa(long mantissa, short exponent, boolean flag) {
+ int result = OS.objc_msgSend(OS.class_NSDecimalNumber, OS.sel_decimalNumberWithMantissa_1exponent_1isNegative_1, mantissa, exponent, flag);
+ return result != 0 ? new NSDecimalNumber(result) : null;
+}
+
+public static NSDecimalNumber static_decimalNumberWithString_(NSString numberValue) {
+ int result = OS.objc_msgSend(OS.class_NSDecimalNumber, OS.sel_decimalNumberWithString_1, numberValue != null ? numberValue.id : 0);
+ return result != 0 ? new NSDecimalNumber(result) : null;
+}
+
+public static NSDecimalNumber static_decimalNumberWithString_locale_(NSString numberValue, id locale) {
+ int result = OS.objc_msgSend(OS.class_NSDecimalNumber, OS.sel_decimalNumberWithString_1locale_1, numberValue != null ? numberValue.id : 0, locale != null ? locale.id : 0);
+ return result != 0 ? new NSDecimalNumber(result) : null;
+}
+
+public NSDecimal decimalValue() {
+ NSDecimal result = new NSDecimal();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_decimalValue);
+ return result;
+}
+
+public static id defaultBehavior() {
+ int result = OS.objc_msgSend(OS.class_NSDecimalNumber, OS.sel_defaultBehavior);
+ return result != 0 ? new id (result) : null;
+}
+
+public NSString descriptionWithLocale(id locale) {
+ int result = OS.objc_msgSend(this.id, OS.sel_descriptionWithLocale_1, locale != null ? locale.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public double doubleValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_doubleValue);
+}
+
+public id initWithDecimal(NSDecimal dcm) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithDecimal_1, dcm);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithMantissa(long mantissa, short exponent, boolean flag) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithMantissa_1exponent_1isNegative_1, mantissa, exponent, flag);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithString_(NSString numberValue) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithString_1, numberValue != null ? numberValue.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithString_locale_(NSString numberValue, id locale) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithString_1locale_1, numberValue != null ? numberValue.id : 0, locale != null ? locale.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static NSDecimalNumber maximumDecimalNumber() {
+ int result = OS.objc_msgSend(OS.class_NSDecimalNumber, OS.sel_maximumDecimalNumber);
+ return result != 0 ? new NSDecimalNumber(result) : null;
+}
+
+public static NSDecimalNumber minimumDecimalNumber() {
+ int result = OS.objc_msgSend(OS.class_NSDecimalNumber, OS.sel_minimumDecimalNumber);
+ return result != 0 ? new NSDecimalNumber(result) : null;
+}
+
+public static NSDecimalNumber notANumber() {
+ int result = OS.objc_msgSend(OS.class_NSDecimalNumber, OS.sel_notANumber);
+ return result != 0 ? new NSDecimalNumber(result) : null;
+}
+
+public int objCType() {
+ return OS.objc_msgSend(this.id, OS.sel_objCType);
+}
+
+public static NSDecimalNumber one() {
+ int result = OS.objc_msgSend(OS.class_NSDecimalNumber, OS.sel_one);
+ return result != 0 ? new NSDecimalNumber(result) : null;
+}
+
+public static void setDefaultBehavior(id behavior) {
+ OS.objc_msgSend(OS.class_NSDecimalNumber, OS.sel_setDefaultBehavior_1, behavior != null ? behavior.id : 0);
+}
+
+public static NSDecimalNumber zero() {
+ int result = OS.objc_msgSend(OS.class_NSDecimalNumber, OS.sel_zero);
+ return result != 0 ? new NSDecimalNumber(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDecimalNumberHandler.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDecimalNumberHandler.java
new file mode 100644
index 0000000000..5ed4edd493
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDecimalNumberHandler.java
@@ -0,0 +1,28 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDecimalNumberHandler extends NSObject {
+
+public NSDecimalNumberHandler() {
+ super();
+}
+
+public NSDecimalNumberHandler(int id) {
+ super(id);
+}
+
+public static id decimalNumberHandlerWithRoundingMode(int roundingMode, short scale, boolean exact, boolean overflow, boolean underflow, boolean divideByZero) {
+ int result = OS.objc_msgSend(OS.class_NSDecimalNumberHandler, OS.sel_decimalNumberHandlerWithRoundingMode_1scale_1raiseOnExactness_1raiseOnOverflow_1raiseOnUnderflow_1raiseOnDivideByZero_1, roundingMode, scale, exact, overflow, underflow, divideByZero);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id defaultDecimalNumberHandler() {
+ int result = OS.objc_msgSend(OS.class_NSDecimalNumberHandler, OS.sel_defaultDecimalNumberHandler);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithRoundingMode(int roundingMode, short scale, boolean exact, boolean overflow, boolean underflow, boolean divideByZero) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithRoundingMode_1scale_1raiseOnExactness_1raiseOnOverflow_1raiseOnUnderflow_1raiseOnDivideByZero_1, roundingMode, scale, exact, overflow, underflow, divideByZero);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDeleteCommand.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDeleteCommand.java
new file mode 100644
index 0000000000..4f211e46d8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDeleteCommand.java
@@ -0,0 +1,22 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDeleteCommand extends NSScriptCommand {
+
+public NSDeleteCommand() {
+ super();
+}
+
+public NSDeleteCommand(int id) {
+ super(id);
+}
+
+public NSScriptObjectSpecifier keySpecifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_keySpecifier);
+ return result != 0 ? new NSScriptObjectSpecifier(result) : null;
+}
+
+public void setReceiversSpecifier(NSScriptObjectSpecifier receiversRef) {
+ OS.objc_msgSend(this.id, OS.sel_setReceiversSpecifier_1, receiversRef != null ? receiversRef.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDictionary.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDictionary.java
new file mode 100644
index 0000000000..887970aff4
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDictionary.java
@@ -0,0 +1,244 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDictionary extends NSObject {
+
+public NSDictionary() {
+ super();
+}
+
+public NSDictionary(int id) {
+ super(id);
+}
+
+public NSArray allKeys() {
+ int result = OS.objc_msgSend(this.id, OS.sel_allKeys);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray allKeysForObject(id anObject) {
+ int result = OS.objc_msgSend(this.id, OS.sel_allKeysForObject_1, anObject != null ? anObject.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray allValues() {
+ int result = OS.objc_msgSend(this.id, OS.sel_allValues);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public int count() {
+ return OS.objc_msgSend(this.id, OS.sel_count);
+}
+
+public NSString description() {
+ int result = OS.objc_msgSend(this.id, OS.sel_description);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString descriptionInStringsFileFormat() {
+ int result = OS.objc_msgSend(this.id, OS.sel_descriptionInStringsFileFormat);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString descriptionWithLocale_(id locale) {
+ int result = OS.objc_msgSend(this.id, OS.sel_descriptionWithLocale_1, locale != null ? locale.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString descriptionWithLocale_indent_(id locale, int level) {
+ int result = OS.objc_msgSend(this.id, OS.sel_descriptionWithLocale_1indent_1, locale != null ? locale.id : 0, level);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static id dictionary() {
+ int result = OS.objc_msgSend(OS.class_NSDictionary, OS.sel_dictionary);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id dictionaryWithContentsOfFile(NSString path) {
+ int result = OS.objc_msgSend(OS.class_NSDictionary, OS.sel_dictionaryWithContentsOfFile_1, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id dictionaryWithContentsOfURL(NSURL url) {
+ int result = OS.objc_msgSend(OS.class_NSDictionary, OS.sel_dictionaryWithContentsOfURL_1, url != null ? url.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id dictionaryWithDictionary(NSDictionary dict) {
+ int result = OS.objc_msgSend(OS.class_NSDictionary, OS.sel_dictionaryWithDictionary_1, dict != null ? dict.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id dictionaryWithObject(id object, id key) {
+ int result = OS.objc_msgSend(OS.class_NSDictionary, OS.sel_dictionaryWithObject_1forKey_1, object != null ? object.id : 0, key != null ? key.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_dictionaryWithObjects_forKeys_(NSArray objects, NSArray keys) {
+ int result = OS.objc_msgSend(OS.class_NSDictionary, OS.sel_dictionaryWithObjects_1forKeys_1, objects != null ? objects.id : 0, keys != null ? keys.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_dictionaryWithObjects_forKeys_count_(int objects, int keys, int cnt) {
+ int result = OS.objc_msgSend(OS.class_NSDictionary, OS.sel_dictionaryWithObjects_1forKeys_1count_1, objects, keys, cnt);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id dictionaryWithObjectsAndKeys(id dictionaryWithObjectsAndKeys) {
+ int result = OS.objc_msgSend(OS.class_NSDictionary, OS.sel_dictionaryWithObjectsAndKeys_1, dictionaryWithObjectsAndKeys != null ? dictionaryWithObjectsAndKeys.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSDate fileCreationDate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileCreationDate);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public boolean fileExtensionHidden() {
+ return OS.objc_msgSend(this.id, OS.sel_fileExtensionHidden) != 0;
+}
+
+public NSNumber fileGroupOwnerAccountID() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileGroupOwnerAccountID);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public NSString fileGroupOwnerAccountName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileGroupOwnerAccountName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int fileHFSCreatorCode() {
+ return OS.objc_msgSend(this.id, OS.sel_fileHFSCreatorCode);
+}
+
+public int fileHFSTypeCode() {
+ return OS.objc_msgSend(this.id, OS.sel_fileHFSTypeCode);
+}
+
+public boolean fileIsAppendOnly() {
+ return OS.objc_msgSend(this.id, OS.sel_fileIsAppendOnly) != 0;
+}
+
+public boolean fileIsImmutable() {
+ return OS.objc_msgSend(this.id, OS.sel_fileIsImmutable) != 0;
+}
+
+public NSDate fileModificationDate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileModificationDate);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public NSNumber fileOwnerAccountID() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileOwnerAccountID);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public NSString fileOwnerAccountName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileOwnerAccountName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int filePosixPermissions() {
+ return OS.objc_msgSend(this.id, OS.sel_filePosixPermissions);
+}
+
+public long fileSize() {
+ return (long)OS.objc_msgSend(this.id, OS.sel_fileSize);
+}
+
+public int fileSystemFileNumber() {
+ return OS.objc_msgSend(this.id, OS.sel_fileSystemFileNumber);
+}
+
+public int fileSystemNumber() {
+ return OS.objc_msgSend(this.id, OS.sel_fileSystemNumber);
+}
+
+public NSString fileType() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileType);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void getObjects(int objects, int keys) {
+ OS.objc_msgSend(this.id, OS.sel_getObjects_1andKeys_1, objects, keys);
+}
+
+public id initWithContentsOfFile(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfFile_1, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithContentsOfURL(NSURL url) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1, url != null ? url.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithDictionary_(NSDictionary otherDictionary) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithDictionary_1, otherDictionary != null ? otherDictionary.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithDictionary_copyItems_(NSDictionary otherDictionary, boolean flag) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithDictionary_1copyItems_1, otherDictionary != null ? otherDictionary.id : 0, flag);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithObjects_forKeys_(NSArray objects, NSArray keys) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithObjects_1forKeys_1, objects != null ? objects.id : 0, keys != null ? keys.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithObjects_forKeys_count_(int objects, int keys, int cnt) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithObjects_1forKeys_1count_1, objects, keys, cnt);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithObjectsAndKeys(id initWithObjectsAndKeys) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithObjectsAndKeys_1, initWithObjectsAndKeys != null ? initWithObjectsAndKeys.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isEqualToDictionary(NSDictionary otherDictionary) {
+ return OS.objc_msgSend(this.id, OS.sel_isEqualToDictionary_1, otherDictionary != null ? otherDictionary.id : 0) != 0;
+}
+
+public NSEnumerator keyEnumerator() {
+ int result = OS.objc_msgSend(this.id, OS.sel_keyEnumerator);
+ return result != 0 ? new NSEnumerator(result) : null;
+}
+
+public NSArray keysSortedByValueUsingSelector(int comparator) {
+ int result = OS.objc_msgSend(this.id, OS.sel_keysSortedByValueUsingSelector_1, comparator);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSEnumerator objectEnumerator() {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectEnumerator);
+ return result != 0 ? new NSEnumerator(result) : null;
+}
+
+public id objectForKey(id aKey) {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectForKey_1, aKey != null ? aKey.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSArray objectsForKeys(NSArray keys, id marker) {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectsForKeys_1notFoundMarker_1, keys != null ? keys.id : 0, marker != null ? marker.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public id valueForKey(NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_valueForKey_1, key != null ? key.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean writeToFile(NSString path, boolean useAuxiliaryFile) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToFile_1atomically_1, path != null ? path.id : 0, useAuxiliaryFile) != 0;
+}
+
+public boolean writeToURL(NSURL url, boolean atomically) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToURL_1atomically_1, url != null ? url.id : 0, atomically) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDictionaryController.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDictionaryController.java
new file mode 100644
index 0000000000..7963c4e6ca
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDictionaryController.java
@@ -0,0 +1,72 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDictionaryController extends NSArrayController {
+
+public NSDictionaryController() {
+ super();
+}
+
+public NSDictionaryController(int id) {
+ super(id);
+}
+
+public NSArray excludedKeys() {
+ int result = OS.objc_msgSend(this.id, OS.sel_excludedKeys);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray includedKeys() {
+ int result = OS.objc_msgSend(this.id, OS.sel_includedKeys);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString initialKey() {
+ int result = OS.objc_msgSend(this.id, OS.sel_initialKey);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id initialValue() {
+ int result = OS.objc_msgSend(this.id, OS.sel_initialValue);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSDictionary localizedKeyDictionary() {
+ int result = OS.objc_msgSend(this.id, OS.sel_localizedKeyDictionary);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSString localizedKeyTable() {
+ int result = OS.objc_msgSend(this.id, OS.sel_localizedKeyTable);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id newObject() {
+ int result = OS.objc_msgSend(this.id, OS.sel_newObject);
+ return result != 0 ? new id(result) : null;
+}
+
+public void setExcludedKeys(NSArray keys) {
+ OS.objc_msgSend(this.id, OS.sel_setExcludedKeys_1, keys != null ? keys.id : 0);
+}
+
+public void setIncludedKeys(NSArray keys) {
+ OS.objc_msgSend(this.id, OS.sel_setIncludedKeys_1, keys != null ? keys.id : 0);
+}
+
+public void setInitialKey(NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_setInitialKey_1, key != null ? key.id : 0);
+}
+
+public void setInitialValue(id value) {
+ OS.objc_msgSend(this.id, OS.sel_setInitialValue_1, value != null ? value.id : 0);
+}
+
+public void setLocalizedKeyDictionary(NSDictionary dictionary) {
+ OS.objc_msgSend(this.id, OS.sel_setLocalizedKeyDictionary_1, dictionary != null ? dictionary.id : 0);
+}
+
+public void setLocalizedKeyTable(NSString stringsFileName) {
+ OS.objc_msgSend(this.id, OS.sel_setLocalizedKeyTable_1, stringsFileName != null ? stringsFileName.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDirectoryEnumerator.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDirectoryEnumerator.java
new file mode 100644
index 0000000000..eacaeef539
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDirectoryEnumerator.java
@@ -0,0 +1,27 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDirectoryEnumerator extends NSEnumerator {
+
+public NSDirectoryEnumerator() {
+ super();
+}
+
+public NSDirectoryEnumerator(int id) {
+ super(id);
+}
+
+public NSDictionary directoryAttributes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_directoryAttributes);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSDictionary fileAttributes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileAttributes);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public void skipDescendents() {
+ OS.objc_msgSend(this.id, OS.sel_skipDescendents);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDistantObject.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDistantObject.java
new file mode 100644
index 0000000000..770b0f7a34
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDistantObject.java
@@ -0,0 +1,42 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDistantObject extends NSProxy {
+
+public NSDistantObject() {
+ super();
+}
+
+public NSDistantObject(int id) {
+ super(id);
+}
+
+public NSConnection connectionForProxy() {
+ int result = OS.objc_msgSend(this.id, OS.sel_connectionForProxy);
+ return result != 0 ? new NSConnection(result) : null;
+}
+
+public id initWithLocal(id target, NSConnection connection) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithLocal_1connection_1, target != null ? target.id : 0, connection != null ? connection.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithTarget(id target, NSConnection connection) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithTarget_1connection_1, target != null ? target.id : 0, connection != null ? connection.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static NSDistantObject proxyWithLocal(id target, NSConnection connection) {
+ int result = OS.objc_msgSend(OS.class_NSDistantObject, OS.sel_proxyWithLocal_1connection_1, target != null ? target.id : 0, connection != null ? connection.id : 0);
+ return result != 0 ? new NSDistantObject(result) : null;
+}
+
+public static NSDistantObject proxyWithTarget(id target, NSConnection connection) {
+ int result = OS.objc_msgSend(OS.class_NSDistantObject, OS.sel_proxyWithTarget_1connection_1, target != null ? target.id : 0, connection != null ? connection.id : 0);
+ return result != 0 ? new NSDistantObject(result) : null;
+}
+
+//PUBLIC VOID SETPROTOCOLFORPROXY(PROTOCOL PROTO) {
+// OS.OBJC_MSGSEND(THIS.ID, OS.SEL_SETPROTOCOLFORPROXY_1, PROTO != NULL ? PROTO.ID : 0);
+//}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDistantObjectRequest.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDistantObjectRequest.java
new file mode 100644
index 0000000000..bdb51cb7f9
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDistantObjectRequest.java
@@ -0,0 +1,32 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDistantObjectRequest extends NSObject {
+
+public NSDistantObjectRequest() {
+ super();
+}
+
+public NSDistantObjectRequest(int id) {
+ super(id);
+}
+
+public NSConnection connection() {
+ int result = OS.objc_msgSend(this.id, OS.sel_connection);
+ return result != 0 ? new NSConnection(result) : null;
+}
+
+public id conversation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_conversation);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSInvocation invocation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_invocation);
+ return result != 0 ? new NSInvocation(result) : null;
+}
+
+public void replyWithException(NSException exception) {
+ OS.objc_msgSend(this.id, OS.sel_replyWithException_1, exception != null ? exception.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDistributedLock.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDistributedLock.java
new file mode 100644
index 0000000000..61fe5894a3
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDistributedLock.java
@@ -0,0 +1,40 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDistributedLock extends NSObject {
+
+public NSDistributedLock() {
+ super();
+}
+
+public NSDistributedLock(int id) {
+ super(id);
+}
+
+public void breakLock() {
+ OS.objc_msgSend(this.id, OS.sel_breakLock);
+}
+
+public id initWithPath(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithPath_1, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSDate lockDate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_lockDate);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public static NSDistributedLock lockWithPath(NSString path) {
+ int result = OS.objc_msgSend(OS.class_NSDistributedLock, OS.sel_lockWithPath_1, path != null ? path.id : 0);
+ return result != 0 ? new NSDistributedLock(result) : null;
+}
+
+public boolean tryLock() {
+ return OS.objc_msgSend(this.id, OS.sel_tryLock) != 0;
+}
+
+public void unlock() {
+ OS.objc_msgSend(this.id, OS.sel_unlock);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDistributedNotificationCenter.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDistributedNotificationCenter.java
new file mode 100644
index 0000000000..3ef200ae8c
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDistributedNotificationCenter.java
@@ -0,0 +1,59 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDistributedNotificationCenter extends NSNotificationCenter {
+
+public NSDistributedNotificationCenter() {
+ super();
+}
+
+public NSDistributedNotificationCenter(int id) {
+ super(id);
+}
+
+public void addObserver_selector_name_object_(id observer, int aSelector, NSString aName, NSString anObject) {
+ OS.objc_msgSend(this.id, OS.sel_addObserver_1selector_1name_1object_1, observer != null ? observer.id : 0, aSelector, aName != null ? aName.id : 0, anObject != null ? anObject.id : 0);
+}
+
+public void addObserver_selector_name_object_suspensionBehavior_(id observer, int selector, NSString name, NSString object, int suspensionBehavior) {
+ OS.objc_msgSend(this.id, OS.sel_addObserver_1selector_1name_1object_1suspensionBehavior_1, observer != null ? observer.id : 0, selector, name != null ? name.id : 0, object != null ? object.id : 0, suspensionBehavior);
+}
+
+public static id defaultCenter() {
+ int result = OS.objc_msgSend(OS.class_NSDistributedNotificationCenter, OS.sel_defaultCenter);
+ return result != 0 ? new id(result) : null;
+}
+
+public static NSDistributedNotificationCenter notificationCenterForType(NSString notificationCenterType) {
+ int result = OS.objc_msgSend(OS.class_NSDistributedNotificationCenter, OS.sel_notificationCenterForType_1, notificationCenterType != null ? notificationCenterType.id : 0);
+ return result != 0 ? new NSDistributedNotificationCenter(result) : null;
+}
+
+public void postNotificationName_object_(NSString aName, NSString anObject) {
+ OS.objc_msgSend(this.id, OS.sel_postNotificationName_1object_1, aName != null ? aName.id : 0, anObject != null ? anObject.id : 0);
+}
+
+public void postNotificationName_object_userInfo_(NSString aName, NSString anObject, NSDictionary aUserInfo) {
+ OS.objc_msgSend(this.id, OS.sel_postNotificationName_1object_1userInfo_1, aName != null ? aName.id : 0, anObject != null ? anObject.id : 0, aUserInfo != null ? aUserInfo.id : 0);
+}
+
+public void postNotificationName_object_userInfo_deliverImmediately_(NSString name, NSString object, NSDictionary userInfo, boolean deliverImmediately) {
+ OS.objc_msgSend(this.id, OS.sel_postNotificationName_1object_1userInfo_1deliverImmediately_1, name != null ? name.id : 0, object != null ? object.id : 0, userInfo != null ? userInfo.id : 0, deliverImmediately);
+}
+
+public void postNotificationName_object_userInfo_options_(NSString name, NSString object, NSDictionary userInfo, int options) {
+ OS.objc_msgSend(this.id, OS.sel_postNotificationName_1object_1userInfo_1options_1, name != null ? name.id : 0, object != null ? object.id : 0, userInfo != null ? userInfo.id : 0, options);
+}
+
+public void removeObserver(id observer, NSString aName, NSString anObject) {
+ OS.objc_msgSend(this.id, OS.sel_removeObserver_1name_1object_1, observer != null ? observer.id : 0, aName != null ? aName.id : 0, anObject != null ? anObject.id : 0);
+}
+
+public void setSuspended(boolean suspended) {
+ OS.objc_msgSend(this.id, OS.sel_setSuspended_1, suspended);
+}
+
+public boolean suspended() {
+ return OS.objc_msgSend(this.id, OS.sel_suspended) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDockTile.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDockTile.java
new file mode 100644
index 0000000000..d1ae7cb0c0
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDockTile.java
@@ -0,0 +1,54 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDockTile extends NSObject {
+
+public NSDockTile() {
+ super();
+}
+
+public NSDockTile(int id) {
+ super(id);
+}
+
+public NSString badgeLabel() {
+ int result = OS.objc_msgSend(this.id, OS.sel_badgeLabel);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSView contentView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_contentView);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public void display() {
+ OS.objc_msgSend(this.id, OS.sel_display);
+}
+
+public id owner() {
+ int result = OS.objc_msgSend(this.id, OS.sel_owner);
+ return result != 0 ? new id(result) : null;
+}
+
+public void setBadgeLabel(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setBadgeLabel_1, string != null ? string.id : 0);
+}
+
+public void setContentView(NSView view) {
+ OS.objc_msgSend(this.id, OS.sel_setContentView_1, view != null ? view.id : 0);
+}
+
+public void setShowsApplicationBadge(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setShowsApplicationBadge_1, flag);
+}
+
+public boolean showsApplicationBadge() {
+ return OS.objc_msgSend(this.id, OS.sel_showsApplicationBadge) != 0;
+}
+
+public NSSize size() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_size);
+ return result;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDocument.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDocument.java
new file mode 100644
index 0000000000..8661bc0208
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDocument.java
@@ -0,0 +1,456 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDocument extends NSObject {
+
+public NSDocument() {
+ super();
+}
+
+public NSDocument(int id) {
+ super(id);
+}
+
+public void addWindowController(NSWindowController windowController) {
+ OS.objc_msgSend(this.id, OS.sel_addWindowController_1, windowController != null ? windowController.id : 0);
+}
+
+public void autosaveDocumentWithDelegate(id delegate, int didAutosaveSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_autosaveDocumentWithDelegate_1didAutosaveSelector_1contextInfo_1, delegate != null ? delegate.id : 0, didAutosaveSelector, contextInfo);
+}
+
+public NSURL autosavedContentsFileURL() {
+ int result = OS.objc_msgSend(this.id, OS.sel_autosavedContentsFileURL);
+ return result != 0 ? new NSURL(result) : null;
+}
+
+public NSString autosavingFileType() {
+ int result = OS.objc_msgSend(this.id, OS.sel_autosavingFileType);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void canCloseDocumentWithDelegate(id delegate, int shouldCloseSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_canCloseDocumentWithDelegate_1shouldCloseSelector_1contextInfo_1, delegate != null ? delegate.id : 0, shouldCloseSelector, contextInfo);
+}
+
+public void close() {
+ OS.objc_msgSend(this.id, OS.sel_close);
+}
+
+public NSData dataOfType(NSString typeName, int outError) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dataOfType_1error_1, typeName != null ? typeName.id : 0, outError);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSData dataRepresentationOfType(NSString type) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dataRepresentationOfType_1, type != null ? type.id : 0);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSString displayName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_displayName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSDictionary fileAttributesToWriteToFile(NSString fullDocumentPath, NSString documentTypeName, int saveOperationType) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileAttributesToWriteToFile_1ofType_1saveOperation_1, fullDocumentPath != null ? fullDocumentPath.id : 0, documentTypeName != null ? documentTypeName.id : 0, saveOperationType);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSDictionary fileAttributesToWriteToURL(NSURL absoluteURL, NSString typeName, int saveOperation, NSURL absoluteOriginalContentsURL, int outError) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileAttributesToWriteToURL_1ofType_1forSaveOperation_1originalContentsURL_1error_1, absoluteURL != null ? absoluteURL.id : 0, typeName != null ? typeName.id : 0, saveOperation, absoluteOriginalContentsURL != null ? absoluteOriginalContentsURL.id : 0, outError);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSDate fileModificationDate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileModificationDate);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public NSString fileName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString fileNameExtensionForType(NSString typeName, int saveOperation) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileNameExtensionForType_1saveOperation_1, typeName != null ? typeName.id : 0, saveOperation);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean fileNameExtensionWasHiddenInLastRunSavePanel() {
+ return OS.objc_msgSend(this.id, OS.sel_fileNameExtensionWasHiddenInLastRunSavePanel) != 0;
+}
+
+public NSString fileType() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileType);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString fileTypeFromLastRunSavePanel() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileTypeFromLastRunSavePanel);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSURL fileURL() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileURL);
+ return result != 0 ? new NSURL(result) : null;
+}
+
+public NSFileWrapper fileWrapperOfType(NSString typeName, int outError) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileWrapperOfType_1error_1, typeName != null ? typeName.id : 0, outError);
+ return result != 0 ? new NSFileWrapper(result) : null;
+}
+
+public NSFileWrapper fileWrapperRepresentationOfType(NSString type) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileWrapperRepresentationOfType_1, type != null ? type.id : 0);
+ return result != 0 ? new NSFileWrapper(result) : null;
+}
+
+public id handleCloseScriptCommand(NSCloseCommand command) {
+ int result = OS.objc_msgSend(this.id, OS.sel_handleCloseScriptCommand_1, command != null ? command.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id handlePrintScriptCommand(NSScriptCommand command) {
+ int result = OS.objc_msgSend(this.id, OS.sel_handlePrintScriptCommand_1, command != null ? command.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id handleSaveScriptCommand(NSScriptCommand command) {
+ int result = OS.objc_msgSend(this.id, OS.sel_handleSaveScriptCommand_1, command != null ? command.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean hasUnautosavedChanges() {
+ return OS.objc_msgSend(this.id, OS.sel_hasUnautosavedChanges) != 0;
+}
+
+public boolean hasUndoManager() {
+ return OS.objc_msgSend(this.id, OS.sel_hasUndoManager) != 0;
+}
+
+public NSDocument initForURL(NSURL absoluteDocumentURL, NSURL absoluteDocumentContentsURL, NSString typeName, int outError) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initForURL_1withContentsOfURL_1ofType_1error_1, absoluteDocumentURL != null ? absoluteDocumentURL.id : 0, absoluteDocumentContentsURL != null ? absoluteDocumentContentsURL.id : 0, typeName != null ? typeName.id : 0, outError);
+ return result != 0 ? this : null;
+}
+
+public NSDocument initWithContentsOfFile(NSString absolutePath, NSString typeName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfFile_1ofType_1, absolutePath != null ? absolutePath.id : 0, typeName != null ? typeName.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSDocument initWithContentsOfURL_ofType_(NSURL absoluteURL, NSString typeName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1ofType_1, absoluteURL != null ? absoluteURL.id : 0, typeName != null ? typeName.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSDocument initWithContentsOfURL_ofType_error_(NSURL absoluteURL, NSString typeName, int outError) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1ofType_1error_1, absoluteURL != null ? absoluteURL.id : 0, typeName != null ? typeName.id : 0, outError);
+ return result != 0 ? this : null;
+}
+
+public NSDocument initWithType(NSString typeName, int outError) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithType_1error_1, typeName != null ? typeName.id : 0, outError);
+ return result != 0 ? this : null;
+}
+
+public boolean isDocumentEdited() {
+ return OS.objc_msgSend(this.id, OS.sel_isDocumentEdited) != 0;
+}
+
+public static boolean isNativeType(NSString type) {
+ return OS.objc_msgSend(OS.class_NSDocument, OS.sel_isNativeType_1, type != null ? type.id : 0) != 0;
+}
+
+public boolean keepBackupFile() {
+ return OS.objc_msgSend(this.id, OS.sel_keepBackupFile) != 0;
+}
+
+public NSString lastComponentOfFileName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_lastComponentOfFileName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean loadDataRepresentation(NSData data, NSString type) {
+ return OS.objc_msgSend(this.id, OS.sel_loadDataRepresentation_1ofType_1, data != null ? data.id : 0, type != null ? type.id : 0) != 0;
+}
+
+public boolean loadFileWrapperRepresentation(NSFileWrapper wrapper, NSString type) {
+ return OS.objc_msgSend(this.id, OS.sel_loadFileWrapperRepresentation_1ofType_1, wrapper != null ? wrapper.id : 0, type != null ? type.id : 0) != 0;
+}
+
+public void makeWindowControllers() {
+ OS.objc_msgSend(this.id, OS.sel_makeWindowControllers);
+}
+
+public NSScriptObjectSpecifier objectSpecifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectSpecifier);
+ return result != 0 ? new NSScriptObjectSpecifier(result) : null;
+}
+
+public boolean preparePageLayout(NSPageLayout pageLayout) {
+ return OS.objc_msgSend(this.id, OS.sel_preparePageLayout_1, pageLayout != null ? pageLayout.id : 0) != 0;
+}
+
+public boolean prepareSavePanel(NSSavePanel savePanel) {
+ return OS.objc_msgSend(this.id, OS.sel_prepareSavePanel_1, savePanel != null ? savePanel.id : 0) != 0;
+}
+
+public boolean presentError_(NSError error) {
+ return OS.objc_msgSend(this.id, OS.sel_presentError_1, error != null ? error.id : 0) != 0;
+}
+
+public void presentError_modalForWindow_delegate_didPresentSelector_contextInfo_(NSError error, NSWindow window, id delegate, int didPresentSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_presentError_1modalForWindow_1delegate_1didPresentSelector_1contextInfo_1, error != null ? error.id : 0, window != null ? window.id : 0, delegate != null ? delegate.id : 0, didPresentSelector, contextInfo);
+}
+
+public void printDocument(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_printDocument_1, sender != null ? sender.id : 0);
+}
+
+public void printDocumentWithSettings(NSDictionary printSettings, boolean showPrintPanel, id delegate, int didPrintSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_printDocumentWithSettings_1showPrintPanel_1delegate_1didPrintSelector_1contextInfo_1, printSettings != null ? printSettings.id : 0, showPrintPanel, delegate != null ? delegate.id : 0, didPrintSelector, contextInfo);
+}
+
+public NSPrintInfo printInfo() {
+ int result = OS.objc_msgSend(this.id, OS.sel_printInfo);
+ return result != 0 ? new NSPrintInfo(result) : null;
+}
+
+public NSPrintOperation printOperationWithSettings(NSDictionary printSettings, int outError) {
+ int result = OS.objc_msgSend(this.id, OS.sel_printOperationWithSettings_1error_1, printSettings != null ? printSettings.id : 0, outError);
+ return result != 0 ? new NSPrintOperation(result) : null;
+}
+
+public void printShowingPrintPanel(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_printShowingPrintPanel_1, flag);
+}
+
+public boolean readFromData(NSData data, NSString typeName, int outError) {
+ return OS.objc_msgSend(this.id, OS.sel_readFromData_1ofType_1error_1, data != null ? data.id : 0, typeName != null ? typeName.id : 0, outError) != 0;
+}
+
+public boolean readFromFile(NSString fileName, NSString type) {
+ return OS.objc_msgSend(this.id, OS.sel_readFromFile_1ofType_1, fileName != null ? fileName.id : 0, type != null ? type.id : 0) != 0;
+}
+
+public boolean readFromFileWrapper(NSFileWrapper fileWrapper, NSString typeName, int outError) {
+ return OS.objc_msgSend(this.id, OS.sel_readFromFileWrapper_1ofType_1error_1, fileWrapper != null ? fileWrapper.id : 0, typeName != null ? typeName.id : 0, outError) != 0;
+}
+
+public boolean readFromURL_ofType_(NSURL url, NSString type) {
+ return OS.objc_msgSend(this.id, OS.sel_readFromURL_1ofType_1, url != null ? url.id : 0, type != null ? type.id : 0) != 0;
+}
+
+public boolean readFromURL_ofType_error_(NSURL absoluteURL, NSString typeName, int outError) {
+ return OS.objc_msgSend(this.id, OS.sel_readFromURL_1ofType_1error_1, absoluteURL != null ? absoluteURL.id : 0, typeName != null ? typeName.id : 0, outError) != 0;
+}
+
+public static NSArray readableTypes() {
+ int result = OS.objc_msgSend(OS.class_NSDocument, OS.sel_readableTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void removeWindowController(NSWindowController windowController) {
+ OS.objc_msgSend(this.id, OS.sel_removeWindowController_1, windowController != null ? windowController.id : 0);
+}
+
+public void revertDocumentToSaved(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_revertDocumentToSaved_1, sender != null ? sender.id : 0);
+}
+
+public boolean revertToContentsOfURL(NSURL absoluteURL, NSString typeName, int outError) {
+ return OS.objc_msgSend(this.id, OS.sel_revertToContentsOfURL_1ofType_1error_1, absoluteURL != null ? absoluteURL.id : 0, typeName != null ? typeName.id : 0, outError) != 0;
+}
+
+public boolean revertToSavedFromFile(NSString fileName, NSString type) {
+ return OS.objc_msgSend(this.id, OS.sel_revertToSavedFromFile_1ofType_1, fileName != null ? fileName.id : 0, type != null ? type.id : 0) != 0;
+}
+
+public boolean revertToSavedFromURL(NSURL url, NSString type) {
+ return OS.objc_msgSend(this.id, OS.sel_revertToSavedFromURL_1ofType_1, url != null ? url.id : 0, type != null ? type.id : 0) != 0;
+}
+
+public int runModalPageLayoutWithPrintInfo_(NSPrintInfo printInfo) {
+ return OS.objc_msgSend(this.id, OS.sel_runModalPageLayoutWithPrintInfo_1, printInfo != null ? printInfo.id : 0);
+}
+
+public void runModalPageLayoutWithPrintInfo_delegate_didRunSelector_contextInfo_(NSPrintInfo printInfo, id delegate, int didRunSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_runModalPageLayoutWithPrintInfo_1delegate_1didRunSelector_1contextInfo_1, printInfo != null ? printInfo.id : 0, delegate != null ? delegate.id : 0, didRunSelector, contextInfo);
+}
+
+public void runModalPrintOperation(NSPrintOperation printOperation, id delegate, int didRunSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_runModalPrintOperation_1delegate_1didRunSelector_1contextInfo_1, printOperation != null ? printOperation.id : 0, delegate != null ? delegate.id : 0, didRunSelector, contextInfo);
+}
+
+public void runModalSavePanelForSaveOperation(int saveOperation, id delegate, int didSaveSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_runModalSavePanelForSaveOperation_1delegate_1didSaveSelector_1contextInfo_1, saveOperation, delegate != null ? delegate.id : 0, didSaveSelector, contextInfo);
+}
+
+public void runPageLayout(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_runPageLayout_1, sender != null ? sender.id : 0);
+}
+
+public void saveDocument(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_saveDocument_1, sender != null ? sender.id : 0);
+}
+
+public void saveDocumentAs(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_saveDocumentAs_1, sender != null ? sender.id : 0);
+}
+
+public void saveDocumentTo(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_saveDocumentTo_1, sender != null ? sender.id : 0);
+}
+
+public void saveDocumentWithDelegate(id delegate, int didSaveSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_saveDocumentWithDelegate_1didSaveSelector_1contextInfo_1, delegate != null ? delegate.id : 0, didSaveSelector, contextInfo);
+}
+
+public void saveToFile(NSString fileName, int saveOperation, id delegate, int didSaveSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_saveToFile_1saveOperation_1delegate_1didSaveSelector_1contextInfo_1, fileName != null ? fileName.id : 0, saveOperation, delegate != null ? delegate.id : 0, didSaveSelector, contextInfo);
+}
+
+public void saveToURL_ofType_forSaveOperation_delegate_didSaveSelector_contextInfo_(NSURL absoluteURL, NSString typeName, int saveOperation, id delegate, int didSaveSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_saveToURL_1ofType_1forSaveOperation_1delegate_1didSaveSelector_1contextInfo_1, absoluteURL != null ? absoluteURL.id : 0, typeName != null ? typeName.id : 0, saveOperation, delegate != null ? delegate.id : 0, didSaveSelector, contextInfo);
+}
+
+public boolean saveToURL_ofType_forSaveOperation_error_(NSURL absoluteURL, NSString typeName, int saveOperation, int outError) {
+ return OS.objc_msgSend(this.id, OS.sel_saveToURL_1ofType_1forSaveOperation_1error_1, absoluteURL != null ? absoluteURL.id : 0, typeName != null ? typeName.id : 0, saveOperation, outError) != 0;
+}
+
+public void setAutosavedContentsFileURL(NSURL absoluteURL) {
+ OS.objc_msgSend(this.id, OS.sel_setAutosavedContentsFileURL_1, absoluteURL != null ? absoluteURL.id : 0);
+}
+
+public void setFileModificationDate(NSDate modificationDate) {
+ OS.objc_msgSend(this.id, OS.sel_setFileModificationDate_1, modificationDate != null ? modificationDate.id : 0);
+}
+
+public void setFileName(NSString fileName) {
+ OS.objc_msgSend(this.id, OS.sel_setFileName_1, fileName != null ? fileName.id : 0);
+}
+
+public void setFileType(NSString typeName) {
+ OS.objc_msgSend(this.id, OS.sel_setFileType_1, typeName != null ? typeName.id : 0);
+}
+
+public void setFileURL(NSURL absoluteURL) {
+ OS.objc_msgSend(this.id, OS.sel_setFileURL_1, absoluteURL != null ? absoluteURL.id : 0);
+}
+
+public void setHasUndoManager(boolean hasUndoManager) {
+ OS.objc_msgSend(this.id, OS.sel_setHasUndoManager_1, hasUndoManager);
+}
+
+public void setLastComponentOfFileName(NSString str) {
+ OS.objc_msgSend(this.id, OS.sel_setLastComponentOfFileName_1, str != null ? str.id : 0);
+}
+
+public void setPrintInfo(NSPrintInfo printInfo) {
+ OS.objc_msgSend(this.id, OS.sel_setPrintInfo_1, printInfo != null ? printInfo.id : 0);
+}
+
+public void setUndoManager(NSUndoManager undoManager) {
+ OS.objc_msgSend(this.id, OS.sel_setUndoManager_1, undoManager != null ? undoManager.id : 0);
+}
+
+public void setWindow(NSWindow window) {
+ OS.objc_msgSend(this.id, OS.sel_setWindow_1, window != null ? window.id : 0);
+}
+
+public boolean shouldChangePrintInfo(NSPrintInfo newPrintInfo) {
+ return OS.objc_msgSend(this.id, OS.sel_shouldChangePrintInfo_1, newPrintInfo != null ? newPrintInfo.id : 0) != 0;
+}
+
+public void shouldCloseWindowController(NSWindowController windowController, id delegate, int shouldCloseSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_shouldCloseWindowController_1delegate_1shouldCloseSelector_1contextInfo_1, windowController != null ? windowController.id : 0, delegate != null ? delegate.id : 0, shouldCloseSelector, contextInfo);
+}
+
+public boolean shouldRunSavePanelWithAccessoryView() {
+ return OS.objc_msgSend(this.id, OS.sel_shouldRunSavePanelWithAccessoryView) != 0;
+}
+
+public void showWindows() {
+ OS.objc_msgSend(this.id, OS.sel_showWindows);
+}
+
+public NSUndoManager undoManager() {
+ int result = OS.objc_msgSend(this.id, OS.sel_undoManager);
+ return result != 0 ? new NSUndoManager(result) : null;
+}
+
+public void updateChangeCount(int change) {
+ OS.objc_msgSend(this.id, OS.sel_updateChangeCount_1, change);
+}
+
+public boolean validateUserInterfaceItem(id anItem) {
+ return OS.objc_msgSend(this.id, OS.sel_validateUserInterfaceItem_1, anItem != null ? anItem.id : 0) != 0;
+}
+
+public NSError willPresentError(NSError error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_willPresentError_1, error != null ? error.id : 0);
+ return result != 0 ? new NSError(result) : null;
+}
+
+public void windowControllerDidLoadNib(NSWindowController windowController) {
+ OS.objc_msgSend(this.id, OS.sel_windowControllerDidLoadNib_1, windowController != null ? windowController.id : 0);
+}
+
+public void windowControllerWillLoadNib(NSWindowController windowController) {
+ OS.objc_msgSend(this.id, OS.sel_windowControllerWillLoadNib_1, windowController != null ? windowController.id : 0);
+}
+
+public NSArray windowControllers() {
+ int result = OS.objc_msgSend(this.id, OS.sel_windowControllers);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSWindow windowForSheet() {
+ int result = OS.objc_msgSend(this.id, OS.sel_windowForSheet);
+ return result != 0 ? new NSWindow(result) : null;
+}
+
+public NSString windowNibName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_windowNibName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSArray writableTypes() {
+ int result = OS.objc_msgSend(OS.class_NSDocument, OS.sel_writableTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray writableTypesForSaveOperation(int saveOperation) {
+ int result = OS.objc_msgSend(this.id, OS.sel_writableTypesForSaveOperation_1, saveOperation);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean writeSafelyToURL(NSURL absoluteURL, NSString typeName, int saveOperation, int outError) {
+ return OS.objc_msgSend(this.id, OS.sel_writeSafelyToURL_1ofType_1forSaveOperation_1error_1, absoluteURL != null ? absoluteURL.id : 0, typeName != null ? typeName.id : 0, saveOperation, outError) != 0;
+}
+
+public boolean writeToFile_ofType_(NSString fileName, NSString type) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToFile_1ofType_1, fileName != null ? fileName.id : 0, type != null ? type.id : 0) != 0;
+}
+
+public boolean writeToFile_ofType_originalFile_saveOperation_(NSString fullDocumentPath, NSString documentTypeName, NSString fullOriginalDocumentPath, int saveOperationType) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToFile_1ofType_1originalFile_1saveOperation_1, fullDocumentPath != null ? fullDocumentPath.id : 0, documentTypeName != null ? documentTypeName.id : 0, fullOriginalDocumentPath != null ? fullOriginalDocumentPath.id : 0, saveOperationType) != 0;
+}
+
+public boolean writeToURL_ofType_(NSURL url, NSString type) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToURL_1ofType_1, url != null ? url.id : 0, type != null ? type.id : 0) != 0;
+}
+
+public boolean writeToURL_ofType_error_(NSURL absoluteURL, NSString typeName, int outError) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToURL_1ofType_1error_1, absoluteURL != null ? absoluteURL.id : 0, typeName != null ? typeName.id : 0, outError) != 0;
+}
+
+public boolean writeToURL_ofType_forSaveOperation_originalContentsURL_error_(NSURL absoluteURL, NSString typeName, int saveOperation, NSURL absoluteOriginalContentsURL, int outError) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToURL_1ofType_1forSaveOperation_1originalContentsURL_1error_1, absoluteURL != null ? absoluteURL.id : 0, typeName != null ? typeName.id : 0, saveOperation, absoluteOriginalContentsURL != null ? absoluteOriginalContentsURL.id : 0, outError) != 0;
+}
+
+public boolean writeWithBackupToFile(NSString fullDocumentPath, NSString documentTypeName, int saveOperationType) {
+ return OS.objc_msgSend(this.id, OS.sel_writeWithBackupToFile_1ofType_1saveOperation_1, fullDocumentPath != null ? fullDocumentPath.id : 0, documentTypeName != null ? documentTypeName.id : 0, saveOperationType) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDocumentController.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDocumentController.java
new file mode 100644
index 0000000000..aeb3f82751
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDocumentController.java
@@ -0,0 +1,241 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDocumentController extends NSObject {
+
+public NSDocumentController() {
+ super();
+}
+
+public NSDocumentController(int id) {
+ super(id);
+}
+
+public NSArray URLsFromRunningOpenPanel() {
+ int result = OS.objc_msgSend(this.id, OS.sel_URLsFromRunningOpenPanel);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void addDocument(NSDocument document) {
+ OS.objc_msgSend(this.id, OS.sel_addDocument_1, document != null ? document.id : 0);
+}
+
+public double autosavingDelay() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_autosavingDelay);
+}
+
+public void clearRecentDocuments(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_clearRecentDocuments_1, sender != null ? sender.id : 0);
+}
+
+public void closeAllDocumentsWithDelegate(id delegate, int didCloseAllSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_closeAllDocumentsWithDelegate_1didCloseAllSelector_1contextInfo_1, delegate != null ? delegate.id : 0, didCloseAllSelector, contextInfo);
+}
+
+public NSString currentDirectory() {
+ int result = OS.objc_msgSend(this.id, OS.sel_currentDirectory);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id currentDocument() {
+ int result = OS.objc_msgSend(this.id, OS.sel_currentDocument);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString defaultType() {
+ int result = OS.objc_msgSend(this.id, OS.sel_defaultType);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString displayNameForType(NSString typeName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_displayNameForType_1, typeName != null ? typeName.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int documentClassForType(NSString typeName) {
+ return OS.objc_msgSend(this.id, OS.sel_documentClassForType_1, typeName != null ? typeName.id : 0);
+}
+
+public NSArray documentClassNames() {
+ int result = OS.objc_msgSend(this.id, OS.sel_documentClassNames);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public id documentForFileName(NSString fileName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_documentForFileName_1, fileName != null ? fileName.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id documentForURL(NSURL absoluteURL) {
+ int result = OS.objc_msgSend(this.id, OS.sel_documentForURL_1, absoluteURL != null ? absoluteURL.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id documentForWindow(NSWindow window) {
+ int result = OS.objc_msgSend(this.id, OS.sel_documentForWindow_1, window != null ? window.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSArray documents() {
+ int result = OS.objc_msgSend(this.id, OS.sel_documents);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray fileExtensionsFromType(NSString typeName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileExtensionsFromType_1, typeName != null ? typeName.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray fileNamesFromRunningOpenPanel() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileNamesFromRunningOpenPanel);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean hasEditedDocuments() {
+ return OS.objc_msgSend(this.id, OS.sel_hasEditedDocuments) != 0;
+}
+
+public id makeDocumentForURL(NSURL absoluteDocumentURL, NSURL absoluteDocumentContentsURL, NSString typeName, int outError) {
+ int result = OS.objc_msgSend(this.id, OS.sel_makeDocumentForURL_1withContentsOfURL_1ofType_1error_1, absoluteDocumentURL != null ? absoluteDocumentURL.id : 0, absoluteDocumentContentsURL != null ? absoluteDocumentContentsURL.id : 0, typeName != null ? typeName.id : 0, outError);
+ return result != 0 ? new id(result) : null;
+}
+
+public id makeDocumentWithContentsOfFile(NSString fileName, NSString type) {
+ int result = OS.objc_msgSend(this.id, OS.sel_makeDocumentWithContentsOfFile_1ofType_1, fileName != null ? fileName.id : 0, type != null ? type.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id makeDocumentWithContentsOfURL_ofType_(NSURL url, NSString type) {
+ int result = OS.objc_msgSend(this.id, OS.sel_makeDocumentWithContentsOfURL_1ofType_1, url != null ? url.id : 0, type != null ? type.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id makeDocumentWithContentsOfURL_ofType_error_(NSURL absoluteURL, NSString typeName, int outError) {
+ int result = OS.objc_msgSend(this.id, OS.sel_makeDocumentWithContentsOfURL_1ofType_1error_1, absoluteURL != null ? absoluteURL.id : 0, typeName != null ? typeName.id : 0, outError);
+ return result != 0 ? new id(result) : null;
+}
+
+public id makeUntitledDocumentOfType_(NSString type) {
+ int result = OS.objc_msgSend(this.id, OS.sel_makeUntitledDocumentOfType_1, type != null ? type.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id makeUntitledDocumentOfType_error_(NSString typeName, int outError) {
+ int result = OS.objc_msgSend(this.id, OS.sel_makeUntitledDocumentOfType_1error_1, typeName != null ? typeName.id : 0, outError);
+ return result != 0 ? new id(result) : null;
+}
+
+public int maximumRecentDocumentCount() {
+ return OS.objc_msgSend(this.id, OS.sel_maximumRecentDocumentCount);
+}
+
+public void newDocument(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_newDocument_1, sender != null ? sender.id : 0);
+}
+
+public void noteNewRecentDocument(NSDocument document) {
+ OS.objc_msgSend(this.id, OS.sel_noteNewRecentDocument_1, document != null ? document.id : 0);
+}
+
+public void noteNewRecentDocumentURL(NSURL absoluteURL) {
+ OS.objc_msgSend(this.id, OS.sel_noteNewRecentDocumentURL_1, absoluteURL != null ? absoluteURL.id : 0);
+}
+
+public void openDocument(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_openDocument_1, sender != null ? sender.id : 0);
+}
+
+public id openDocumentWithContentsOfFile(NSString fileName, boolean display) {
+ int result = OS.objc_msgSend(this.id, OS.sel_openDocumentWithContentsOfFile_1display_1, fileName != null ? fileName.id : 0, display);
+ return result != 0 ? new id(result) : null;
+}
+
+public id openDocumentWithContentsOfURL_display_(NSURL url, boolean display) {
+ int result = OS.objc_msgSend(this.id, OS.sel_openDocumentWithContentsOfURL_1display_1, url != null ? url.id : 0, display);
+ return result != 0 ? new id(result) : null;
+}
+
+public id openDocumentWithContentsOfURL_display_error_(NSURL absoluteURL, boolean displayDocument, int outError) {
+ int result = OS.objc_msgSend(this.id, OS.sel_openDocumentWithContentsOfURL_1display_1error_1, absoluteURL != null ? absoluteURL.id : 0, displayDocument, outError);
+ return result != 0 ? new id(result) : null;
+}
+
+public id openUntitledDocumentAndDisplay(boolean displayDocument, int outError) {
+ int result = OS.objc_msgSend(this.id, OS.sel_openUntitledDocumentAndDisplay_1error_1, displayDocument, outError);
+ return result != 0 ? new id(result) : null;
+}
+
+public id openUntitledDocumentOfType(NSString type, boolean display) {
+ int result = OS.objc_msgSend(this.id, OS.sel_openUntitledDocumentOfType_1display_1, type != null ? type.id : 0, display);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean presentError_(NSError error) {
+ return OS.objc_msgSend(this.id, OS.sel_presentError_1, error != null ? error.id : 0) != 0;
+}
+
+public void presentError_modalForWindow_delegate_didPresentSelector_contextInfo_(NSError error, NSWindow window, id delegate, int didPresentSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_presentError_1modalForWindow_1delegate_1didPresentSelector_1contextInfo_1, error != null ? error.id : 0, window != null ? window.id : 0, delegate != null ? delegate.id : 0, didPresentSelector, contextInfo);
+}
+
+public NSArray recentDocumentURLs() {
+ int result = OS.objc_msgSend(this.id, OS.sel_recentDocumentURLs);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void removeDocument(NSDocument document) {
+ OS.objc_msgSend(this.id, OS.sel_removeDocument_1, document != null ? document.id : 0);
+}
+
+public boolean reopenDocumentForURL(NSURL absoluteDocumentURL, NSURL absoluteDocumentContentsURL, int outError) {
+ return OS.objc_msgSend(this.id, OS.sel_reopenDocumentForURL_1withContentsOfURL_1error_1, absoluteDocumentURL != null ? absoluteDocumentURL.id : 0, absoluteDocumentContentsURL != null ? absoluteDocumentContentsURL.id : 0, outError) != 0;
+}
+
+public void reviewUnsavedDocumentsWithAlertTitle(NSString title, boolean cancellable, id delegate, int didReviewAllSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_reviewUnsavedDocumentsWithAlertTitle_1cancellable_1delegate_1didReviewAllSelector_1contextInfo_1, title != null ? title.id : 0, cancellable, delegate != null ? delegate.id : 0, didReviewAllSelector, contextInfo);
+}
+
+public int runModalOpenPanel(NSOpenPanel openPanel, NSArray types) {
+ return OS.objc_msgSend(this.id, OS.sel_runModalOpenPanel_1forTypes_1, openPanel != null ? openPanel.id : 0, types != null ? types.id : 0);
+}
+
+public void saveAllDocuments(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_saveAllDocuments_1, sender != null ? sender.id : 0);
+}
+
+public void setAutosavingDelay(double autosavingDelay) {
+ OS.objc_msgSend(this.id, OS.sel_setAutosavingDelay_1, autosavingDelay);
+}
+
+public void setShouldCreateUI(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setShouldCreateUI_1, flag);
+}
+
+public static id sharedDocumentController() {
+ int result = OS.objc_msgSend(OS.class_NSDocumentController, OS.sel_sharedDocumentController);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean shouldCreateUI() {
+ return OS.objc_msgSend(this.id, OS.sel_shouldCreateUI) != 0;
+}
+
+public NSString typeForContentsOfURL(NSURL inAbsoluteURL, int outError) {
+ int result = OS.objc_msgSend(this.id, OS.sel_typeForContentsOfURL_1error_1, inAbsoluteURL != null ? inAbsoluteURL.id : 0, outError);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString typeFromFileExtension(NSString fileNameExtensionOrHFSFileType) {
+ int result = OS.objc_msgSend(this.id, OS.sel_typeFromFileExtension_1, fileNameExtensionOrHFSFileType != null ? fileNameExtensionOrHFSFileType.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean validateUserInterfaceItem(id anItem) {
+ return OS.objc_msgSend(this.id, OS.sel_validateUserInterfaceItem_1, anItem != null ? anItem.id : 0) != 0;
+}
+
+public NSError willPresentError(NSError error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_willPresentError_1, error != null ? error.id : 0);
+ return result != 0 ? new NSError(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDrawer.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDrawer.java
new file mode 100644
index 0000000000..9ee42597dc
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDrawer.java
@@ -0,0 +1,131 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSDrawer extends NSResponder {
+
+public NSDrawer() {
+ super();
+}
+
+public NSDrawer(int id) {
+ super(id);
+}
+
+public void close() {
+ OS.objc_msgSend(this.id, OS.sel_close);
+}
+
+public void close_(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_close_1, sender != null ? sender.id : 0);
+}
+
+public NSSize contentSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_contentSize);
+ return result;
+}
+
+public NSView contentView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_contentView);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public int edge() {
+ return OS.objc_msgSend(this.id, OS.sel_edge);
+}
+
+public NSDrawer initWithContentSize(NSSize contentSize, int edge) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentSize_1preferredEdge_1, contentSize, edge);
+ return result != 0 ? this : null;
+}
+
+public float leadingOffset() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_leadingOffset);
+}
+
+public NSSize maxContentSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_maxContentSize);
+ return result;
+}
+
+public NSSize minContentSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_minContentSize);
+ return result;
+}
+
+public void open() {
+ OS.objc_msgSend(this.id, OS.sel_open);
+}
+
+public void open_(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_open_1, sender != null ? sender.id : 0);
+}
+
+public void openOnEdge(int edge) {
+ OS.objc_msgSend(this.id, OS.sel_openOnEdge_1, edge);
+}
+
+public NSWindow parentWindow() {
+ int result = OS.objc_msgSend(this.id, OS.sel_parentWindow);
+ return result != 0 ? new NSWindow(result) : null;
+}
+
+public int preferredEdge() {
+ return OS.objc_msgSend(this.id, OS.sel_preferredEdge);
+}
+
+public void setContentSize(NSSize size) {
+ OS.objc_msgSend(this.id, OS.sel_setContentSize_1, size);
+}
+
+public void setContentView(NSView aView) {
+ OS.objc_msgSend(this.id, OS.sel_setContentView_1, aView != null ? aView.id : 0);
+}
+
+public void setDelegate(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
+}
+
+public void setLeadingOffset(float offset) {
+ OS.objc_msgSend(this.id, OS.sel_setLeadingOffset_1, offset);
+}
+
+public void setMaxContentSize(NSSize size) {
+ OS.objc_msgSend(this.id, OS.sel_setMaxContentSize_1, size);
+}
+
+public void setMinContentSize(NSSize size) {
+ OS.objc_msgSend(this.id, OS.sel_setMinContentSize_1, size);
+}
+
+public void setParentWindow(NSWindow parent) {
+ OS.objc_msgSend(this.id, OS.sel_setParentWindow_1, parent != null ? parent.id : 0);
+}
+
+public void setPreferredEdge(int edge) {
+ OS.objc_msgSend(this.id, OS.sel_setPreferredEdge_1, edge);
+}
+
+public void setTrailingOffset(float offset) {
+ OS.objc_msgSend(this.id, OS.sel_setTrailingOffset_1, offset);
+}
+
+public int state() {
+ return OS.objc_msgSend(this.id, OS.sel_state);
+}
+
+public void toggle(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_toggle_1, sender != null ? sender.id : 0);
+}
+
+public float trailingOffset() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_trailingOffset);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSEPSImageRep.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSEPSImageRep.java
new file mode 100644
index 0000000000..c64f35c7a8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSEPSImageRep.java
@@ -0,0 +1,38 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSEPSImageRep extends NSImageRep {
+
+public NSEPSImageRep() {
+ super();
+}
+
+public NSEPSImageRep(int id) {
+ super(id);
+}
+
+public NSData EPSRepresentation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_EPSRepresentation);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSRect boundingBox() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_boundingBox);
+ return result;
+}
+
+public static id imageRepWithData(NSData epsData) {
+ int result = OS.objc_msgSend(OS.class_NSEPSImageRep, OS.sel_imageRepWithData_1, epsData != null ? epsData.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithData(NSData epsData) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithData_1, epsData != null ? epsData.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void prepareGState() {
+ OS.objc_msgSend(this.id, OS.sel_prepareGState);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSEnumerator.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSEnumerator.java
new file mode 100644
index 0000000000..48304c60d9
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSEnumerator.java
@@ -0,0 +1,23 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSEnumerator extends NSObject {
+
+public NSEnumerator() {
+ super();
+}
+
+public NSEnumerator(int id) {
+ super(id);
+}
+
+public NSArray allObjects() {
+ int result = OS.objc_msgSend(this.id, OS.sel_allObjects);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public id nextObject() {
+ int result = OS.objc_msgSend(this.id, OS.sel_nextObject);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSError.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSError.java
new file mode 100644
index 0000000000..2e1422ac70
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSError.java
@@ -0,0 +1,62 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSError extends NSObject {
+
+public NSError() {
+ super();
+}
+
+public NSError(int id) {
+ super(id);
+}
+
+public int code() {
+ return OS.objc_msgSend(this.id, OS.sel_code);
+}
+
+public NSString domain() {
+ int result = OS.objc_msgSend(this.id, OS.sel_domain);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static id errorWithDomain(NSString domain, int code, NSDictionary dict) {
+ int result = OS.objc_msgSend(OS.class_NSError, OS.sel_errorWithDomain_1code_1userInfo_1, domain != null ? domain.id : 0, code, dict != null ? dict.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithDomain(NSString domain, int code, NSDictionary dict) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithDomain_1code_1userInfo_1, domain != null ? domain.id : 0, code, dict != null ? dict.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString localizedDescription() {
+ int result = OS.objc_msgSend(this.id, OS.sel_localizedDescription);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString localizedFailureReason() {
+ int result = OS.objc_msgSend(this.id, OS.sel_localizedFailureReason);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSArray localizedRecoveryOptions() {
+ int result = OS.objc_msgSend(this.id, OS.sel_localizedRecoveryOptions);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString localizedRecoverySuggestion() {
+ int result = OS.objc_msgSend(this.id, OS.sel_localizedRecoverySuggestion);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id recoveryAttempter() {
+ int result = OS.objc_msgSend(this.id, OS.sel_recoveryAttempter);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSDictionary userInfo() {
+ int result = OS.objc_msgSend(this.id, OS.sel_userInfo);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSEvent.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSEvent.java
new file mode 100644
index 0000000000..5aca13a02d
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSEvent.java
@@ -0,0 +1,255 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSEvent extends NSObject {
+
+public NSEvent() {
+ super();
+}
+
+public NSEvent(int id) {
+ super(id);
+}
+
+public int CGEvent() {
+ return OS.objc_msgSend(this.id, OS.sel_CGEvent);
+}
+
+public int absoluteX() {
+ return OS.objc_msgSend(this.id, OS.sel_absoluteX);
+}
+
+public int absoluteY() {
+ return OS.objc_msgSend(this.id, OS.sel_absoluteY);
+}
+
+public int absoluteZ() {
+ return OS.objc_msgSend(this.id, OS.sel_absoluteZ);
+}
+
+public int buttonMask() {
+ return OS.objc_msgSend(this.id, OS.sel_buttonMask);
+}
+
+public int buttonNumber() {
+ return OS.objc_msgSend(this.id, OS.sel_buttonNumber);
+}
+
+public int capabilityMask() {
+ return OS.objc_msgSend(this.id, OS.sel_capabilityMask);
+}
+
+public NSString characters() {
+ int result = OS.objc_msgSend(this.id, OS.sel_characters);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString charactersIgnoringModifiers() {
+ int result = OS.objc_msgSend(this.id, OS.sel_charactersIgnoringModifiers);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int clickCount() {
+ return OS.objc_msgSend(this.id, OS.sel_clickCount);
+}
+
+public NSGraphicsContext context() {
+ int result = OS.objc_msgSend(this.id, OS.sel_context);
+ return result != 0 ? new NSGraphicsContext(result) : null;
+}
+
+public int data1() {
+ return OS.objc_msgSend(this.id, OS.sel_data1);
+}
+
+public int data2() {
+ return OS.objc_msgSend(this.id, OS.sel_data2);
+}
+
+public float deltaX() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_deltaX);
+}
+
+public float deltaY() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_deltaY);
+}
+
+public float deltaZ() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_deltaZ);
+}
+
+public int deviceID() {
+ return OS.objc_msgSend(this.id, OS.sel_deviceID);
+}
+
+public static NSEvent enterExitEventWithType(int type, NSPoint location, int flags, double time, int wNum, NSGraphicsContext context, int eNum, int tNum, int data) {
+ int result = OS.objc_msgSend(OS.class_NSEvent, OS.sel_enterExitEventWithType_1location_1modifierFlags_1timestamp_1windowNumber_1context_1eventNumber_1trackingNumber_1userData_1, type, location, flags, time, wNum, context != null ? context.id : 0, eNum, tNum, data);
+ return result != 0 ? new NSEvent(result) : null;
+}
+
+public int eventNumber() {
+ return OS.objc_msgSend(this.id, OS.sel_eventNumber);
+}
+
+public int eventRef() {
+ return OS.objc_msgSend(this.id, OS.sel_eventRef);
+}
+
+public static NSEvent eventWithCGEvent(int cgEvent) {
+ int result = OS.objc_msgSend(OS.class_NSEvent, OS.sel_eventWithCGEvent_1, cgEvent);
+ return result != 0 ? new NSEvent(result) : null;
+}
+
+public static NSEvent eventWithEventRef(int eventRef) {
+ int result = OS.objc_msgSend(OS.class_NSEvent, OS.sel_eventWithEventRef_1, eventRef);
+ return result != 0 ? new NSEvent(result) : null;
+}
+
+public boolean isARepeat() {
+ return OS.objc_msgSend(this.id, OS.sel_isARepeat) != 0;
+}
+
+public boolean isEnteringProximity() {
+ return OS.objc_msgSend(this.id, OS.sel_isEnteringProximity) != 0;
+}
+
+public static boolean isMouseCoalescingEnabled() {
+ return OS.objc_msgSend(OS.class_NSEvent, OS.sel_isMouseCoalescingEnabled) != 0;
+}
+
+public short keyCode() {
+ return (short)OS.objc_msgSend(this.id, OS.sel_keyCode);
+}
+
+public static NSEvent keyEventWithType(int type, NSPoint location, int flags, double time, int wNum, NSGraphicsContext context, NSString keys, NSString ukeys, boolean flag, short code) {
+ int result = OS.objc_msgSend(OS.class_NSEvent, OS.sel_keyEventWithType_1location_1modifierFlags_1timestamp_1windowNumber_1context_1characters_1charactersIgnoringModifiers_1isARepeat_1keyCode_1, type, location, flags, time, wNum, context != null ? context.id : 0, keys != null ? keys.id : 0, ukeys != null ? ukeys.id : 0, flag, code);
+ return result != 0 ? new NSEvent(result) : null;
+}
+
+public NSPoint locationInWindow() {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_struct(result, this.id, OS.sel_locationInWindow);
+ return result;
+}
+
+public int modifierFlags() {
+ return OS.objc_msgSend(this.id, OS.sel_modifierFlags);
+}
+
+public static NSEvent mouseEventWithType(int type, NSPoint location, int flags, double time, int wNum, NSGraphicsContext context, int eNum, int cNum, float pressure) {
+ int result = OS.objc_msgSend(OS.class_NSEvent, OS.sel_mouseEventWithType_1location_1modifierFlags_1timestamp_1windowNumber_1context_1eventNumber_1clickCount_1pressure_1, type, location, flags, time, wNum, context != null ? context.id : 0, eNum, cNum, pressure);
+ return result != 0 ? new NSEvent(result) : null;
+}
+
+public static NSPoint mouseLocation() {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, OS.class_NSEvent, OS.sel_mouseLocation);
+ return result;
+}
+
+public static NSEvent otherEventWithType(int type, NSPoint location, int flags, double time, int wNum, NSGraphicsContext context, short subtype, int d1, int d2) {
+ int result = OS.objc_msgSend(OS.class_NSEvent, OS.sel_otherEventWithType_1location_1modifierFlags_1timestamp_1windowNumber_1context_1subtype_1data1_1data2_1, type, location, flags, time, wNum, context != null ? context.id : 0, subtype, d1, d2);
+ return result != 0 ? new NSEvent(result) : null;
+}
+
+public int pointingDeviceID() {
+ return OS.objc_msgSend(this.id, OS.sel_pointingDeviceID);
+}
+
+public int pointingDeviceSerialNumber() {
+ return OS.objc_msgSend(this.id, OS.sel_pointingDeviceSerialNumber);
+}
+
+public int pointingDeviceType() {
+ return OS.objc_msgSend(this.id, OS.sel_pointingDeviceType);
+}
+
+public float pressure() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_pressure);
+}
+
+public float rotation() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_rotation);
+}
+
+public static void setMouseCoalescingEnabled(boolean flag) {
+ OS.objc_msgSend(OS.class_NSEvent, OS.sel_setMouseCoalescingEnabled_1, flag);
+}
+
+public static void startPeriodicEventsAfterDelay(double delay, double period) {
+ OS.objc_msgSend(OS.class_NSEvent, OS.sel_startPeriodicEventsAfterDelay_1withPeriod_1, delay, period);
+}
+
+public static void stopPeriodicEvents() {
+ OS.objc_msgSend(OS.class_NSEvent, OS.sel_stopPeriodicEvents);
+}
+
+public short subtype() {
+ return (short)OS.objc_msgSend(this.id, OS.sel_subtype);
+}
+
+public int systemTabletID() {
+ return OS.objc_msgSend(this.id, OS.sel_systemTabletID);
+}
+
+public int tabletID() {
+ return OS.objc_msgSend(this.id, OS.sel_tabletID);
+}
+
+public float tangentialPressure() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_tangentialPressure);
+}
+
+public NSPoint tilt() {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_tilt);
+ return result;
+}
+
+public double timestamp() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_timestamp);
+}
+
+public NSTrackingArea trackingArea() {
+ int result = OS.objc_msgSend(this.id, OS.sel_trackingArea);
+ return result != 0 ? new NSTrackingArea(result) : null;
+}
+
+public int trackingNumber() {
+ return OS.objc_msgSend(this.id, OS.sel_trackingNumber);
+}
+
+public int type() {
+ return OS.objc_msgSend(this.id, OS.sel_type);
+}
+
+public long uniqueID() {
+ return (long)OS.objc_msgSend(this.id, OS.sel_uniqueID);
+}
+
+public int userData() {
+ return OS.objc_msgSend(this.id, OS.sel_userData);
+}
+
+public id vendorDefined() {
+ int result = OS.objc_msgSend(this.id, OS.sel_vendorDefined);
+ return result != 0 ? new id(result) : null;
+}
+
+public int vendorID() {
+ return OS.objc_msgSend(this.id, OS.sel_vendorID);
+}
+
+public int vendorPointingDeviceType() {
+ return OS.objc_msgSend(this.id, OS.sel_vendorPointingDeviceType);
+}
+
+public NSWindow window() {
+ int result = OS.objc_msgSend(this.id, OS.sel_window);
+ return result != 0 ? new NSWindow(result) : null;
+}
+
+public int windowNumber() {
+ return OS.objc_msgSend(this.id, OS.sel_windowNumber);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSException.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSException.java
new file mode 100644
index 0000000000..87a451abc1
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSException.java
@@ -0,0 +1,55 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSException extends NSObject {
+
+public NSException() {
+ super();
+}
+
+public NSException(int id) {
+ super(id);
+}
+
+public NSArray callStackReturnAddresses() {
+ int result = OS.objc_msgSend(this.id, OS.sel_callStackReturnAddresses);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSException exceptionWithName(NSString name, NSString reason, NSDictionary userInfo) {
+ int result = OS.objc_msgSend(OS.class_NSException, OS.sel_exceptionWithName_1reason_1userInfo_1, name != null ? name.id : 0, reason != null ? reason.id : 0, userInfo != null ? userInfo.id : 0);
+ return result != 0 ? new NSException(result) : null;
+}
+
+public id initWithName(NSString aName, NSString aReason, NSDictionary aUserInfo) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithName_1reason_1userInfo_1, aName != null ? aName.id : 0, aReason != null ? aReason.id : 0, aUserInfo != null ? aUserInfo.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString name() {
+ int result = OS.objc_msgSend(this.id, OS.sel_name);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void raise() {
+ OS.objc_msgSend(this.id, OS.sel_raise);
+}
+
+public static void static_raise_format_(NSString name, NSString format) {
+ OS.objc_msgSend(OS.class_NSException, OS.sel_raise_1format_1, name != null ? name.id : 0, format != null ? format.id : 0);
+}
+
+public static void static_raise_format_arguments_(NSString name, NSString format, int argList) {
+ OS.objc_msgSend(OS.class_NSException, OS.sel_raise_1format_1arguments_1, name != null ? name.id : 0, format != null ? format.id : 0, argList);
+}
+
+public NSString reason() {
+ int result = OS.objc_msgSend(this.id, OS.sel_reason);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSDictionary userInfo() {
+ int result = OS.objc_msgSend(this.id, OS.sel_userInfo);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSExpression.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSExpression.java
new file mode 100644
index 0000000000..55b97ee228
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSExpression.java
@@ -0,0 +1,132 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSExpression extends NSObject {
+
+public NSExpression() {
+ super();
+}
+
+public NSExpression(int id) {
+ super(id);
+}
+
+public NSArray arguments() {
+ int result = OS.objc_msgSend(this.id, OS.sel_arguments);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public id collection() {
+ int result = OS.objc_msgSend(this.id, OS.sel_collection);
+ return result != 0 ? new id(result) : null;
+}
+
+public id constantValue() {
+ int result = OS.objc_msgSend(this.id, OS.sel_constantValue);
+ return result != 0 ? new id(result) : null;
+}
+
+public static NSExpression expressionForAggregate(NSArray subexpressions) {
+ int result = OS.objc_msgSend(OS.class_NSExpression, OS.sel_expressionForAggregate_1, subexpressions != null ? subexpressions.id : 0);
+ return result != 0 ? new NSExpression(result) : null;
+}
+
+public static NSExpression expressionForConstantValue(id obj) {
+ int result = OS.objc_msgSend(OS.class_NSExpression, OS.sel_expressionForConstantValue_1, obj != null ? obj.id : 0);
+ return result != 0 ? new NSExpression(result) : null;
+}
+
+public static NSExpression expressionForEvaluatedObject() {
+ int result = OS.objc_msgSend(OS.class_NSExpression, OS.sel_expressionForEvaluatedObject);
+ return result != 0 ? new NSExpression(result) : null;
+}
+
+public static NSExpression static_expressionForFunction_arguments_(NSString name, NSArray parameters) {
+ int result = OS.objc_msgSend(OS.class_NSExpression, OS.sel_expressionForFunction_1arguments_1, name != null ? name.id : 0, parameters != null ? parameters.id : 0);
+ return result != 0 ? new NSExpression(result) : null;
+}
+
+public static NSExpression static_expressionForFunction_selectorName_arguments_(NSExpression target, NSString name, NSArray parameters) {
+ int result = OS.objc_msgSend(OS.class_NSExpression, OS.sel_expressionForFunction_1selectorName_1arguments_1, target != null ? target.id : 0, name != null ? name.id : 0, parameters != null ? parameters.id : 0);
+ return result != 0 ? new NSExpression(result) : null;
+}
+
+public static NSExpression expressionForIntersectSet(NSExpression left, NSExpression right) {
+ int result = OS.objc_msgSend(OS.class_NSExpression, OS.sel_expressionForIntersectSet_1with_1, left != null ? left.id : 0, right != null ? right.id : 0);
+ return result != 0 ? new NSExpression(result) : null;
+}
+
+public static NSExpression expressionForKeyPath(NSString keyPath) {
+ int result = OS.objc_msgSend(OS.class_NSExpression, OS.sel_expressionForKeyPath_1, keyPath != null ? keyPath.id : 0);
+ return result != 0 ? new NSExpression(result) : null;
+}
+
+public static NSExpression expressionForMinusSet(NSExpression left, NSExpression right) {
+ int result = OS.objc_msgSend(OS.class_NSExpression, OS.sel_expressionForMinusSet_1with_1, left != null ? left.id : 0, right != null ? right.id : 0);
+ return result != 0 ? new NSExpression(result) : null;
+}
+
+public static NSExpression expressionForSubquery(NSExpression expression, NSString variable, id predicate) {
+ int result = OS.objc_msgSend(OS.class_NSExpression, OS.sel_expressionForSubquery_1usingIteratorVariable_1predicate_1, expression != null ? expression.id : 0, variable != null ? variable.id : 0, predicate != null ? predicate.id : 0);
+ return result != 0 ? new NSExpression(result) : null;
+}
+
+public static NSExpression expressionForUnionSet(NSExpression left, NSExpression right) {
+ int result = OS.objc_msgSend(OS.class_NSExpression, OS.sel_expressionForUnionSet_1with_1, left != null ? left.id : 0, right != null ? right.id : 0);
+ return result != 0 ? new NSExpression(result) : null;
+}
+
+public static NSExpression expressionForVariable(NSString string) {
+ int result = OS.objc_msgSend(OS.class_NSExpression, OS.sel_expressionForVariable_1, string != null ? string.id : 0);
+ return result != 0 ? new NSExpression(result) : null;
+}
+
+public int expressionType() {
+ return OS.objc_msgSend(this.id, OS.sel_expressionType);
+}
+
+public id expressionValueWithObject(id object, NSMutableDictionary context) {
+ int result = OS.objc_msgSend(this.id, OS.sel_expressionValueWithObject_1context_1, object != null ? object.id : 0, context != null ? context.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString function() {
+ int result = OS.objc_msgSend(this.id, OS.sel_function);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id initWithExpressionType(int type) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithExpressionType_1, type);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString keyPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_keyPath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSExpression leftExpression() {
+ int result = OS.objc_msgSend(this.id, OS.sel_leftExpression);
+ return result == this.id ? this : (result != 0 ? new NSExpression(result) : null);
+}
+
+public NSExpression operand() {
+ int result = OS.objc_msgSend(this.id, OS.sel_operand);
+ return result == this.id ? this : (result != 0 ? new NSExpression(result) : null);
+}
+
+public NSPredicate predicate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_predicate);
+ return result != 0 ? new NSPredicate(result) : null;
+}
+
+public NSExpression rightExpression() {
+ int result = OS.objc_msgSend(this.id, OS.sel_rightExpression);
+ return result == this.id ? this : (result != 0 ? new NSExpression(result) : null);
+}
+
+public NSString variable() {
+ int result = OS.objc_msgSend(this.id, OS.sel_variable);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFileHandle.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFileHandle.java
new file mode 100644
index 0000000000..91a2dc35ad
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFileHandle.java
@@ -0,0 +1,137 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSFileHandle extends NSObject {
+
+public NSFileHandle() {
+ super();
+}
+
+public NSFileHandle(int id) {
+ super(id);
+}
+
+public void acceptConnectionInBackgroundAndNotify() {
+ OS.objc_msgSend(this.id, OS.sel_acceptConnectionInBackgroundAndNotify);
+}
+
+public void acceptConnectionInBackgroundAndNotifyForModes(NSArray modes) {
+ OS.objc_msgSend(this.id, OS.sel_acceptConnectionInBackgroundAndNotifyForModes_1, modes != null ? modes.id : 0);
+}
+
+public NSData availableData() {
+ int result = OS.objc_msgSend(this.id, OS.sel_availableData);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public void closeFile() {
+ OS.objc_msgSend(this.id, OS.sel_closeFile);
+}
+
+public int fileDescriptor() {
+ return OS.objc_msgSend(this.id, OS.sel_fileDescriptor);
+}
+
+public static id fileHandleForReadingAtPath(NSString path) {
+ int result = OS.objc_msgSend(OS.class_NSFileHandle, OS.sel_fileHandleForReadingAtPath_1, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id fileHandleForUpdatingAtPath(NSString path) {
+ int result = OS.objc_msgSend(OS.class_NSFileHandle, OS.sel_fileHandleForUpdatingAtPath_1, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id fileHandleForWritingAtPath(NSString path) {
+ int result = OS.objc_msgSend(OS.class_NSFileHandle, OS.sel_fileHandleForWritingAtPath_1, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id fileHandleWithNullDevice() {
+ int result = OS.objc_msgSend(OS.class_NSFileHandle, OS.sel_fileHandleWithNullDevice);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id fileHandleWithStandardError() {
+ int result = OS.objc_msgSend(OS.class_NSFileHandle, OS.sel_fileHandleWithStandardError);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id fileHandleWithStandardInput() {
+ int result = OS.objc_msgSend(OS.class_NSFileHandle, OS.sel_fileHandleWithStandardInput);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id fileHandleWithStandardOutput() {
+ int result = OS.objc_msgSend(OS.class_NSFileHandle, OS.sel_fileHandleWithStandardOutput);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithFileDescriptor_(int fd) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFileDescriptor_1, fd);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithFileDescriptor_closeOnDealloc_(int fd, boolean closeopt) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFileDescriptor_1closeOnDealloc_1, fd, closeopt);
+ return result != 0 ? new id(result) : null;
+}
+
+public long offsetInFile() {
+ return (long)OS.objc_msgSend(this.id, OS.sel_offsetInFile);
+}
+
+public NSData readDataOfLength(int length) {
+ int result = OS.objc_msgSend(this.id, OS.sel_readDataOfLength_1, length);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSData readDataToEndOfFile() {
+ int result = OS.objc_msgSend(this.id, OS.sel_readDataToEndOfFile);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public void readInBackgroundAndNotify() {
+ OS.objc_msgSend(this.id, OS.sel_readInBackgroundAndNotify);
+}
+
+public void readInBackgroundAndNotifyForModes(NSArray modes) {
+ OS.objc_msgSend(this.id, OS.sel_readInBackgroundAndNotifyForModes_1, modes != null ? modes.id : 0);
+}
+
+public void readToEndOfFileInBackgroundAndNotify() {
+ OS.objc_msgSend(this.id, OS.sel_readToEndOfFileInBackgroundAndNotify);
+}
+
+public void readToEndOfFileInBackgroundAndNotifyForModes(NSArray modes) {
+ OS.objc_msgSend(this.id, OS.sel_readToEndOfFileInBackgroundAndNotifyForModes_1, modes != null ? modes.id : 0);
+}
+
+public long seekToEndOfFile() {
+ return (long)OS.objc_msgSend(this.id, OS.sel_seekToEndOfFile);
+}
+
+public void seekToFileOffset(long offset) {
+ OS.objc_msgSend(this.id, OS.sel_seekToFileOffset_1, offset);
+}
+
+public void synchronizeFile() {
+ OS.objc_msgSend(this.id, OS.sel_synchronizeFile);
+}
+
+public void truncateFileAtOffset(long offset) {
+ OS.objc_msgSend(this.id, OS.sel_truncateFileAtOffset_1, offset);
+}
+
+public void waitForDataInBackgroundAndNotify() {
+ OS.objc_msgSend(this.id, OS.sel_waitForDataInBackgroundAndNotify);
+}
+
+public void waitForDataInBackgroundAndNotifyForModes(NSArray modes) {
+ OS.objc_msgSend(this.id, OS.sel_waitForDataInBackgroundAndNotifyForModes_1, modes != null ? modes.id : 0);
+}
+
+public void writeData(NSData data) {
+ OS.objc_msgSend(this.id, OS.sel_writeData_1, data != null ? data.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFileManager.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFileManager.java
new file mode 100644
index 0000000000..ace236938d
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFileManager.java
@@ -0,0 +1,203 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSFileManager extends NSObject {
+
+public NSFileManager() {
+ super();
+}
+
+public NSFileManager(int id) {
+ super(id);
+}
+
+public NSDictionary attributesOfFileSystemForPath(NSString path, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributesOfFileSystemForPath_1error_1, path != null ? path.id : 0, error);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSDictionary attributesOfItemAtPath(NSString path, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributesOfItemAtPath_1error_1, path != null ? path.id : 0, error);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public boolean changeCurrentDirectoryPath(NSString path) {
+ return OS.objc_msgSend(this.id, OS.sel_changeCurrentDirectoryPath_1, path != null ? path.id : 0) != 0;
+}
+
+public boolean changeFileAttributes(NSDictionary attributes, NSString path) {
+ return OS.objc_msgSend(this.id, OS.sel_changeFileAttributes_1atPath_1, attributes != null ? attributes.id : 0, path != null ? path.id : 0) != 0;
+}
+
+public NSArray componentsToDisplayForPath(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_componentsToDisplayForPath_1, path != null ? path.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSData contentsAtPath(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_contentsAtPath_1, path != null ? path.id : 0);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public boolean contentsEqualAtPath(NSString path1, NSString path2) {
+ return OS.objc_msgSend(this.id, OS.sel_contentsEqualAtPath_1andPath_1, path1 != null ? path1.id : 0, path2 != null ? path2.id : 0) != 0;
+}
+
+public NSArray contentsOfDirectoryAtPath(NSString path, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_contentsOfDirectoryAtPath_1error_1, path != null ? path.id : 0, error);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean copyItemAtPath(NSString srcPath, NSString dstPath, int error) {
+ return OS.objc_msgSend(this.id, OS.sel_copyItemAtPath_1toPath_1error_1, srcPath != null ? srcPath.id : 0, dstPath != null ? dstPath.id : 0, error) != 0;
+}
+
+public boolean copyPath(NSString src, NSString dest, id handler) {
+ return OS.objc_msgSend(this.id, OS.sel_copyPath_1toPath_1handler_1, src != null ? src.id : 0, dest != null ? dest.id : 0, handler != null ? handler.id : 0) != 0;
+}
+
+public boolean createDirectoryAtPath_attributes_(NSString path, NSDictionary attributes) {
+ return OS.objc_msgSend(this.id, OS.sel_createDirectoryAtPath_1attributes_1, path != null ? path.id : 0, attributes != null ? attributes.id : 0) != 0;
+}
+
+public boolean createDirectoryAtPath_withIntermediateDirectories_attributes_error_(NSString path, boolean createIntermediates, NSDictionary attributes, int error) {
+ return OS.objc_msgSend(this.id, OS.sel_createDirectoryAtPath_1withIntermediateDirectories_1attributes_1error_1, path != null ? path.id : 0, createIntermediates, attributes != null ? attributes.id : 0, error) != 0;
+}
+
+public boolean createFileAtPath(NSString path, NSData data, NSDictionary attr) {
+ return OS.objc_msgSend(this.id, OS.sel_createFileAtPath_1contents_1attributes_1, path != null ? path.id : 0, data != null ? data.id : 0, attr != null ? attr.id : 0) != 0;
+}
+
+public boolean createSymbolicLinkAtPath_pathContent_(NSString path, NSString otherpath) {
+ return OS.objc_msgSend(this.id, OS.sel_createSymbolicLinkAtPath_1pathContent_1, path != null ? path.id : 0, otherpath != null ? otherpath.id : 0) != 0;
+}
+
+public boolean createSymbolicLinkAtPath_withDestinationPath_error_(NSString path, NSString destPath, int error) {
+ return OS.objc_msgSend(this.id, OS.sel_createSymbolicLinkAtPath_1withDestinationPath_1error_1, path != null ? path.id : 0, destPath != null ? destPath.id : 0, error) != 0;
+}
+
+public NSString currentDirectoryPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_currentDirectoryPath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSFileManager defaultManager() {
+ int result = OS.objc_msgSend(OS.class_NSFileManager, OS.sel_defaultManager);
+ return result != 0 ? new NSFileManager(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString destinationOfSymbolicLinkAtPath(NSString path, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_destinationOfSymbolicLinkAtPath_1error_1, path != null ? path.id : 0, error);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSArray directoryContentsAtPath(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_directoryContentsAtPath_1, path != null ? path.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString displayNameAtPath(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_displayNameAtPath_1, path != null ? path.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSDirectoryEnumerator enumeratorAtPath(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_enumeratorAtPath_1, path != null ? path.id : 0);
+ return result != 0 ? new NSDirectoryEnumerator(result) : null;
+}
+
+public NSDictionary fileAttributesAtPath(NSString path, boolean yorn) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileAttributesAtPath_1traverseLink_1, path != null ? path.id : 0, yorn);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public boolean fileExistsAtPath_(NSString path) {
+ return OS.objc_msgSend(this.id, OS.sel_fileExistsAtPath_1, path != null ? path.id : 0) != 0;
+}
+
+public boolean fileExistsAtPath_isDirectory_(NSString path, int isDirectory) {
+ return OS.objc_msgSend(this.id, OS.sel_fileExistsAtPath_1isDirectory_1, path != null ? path.id : 0, isDirectory) != 0;
+}
+
+public NSDictionary fileSystemAttributesAtPath(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileSystemAttributesAtPath_1, path != null ? path.id : 0);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public int fileSystemRepresentationWithPath(NSString path) {
+ return OS.objc_msgSend(this.id, OS.sel_fileSystemRepresentationWithPath_1, path != null ? path.id : 0);
+}
+
+public boolean isDeletableFileAtPath(NSString path) {
+ return OS.objc_msgSend(this.id, OS.sel_isDeletableFileAtPath_1, path != null ? path.id : 0) != 0;
+}
+
+public boolean isExecutableFileAtPath(NSString path) {
+ return OS.objc_msgSend(this.id, OS.sel_isExecutableFileAtPath_1, path != null ? path.id : 0) != 0;
+}
+
+public boolean isReadableFileAtPath(NSString path) {
+ return OS.objc_msgSend(this.id, OS.sel_isReadableFileAtPath_1, path != null ? path.id : 0) != 0;
+}
+
+public boolean isWritableFileAtPath(NSString path) {
+ return OS.objc_msgSend(this.id, OS.sel_isWritableFileAtPath_1, path != null ? path.id : 0) != 0;
+}
+
+public boolean linkItemAtPath(NSString srcPath, NSString dstPath, int error) {
+ return OS.objc_msgSend(this.id, OS.sel_linkItemAtPath_1toPath_1error_1, srcPath != null ? srcPath.id : 0, dstPath != null ? dstPath.id : 0, error) != 0;
+}
+
+public boolean linkPath(NSString src, NSString dest, id handler) {
+ return OS.objc_msgSend(this.id, OS.sel_linkPath_1toPath_1handler_1, src != null ? src.id : 0, dest != null ? dest.id : 0, handler != null ? handler.id : 0) != 0;
+}
+
+public boolean moveItemAtPath(NSString srcPath, NSString dstPath, int error) {
+ return OS.objc_msgSend(this.id, OS.sel_moveItemAtPath_1toPath_1error_1, srcPath != null ? srcPath.id : 0, dstPath != null ? dstPath.id : 0, error) != 0;
+}
+
+public boolean movePath(NSString src, NSString dest, id handler) {
+ return OS.objc_msgSend(this.id, OS.sel_movePath_1toPath_1handler_1, src != null ? src.id : 0, dest != null ? dest.id : 0, handler != null ? handler.id : 0) != 0;
+}
+
+public NSString pathContentOfSymbolicLinkAtPath(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_pathContentOfSymbolicLinkAtPath_1, path != null ? path.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean removeFileAtPath(NSString path, id handler) {
+ return OS.objc_msgSend(this.id, OS.sel_removeFileAtPath_1handler_1, path != null ? path.id : 0, handler != null ? handler.id : 0) != 0;
+}
+
+public boolean removeItemAtPath(NSString path, int error) {
+ return OS.objc_msgSend(this.id, OS.sel_removeItemAtPath_1error_1, path != null ? path.id : 0, error) != 0;
+}
+
+public boolean setAttributes(NSDictionary attributes, NSString path, int error) {
+ return OS.objc_msgSend(this.id, OS.sel_setAttributes_1ofItemAtPath_1error_1, attributes != null ? attributes.id : 0, path != null ? path.id : 0, error) != 0;
+}
+
+public void setDelegate(id delegate) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegate != null ? delegate.id : 0);
+}
+
+public NSString stringWithFileSystemRepresentation(int str, int len) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringWithFileSystemRepresentation_1length_1, str, len);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSArray subpathsAtPath(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_subpathsAtPath_1, path != null ? path.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray subpathsOfDirectoryAtPath(NSString path, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_subpathsOfDirectoryAtPath_1error_1, path != null ? path.id : 0, error);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFileWrapper.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFileWrapper.java
new file mode 100644
index 0000000000..abae422f76
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFileWrapper.java
@@ -0,0 +1,147 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSFileWrapper extends NSObject {
+
+public NSFileWrapper() {
+ super();
+}
+
+public NSFileWrapper(int id) {
+ super(id);
+}
+
+public NSString addFileWithPath(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_addFileWithPath_1, path != null ? path.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString addFileWrapper(NSFileWrapper doc) {
+ int result = OS.objc_msgSend(this.id, OS.sel_addFileWrapper_1, doc != null ? doc.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString addRegularFileWithContents(NSData data, NSString filename) {
+ int result = OS.objc_msgSend(this.id, OS.sel_addRegularFileWithContents_1preferredFilename_1, data != null ? data.id : 0, filename != null ? filename.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString addSymbolicLinkWithDestination(NSString path, NSString filename) {
+ int result = OS.objc_msgSend(this.id, OS.sel_addSymbolicLinkWithDestination_1preferredFilename_1, path != null ? path.id : 0, filename != null ? filename.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSDictionary fileAttributes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileAttributes);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSDictionary fileWrappers() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileWrappers);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSString filename() {
+ int result = OS.objc_msgSend(this.id, OS.sel_filename);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSImage icon() {
+ int result = OS.objc_msgSend(this.id, OS.sel_icon);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public id initDirectoryWithFileWrappers(NSDictionary docs) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initDirectoryWithFileWrappers_1, docs != null ? docs.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initRegularFileWithContents(NSData data) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initRegularFileWithContents_1, data != null ? data.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initSymbolicLinkWithDestination(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initSymbolicLinkWithDestination_1, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithPath(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithPath_1, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithSerializedRepresentation(NSData data) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithSerializedRepresentation_1, data != null ? data.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isDirectory() {
+ return OS.objc_msgSend(this.id, OS.sel_isDirectory) != 0;
+}
+
+public boolean isRegularFile() {
+ return OS.objc_msgSend(this.id, OS.sel_isRegularFile) != 0;
+}
+
+public boolean isSymbolicLink() {
+ return OS.objc_msgSend(this.id, OS.sel_isSymbolicLink) != 0;
+}
+
+public NSString keyForFileWrapper(NSFileWrapper doc) {
+ int result = OS.objc_msgSend(this.id, OS.sel_keyForFileWrapper_1, doc != null ? doc.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean needsToBeUpdatedFromPath(NSString path) {
+ return OS.objc_msgSend(this.id, OS.sel_needsToBeUpdatedFromPath_1, path != null ? path.id : 0) != 0;
+}
+
+public NSString preferredFilename() {
+ int result = OS.objc_msgSend(this.id, OS.sel_preferredFilename);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSData regularFileContents() {
+ int result = OS.objc_msgSend(this.id, OS.sel_regularFileContents);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public void removeFileWrapper(NSFileWrapper doc) {
+ OS.objc_msgSend(this.id, OS.sel_removeFileWrapper_1, doc != null ? doc.id : 0);
+}
+
+public NSData serializedRepresentation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_serializedRepresentation);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public void setFileAttributes(NSDictionary attributes) {
+ OS.objc_msgSend(this.id, OS.sel_setFileAttributes_1, attributes != null ? attributes.id : 0);
+}
+
+public void setFilename(NSString filename) {
+ OS.objc_msgSend(this.id, OS.sel_setFilename_1, filename != null ? filename.id : 0);
+}
+
+public void setIcon(NSImage icon) {
+ OS.objc_msgSend(this.id, OS.sel_setIcon_1, icon != null ? icon.id : 0);
+}
+
+public void setPreferredFilename(NSString filename) {
+ OS.objc_msgSend(this.id, OS.sel_setPreferredFilename_1, filename != null ? filename.id : 0);
+}
+
+public NSString symbolicLinkDestination() {
+ int result = OS.objc_msgSend(this.id, OS.sel_symbolicLinkDestination);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean updateFromPath(NSString path) {
+ return OS.objc_msgSend(this.id, OS.sel_updateFromPath_1, path != null ? path.id : 0) != 0;
+}
+
+public boolean writeToFile(NSString path, boolean atomicFlag, boolean updateFilenamesFlag) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToFile_1atomically_1updateFilenames_1, path != null ? path.id : 0, atomicFlag, updateFilenamesFlag) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFont.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFont.java
new file mode 100644
index 0000000000..63a79087cf
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFont.java
@@ -0,0 +1,343 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSFont extends NSObject {
+
+public NSFont() {
+ super();
+}
+
+public NSFont(int id) {
+ super(id);
+}
+
+public NSSize advancementForGlyph(int ag) {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_advancementForGlyph_1, ag);
+ return result;
+}
+
+public NSDictionary afmDictionary() {
+ int result = OS.objc_msgSend(this.id, OS.sel_afmDictionary);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public float ascender() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_ascender);
+}
+
+public static NSFont boldSystemFontOfSize(float fontSize) {
+ int result = OS.objc_msgSend(OS.class_NSFont, OS.sel_boldSystemFontOfSize_1, fontSize);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public NSRect boundingRectForFont() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_boundingRectForFont);
+ return result;
+}
+
+public NSRect boundingRectForGlyph(int aGlyph) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_boundingRectForGlyph_1, aGlyph);
+ return result;
+}
+
+public float capHeight() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_capHeight);
+}
+
+public static NSFont controlContentFontOfSize(float fontSize) {
+ int result = OS.objc_msgSend(OS.class_NSFont, OS.sel_controlContentFontOfSize_1, fontSize);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public NSCharacterSet coveredCharacterSet() {
+ int result = OS.objc_msgSend(this.id, OS.sel_coveredCharacterSet);
+ return result != 0 ? new NSCharacterSet(result) : null;
+}
+
+public float defaultLineHeightForFont() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_defaultLineHeightForFont);
+}
+
+public float descender() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_descender);
+}
+
+public NSString displayName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_displayName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString encodingScheme() {
+ int result = OS.objc_msgSend(this.id, OS.sel_encodingScheme);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString familyName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_familyName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSFontDescriptor fontDescriptor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fontDescriptor);
+ return result != 0 ? new NSFontDescriptor(result) : null;
+}
+
+public NSString fontName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fontName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSFont static_fontWithDescriptor_size_(NSFontDescriptor fontDescriptor, float fontSize) {
+ int result = OS.objc_msgSend(OS.class_NSFont, OS.sel_fontWithDescriptor_1size_1, fontDescriptor != null ? fontDescriptor.id : 0, fontSize);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public static NSFont static_fontWithDescriptor_textTransform_(NSFontDescriptor fontDescriptor, NSAffineTransform textTransform) {
+ int result = OS.objc_msgSend(OS.class_NSFont, OS.sel_fontWithDescriptor_1textTransform_1, fontDescriptor != null ? fontDescriptor.id : 0, textTransform != null ? textTransform.id : 0);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public static NSFont static_fontWithName_matrix_(NSString fontName, int fontMatrix) {
+ int result = OS.objc_msgSend(OS.class_NSFont, OS.sel_fontWithName_1matrix_1, fontName != null ? fontName.id : 0, fontMatrix);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public static NSFont static_fontWithName_size_(NSString fontName, float fontSize) {
+ int result = OS.objc_msgSend(OS.class_NSFont, OS.sel_fontWithName_1size_1, fontName != null ? fontName.id : 0, fontSize);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public void getAdvancements_forGlyphs_count_(int advancements, int glyphs, int glyphCount) {
+ OS.objc_msgSend(this.id, OS.sel_getAdvancements_1forGlyphs_1count_1, advancements, glyphs, glyphCount);
+}
+
+public void getAdvancements_forPackedGlyphs_length_(int advancements, int packedGlyphs, int length) {
+ OS.objc_msgSend(this.id, OS.sel_getAdvancements_1forPackedGlyphs_1length_1, advancements, packedGlyphs, length);
+}
+
+public void getBoundingRects(int bounds, int glyphs, int glyphCount) {
+ OS.objc_msgSend(this.id, OS.sel_getBoundingRects_1forGlyphs_1count_1, bounds, glyphs, glyphCount);
+}
+
+public boolean glyphIsEncoded(int aGlyph) {
+ return OS.objc_msgSend(this.id, OS.sel_glyphIsEncoded_1, aGlyph) != 0;
+}
+
+public int glyphPacking() {
+ return OS.objc_msgSend(this.id, OS.sel_glyphPacking);
+}
+
+public int glyphWithName(NSString aName) {
+ return OS.objc_msgSend(this.id, OS.sel_glyphWithName_1, aName != null ? aName.id : 0);
+}
+
+public boolean isBaseFont() {
+ return OS.objc_msgSend(this.id, OS.sel_isBaseFont) != 0;
+}
+
+public boolean isFixedPitch() {
+ return OS.objc_msgSend(this.id, OS.sel_isFixedPitch) != 0;
+}
+
+public float italicAngle() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_italicAngle);
+}
+
+public static NSFont labelFontOfSize(float fontSize) {
+ int result = OS.objc_msgSend(OS.class_NSFont, OS.sel_labelFontOfSize_1, fontSize);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public static float labelFontSize() {
+ return (float)OS.objc_msgSend_fpret(OS.class_NSFont, OS.sel_labelFontSize);
+}
+
+public float leading() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_leading);
+}
+
+public int matrix() {
+ return OS.objc_msgSend(this.id, OS.sel_matrix);
+}
+
+public NSSize maximumAdvancement() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_maximumAdvancement);
+ return result;
+}
+
+public static NSFont menuBarFontOfSize(float fontSize) {
+ int result = OS.objc_msgSend(OS.class_NSFont, OS.sel_menuBarFontOfSize_1, fontSize);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public static NSFont menuFontOfSize(float fontSize) {
+ int result = OS.objc_msgSend(OS.class_NSFont, OS.sel_menuFontOfSize_1, fontSize);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public static NSFont messageFontOfSize(float fontSize) {
+ int result = OS.objc_msgSend(OS.class_NSFont, OS.sel_messageFontOfSize_1, fontSize);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public int mostCompatibleStringEncoding() {
+ return OS.objc_msgSend(this.id, OS.sel_mostCompatibleStringEncoding);
+}
+
+public int numberOfGlyphs() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfGlyphs);
+}
+
+public static NSFont paletteFontOfSize(float fontSize) {
+ int result = OS.objc_msgSend(OS.class_NSFont, OS.sel_paletteFontOfSize_1, fontSize);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public float pointSize() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_pointSize);
+}
+
+public NSPoint positionOfGlyph_forCharacter_struckOverRect_(int aGlyph, short aChar, NSRect aRect) {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_positionOfGlyph_1forCharacter_1struckOverRect_1, aGlyph, aChar, aRect);
+ return result;
+}
+
+public NSPoint positionOfGlyph_precededByGlyph_isNominal_(int curGlyph, int prevGlyph, int nominal) {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_positionOfGlyph_1precededByGlyph_1isNominal_1, curGlyph, prevGlyph, nominal);
+ return result;
+}
+
+public NSPoint positionOfGlyph_struckOverGlyph_metricsExist_(int curGlyph, int prevGlyph, int exist) {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_positionOfGlyph_1struckOverGlyph_1metricsExist_1, curGlyph, prevGlyph, exist);
+ return result;
+}
+
+public NSPoint positionOfGlyph_struckOverRect_metricsExist_(int aGlyph, NSRect aRect, int exist) {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_positionOfGlyph_1struckOverRect_1metricsExist_1, aGlyph, aRect, exist);
+ return result;
+}
+
+public NSPoint positionOfGlyph_withRelation_toBaseGlyph_totalAdvancement_metricsExist_(int thisGlyph, int rel, int baseGlyph, int adv, int exist) {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_positionOfGlyph_1withRelation_1toBaseGlyph_1totalAdvancement_1metricsExist_1, thisGlyph, rel, baseGlyph, adv, exist);
+ return result;
+}
+
+public int positionsForCompositeSequence(int someGlyphs, int numGlyphs, int points) {
+ return OS.objc_msgSend(this.id, OS.sel_positionsForCompositeSequence_1numberOfGlyphs_1pointArray_1, someGlyphs, numGlyphs, points);
+}
+
+public static NSArray preferredFontNames() {
+ int result = OS.objc_msgSend(OS.class_NSFont, OS.sel_preferredFontNames);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSFont printerFont() {
+ int result = OS.objc_msgSend(this.id, OS.sel_printerFont);
+ return result == this.id ? this : (result != 0 ? new NSFont(result) : null);
+}
+
+public int renderingMode() {
+ return OS.objc_msgSend(this.id, OS.sel_renderingMode);
+}
+
+public NSFont screenFont() {
+ int result = OS.objc_msgSend(this.id, OS.sel_screenFont);
+ return result == this.id ? this : (result != 0 ? new NSFont(result) : null);
+}
+
+public NSFont screenFontWithRenderingMode(int renderingMode) {
+ int result = OS.objc_msgSend(this.id, OS.sel_screenFontWithRenderingMode_1, renderingMode);
+ return result == this.id ? this : (result != 0 ? new NSFont(result) : null);
+}
+
+public void set() {
+ OS.objc_msgSend(this.id, OS.sel_set);
+}
+
+public void setInContext(NSGraphicsContext graphicsContext) {
+ OS.objc_msgSend(this.id, OS.sel_setInContext_1, graphicsContext != null ? graphicsContext.id : 0);
+}
+
+public static void setPreferredFontNames(NSArray fontNameArray) {
+ OS.objc_msgSend(OS.class_NSFont, OS.sel_setPreferredFontNames_1, fontNameArray != null ? fontNameArray.id : 0);
+}
+
+public static void setUserFixedPitchFont(NSFont aFont) {
+ OS.objc_msgSend(OS.class_NSFont, OS.sel_setUserFixedPitchFont_1, aFont != null ? aFont.id : 0);
+}
+
+public static void setUserFont(NSFont aFont) {
+ OS.objc_msgSend(OS.class_NSFont, OS.sel_setUserFont_1, aFont != null ? aFont.id : 0);
+}
+
+public static float smallSystemFontSize() {
+ return (float)OS.objc_msgSend_fpret(OS.class_NSFont, OS.sel_smallSystemFontSize);
+}
+
+public static NSFont systemFontOfSize(float fontSize) {
+ int result = OS.objc_msgSend(OS.class_NSFont, OS.sel_systemFontOfSize_1, fontSize);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public static float systemFontSize() {
+ return (float)OS.objc_msgSend_fpret(OS.class_NSFont, OS.sel_systemFontSize);
+}
+
+public static float systemFontSizeForControlSize(int controlSize) {
+ return (float)OS.objc_msgSend_fpret(OS.class_NSFont, OS.sel_systemFontSizeForControlSize_1, controlSize);
+}
+
+public NSAffineTransform textTransform() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textTransform);
+ return result != 0 ? new NSAffineTransform(result) : null;
+}
+
+public static NSFont titleBarFontOfSize(float fontSize) {
+ int result = OS.objc_msgSend(OS.class_NSFont, OS.sel_titleBarFontOfSize_1, fontSize);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public static NSFont toolTipsFontOfSize(float fontSize) {
+ int result = OS.objc_msgSend(OS.class_NSFont, OS.sel_toolTipsFontOfSize_1, fontSize);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public float underlinePosition() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_underlinePosition);
+}
+
+public float underlineThickness() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_underlineThickness);
+}
+
+public static void useFont(NSString fontName) {
+ OS.objc_msgSend(OS.class_NSFont, OS.sel_useFont_1, fontName != null ? fontName.id : 0);
+}
+
+public static NSFont userFixedPitchFontOfSize(float fontSize) {
+ int result = OS.objc_msgSend(OS.class_NSFont, OS.sel_userFixedPitchFontOfSize_1, fontSize);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public static NSFont userFontOfSize(float fontSize) {
+ int result = OS.objc_msgSend(OS.class_NSFont, OS.sel_userFontOfSize_1, fontSize);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public float widthOfString(NSString string) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_widthOfString_1, string != null ? string.id : 0);
+}
+
+public float xHeight() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_xHeight);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFontDescriptor.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFontDescriptor.java
new file mode 100644
index 0000000000..3448cb277c
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFontDescriptor.java
@@ -0,0 +1,101 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSFontDescriptor extends NSObject {
+
+public NSFontDescriptor() {
+ super();
+}
+
+public NSFontDescriptor(int id) {
+ super(id);
+}
+
+public NSDictionary fontAttributes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fontAttributes);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSFontDescriptor fontDescriptorByAddingAttributes(NSDictionary attributes) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fontDescriptorByAddingAttributes_1, attributes != null ? attributes.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSFontDescriptor(result) : null);
+}
+
+public NSFontDescriptor fontDescriptorWithFace(NSString newFace) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fontDescriptorWithFace_1, newFace != null ? newFace.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSFontDescriptor(result) : null);
+}
+
+public NSFontDescriptor fontDescriptorWithFamily(NSString newFamily) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fontDescriptorWithFamily_1, newFamily != null ? newFamily.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSFontDescriptor(result) : null);
+}
+
+public static NSFontDescriptor fontDescriptorWithFontAttributes(NSDictionary attributes) {
+ int result = OS.objc_msgSend(OS.class_NSFontDescriptor, OS.sel_fontDescriptorWithFontAttributes_1, attributes != null ? attributes.id : 0);
+ return result != 0 ? new NSFontDescriptor(result) : null;
+}
+
+public NSFontDescriptor fontDescriptorWithMatrix(NSAffineTransform matrix) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fontDescriptorWithMatrix_1, matrix != null ? matrix.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSFontDescriptor(result) : null);
+}
+
+public static NSFontDescriptor static_fontDescriptorWithName_matrix_(NSString fontName, NSAffineTransform matrix) {
+ int result = OS.objc_msgSend(OS.class_NSFontDescriptor, OS.sel_fontDescriptorWithName_1matrix_1, fontName != null ? fontName.id : 0, matrix != null ? matrix.id : 0);
+ return result != 0 ? new NSFontDescriptor(result) : null;
+}
+
+public static NSFontDescriptor static_fontDescriptorWithName_size_(NSString fontName, float size) {
+ int result = OS.objc_msgSend(OS.class_NSFontDescriptor, OS.sel_fontDescriptorWithName_1size_1, fontName != null ? fontName.id : 0, size);
+ return result != 0 ? new NSFontDescriptor(result) : null;
+}
+
+public NSFontDescriptor fontDescriptorWithSize(float newPointSize) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fontDescriptorWithSize_1, newPointSize);
+ return result == this.id ? this : (result != 0 ? new NSFontDescriptor(result) : null);
+}
+
+public NSFontDescriptor fontDescriptorWithSymbolicTraits(int symbolicTraits) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fontDescriptorWithSymbolicTraits_1, symbolicTraits);
+ return result == this.id ? this : (result != 0 ? new NSFontDescriptor(result) : null);
+}
+
+public id initWithFontAttributes(NSDictionary attributes) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFontAttributes_1, attributes != null ? attributes.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSFontDescriptor matchingFontDescriptorWithMandatoryKeys(NSSet mandatoryKeys) {
+ int result = OS.objc_msgSend(this.id, OS.sel_matchingFontDescriptorWithMandatoryKeys_1, mandatoryKeys != null ? mandatoryKeys.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSFontDescriptor(result) : null);
+}
+
+public NSArray matchingFontDescriptorsWithMandatoryKeys(NSSet mandatoryKeys) {
+ int result = OS.objc_msgSend(this.id, OS.sel_matchingFontDescriptorsWithMandatoryKeys_1, mandatoryKeys != null ? mandatoryKeys.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSAffineTransform matrix() {
+ int result = OS.objc_msgSend(this.id, OS.sel_matrix);
+ return result != 0 ? new NSAffineTransform(result) : null;
+}
+
+public id objectForKey(NSString anAttribute) {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectForKey_1, anAttribute != null ? anAttribute.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public float pointSize() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_pointSize);
+}
+
+public NSString postscriptName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_postscriptName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int symbolicTraits() {
+ return OS.objc_msgSend(this.id, OS.sel_symbolicTraits);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFontManager.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFontManager.java
new file mode 100644
index 0000000000..7cdfc449db
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFontManager.java
@@ -0,0 +1,240 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSFontManager extends NSObject {
+
+public NSFontManager() {
+ super();
+}
+
+public NSFontManager(int id) {
+ super(id);
+}
+
+public int action() {
+ return OS.objc_msgSend(this.id, OS.sel_action);
+}
+
+public boolean addCollection(NSString collectionName, int collectionOptions) {
+ return OS.objc_msgSend(this.id, OS.sel_addCollection_1options_1, collectionName != null ? collectionName.id : 0, collectionOptions) != 0;
+}
+
+public void addFontDescriptors(NSArray descriptors, NSString collectionName) {
+ OS.objc_msgSend(this.id, OS.sel_addFontDescriptors_1toCollection_1, descriptors != null ? descriptors.id : 0, collectionName != null ? collectionName.id : 0);
+}
+
+public void addFontTrait(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_addFontTrait_1, sender != null ? sender.id : 0);
+}
+
+public NSArray availableFontFamilies() {
+ int result = OS.objc_msgSend(this.id, OS.sel_availableFontFamilies);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray availableFontNamesMatchingFontDescriptor(NSFontDescriptor descriptor) {
+ int result = OS.objc_msgSend(this.id, OS.sel_availableFontNamesMatchingFontDescriptor_1, descriptor != null ? descriptor.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray availableFontNamesWithTraits(int someTraits) {
+ int result = OS.objc_msgSend(this.id, OS.sel_availableFontNamesWithTraits_1, someTraits);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray availableFonts() {
+ int result = OS.objc_msgSend(this.id, OS.sel_availableFonts);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray availableMembersOfFontFamily(NSString fam) {
+ int result = OS.objc_msgSend(this.id, OS.sel_availableMembersOfFontFamily_1, fam != null ? fam.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray collectionNames() {
+ int result = OS.objc_msgSend(this.id, OS.sel_collectionNames);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSDictionary convertAttributes(NSDictionary attributes) {
+ int result = OS.objc_msgSend(this.id, OS.sel_convertAttributes_1, attributes != null ? attributes.id : 0);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSFont convertFont_(NSFont fontObj) {
+ int result = OS.objc_msgSend(this.id, OS.sel_convertFont_1, fontObj != null ? fontObj.id : 0);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public NSFont convertFont_toFace_(NSFont fontObj, NSString typeface) {
+ int result = OS.objc_msgSend(this.id, OS.sel_convertFont_1toFace_1, fontObj != null ? fontObj.id : 0, typeface != null ? typeface.id : 0);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public NSFont convertFont_toFamily_(NSFont fontObj, NSString family) {
+ int result = OS.objc_msgSend(this.id, OS.sel_convertFont_1toFamily_1, fontObj != null ? fontObj.id : 0, family != null ? family.id : 0);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public NSFont convertFont_toHaveTrait_(NSFont fontObj, int trait) {
+ int result = OS.objc_msgSend(this.id, OS.sel_convertFont_1toHaveTrait_1, fontObj != null ? fontObj.id : 0, trait);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public NSFont convertFont_toNotHaveTrait_(NSFont fontObj, int trait) {
+ int result = OS.objc_msgSend(this.id, OS.sel_convertFont_1toNotHaveTrait_1, fontObj != null ? fontObj.id : 0, trait);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public NSFont convertFont_toSize_(NSFont fontObj, float size) {
+ int result = OS.objc_msgSend(this.id, OS.sel_convertFont_1toSize_1, fontObj != null ? fontObj.id : 0, size);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public int convertFontTraits(int traits) {
+ return OS.objc_msgSend(this.id, OS.sel_convertFontTraits_1, traits);
+}
+
+public NSFont convertWeight(boolean upFlag, NSFont fontObj) {
+ int result = OS.objc_msgSend(this.id, OS.sel_convertWeight_1ofFont_1, upFlag, fontObj != null ? fontObj.id : 0);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public int currentFontAction() {
+ return OS.objc_msgSend(this.id, OS.sel_currentFontAction);
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSArray fontDescriptorsInCollection(NSString collectionNames) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fontDescriptorsInCollection_1, collectionNames != null ? collectionNames.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSMenu fontMenu(boolean create) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fontMenu_1, create);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+public boolean fontNamed(NSString fName, int someTraits) {
+ return OS.objc_msgSend(this.id, OS.sel_fontNamed_1hasTraits_1, fName != null ? fName.id : 0, someTraits) != 0;
+}
+
+public NSFontPanel fontPanel(boolean create) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fontPanel_1, create);
+ return result != 0 ? new NSFontPanel(result) : null;
+}
+
+public NSFont fontWithFamily(NSString family, int traits, int weight, float size) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fontWithFamily_1traits_1weight_1size_1, family != null ? family.id : 0, traits, weight, size);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public boolean isEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_isEnabled) != 0;
+}
+
+public boolean isMultiple() {
+ return OS.objc_msgSend(this.id, OS.sel_isMultiple) != 0;
+}
+
+public NSString localizedNameForFamily(NSString family, NSString faceKey) {
+ int result = OS.objc_msgSend(this.id, OS.sel_localizedNameForFamily_1face_1, family != null ? family.id : 0, faceKey != null ? faceKey.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void modifyFont(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_modifyFont_1, sender != null ? sender.id : 0);
+}
+
+public void modifyFontViaPanel(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_modifyFontViaPanel_1, sender != null ? sender.id : 0);
+}
+
+public void orderFrontFontPanel(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_orderFrontFontPanel_1, sender != null ? sender.id : 0);
+}
+
+public void orderFrontStylesPanel(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_orderFrontStylesPanel_1, sender != null ? sender.id : 0);
+}
+
+public boolean removeCollection(NSString collectionName) {
+ return OS.objc_msgSend(this.id, OS.sel_removeCollection_1, collectionName != null ? collectionName.id : 0) != 0;
+}
+
+public void removeFontDescriptor(NSFontDescriptor descriptor, NSString collection) {
+ OS.objc_msgSend(this.id, OS.sel_removeFontDescriptor_1fromCollection_1, descriptor != null ? descriptor.id : 0, collection != null ? collection.id : 0);
+}
+
+public void removeFontTrait(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_removeFontTrait_1, sender != null ? sender.id : 0);
+}
+
+public NSFont selectedFont() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedFont);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public boolean sendAction() {
+ return OS.objc_msgSend(this.id, OS.sel_sendAction) != 0;
+}
+
+public void setAction(int aSelector) {
+ OS.objc_msgSend(this.id, OS.sel_setAction_1, aSelector);
+}
+
+public void setDelegate(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
+}
+
+public void setEnabled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setEnabled_1, flag);
+}
+
+public static void setFontManagerFactory(int factoryId) {
+ OS.objc_msgSend(OS.class_NSFontManager, OS.sel_setFontManagerFactory_1, factoryId);
+}
+
+public void setFontMenu(NSMenu newMenu) {
+ OS.objc_msgSend(this.id, OS.sel_setFontMenu_1, newMenu != null ? newMenu.id : 0);
+}
+
+public static void setFontPanelFactory(int factoryId) {
+ OS.objc_msgSend(OS.class_NSFontManager, OS.sel_setFontPanelFactory_1, factoryId);
+}
+
+public void setSelectedAttributes(NSDictionary attributes, boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectedAttributes_1isMultiple_1, attributes != null ? attributes.id : 0, flag);
+}
+
+public void setSelectedFont(NSFont fontObj, boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectedFont_1isMultiple_1, fontObj != null ? fontObj.id : 0, flag);
+}
+
+public void setTarget(id aTarget) {
+ OS.objc_msgSend(this.id, OS.sel_setTarget_1, aTarget != null ? aTarget.id : 0);
+}
+
+public static NSFontManager sharedFontManager() {
+ int result = OS.objc_msgSend(OS.class_NSFontManager, OS.sel_sharedFontManager);
+ return result != 0 ? new NSFontManager(result) : null;
+}
+
+public id target() {
+ int result = OS.objc_msgSend(this.id, OS.sel_target);
+ return result != 0 ? new id(result) : null;
+}
+
+public int traitsOfFont(NSFont fontObj) {
+ return OS.objc_msgSend(this.id, OS.sel_traitsOfFont_1, fontObj != null ? fontObj.id : 0);
+}
+
+public int weightOfFont(NSFont fontObj) {
+ return OS.objc_msgSend(this.id, OS.sel_weightOfFont_1, fontObj != null ? fontObj.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFontPanel.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFontPanel.java
new file mode 100644
index 0000000000..f3bf1a860f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFontPanel.java
@@ -0,0 +1,56 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSFontPanel extends NSPanel {
+
+public NSFontPanel() {
+ super();
+}
+
+public NSFontPanel(int id) {
+ super(id);
+}
+
+public NSView accessoryView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_accessoryView);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public boolean isEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_isEnabled) != 0;
+}
+
+public NSFont panelConvertFont(NSFont fontObj) {
+ int result = OS.objc_msgSend(this.id, OS.sel_panelConvertFont_1, fontObj != null ? fontObj.id : 0);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public void reloadDefaultFontFamilies() {
+ OS.objc_msgSend(this.id, OS.sel_reloadDefaultFontFamilies);
+}
+
+public void setAccessoryView(NSView aView) {
+ OS.objc_msgSend(this.id, OS.sel_setAccessoryView_1, aView != null ? aView.id : 0);
+}
+
+public void setEnabled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setEnabled_1, flag);
+}
+
+public void setPanelFont(NSFont fontObj, boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setPanelFont_1isMultiple_1, fontObj != null ? fontObj.id : 0, flag);
+}
+
+public static NSFontPanel sharedFontPanel() {
+ int result = OS.objc_msgSend(OS.class_NSFontPanel, OS.sel_sharedFontPanel);
+ return result != 0 ? new NSFontPanel(result) : null;
+}
+
+public static boolean sharedFontPanelExists() {
+ return OS.objc_msgSend(OS.class_NSFontPanel, OS.sel_sharedFontPanelExists) != 0;
+}
+
+public boolean worksWhenModal() {
+ return OS.objc_msgSend(this.id, OS.sel_worksWhenModal) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSForm.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSForm.java
new file mode 100644
index 0000000000..9ca9099013
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSForm.java
@@ -0,0 +1,92 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSForm extends NSMatrix {
+
+public NSForm() {
+ super();
+}
+
+public NSForm(int id) {
+ super(id);
+}
+
+public NSFormCell addEntry(NSString title) {
+ int result = OS.objc_msgSend(this.id, OS.sel_addEntry_1, title != null ? title.id : 0);
+ return result != 0 ? new NSFormCell(result) : null;
+}
+
+public id cellAtIndex(int index) {
+ int result = OS.objc_msgSend(this.id, OS.sel_cellAtIndex_1, index);
+ return result != 0 ? new id(result) : null;
+}
+
+public void drawCellAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_drawCellAtIndex_1, index);
+}
+
+public int indexOfCellWithTag(int aTag) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfCellWithTag_1, aTag);
+}
+
+public int indexOfSelectedItem() {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfSelectedItem);
+}
+
+public NSFormCell insertEntry(NSString title, int index) {
+ int result = OS.objc_msgSend(this.id, OS.sel_insertEntry_1atIndex_1, title != null ? title.id : 0, index);
+ return result != 0 ? new NSFormCell(result) : null;
+}
+
+public void removeEntryAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_removeEntryAtIndex_1, index);
+}
+
+public void selectTextAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_selectTextAtIndex_1, index);
+}
+
+public void setBezeled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setBezeled_1, flag);
+}
+
+public void setBordered(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setBordered_1, flag);
+}
+
+public void setEntryWidth(float width) {
+ OS.objc_msgSend(this.id, OS.sel_setEntryWidth_1, width);
+}
+
+public void setFrameSize(NSSize newSize) {
+ OS.objc_msgSend(this.id, OS.sel_setFrameSize_1, newSize);
+}
+
+public void setInterlineSpacing(float spacing) {
+ OS.objc_msgSend(this.id, OS.sel_setInterlineSpacing_1, spacing);
+}
+
+public void setTextAlignment(int mode) {
+ OS.objc_msgSend(this.id, OS.sel_setTextAlignment_1, mode);
+}
+
+public void setTextBaseWritingDirection(int writingDirection) {
+ OS.objc_msgSend(this.id, OS.sel_setTextBaseWritingDirection_1, writingDirection);
+}
+
+public void setTextFont(NSFont fontObj) {
+ OS.objc_msgSend(this.id, OS.sel_setTextFont_1, fontObj != null ? fontObj.id : 0);
+}
+
+public void setTitleAlignment(int mode) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleAlignment_1, mode);
+}
+
+public void setTitleBaseWritingDirection(int writingDirection) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleBaseWritingDirection_1, writingDirection);
+}
+
+public void setTitleFont(NSFont fontObj) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleFont_1, fontObj != null ? fontObj.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFormCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFormCell.java
new file mode 100644
index 0000000000..2a42ece4d1
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFormCell.java
@@ -0,0 +1,94 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSFormCell extends NSActionCell {
+
+public NSFormCell() {
+ super();
+}
+
+public NSFormCell(int id) {
+ super(id);
+}
+
+public NSAttributedString attributedTitle() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributedTitle);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public boolean isOpaque() {
+ return OS.objc_msgSend(this.id, OS.sel_isOpaque) != 0;
+}
+
+public NSAttributedString placeholderAttributedString() {
+ int result = OS.objc_msgSend(this.id, OS.sel_placeholderAttributedString);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public NSString placeholderString() {
+ int result = OS.objc_msgSend(this.id, OS.sel_placeholderString);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void setAttributedTitle(NSAttributedString obj) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributedTitle_1, obj != null ? obj.id : 0);
+}
+
+public void setPlaceholderAttributedString(NSAttributedString string) {
+ OS.objc_msgSend(this.id, OS.sel_setPlaceholderAttributedString_1, string != null ? string.id : 0);
+}
+
+public void setPlaceholderString(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setPlaceholderString_1, string != null ? string.id : 0);
+}
+
+public void setTitle(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString != null ? aString.id : 0);
+}
+
+public void setTitleAlignment(int mode) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleAlignment_1, mode);
+}
+
+public void setTitleBaseWritingDirection(int writingDirection) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleBaseWritingDirection_1, writingDirection);
+}
+
+public void setTitleFont(NSFont fontObj) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleFont_1, fontObj != null ? fontObj.id : 0);
+}
+
+public void setTitleWidth(float width) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleWidth_1, width);
+}
+
+public void setTitleWithMnemonic(NSString stringWithAmpersand) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleWithMnemonic_1, stringWithAmpersand != null ? stringWithAmpersand.id : 0);
+}
+
+public NSString title() {
+ int result = OS.objc_msgSend(this.id, OS.sel_title);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int titleAlignment() {
+ return OS.objc_msgSend(this.id, OS.sel_titleAlignment);
+}
+
+public int titleBaseWritingDirection() {
+ return OS.objc_msgSend(this.id, OS.sel_titleBaseWritingDirection);
+}
+
+public NSFont titleFont() {
+ int result = OS.objc_msgSend(this.id, OS.sel_titleFont);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public float titleWidth() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_titleWidth);
+}
+
+public float titleWidth_(NSSize aSize) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_titleWidth_1, aSize);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFormatter.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFormatter.java
new file mode 100644
index 0000000000..61a1c6d0cc
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSFormatter.java
@@ -0,0 +1,40 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSFormatter extends NSObject {
+
+public NSFormatter() {
+ super();
+}
+
+public NSFormatter(int id) {
+ super(id);
+}
+
+public NSAttributedString attributedStringForObjectValue(id obj, NSDictionary attrs) {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributedStringForObjectValue_1withDefaultAttributes_1, obj != null ? obj.id : 0, attrs != null ? attrs.id : 0);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public NSString editingStringForObjectValue(id obj) {
+ int result = OS.objc_msgSend(this.id, OS.sel_editingStringForObjectValue_1, obj != null ? obj.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean getObjectValue(int obj, NSString string, int error) {
+ return OS.objc_msgSend(this.id, OS.sel_getObjectValue_1forString_1errorDescription_1, obj, string != null ? string.id : 0, error) != 0;
+}
+
+public boolean isPartialStringValid_newEditingString_errorDescription_(NSString partialString, int newString, int error) {
+ return OS.objc_msgSend(this.id, OS.sel_isPartialStringValid_1newEditingString_1errorDescription_1, partialString != null ? partialString.id : 0, newString, error) != 0;
+}
+
+public boolean isPartialStringValid_proposedSelectedRange_originalString_originalSelectedRange_errorDescription_(int partialStringPtr, int proposedSelRangePtr, NSString origString, NSRange origSelRange, int error) {
+ return OS.objc_msgSend(this.id, OS.sel_isPartialStringValid_1proposedSelectedRange_1originalString_1originalSelectedRange_1errorDescription_1, partialStringPtr, proposedSelRangePtr, origString != null ? origString.id : 0, origSelRange, error) != 0;
+}
+
+public NSString stringForObjectValue(id obj) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringForObjectValue_1, obj != null ? obj.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGarbageCollector.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGarbageCollector.java
new file mode 100644
index 0000000000..29c6b78c87
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGarbageCollector.java
@@ -0,0 +1,54 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSGarbageCollector extends NSObject {
+
+public NSGarbageCollector() {
+ super();
+}
+
+public NSGarbageCollector(int id) {
+ super(id);
+}
+
+public void collectExhaustively() {
+ OS.objc_msgSend(this.id, OS.sel_collectExhaustively);
+}
+
+public void collectIfNeeded() {
+ OS.objc_msgSend(this.id, OS.sel_collectIfNeeded);
+}
+
+public static id defaultCollector() {
+ int result = OS.objc_msgSend(OS.class_NSGarbageCollector, OS.sel_defaultCollector);
+ return result != 0 ? new id(result) : null;
+}
+
+public void disable() {
+ OS.objc_msgSend(this.id, OS.sel_disable);
+}
+
+public void disableCollectorForPointer(int ptr) {
+ OS.objc_msgSend(this.id, OS.sel_disableCollectorForPointer_1, ptr);
+}
+
+public void enable() {
+ OS.objc_msgSend(this.id, OS.sel_enable);
+}
+
+public void enableCollectorForPointer(int ptr) {
+ OS.objc_msgSend(this.id, OS.sel_enableCollectorForPointer_1, ptr);
+}
+
+public boolean isCollecting() {
+ return OS.objc_msgSend(this.id, OS.sel_isCollecting) != 0;
+}
+
+public boolean isEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_isEnabled) != 0;
+}
+
+public int zone() {
+ return OS.objc_msgSend(this.id, OS.sel_zone);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGlyphGenerator.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGlyphGenerator.java
new file mode 100644
index 0000000000..3871c09b8f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGlyphGenerator.java
@@ -0,0 +1,22 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSGlyphGenerator extends NSObject {
+
+public NSGlyphGenerator() {
+ super();
+}
+
+public NSGlyphGenerator(int id) {
+ super(id);
+}
+
+public void generateGlyphsForGlyphStorage(id glyphStorage, int nChars, int glyphIndex, int charIndex) {
+ OS.objc_msgSend(this.id, OS.sel_generateGlyphsForGlyphStorage_1desiredNumberOfCharacters_1glyphIndex_1characterIndex_1, glyphStorage != null ? glyphStorage.id : 0, nChars, glyphIndex, charIndex);
+}
+
+public static id sharedGlyphGenerator() {
+ int result = OS.objc_msgSend(OS.class_NSGlyphGenerator, OS.sel_sharedGlyphGenerator);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGlyphInfo.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGlyphInfo.java
new file mode 100644
index 0000000000..00a5d420b9
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGlyphInfo.java
@@ -0,0 +1,41 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSGlyphInfo extends NSObject {
+
+public NSGlyphInfo() {
+ super();
+}
+
+public NSGlyphInfo(int id) {
+ super(id);
+}
+
+public int characterCollection() {
+ return OS.objc_msgSend(this.id, OS.sel_characterCollection);
+}
+
+public int characterIdentifier() {
+ return OS.objc_msgSend(this.id, OS.sel_characterIdentifier);
+}
+
+public static NSGlyphInfo glyphInfoWithCharacterIdentifier(int cid, int characterCollection, NSString theString) {
+ int result = OS.objc_msgSend(OS.class_NSGlyphInfo, OS.sel_glyphInfoWithCharacterIdentifier_1collection_1baseString_1, cid, characterCollection, theString != null ? theString.id : 0);
+ return result != 0 ? new NSGlyphInfo(result) : null;
+}
+
+public static NSGlyphInfo glyphInfoWithGlyph(int glyph, NSFont font, NSString theString) {
+ int result = OS.objc_msgSend(OS.class_NSGlyphInfo, OS.sel_glyphInfoWithGlyph_1forFont_1baseString_1, glyph, font != null ? font.id : 0, theString != null ? theString.id : 0);
+ return result != 0 ? new NSGlyphInfo(result) : null;
+}
+
+public static NSGlyphInfo glyphInfoWithGlyphName(NSString glyphName, NSFont font, NSString theString) {
+ int result = OS.objc_msgSend(OS.class_NSGlyphInfo, OS.sel_glyphInfoWithGlyphName_1forFont_1baseString_1, glyphName != null ? glyphName.id : 0, font != null ? font.id : 0, theString != null ? theString.id : 0);
+ return result != 0 ? new NSGlyphInfo(result) : null;
+}
+
+public NSString glyphName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_glyphName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGradient.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGradient.java
new file mode 100644
index 0000000000..8fc417d235
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGradient.java
@@ -0,0 +1,75 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSGradient extends NSObject {
+
+public NSGradient() {
+ super();
+}
+
+public NSGradient(int id) {
+ super(id);
+}
+
+public NSColorSpace colorSpace() {
+ int result = OS.objc_msgSend(this.id, OS.sel_colorSpace);
+ return result != 0 ? new NSColorSpace(result) : null;
+}
+
+public void drawFromCenter(NSPoint startCenter, float startRadius, NSPoint endCenter, float endRadius, int options) {
+ OS.objc_msgSend(this.id, OS.sel_drawFromCenter_1radius_1toCenter_1radius_1options_1, startCenter, startRadius, endCenter, endRadius, options);
+}
+
+public void drawFromPoint(NSPoint startingPoint, NSPoint endingPoint, int options) {
+ OS.objc_msgSend(this.id, OS.sel_drawFromPoint_1toPoint_1options_1, startingPoint, endingPoint, options);
+}
+
+public void drawInBezierPath_angle_(NSBezierPath path, float angle) {
+ OS.objc_msgSend(this.id, OS.sel_drawInBezierPath_1angle_1, path != null ? path.id : 0, angle);
+}
+
+public void drawInBezierPath_relativeCenterPosition_(NSBezierPath path, NSPoint relativeCenterPosition) {
+ OS.objc_msgSend(this.id, OS.sel_drawInBezierPath_1relativeCenterPosition_1, path != null ? path.id : 0, relativeCenterPosition);
+}
+
+public void drawInRect_angle_(NSRect rect, float angle) {
+ OS.objc_msgSend(this.id, OS.sel_drawInRect_1angle_1, rect, angle);
+}
+
+public void drawInRect_relativeCenterPosition_(NSRect rect, NSPoint relativeCenterPosition) {
+ OS.objc_msgSend(this.id, OS.sel_drawInRect_1relativeCenterPosition_1, rect, relativeCenterPosition);
+}
+
+public void getColor(int color, int location, int index) {
+ OS.objc_msgSend(this.id, OS.sel_getColor_1location_1atIndex_1, color, location, index);
+}
+
+public NSGradient initWithColors_(NSArray colorArray) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithColors_1, colorArray != null ? colorArray.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSGradient initWithColors_atLocations_colorSpace_(NSArray colorArray, int locations, NSColorSpace colorSpace) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithColors_1atLocations_1colorSpace_1, colorArray != null ? colorArray.id : 0, locations, colorSpace != null ? colorSpace.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSGradient initWithColorsAndLocations(NSColor initWithColorsAndLocations) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithColorsAndLocations_1, initWithColorsAndLocations != null ? initWithColorsAndLocations.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSGradient initWithStartingColor(NSColor startingColor, NSColor endingColor) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithStartingColor_1endingColor_1, startingColor != null ? startingColor.id : 0, endingColor != null ? endingColor.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSColor interpolatedColorAtLocation(float location) {
+ int result = OS.objc_msgSend(this.id, OS.sel_interpolatedColorAtLocation_1, location);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public int numberOfColorStops() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfColorStops);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGraphicsContext.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGraphicsContext.java
new file mode 100644
index 0000000000..a26be04126
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSGraphicsContext.java
@@ -0,0 +1,143 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSGraphicsContext extends NSObject {
+
+public NSGraphicsContext() {
+ super();
+}
+
+public NSGraphicsContext(int id) {
+ super(id);
+}
+
+//public CIContext CIContext() {
+// int result = OS.objc_msgSend(this.id, OS.sel_CIContext);
+// return result != 0 ? new CIContext(result) : null;
+//}
+
+public NSDictionary attributes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributes);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public int colorRenderingIntent() {
+ return OS.objc_msgSend(this.id, OS.sel_colorRenderingIntent);
+}
+
+public int compositingOperation() {
+ return OS.objc_msgSend(this.id, OS.sel_compositingOperation);
+}
+
+public static NSGraphicsContext currentContext() {
+ int result = OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_currentContext);
+ return result != 0 ? new NSGraphicsContext(result) : null;
+}
+
+public static boolean currentContextDrawingToScreen() {
+ return OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_currentContextDrawingToScreen) != 0;
+}
+
+public void flushGraphics() {
+ OS.objc_msgSend(this.id, OS.sel_flushGraphics);
+}
+
+public id focusStack() {
+ int result = OS.objc_msgSend(this.id, OS.sel_focusStack);
+ return result != 0 ? new id(result) : null;
+}
+
+public static NSGraphicsContext graphicsContextWithAttributes(NSDictionary attributes) {
+ int result = OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_graphicsContextWithAttributes_1, attributes != null ? attributes.id : 0);
+ return result != 0 ? new NSGraphicsContext(result) : null;
+}
+
+public static NSGraphicsContext graphicsContextWithBitmapImageRep(NSBitmapImageRep bitmapRep) {
+ int result = OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_graphicsContextWithBitmapImageRep_1, bitmapRep != null ? bitmapRep.id : 0);
+ return result != 0 ? new NSGraphicsContext(result) : null;
+}
+
+public static NSGraphicsContext graphicsContextWithGraphicsPort(int graphicsPort, boolean initialFlippedState) {
+ int result = OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_graphicsContextWithGraphicsPort_1flipped_1, graphicsPort, initialFlippedState);
+ return result != 0 ? new NSGraphicsContext(result) : null;
+}
+
+public static NSGraphicsContext graphicsContextWithWindow(NSWindow window) {
+ int result = OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_graphicsContextWithWindow_1, window != null ? window.id : 0);
+ return result != 0 ? new NSGraphicsContext(result) : null;
+}
+
+public int graphicsPort() {
+ return OS.objc_msgSend(this.id, OS.sel_graphicsPort);
+}
+
+public int imageInterpolation() {
+ return OS.objc_msgSend(this.id, OS.sel_imageInterpolation);
+}
+
+public boolean isDrawingToScreen() {
+ return OS.objc_msgSend(this.id, OS.sel_isDrawingToScreen) != 0;
+}
+
+public boolean isFlipped() {
+ return OS.objc_msgSend(this.id, OS.sel_isFlipped) != 0;
+}
+
+public NSPoint patternPhase() {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_patternPhase);
+ return result;
+}
+
+public void restoreGraphicsState() {
+ OS.objc_msgSend(this.id, OS.sel_restoreGraphicsState);
+}
+
+public static void static_restoreGraphicsState() {
+ OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_restoreGraphicsState);
+}
+
+public void saveGraphicsState() {
+ OS.objc_msgSend(this.id, OS.sel_saveGraphicsState);
+}
+
+public static void static_saveGraphicsState() {
+ OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_saveGraphicsState);
+}
+
+public void setColorRenderingIntent(int renderingIntent) {
+ OS.objc_msgSend(this.id, OS.sel_setColorRenderingIntent_1, renderingIntent);
+}
+
+public void setCompositingOperation(int operation) {
+ OS.objc_msgSend(this.id, OS.sel_setCompositingOperation_1, operation);
+}
+
+public static void setCurrentContext(NSGraphicsContext context) {
+ OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_setCurrentContext_1, context != null ? context.id : 0);
+}
+
+public void setFocusStack(id stack) {
+ OS.objc_msgSend(this.id, OS.sel_setFocusStack_1, stack != null ? stack.id : 0);
+}
+
+public static void setGraphicsState(int gState) {
+ OS.objc_msgSend(OS.class_NSGraphicsContext, OS.sel_setGraphicsState_1, gState);
+}
+
+public void setImageInterpolation(int interpolation) {
+ OS.objc_msgSend(this.id, OS.sel_setImageInterpolation_1, interpolation);
+}
+
+public void setPatternPhase(NSPoint phase) {
+ OS.objc_msgSend(this.id, OS.sel_setPatternPhase_1, phase);
+}
+
+public void setShouldAntialias(boolean antialias) {
+ OS.objc_msgSend(this.id, OS.sel_setShouldAntialias_1, antialias);
+}
+
+public boolean shouldAntialias() {
+ return OS.objc_msgSend(this.id, OS.sel_shouldAntialias) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHTTPCookie.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHTTPCookie.java
new file mode 100644
index 0000000000..787acda312
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHTTPCookie.java
@@ -0,0 +1,90 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSHTTPCookie extends NSObject {
+
+public NSHTTPCookie() {
+ super();
+}
+
+public NSHTTPCookie(int id) {
+ super(id);
+}
+
+public NSString comment() {
+ int result = OS.objc_msgSend(this.id, OS.sel_comment);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSURL commentURL() {
+ int result = OS.objc_msgSend(this.id, OS.sel_commentURL);
+ return result != 0 ? new NSURL(result) : null;
+}
+
+public static id cookieWithProperties(NSDictionary properties) {
+ int result = OS.objc_msgSend(OS.class_NSHTTPCookie, OS.sel_cookieWithProperties_1, properties != null ? properties.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static NSArray cookiesWithResponseHeaderFields(NSDictionary headerFields, NSURL URL) {
+ int result = OS.objc_msgSend(OS.class_NSHTTPCookie, OS.sel_cookiesWithResponseHeaderFields_1forURL_1, headerFields != null ? headerFields.id : 0, URL != null ? URL.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString domain() {
+ int result = OS.objc_msgSend(this.id, OS.sel_domain);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSDate expiresDate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_expiresDate);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public id initWithProperties(NSDictionary properties) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithProperties_1, properties != null ? properties.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isSecure() {
+ return OS.objc_msgSend(this.id, OS.sel_isSecure) != 0;
+}
+
+public boolean isSessionOnly() {
+ return OS.objc_msgSend(this.id, OS.sel_isSessionOnly) != 0;
+}
+
+public NSString name() {
+ int result = OS.objc_msgSend(this.id, OS.sel_name);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString path() {
+ int result = OS.objc_msgSend(this.id, OS.sel_path);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSArray portList() {
+ int result = OS.objc_msgSend(this.id, OS.sel_portList);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSDictionary properties() {
+ int result = OS.objc_msgSend(this.id, OS.sel_properties);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public static NSDictionary requestHeaderFieldsWithCookies(NSArray cookies) {
+ int result = OS.objc_msgSend(OS.class_NSHTTPCookie, OS.sel_requestHeaderFieldsWithCookies_1, cookies != null ? cookies.id : 0);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSString value() {
+ int result = OS.objc_msgSend(this.id, OS.sel_value);
+ return result != 0 ? new NSString(result) : null;
+}
+
+//public int version() {
+// return OS.objc_msgSend(this.id, OS.sel_version);
+//}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHTTPCookieStorage.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHTTPCookieStorage.java
new file mode 100644
index 0000000000..84217a82b7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHTTPCookieStorage.java
@@ -0,0 +1,48 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSHTTPCookieStorage extends NSObject {
+
+public NSHTTPCookieStorage() {
+ super();
+}
+
+public NSHTTPCookieStorage(int id) {
+ super(id);
+}
+
+public int cookieAcceptPolicy() {
+ return OS.objc_msgSend(this.id, OS.sel_cookieAcceptPolicy);
+}
+
+public NSArray cookies() {
+ int result = OS.objc_msgSend(this.id, OS.sel_cookies);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray cookiesForURL(NSURL URL) {
+ int result = OS.objc_msgSend(this.id, OS.sel_cookiesForURL_1, URL != null ? URL.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void deleteCookie(NSHTTPCookie cookie) {
+ OS.objc_msgSend(this.id, OS.sel_deleteCookie_1, cookie != null ? cookie.id : 0);
+}
+
+public void setCookie(NSHTTPCookie cookie) {
+ OS.objc_msgSend(this.id, OS.sel_setCookie_1, cookie != null ? cookie.id : 0);
+}
+
+public void setCookieAcceptPolicy(int cookieAcceptPolicy) {
+ OS.objc_msgSend(this.id, OS.sel_setCookieAcceptPolicy_1, cookieAcceptPolicy);
+}
+
+public void setCookies(NSArray cookies, NSURL URL, NSURL mainDocumentURL) {
+ OS.objc_msgSend(this.id, OS.sel_setCookies_1forURL_1mainDocumentURL_1, cookies != null ? cookies.id : 0, URL != null ? URL.id : 0, mainDocumentURL != null ? mainDocumentURL.id : 0);
+}
+
+public static NSHTTPCookieStorage sharedHTTPCookieStorage() {
+ int result = OS.objc_msgSend(OS.class_NSHTTPCookieStorage, OS.sel_sharedHTTPCookieStorage);
+ return result != 0 ? new NSHTTPCookieStorage(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHTTPURLResponse.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHTTPURLResponse.java
new file mode 100644
index 0000000000..6ec9c26bb8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHTTPURLResponse.java
@@ -0,0 +1,27 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSHTTPURLResponse extends NSURLResponse {
+
+public NSHTTPURLResponse() {
+ super();
+}
+
+public NSHTTPURLResponse(int id) {
+ super(id);
+}
+
+public NSDictionary allHeaderFields() {
+ int result = OS.objc_msgSend(this.id, OS.sel_allHeaderFields);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public static NSString localizedStringForStatusCode(int statusCode) {
+ int result = OS.objc_msgSend(OS.class_NSHTTPURLResponse, OS.sel_localizedStringForStatusCode_1, statusCode);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int statusCode() {
+ return OS.objc_msgSend(this.id, OS.sel_statusCode);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHashEnumerator.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHashEnumerator.java
new file mode 100644
index 0000000000..9ba1c5f1a7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHashEnumerator.java
@@ -0,0 +1,5 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSHashEnumerator {
+//TODO
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHashTable.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHashTable.java
new file mode 100644
index 0000000000..b00b97ff37
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHashTable.java
@@ -0,0 +1,107 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSHashTable extends NSObject {
+
+public NSHashTable() {
+ super();
+}
+
+public NSHashTable(int id) {
+ super(id);
+}
+
+public void addObject(id object) {
+ OS.objc_msgSend(this.id, OS.sel_addObject_1, object != null ? object.id : 0);
+}
+
+public NSArray allObjects() {
+ int result = OS.objc_msgSend(this.id, OS.sel_allObjects);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public id anyObject() {
+ int result = OS.objc_msgSend(this.id, OS.sel_anyObject);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean containsObject(id anObject) {
+ return OS.objc_msgSend(this.id, OS.sel_containsObject_1, anObject != null ? anObject.id : 0) != 0;
+}
+
+public int count() {
+ return OS.objc_msgSend(this.id, OS.sel_count);
+}
+
+public static id hashTableWithOptions(int options) {
+ int result = OS.objc_msgSend(OS.class_NSHashTable, OS.sel_hashTableWithOptions_1, options);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id hashTableWithWeakObjects() {
+ int result = OS.objc_msgSend(OS.class_NSHashTable, OS.sel_hashTableWithWeakObjects);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithOptions(int options, int initialCapacity) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithOptions_1capacity_1, options, initialCapacity);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithPointerFunctions(NSPointerFunctions functions, int initialCapacity) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithPointerFunctions_1capacity_1, functions != null ? functions.id : 0, initialCapacity);
+ return result != 0 ? new id(result) : null;
+}
+
+public void intersectHashTable(NSHashTable other) {
+ OS.objc_msgSend(this.id, OS.sel_intersectHashTable_1, other != null ? other.id : 0);
+}
+
+public boolean intersectsHashTable(NSHashTable other) {
+ return OS.objc_msgSend(this.id, OS.sel_intersectsHashTable_1, other != null ? other.id : 0) != 0;
+}
+
+public boolean isEqualToHashTable(NSHashTable other) {
+ return OS.objc_msgSend(this.id, OS.sel_isEqualToHashTable_1, other != null ? other.id : 0) != 0;
+}
+
+public boolean isSubsetOfHashTable(NSHashTable other) {
+ return OS.objc_msgSend(this.id, OS.sel_isSubsetOfHashTable_1, other != null ? other.id : 0) != 0;
+}
+
+public id member(id object) {
+ int result = OS.objc_msgSend(this.id, OS.sel_member_1, object != null ? object.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void minusHashTable(NSHashTable other) {
+ OS.objc_msgSend(this.id, OS.sel_minusHashTable_1, other != null ? other.id : 0);
+}
+
+public NSEnumerator objectEnumerator() {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectEnumerator);
+ return result != 0 ? new NSEnumerator(result) : null;
+}
+
+public NSPointerFunctions pointerFunctions() {
+ int result = OS.objc_msgSend(this.id, OS.sel_pointerFunctions);
+ return result != 0 ? new NSPointerFunctions(result) : null;
+}
+
+public void removeAllObjects() {
+ OS.objc_msgSend(this.id, OS.sel_removeAllObjects);
+}
+
+public void removeObject(id object) {
+ OS.objc_msgSend(this.id, OS.sel_removeObject_1, object != null ? object.id : 0);
+}
+
+public NSSet setRepresentation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_setRepresentation);
+ return result != 0 ? new NSSet(result) : null;
+}
+
+public void unionHashTable(NSHashTable other) {
+ OS.objc_msgSend(this.id, OS.sel_unionHashTable_1, other != null ? other.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHashTableCallBacks.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHashTableCallBacks.java
new file mode 100644
index 0000000000..dbd851a6fe
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHashTableCallBacks.java
@@ -0,0 +1,5 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSHashTableCallBacks {
+//TODO
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHelpManager.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHelpManager.java
new file mode 100644
index 0000000000..938332d7ec
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHelpManager.java
@@ -0,0 +1,51 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSHelpManager extends NSObject {
+
+public NSHelpManager() {
+ super();
+}
+
+public NSHelpManager(int id) {
+ super(id);
+}
+
+public NSAttributedString contextHelpForObject(id object) {
+ int result = OS.objc_msgSend(this.id, OS.sel_contextHelpForObject_1, object != null ? object.id : 0);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public void findString(NSString query, NSString book) {
+ OS.objc_msgSend(this.id, OS.sel_findString_1inBook_1, query != null ? query.id : 0, book != null ? book.id : 0);
+}
+
+public static boolean isContextHelpModeActive() {
+ return OS.objc_msgSend(OS.class_NSHelpManager, OS.sel_isContextHelpModeActive) != 0;
+}
+
+public void openHelpAnchor(NSString anchor, NSString book) {
+ OS.objc_msgSend(this.id, OS.sel_openHelpAnchor_1inBook_1, anchor != null ? anchor.id : 0, book != null ? book.id : 0);
+}
+
+public void removeContextHelpForObject(id object) {
+ OS.objc_msgSend(this.id, OS.sel_removeContextHelpForObject_1, object != null ? object.id : 0);
+}
+
+public void setContextHelp(NSAttributedString attrString, id object) {
+ OS.objc_msgSend(this.id, OS.sel_setContextHelp_1forObject_1, attrString != null ? attrString.id : 0, object != null ? object.id : 0);
+}
+
+public static void setContextHelpModeActive(boolean active) {
+ OS.objc_msgSend(OS.class_NSHelpManager, OS.sel_setContextHelpModeActive_1, active);
+}
+
+public static NSHelpManager sharedHelpManager() {
+ int result = OS.objc_msgSend(OS.class_NSHelpManager, OS.sel_sharedHelpManager);
+ return result != 0 ? new NSHelpManager(result) : null;
+}
+
+public boolean showContextHelpForObject(id object, NSPoint pt) {
+ return OS.objc_msgSend(this.id, OS.sel_showContextHelpForObject_1locationHint_1, object != null ? object.id : 0, pt) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHost.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHost.java
new file mode 100644
index 0000000000..4981433ca1
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSHost.java
@@ -0,0 +1,64 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSHost extends NSObject {
+
+public NSHost() {
+ super();
+}
+
+public NSHost(int id) {
+ super(id);
+}
+
+public NSString address() {
+ int result = OS.objc_msgSend(this.id, OS.sel_address);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSArray addresses() {
+ int result = OS.objc_msgSend(this.id, OS.sel_addresses);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSHost currentHost() {
+ int result = OS.objc_msgSend(OS.class_NSHost, OS.sel_currentHost);
+ return result != 0 ? new NSHost(result) : null;
+}
+
+public static void flushHostCache() {
+ OS.objc_msgSend(OS.class_NSHost, OS.sel_flushHostCache);
+}
+
+public static NSHost hostWithAddress(NSString address) {
+ int result = OS.objc_msgSend(OS.class_NSHost, OS.sel_hostWithAddress_1, address != null ? address.id : 0);
+ return result != 0 ? new NSHost(result) : null;
+}
+
+public static NSHost hostWithName(NSString name) {
+ int result = OS.objc_msgSend(OS.class_NSHost, OS.sel_hostWithName_1, name != null ? name.id : 0);
+ return result != 0 ? new NSHost(result) : null;
+}
+
+public boolean isEqualToHost(NSHost aHost) {
+ return OS.objc_msgSend(this.id, OS.sel_isEqualToHost_1, aHost != null ? aHost.id : 0) != 0;
+}
+
+public static boolean isHostCacheEnabled() {
+ return OS.objc_msgSend(OS.class_NSHost, OS.sel_isHostCacheEnabled) != 0;
+}
+
+public NSString name() {
+ int result = OS.objc_msgSend(this.id, OS.sel_name);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSArray names() {
+ int result = OS.objc_msgSend(this.id, OS.sel_names);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static void setHostCacheEnabled(boolean flag) {
+ OS.objc_msgSend(OS.class_NSHost, OS.sel_setHostCacheEnabled_1, flag);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSImage.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSImage.java
new file mode 100644
index 0000000000..fb8b1c7c1c
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSImage.java
@@ -0,0 +1,311 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSImage extends NSObject {
+
+public NSImage() {
+ super();
+}
+
+public NSImage(int id) {
+ super(id);
+}
+
+public NSData TIFFRepresentation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_TIFFRepresentation);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSData TIFFRepresentationUsingCompression(int comp, float aFloat) {
+ int result = OS.objc_msgSend(this.id, OS.sel_TIFFRepresentationUsingCompression_1factor_1, comp, aFloat);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public void addRepresentation(NSImageRep imageRep) {
+ OS.objc_msgSend(this.id, OS.sel_addRepresentation_1, imageRep != null ? imageRep.id : 0);
+}
+
+public void addRepresentations(NSArray imageReps) {
+ OS.objc_msgSend(this.id, OS.sel_addRepresentations_1, imageReps != null ? imageReps.id : 0);
+}
+
+public NSRect alignmentRect() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_alignmentRect);
+ return result;
+}
+
+public NSColor backgroundColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public NSImageRep bestRepresentationForDevice(NSDictionary deviceDescription) {
+ int result = OS.objc_msgSend(this.id, OS.sel_bestRepresentationForDevice_1, deviceDescription != null ? deviceDescription.id : 0);
+ return result != 0 ? new NSImageRep(result) : null;
+}
+
+public boolean cacheDepthMatchesImageDepth() {
+ return OS.objc_msgSend(this.id, OS.sel_cacheDepthMatchesImageDepth) != 0;
+}
+
+public int cacheMode() {
+ return OS.objc_msgSend(this.id, OS.sel_cacheMode);
+}
+
+public static boolean canInitWithPasteboard(NSPasteboard pasteboard) {
+ return OS.objc_msgSend(OS.class_NSImage, OS.sel_canInitWithPasteboard_1, pasteboard != null ? pasteboard.id : 0) != 0;
+}
+
+public void cancelIncrementalLoad() {
+ OS.objc_msgSend(this.id, OS.sel_cancelIncrementalLoad);
+}
+
+public void compositeToPoint_fromRect_operation_(NSPoint point, NSRect rect, int op) {
+ OS.objc_msgSend(this.id, OS.sel_compositeToPoint_1fromRect_1operation_1, point, rect, op);
+}
+
+public void compositeToPoint_fromRect_operation_fraction_(NSPoint point, NSRect rect, int op, float delta) {
+ OS.objc_msgSend(this.id, OS.sel_compositeToPoint_1fromRect_1operation_1fraction_1, point, rect, op, delta);
+}
+
+public void compositeToPoint_operation_(NSPoint point, int op) {
+ OS.objc_msgSend(this.id, OS.sel_compositeToPoint_1operation_1, point, op);
+}
+
+public void compositeToPoint_operation_fraction_(NSPoint point, int op, float delta) {
+ OS.objc_msgSend(this.id, OS.sel_compositeToPoint_1operation_1fraction_1, point, op, delta);
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public void dissolveToPoint_fraction_(NSPoint point, float aFloat) {
+ OS.objc_msgSend(this.id, OS.sel_dissolveToPoint_1fraction_1, point, aFloat);
+}
+
+public void dissolveToPoint_fromRect_fraction_(NSPoint point, NSRect rect, float aFloat) {
+ OS.objc_msgSend(this.id, OS.sel_dissolveToPoint_1fromRect_1fraction_1, point, rect, aFloat);
+}
+
+public void drawAtPoint(NSPoint point, NSRect fromRect, int op, float delta) {
+ OS.objc_msgSend(this.id, OS.sel_drawAtPoint_1fromRect_1operation_1fraction_1, point, fromRect, op, delta);
+}
+
+public void drawInRect(NSRect rect, NSRect fromRect, int op, float delta) {
+ OS.objc_msgSend(this.id, OS.sel_drawInRect_1fromRect_1operation_1fraction_1, rect, fromRect, op, delta);
+}
+
+public boolean drawRepresentation(NSImageRep imageRep, NSRect rect) {
+ return OS.objc_msgSend(this.id, OS.sel_drawRepresentation_1inRect_1, imageRep != null ? imageRep.id : 0, rect) != 0;
+}
+
+public static NSArray imageFileTypes() {
+ int result = OS.objc_msgSend(OS.class_NSImage, OS.sel_imageFileTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static id imageNamed(NSString name) {
+ int result = OS.objc_msgSend(OS.class_NSImage, OS.sel_imageNamed_1, name != null ? name.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static NSArray imagePasteboardTypes() {
+ int result = OS.objc_msgSend(OS.class_NSImage, OS.sel_imagePasteboardTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray imageTypes() {
+ int result = OS.objc_msgSend(OS.class_NSImage, OS.sel_imageTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray imageUnfilteredFileTypes() {
+ int result = OS.objc_msgSend(OS.class_NSImage, OS.sel_imageUnfilteredFileTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray imageUnfilteredPasteboardTypes() {
+ int result = OS.objc_msgSend(OS.class_NSImage, OS.sel_imageUnfilteredPasteboardTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray imageUnfilteredTypes() {
+ int result = OS.objc_msgSend(OS.class_NSImage, OS.sel_imageUnfilteredTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSImage initByReferencingFile(NSString fileName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initByReferencingFile_1, fileName != null ? fileName.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSImage initByReferencingURL(NSURL url) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initByReferencingURL_1, url != null ? url.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSImage initWithContentsOfFile(NSString fileName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfFile_1, fileName != null ? fileName.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSImage initWithContentsOfURL(NSURL url) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1, url != null ? url.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSImage initWithData(NSData data) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithData_1, data != null ? data.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSImage initWithIconRef(int iconRef) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithIconRef_1, iconRef);
+ return result != 0 ? this : null;
+}
+
+public NSImage initWithPasteboard(NSPasteboard pasteboard) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithPasteboard_1, pasteboard != null ? pasteboard.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSImage initWithSize(NSSize aSize) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithSize_1, aSize);
+ return result != 0 ? this : null;
+}
+
+public boolean isCachedSeparately() {
+ return OS.objc_msgSend(this.id, OS.sel_isCachedSeparately) != 0;
+}
+
+public boolean isDataRetained() {
+ return OS.objc_msgSend(this.id, OS.sel_isDataRetained) != 0;
+}
+
+public boolean isFlipped() {
+ return OS.objc_msgSend(this.id, OS.sel_isFlipped) != 0;
+}
+
+public boolean isTemplate() {
+ return OS.objc_msgSend(this.id, OS.sel_isTemplate) != 0;
+}
+
+public boolean isValid() {
+ return OS.objc_msgSend(this.id, OS.sel_isValid) != 0;
+}
+
+public void lockFocus() {
+ OS.objc_msgSend(this.id, OS.sel_lockFocus);
+}
+
+public void lockFocusOnRepresentation(NSImageRep imageRepresentation) {
+ OS.objc_msgSend(this.id, OS.sel_lockFocusOnRepresentation_1, imageRepresentation != null ? imageRepresentation.id : 0);
+}
+
+public boolean matchesOnMultipleResolution() {
+ return OS.objc_msgSend(this.id, OS.sel_matchesOnMultipleResolution) != 0;
+}
+
+public NSString name() {
+ int result = OS.objc_msgSend(this.id, OS.sel_name);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean prefersColorMatch() {
+ return OS.objc_msgSend(this.id, OS.sel_prefersColorMatch) != 0;
+}
+
+public void recache() {
+ OS.objc_msgSend(this.id, OS.sel_recache);
+}
+
+public void removeRepresentation(NSImageRep imageRep) {
+ OS.objc_msgSend(this.id, OS.sel_removeRepresentation_1, imageRep != null ? imageRep.id : 0);
+}
+
+public NSArray representations() {
+ int result = OS.objc_msgSend(this.id, OS.sel_representations);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean scalesWhenResized() {
+ return OS.objc_msgSend(this.id, OS.sel_scalesWhenResized) != 0;
+}
+
+public void setAlignmentRect(NSRect rect) {
+ OS.objc_msgSend(this.id, OS.sel_setAlignmentRect_1, rect);
+}
+
+public void setBackgroundColor(NSColor aColor) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, aColor != null ? aColor.id : 0);
+}
+
+public void setCacheDepthMatchesImageDepth(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setCacheDepthMatchesImageDepth_1, flag);
+}
+
+public void setCacheMode(int mode) {
+ OS.objc_msgSend(this.id, OS.sel_setCacheMode_1, mode);
+}
+
+public void setCachedSeparately(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setCachedSeparately_1, flag);
+}
+
+public void setDataRetained(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setDataRetained_1, flag);
+}
+
+public void setDelegate(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
+}
+
+public void setFlipped(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setFlipped_1, flag);
+}
+
+public void setMatchesOnMultipleResolution(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setMatchesOnMultipleResolution_1, flag);
+}
+
+public boolean setName(NSString string) {
+ return OS.objc_msgSend(this.id, OS.sel_setName_1, string != null ? string.id : 0) != 0;
+}
+
+public void setPrefersColorMatch(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setPrefersColorMatch_1, flag);
+}
+
+public void setScalesWhenResized(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setScalesWhenResized_1, flag);
+}
+
+public void setSize(NSSize aSize) {
+ OS.objc_msgSend(this.id, OS.sel_setSize_1, aSize);
+}
+
+public void setTemplate(boolean isTemplate) {
+ OS.objc_msgSend(this.id, OS.sel_setTemplate_1, isTemplate);
+}
+
+public void setUsesEPSOnResolutionMismatch(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setUsesEPSOnResolutionMismatch_1, flag);
+}
+
+public NSSize size() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_struct(result, this.id, OS.sel_size);
+ return result;
+}
+
+public void unlockFocus() {
+ OS.objc_msgSend(this.id, OS.sel_unlockFocus);
+}
+
+public boolean usesEPSOnResolutionMismatch() {
+ return OS.objc_msgSend(this.id, OS.sel_usesEPSOnResolutionMismatch) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSImageCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSImageCell.java
new file mode 100644
index 0000000000..22cb319fa8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSImageCell.java
@@ -0,0 +1,37 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSImageCell extends NSCell {
+
+public NSImageCell() {
+ super();
+}
+
+public NSImageCell(int id) {
+ super(id);
+}
+
+public int imageAlignment() {
+ return OS.objc_msgSend(this.id, OS.sel_imageAlignment);
+}
+
+public int imageFrameStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_imageFrameStyle);
+}
+
+public int imageScaling() {
+ return OS.objc_msgSend(this.id, OS.sel_imageScaling);
+}
+
+public void setImageAlignment(int newAlign) {
+ OS.objc_msgSend(this.id, OS.sel_setImageAlignment_1, newAlign);
+}
+
+public void setImageFrameStyle(int newStyle) {
+ OS.objc_msgSend(this.id, OS.sel_setImageFrameStyle_1, newStyle);
+}
+
+public void setImageScaling(int newScaling) {
+ OS.objc_msgSend(this.id, OS.sel_setImageScaling_1, newScaling);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSImageRep.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSImageRep.java
new file mode 100644
index 0000000000..a6e1e4b861
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSImageRep.java
@@ -0,0 +1,181 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSImageRep extends NSObject {
+
+public NSImageRep() {
+ super();
+}
+
+public NSImageRep(int id) {
+ super(id);
+}
+
+public int bitsPerSample() {
+ return OS.objc_msgSend(this.id, OS.sel_bitsPerSample);
+}
+
+public static boolean canInitWithData(NSData data) {
+ return OS.objc_msgSend(OS.class_NSImageRep, OS.sel_canInitWithData_1, data != null ? data.id : 0) != 0;
+}
+
+public static boolean canInitWithPasteboard(NSPasteboard pasteboard) {
+ return OS.objc_msgSend(OS.class_NSImageRep, OS.sel_canInitWithPasteboard_1, pasteboard != null ? pasteboard.id : 0) != 0;
+}
+
+public NSString colorSpaceName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_colorSpaceName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean draw() {
+ return OS.objc_msgSend(this.id, OS.sel_draw) != 0;
+}
+
+public boolean drawAtPoint(NSPoint point) {
+ return OS.objc_msgSend(this.id, OS.sel_drawAtPoint_1, point) != 0;
+}
+
+public boolean drawInRect(NSRect rect) {
+ return OS.objc_msgSend(this.id, OS.sel_drawInRect_1, rect) != 0;
+}
+
+public boolean hasAlpha() {
+ return OS.objc_msgSend(this.id, OS.sel_hasAlpha) != 0;
+}
+
+public static NSArray imageFileTypes() {
+ int result = OS.objc_msgSend(OS.class_NSImageRep, OS.sel_imageFileTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray imagePasteboardTypes() {
+ int result = OS.objc_msgSend(OS.class_NSImageRep, OS.sel_imagePasteboardTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static int imageRepClassForData(NSData data) {
+ return OS.objc_msgSend(OS.class_NSImageRep, OS.sel_imageRepClassForData_1, data != null ? data.id : 0);
+}
+
+public static int imageRepClassForFileType(NSString type) {
+ return OS.objc_msgSend(OS.class_NSImageRep, OS.sel_imageRepClassForFileType_1, type != null ? type.id : 0);
+}
+
+public static int imageRepClassForPasteboardType(NSString type) {
+ return OS.objc_msgSend(OS.class_NSImageRep, OS.sel_imageRepClassForPasteboardType_1, type != null ? type.id : 0);
+}
+
+public static int imageRepClassForType(NSString type) {
+ return OS.objc_msgSend(OS.class_NSImageRep, OS.sel_imageRepClassForType_1, type != null ? type.id : 0);
+}
+
+public static id imageRepWithContentsOfFile(NSString filename) {
+ int result = OS.objc_msgSend(OS.class_NSImageRep, OS.sel_imageRepWithContentsOfFile_1, filename != null ? filename.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id imageRepWithContentsOfURL(NSURL url) {
+ int result = OS.objc_msgSend(OS.class_NSImageRep, OS.sel_imageRepWithContentsOfURL_1, url != null ? url.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id imageRepWithPasteboard(NSPasteboard pasteboard) {
+ int result = OS.objc_msgSend(OS.class_NSImageRep, OS.sel_imageRepWithPasteboard_1, pasteboard != null ? pasteboard.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static NSArray imageRepsWithContentsOfFile(NSString filename) {
+ int result = OS.objc_msgSend(OS.class_NSImageRep, OS.sel_imageRepsWithContentsOfFile_1, filename != null ? filename.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray imageRepsWithContentsOfURL(NSURL url) {
+ int result = OS.objc_msgSend(OS.class_NSImageRep, OS.sel_imageRepsWithContentsOfURL_1, url != null ? url.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray imageRepsWithPasteboard(NSPasteboard pasteboard) {
+ int result = OS.objc_msgSend(OS.class_NSImageRep, OS.sel_imageRepsWithPasteboard_1, pasteboard != null ? pasteboard.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray imageTypes() {
+ int result = OS.objc_msgSend(OS.class_NSImageRep, OS.sel_imageTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray imageUnfilteredFileTypes() {
+ int result = OS.objc_msgSend(OS.class_NSImageRep, OS.sel_imageUnfilteredFileTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray imageUnfilteredPasteboardTypes() {
+ int result = OS.objc_msgSend(OS.class_NSImageRep, OS.sel_imageUnfilteredPasteboardTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray imageUnfilteredTypes() {
+ int result = OS.objc_msgSend(OS.class_NSImageRep, OS.sel_imageUnfilteredTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean isOpaque() {
+ return OS.objc_msgSend(this.id, OS.sel_isOpaque) != 0;
+}
+
+public int pixelsHigh() {
+ return OS.objc_msgSend(this.id, OS.sel_pixelsHigh);
+}
+
+public int pixelsWide() {
+ return OS.objc_msgSend(this.id, OS.sel_pixelsWide);
+}
+
+public static void registerImageRepClass(int imageRepClass) {
+ OS.objc_msgSend(OS.class_NSImageRep, OS.sel_registerImageRepClass_1, imageRepClass);
+}
+
+public static NSArray registeredImageRepClasses() {
+ int result = OS.objc_msgSend(OS.class_NSImageRep, OS.sel_registeredImageRepClasses);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void setAlpha(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAlpha_1, flag);
+}
+
+public void setBitsPerSample(int anInt) {
+ OS.objc_msgSend(this.id, OS.sel_setBitsPerSample_1, anInt);
+}
+
+public void setColorSpaceName(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setColorSpaceName_1, string != null ? string.id : 0);
+}
+
+public void setOpaque(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setOpaque_1, flag);
+}
+
+public void setPixelsHigh(int anInt) {
+ OS.objc_msgSend(this.id, OS.sel_setPixelsHigh_1, anInt);
+}
+
+public void setPixelsWide(int anInt) {
+ OS.objc_msgSend(this.id, OS.sel_setPixelsWide_1, anInt);
+}
+
+public void setSize(NSSize aSize) {
+ OS.objc_msgSend(this.id, OS.sel_setSize_1, aSize);
+}
+
+public NSSize size() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_size);
+ return result;
+}
+
+public static void unregisterImageRepClass(int imageRepClass) {
+ OS.objc_msgSend(OS.class_NSImageRep, OS.sel_unregisterImageRepClass_1, imageRepClass);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSImageView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSImageView.java
new file mode 100644
index 0000000000..71f6ce0dc0
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSImageView.java
@@ -0,0 +1,70 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSImageView extends NSControl {
+
+public NSImageView() {
+ super();
+}
+
+public NSImageView(int id) {
+ super(id);
+}
+
+public boolean allowsCutCopyPaste() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsCutCopyPaste) != 0;
+}
+
+public boolean animates() {
+ return OS.objc_msgSend(this.id, OS.sel_animates) != 0;
+}
+
+public NSImage image() {
+ int result = OS.objc_msgSend(this.id, OS.sel_image);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public int imageAlignment() {
+ return OS.objc_msgSend(this.id, OS.sel_imageAlignment);
+}
+
+public int imageFrameStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_imageFrameStyle);
+}
+
+public int imageScaling() {
+ return OS.objc_msgSend(this.id, OS.sel_imageScaling);
+}
+
+public boolean isEditable() {
+ return OS.objc_msgSend(this.id, OS.sel_isEditable) != 0;
+}
+
+public void setAllowsCutCopyPaste(boolean allow) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsCutCopyPaste_1, allow);
+}
+
+public void setAnimates(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAnimates_1, flag);
+}
+
+public void setEditable(boolean yn) {
+ OS.objc_msgSend(this.id, OS.sel_setEditable_1, yn);
+}
+
+public void setImage(NSImage newImage) {
+ OS.objc_msgSend(this.id, OS.sel_setImage_1, newImage != null ? newImage.id : 0);
+}
+
+public void setImageAlignment(int newAlign) {
+ OS.objc_msgSend(this.id, OS.sel_setImageAlignment_1, newAlign);
+}
+
+public void setImageFrameStyle(int newStyle) {
+ OS.objc_msgSend(this.id, OS.sel_setImageFrameStyle_1, newStyle);
+}
+
+public void setImageScaling(int newScaling) {
+ OS.objc_msgSend(this.id, OS.sel_setImageScaling_1, newScaling);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSIndexPath.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSIndexPath.java
new file mode 100644
index 0000000000..bba61afea7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSIndexPath.java
@@ -0,0 +1,59 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSIndexPath extends NSObject {
+
+public NSIndexPath() {
+ super();
+}
+
+public NSIndexPath(int id) {
+ super(id);
+}
+
+public int compare(NSIndexPath otherObject) {
+ return OS.objc_msgSend(this.id, OS.sel_compare_1, otherObject != null ? otherObject.id : 0);
+}
+
+public void getIndexes(int indexes) {
+ OS.objc_msgSend(this.id, OS.sel_getIndexes_1, indexes);
+}
+
+public int indexAtPosition(int position) {
+ return OS.objc_msgSend(this.id, OS.sel_indexAtPosition_1, position);
+}
+
+public NSIndexPath indexPathByAddingIndex(int index) {
+ int result = OS.objc_msgSend(this.id, OS.sel_indexPathByAddingIndex_1, index);
+ return result == this.id ? this : (result != 0 ? new NSIndexPath(result) : null);
+}
+
+public NSIndexPath indexPathByRemovingLastIndex() {
+ int result = OS.objc_msgSend(this.id, OS.sel_indexPathByRemovingLastIndex);
+ return result == this.id ? this : (result != 0 ? new NSIndexPath(result) : null);
+}
+
+public static id indexPathWithIndex(int index) {
+ int result = OS.objc_msgSend(OS.class_NSIndexPath, OS.sel_indexPathWithIndex_1, index);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id indexPathWithIndexes(int indexes, int length) {
+ int result = OS.objc_msgSend(OS.class_NSIndexPath, OS.sel_indexPathWithIndexes_1length_1, indexes, length);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithIndex(int index) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithIndex_1, index);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithIndexes(int indexes, int length) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithIndexes_1length_1, indexes, length);
+ return result != 0 ? new id(result) : null;
+}
+
+public int length() {
+ return OS.objc_msgSend(this.id, OS.sel_length);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSIndexSet.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSIndexSet.java
new file mode 100644
index 0000000000..9dc38ca1fa
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSIndexSet.java
@@ -0,0 +1,99 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSIndexSet extends NSObject {
+
+public NSIndexSet() {
+ super();
+}
+
+public NSIndexSet(int id) {
+ super(id);
+}
+
+public boolean containsIndex(int value) {
+ return OS.objc_msgSend(this.id, OS.sel_containsIndex_1, value) != 0;
+}
+
+public boolean containsIndexes(NSIndexSet indexSet) {
+ return OS.objc_msgSend(this.id, OS.sel_containsIndexes_1, indexSet != null ? indexSet.id : 0) != 0;
+}
+
+public boolean containsIndexesInRange(NSRange range) {
+ return OS.objc_msgSend(this.id, OS.sel_containsIndexesInRange_1, range) != 0;
+}
+
+public int count() {
+ return OS.objc_msgSend(this.id, OS.sel_count);
+}
+
+public int countOfIndexesInRange(NSRange range) {
+ return OS.objc_msgSend(this.id, OS.sel_countOfIndexesInRange_1, range);
+}
+
+public int firstIndex() {
+ return OS.objc_msgSend(this.id, OS.sel_firstIndex);
+}
+
+public int getIndexes(int [] indexBuffer, int bufferSize, int range) {
+ return OS.objc_msgSend(this.id, OS.sel_getIndexes_1maxCount_1inIndexRange_1, indexBuffer, bufferSize, range);
+}
+
+public int indexGreaterThanIndex(int value) {
+ return OS.objc_msgSend(this.id, OS.sel_indexGreaterThanIndex_1, value);
+}
+
+public int indexGreaterThanOrEqualToIndex(int value) {
+ return OS.objc_msgSend(this.id, OS.sel_indexGreaterThanOrEqualToIndex_1, value);
+}
+
+public int indexLessThanIndex(int value) {
+ return OS.objc_msgSend(this.id, OS.sel_indexLessThanIndex_1, value);
+}
+
+public int indexLessThanOrEqualToIndex(int value) {
+ return OS.objc_msgSend(this.id, OS.sel_indexLessThanOrEqualToIndex_1, value);
+}
+
+public static id indexSet() {
+ int result = OS.objc_msgSend(OS.class_NSIndexSet, OS.sel_indexSet);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id indexSetWithIndex(int value) {
+ int result = OS.objc_msgSend(OS.class_NSIndexSet, OS.sel_indexSetWithIndex_1, value);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id indexSetWithIndexesInRange(NSRange range) {
+ int result = OS.objc_msgSend(OS.class_NSIndexSet, OS.sel_indexSetWithIndexesInRange_1, range);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithIndex(int value) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithIndex_1, value);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithIndexSet(NSIndexSet indexSet) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithIndexSet_1, indexSet != null ? indexSet.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithIndexesInRange(NSRange range) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithIndexesInRange_1, range);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean intersectsIndexesInRange(NSRange range) {
+ return OS.objc_msgSend(this.id, OS.sel_intersectsIndexesInRange_1, range) != 0;
+}
+
+public boolean isEqualToIndexSet(NSIndexSet indexSet) {
+ return OS.objc_msgSend(this.id, OS.sel_isEqualToIndexSet_1, indexSet != null ? indexSet.id : 0) != 0;
+}
+
+public int lastIndex() {
+ return OS.objc_msgSend(this.id, OS.sel_lastIndex);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSIndexSpecifier.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSIndexSpecifier.java
new file mode 100644
index 0000000000..95c21ca7e8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSIndexSpecifier.java
@@ -0,0 +1,26 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSIndexSpecifier extends NSScriptObjectSpecifier {
+
+public NSIndexSpecifier() {
+ super();
+}
+
+public NSIndexSpecifier(int id) {
+ super(id);
+}
+
+public int index() {
+ return OS.objc_msgSend(this.id, OS.sel_index);
+}
+
+public id initWithContainerClassDescription(NSScriptClassDescription classDesc, NSScriptObjectSpecifier container, NSString property, int index) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContainerClassDescription_1containerSpecifier_1key_1index_1, classDesc != null ? classDesc.id : 0, container != null ? container.id : 0, property != null ? property.id : 0, index);
+ return result != 0 ? new id(result) : null;
+}
+
+public void setIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_setIndex_1, index);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInputManager.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInputManager.java
new file mode 100644
index 0000000000..75eb9ea612
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInputManager.java
@@ -0,0 +1,75 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSInputManager extends NSObject {
+
+public NSInputManager() {
+ super();
+}
+
+public NSInputManager(int id) {
+ super(id);
+}
+
+public static NSInputManager currentInputManager() {
+ int result = OS.objc_msgSend(OS.class_NSInputManager, OS.sel_currentInputManager);
+ return result != 0 ? new NSInputManager(result) : null;
+}
+
+public static void cycleToNextInputLanguage(id sender) {
+ OS.objc_msgSend(OS.class_NSInputManager, OS.sel_cycleToNextInputLanguage_1, sender != null ? sender.id : 0);
+}
+
+public static void cycleToNextInputServerInLanguage(id sender) {
+ OS.objc_msgSend(OS.class_NSInputManager, OS.sel_cycleToNextInputServerInLanguage_1, sender != null ? sender.id : 0);
+}
+
+public boolean handleMouseEvent(NSEvent theMouseEvent) {
+ return OS.objc_msgSend(this.id, OS.sel_handleMouseEvent_1, theMouseEvent != null ? theMouseEvent.id : 0) != 0;
+}
+
+public NSImage image() {
+ int result = OS.objc_msgSend(this.id, OS.sel_image);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public NSInputManager initWithName(NSString inputServerName, NSString hostName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithName_1host_1, inputServerName != null ? inputServerName.id : 0, hostName != null ? hostName.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSInputManager(result) : null);
+}
+
+public NSString language() {
+ int result = OS.objc_msgSend(this.id, OS.sel_language);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString localizedInputManagerName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_localizedInputManagerName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void markedTextAbandoned(id cli) {
+ OS.objc_msgSend(this.id, OS.sel_markedTextAbandoned_1, cli != null ? cli.id : 0);
+}
+
+public void markedTextSelectionChanged(NSRange newSel, id cli) {
+ OS.objc_msgSend(this.id, OS.sel_markedTextSelectionChanged_1client_1, newSel, cli != null ? cli.id : 0);
+}
+
+public NSInputServer server() {
+ int result = OS.objc_msgSend(this.id, OS.sel_server);
+ return result != 0 ? new NSInputServer(result) : null;
+}
+
+public boolean wantsToDelayTextChangeNotifications() {
+ return OS.objc_msgSend(this.id, OS.sel_wantsToDelayTextChangeNotifications) != 0;
+}
+
+public boolean wantsToHandleMouseEvents() {
+ return OS.objc_msgSend(this.id, OS.sel_wantsToHandleMouseEvents) != 0;
+}
+
+public boolean wantsToInterpretAllKeystrokes() {
+ return OS.objc_msgSend(this.id, OS.sel_wantsToInterpretAllKeystrokes) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInputServer.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInputServer.java
new file mode 100644
index 0000000000..de50caf340
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInputServer.java
@@ -0,0 +1,18 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSInputServer extends NSObject {
+
+public NSInputServer() {
+ super();
+}
+
+public NSInputServer(int id) {
+ super(id);
+}
+
+public id initWithDelegate(id aDelegate, NSString name) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithDelegate_1name_1, aDelegate != null ? aDelegate.id : 0, name != null ? name.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInputStream.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInputStream.java
new file mode 100644
index 0000000000..96c278742b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInputStream.java
@@ -0,0 +1,45 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSInputStream extends NSStream {
+
+public NSInputStream() {
+ super();
+}
+
+public NSInputStream(int id) {
+ super(id);
+}
+
+public boolean getBuffer(int buffer, int len) {
+ return OS.objc_msgSend(this.id, OS.sel_getBuffer_1length_1, buffer, len) != 0;
+}
+
+public boolean hasBytesAvailable() {
+ return OS.objc_msgSend(this.id, OS.sel_hasBytesAvailable) != 0;
+}
+
+public id initWithData(NSData data) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithData_1, data != null ? data.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithFileAtPath(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFileAtPath_1, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id inputStreamWithData(NSData data) {
+ int result = OS.objc_msgSend(OS.class_NSInputStream, OS.sel_inputStreamWithData_1, data != null ? data.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id inputStreamWithFileAtPath(NSString path) {
+ int result = OS.objc_msgSend(OS.class_NSInputStream, OS.sel_inputStreamWithFileAtPath_1, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public int read(int buffer, int len) {
+ return OS.objc_msgSend(this.id, OS.sel_read_1maxLength_1, buffer, len);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInvocation.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInvocation.java
new file mode 100644
index 0000000000..abe1d990f6
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInvocation.java
@@ -0,0 +1,72 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSInvocation extends NSObject {
+
+public NSInvocation() {
+ super();
+}
+
+public NSInvocation(int id) {
+ super(id);
+}
+
+public boolean argumentsRetained() {
+ return OS.objc_msgSend(this.id, OS.sel_argumentsRetained) != 0;
+}
+
+public void getArgument(int argumentLocation, int idx) {
+ OS.objc_msgSend(this.id, OS.sel_getArgument_1atIndex_1, argumentLocation, idx);
+}
+
+public void getReturnValue(int retLoc) {
+ OS.objc_msgSend(this.id, OS.sel_getReturnValue_1, retLoc);
+}
+
+public static NSInvocation invocationWithMethodSignature(NSMethodSignature sig) {
+ int result = OS.objc_msgSend(OS.class_NSInvocation, OS.sel_invocationWithMethodSignature_1, sig != null ? sig.id : 0);
+ return result != 0 ? new NSInvocation(result) : null;
+}
+
+public void invoke() {
+ OS.objc_msgSend(this.id, OS.sel_invoke);
+}
+
+public void invokeWithTarget(id target) {
+ OS.objc_msgSend(this.id, OS.sel_invokeWithTarget_1, target != null ? target.id : 0);
+}
+
+public NSMethodSignature methodSignature() {
+ int result = OS.objc_msgSend(this.id, OS.sel_methodSignature);
+ return result != 0 ? new NSMethodSignature(result) : null;
+}
+
+public void retainArguments() {
+ OS.objc_msgSend(this.id, OS.sel_retainArguments);
+}
+
+public int selector() {
+ return OS.objc_msgSend(this.id, OS.sel_selector);
+}
+
+public void setArgument(int argumentLocation, int idx) {
+ OS.objc_msgSend(this.id, OS.sel_setArgument_1atIndex_1, argumentLocation, idx);
+}
+
+public void setReturnValue(int retLoc) {
+ OS.objc_msgSend(this.id, OS.sel_setReturnValue_1, retLoc);
+}
+
+public void setSelector(int selector) {
+ OS.objc_msgSend(this.id, OS.sel_setSelector_1, selector);
+}
+
+public void setTarget(id target) {
+ OS.objc_msgSend(this.id, OS.sel_setTarget_1, target != null ? target.id : 0);
+}
+
+public id target() {
+ int result = OS.objc_msgSend(this.id, OS.sel_target);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInvocationOperation.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInvocationOperation.java
new file mode 100644
index 0000000000..a9316b8256
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSInvocationOperation.java
@@ -0,0 +1,33 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSInvocationOperation extends NSOperation {
+
+public NSInvocationOperation() {
+ super();
+}
+
+public NSInvocationOperation(int id) {
+ super(id);
+}
+
+public id initWithInvocation(NSInvocation inv) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithInvocation_1, inv != null ? inv.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithTarget(id target, int sel, id arg) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithTarget_1selector_1object_1, target != null ? target.id : 0, sel, arg != null ? arg.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSInvocation invocation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_invocation);
+ return result != 0 ? new NSInvocation(result) : null;
+}
+
+public id result() {
+ int result = OS.objc_msgSend(this.id, OS.sel_result);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSKeyedArchiver.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSKeyedArchiver.java
new file mode 100644
index 0000000000..6bf278d83b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSKeyedArchiver.java
@@ -0,0 +1,102 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSKeyedArchiver extends NSCoder {
+
+public NSKeyedArchiver() {
+ super();
+}
+
+public NSKeyedArchiver(int id) {
+ super(id);
+}
+
+public static boolean archiveRootObject(id rootObject, NSString path) {
+ return OS.objc_msgSend(OS.class_NSKeyedArchiver, OS.sel_archiveRootObject_1toFile_1, rootObject != null ? rootObject.id : 0, path != null ? path.id : 0) != 0;
+}
+
+public static NSData archivedDataWithRootObject(id rootObject) {
+ int result = OS.objc_msgSend(OS.class_NSKeyedArchiver, OS.sel_archivedDataWithRootObject_1, rootObject != null ? rootObject.id : 0);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSString classNameForClass_(int cls) {
+ int result = OS.objc_msgSend(this.id, OS.sel_classNameForClass_1, cls);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSString static_classNameForClass_(int cls) {
+ int result = OS.objc_msgSend(OS.class_NSKeyedArchiver, OS.sel_classNameForClass_1, cls);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public void encodeBool(boolean boolv, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeBool_1forKey_1, boolv, key != null ? key.id : 0);
+}
+
+public void encodeBytes(int bytesp, int lenv, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeBytes_1length_1forKey_1, bytesp, lenv, key != null ? key.id : 0);
+}
+
+public void encodeConditionalObject(id objv, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeConditionalObject_1forKey_1, objv != null ? objv.id : 0, key != null ? key.id : 0);
+}
+
+public void encodeDouble(double realv, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeDouble_1forKey_1, realv, key != null ? key.id : 0);
+}
+
+public void encodeFloat(float realv, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeFloat_1forKey_1, realv, key != null ? key.id : 0);
+}
+
+public void encodeInt32(int intv, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeInt32_1forKey_1, intv, key != null ? key.id : 0);
+}
+
+public void encodeInt64(long intv, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeInt64_1forKey_1, intv, key != null ? key.id : 0);
+}
+
+public void encodeInt(int intv, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeInt_1forKey_1, intv, key != null ? key.id : 0);
+}
+
+public void encodeObject(id objv, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_encodeObject_1forKey_1, objv != null ? objv.id : 0, key != null ? key.id : 0);
+}
+
+public void finishEncoding() {
+ OS.objc_msgSend(this.id, OS.sel_finishEncoding);
+}
+
+public id initForWritingWithMutableData(NSMutableData data) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initForWritingWithMutableData_1, data != null ? data.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public int outputFormat() {
+ return OS.objc_msgSend(this.id, OS.sel_outputFormat);
+}
+
+public static void static_setClassName_forClass_(NSString codedName, int cls) {
+ OS.objc_msgSend(OS.class_NSKeyedArchiver, OS.sel_setClassName_1forClass_1, codedName != null ? codedName.id : 0, cls);
+}
+
+public void setClassName_forClass_(NSString codedName, int cls) {
+ OS.objc_msgSend(this.id, OS.sel_setClassName_1forClass_1, codedName != null ? codedName.id : 0, cls);
+}
+
+public void setDelegate(id delegate) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegate != null ? delegate.id : 0);
+}
+
+public void setOutputFormat(int format) {
+ OS.objc_msgSend(this.id, OS.sel_setOutputFormat_1, format);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSKeyedUnarchiver.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSKeyedUnarchiver.java
new file mode 100644
index 0000000000..3218fc9a99
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSKeyedUnarchiver.java
@@ -0,0 +1,94 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSKeyedUnarchiver extends NSCoder {
+
+public NSKeyedUnarchiver() {
+ super();
+}
+
+public NSKeyedUnarchiver(int id) {
+ super(id);
+}
+
+public int classForClassName_(NSString codedName) {
+ return OS.objc_msgSend(this.id, OS.sel_classForClassName_1, codedName != null ? codedName.id : 0);
+}
+
+public static int static_classForClassName_(NSString codedName) {
+ return OS.objc_msgSend(OS.class_NSKeyedUnarchiver, OS.sel_classForClassName_1, codedName != null ? codedName.id : 0);
+}
+
+public boolean containsValueForKey(NSString key) {
+ return OS.objc_msgSend(this.id, OS.sel_containsValueForKey_1, key != null ? key.id : 0) != 0;
+}
+
+public boolean decodeBoolForKey(NSString key) {
+ return OS.objc_msgSend(this.id, OS.sel_decodeBoolForKey_1, key != null ? key.id : 0) != 0;
+}
+
+public int decodeBytesForKey(NSString key, int lengthp) {
+ return OS.objc_msgSend(this.id, OS.sel_decodeBytesForKey_1returnedLength_1, key != null ? key.id : 0, lengthp);
+}
+
+public double decodeDoubleForKey(NSString key) {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_decodeDoubleForKey_1, key != null ? key.id : 0);
+}
+
+public float decodeFloatForKey(NSString key) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_decodeFloatForKey_1, key != null ? key.id : 0);
+}
+
+public int decodeInt32ForKey(NSString key) {
+ return OS.objc_msgSend(this.id, OS.sel_decodeInt32ForKey_1, key != null ? key.id : 0);
+}
+
+public long decodeInt64ForKey(NSString key) {
+ return (long)OS.objc_msgSend(this.id, OS.sel_decodeInt64ForKey_1, key != null ? key.id : 0);
+}
+
+public int decodeIntForKey(NSString key) {
+ return OS.objc_msgSend(this.id, OS.sel_decodeIntForKey_1, key != null ? key.id : 0);
+}
+
+public id decodeObjectForKey(NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_decodeObjectForKey_1, key != null ? key.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public void finishDecoding() {
+ OS.objc_msgSend(this.id, OS.sel_finishDecoding);
+}
+
+public id initForReadingWithData(NSData data) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initForReadingWithData_1, data != null ? data.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void setClass_forClassName_(int cls, NSString codedName) {
+ OS.objc_msgSend(this.id, OS.sel_setClass_1forClassName_1, cls, codedName != null ? codedName.id : 0);
+}
+
+public static void static_setClass_forClassName_(int cls, NSString codedName) {
+ OS.objc_msgSend(OS.class_NSKeyedUnarchiver, OS.sel_setClass_1forClassName_1, cls, codedName != null ? codedName.id : 0);
+}
+
+public void setDelegate(id delegate) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegate != null ? delegate.id : 0);
+}
+
+public static id unarchiveObjectWithData(NSData data) {
+ int result = OS.objc_msgSend(OS.class_NSKeyedUnarchiver, OS.sel_unarchiveObjectWithData_1, data != null ? data.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id unarchiveObjectWithFile(NSString path) {
+ int result = OS.objc_msgSend(OS.class_NSKeyedUnarchiver, OS.sel_unarchiveObjectWithFile_1, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLayoutManager.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLayoutManager.java
new file mode 100644
index 0000000000..b5828b83bd
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLayoutManager.java
@@ -0,0 +1,603 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSLayoutManager extends NSObject {
+
+public NSLayoutManager() {
+ super();
+}
+
+public NSLayoutManager(int id) {
+ super(id);
+}
+
+public void addTemporaryAttribute(NSString attrName, id value, NSRange charRange) {
+ OS.objc_msgSend(this.id, OS.sel_addTemporaryAttribute_1value_1forCharacterRange_1, attrName != null ? attrName.id : 0, value != null ? value.id : 0, charRange);
+}
+
+public void addTemporaryAttributes(NSDictionary attrs, NSRange charRange) {
+ OS.objc_msgSend(this.id, OS.sel_addTemporaryAttributes_1forCharacterRange_1, attrs != null ? attrs.id : 0, charRange);
+}
+
+public void addTextContainer(NSTextContainer container) {
+ OS.objc_msgSend(this.id, OS.sel_addTextContainer_1, container != null ? container.id : 0);
+}
+
+public boolean allowsNonContiguousLayout() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsNonContiguousLayout) != 0;
+}
+
+public NSSize attachmentSizeForGlyphAtIndex(int glyphIndex) {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_attachmentSizeForGlyphAtIndex_1, glyphIndex);
+ return result;
+}
+
+public NSAttributedString attributedString() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributedString);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public boolean backgroundLayoutEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_backgroundLayoutEnabled) != 0;
+}
+
+public NSRect boundingRectForGlyphRange(NSRange glyphRange, NSTextContainer container) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_boundingRectForGlyphRange_1inTextContainer_1, glyphRange, container != null ? container.id : 0);
+ return result;
+}
+
+public NSRect boundsRectForTextBlock_atIndex_effectiveRange_(NSTextBlock block, int glyphIndex, int effectiveGlyphRange) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_boundsRectForTextBlock_1atIndex_1effectiveRange_1, block != null ? block.id : 0, glyphIndex, effectiveGlyphRange);
+ return result;
+}
+
+public NSRect boundsRectForTextBlock_glyphRange_(NSTextBlock block, NSRange glyphRange) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_boundsRectForTextBlock_1glyphRange_1, block != null ? block.id : 0, glyphRange);
+ return result;
+}
+
+public int characterIndexForGlyphAtIndex(int glyphIndex) {
+ return OS.objc_msgSend(this.id, OS.sel_characterIndexForGlyphAtIndex_1, glyphIndex);
+}
+
+public NSRange characterRangeForGlyphRange(NSRange glyphRange, int actualGlyphRange) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_characterRangeForGlyphRange_1actualGlyphRange_1, glyphRange, actualGlyphRange);
+ return result;
+}
+
+public int defaultAttachmentScaling() {
+ return OS.objc_msgSend(this.id, OS.sel_defaultAttachmentScaling);
+}
+
+public float defaultBaselineOffsetForFont(NSFont theFont) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_defaultBaselineOffsetForFont_1, theFont != null ? theFont.id : 0);
+}
+
+public float defaultLineHeightForFont(NSFont theFont) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_defaultLineHeightForFont_1, theFont != null ? theFont.id : 0);
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public void deleteGlyphsInRange(NSRange glyphRange) {
+ OS.objc_msgSend(this.id, OS.sel_deleteGlyphsInRange_1, glyphRange);
+}
+
+public void drawBackgroundForGlyphRange(NSRange glyphsToShow, NSPoint origin) {
+ OS.objc_msgSend(this.id, OS.sel_drawBackgroundForGlyphRange_1atPoint_1, glyphsToShow, origin);
+}
+
+public void drawGlyphsForGlyphRange(NSRange glyphsToShow, NSPoint origin) {
+ OS.objc_msgSend(this.id, OS.sel_drawGlyphsForGlyphRange_1atPoint_1, glyphsToShow, origin);
+}
+
+public void drawStrikethroughForGlyphRange(NSRange glyphRange, int strikethroughVal, float baselineOffset, NSRect lineRect, NSRange lineGlyphRange, NSPoint containerOrigin) {
+ OS.objc_msgSend(this.id, OS.sel_drawStrikethroughForGlyphRange_1strikethroughType_1baselineOffset_1lineFragmentRect_1lineFragmentGlyphRange_1containerOrigin_1, glyphRange, strikethroughVal, baselineOffset, lineRect, lineGlyphRange, containerOrigin);
+}
+
+public void drawUnderlineForGlyphRange(NSRange glyphRange, int underlineVal, float baselineOffset, NSRect lineRect, NSRange lineGlyphRange, NSPoint containerOrigin) {
+ OS.objc_msgSend(this.id, OS.sel_drawUnderlineForGlyphRange_1underlineType_1baselineOffset_1lineFragmentRect_1lineFragmentGlyphRange_1containerOrigin_1, glyphRange, underlineVal, baselineOffset, lineRect, lineGlyphRange, containerOrigin);
+}
+
+public boolean drawsOutsideLineFragmentForGlyphAtIndex(int glyphIndex) {
+ return OS.objc_msgSend(this.id, OS.sel_drawsOutsideLineFragmentForGlyphAtIndex_1, glyphIndex) != 0;
+}
+
+public void ensureGlyphsForCharacterRange(NSRange charRange) {
+ OS.objc_msgSend(this.id, OS.sel_ensureGlyphsForCharacterRange_1, charRange);
+}
+
+public void ensureGlyphsForGlyphRange(NSRange glyphRange) {
+ OS.objc_msgSend(this.id, OS.sel_ensureGlyphsForGlyphRange_1, glyphRange);
+}
+
+public void ensureLayoutForBoundingRect(NSRect bounds, NSTextContainer container) {
+ OS.objc_msgSend(this.id, OS.sel_ensureLayoutForBoundingRect_1inTextContainer_1, bounds, container != null ? container.id : 0);
+}
+
+public void ensureLayoutForCharacterRange(NSRange charRange) {
+ OS.objc_msgSend(this.id, OS.sel_ensureLayoutForCharacterRange_1, charRange);
+}
+
+public void ensureLayoutForGlyphRange(NSRange glyphRange) {
+ OS.objc_msgSend(this.id, OS.sel_ensureLayoutForGlyphRange_1, glyphRange);
+}
+
+public void ensureLayoutForTextContainer(NSTextContainer container) {
+ OS.objc_msgSend(this.id, OS.sel_ensureLayoutForTextContainer_1, container != null ? container.id : 0);
+}
+
+public NSRect extraLineFragmentRect() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_extraLineFragmentRect);
+ return result;
+}
+
+public NSTextContainer extraLineFragmentTextContainer() {
+ int result = OS.objc_msgSend(this.id, OS.sel_extraLineFragmentTextContainer);
+ return result != 0 ? new NSTextContainer(result) : null;
+}
+
+public NSRect extraLineFragmentUsedRect() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_extraLineFragmentUsedRect);
+ return result;
+}
+
+public NSTextView firstTextView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_firstTextView);
+ return result != 0 ? new NSTextView(result) : null;
+}
+
+public int firstUnlaidCharacterIndex() {
+ return OS.objc_msgSend(this.id, OS.sel_firstUnlaidCharacterIndex);
+}
+
+public int firstUnlaidGlyphIndex() {
+ return OS.objc_msgSend(this.id, OS.sel_firstUnlaidGlyphIndex);
+}
+
+public float fractionOfDistanceThroughGlyphForPoint(NSPoint point, NSTextContainer container) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_fractionOfDistanceThroughGlyphForPoint_1inTextContainer_1, point, container != null ? container.id : 0);
+}
+
+public void getFirstUnlaidCharacterIndex(int charIndex, int glyphIndex) {
+ OS.objc_msgSend(this.id, OS.sel_getFirstUnlaidCharacterIndex_1glyphIndex_1, charIndex, glyphIndex);
+}
+
+public int getGlyphs(int glyphArray, NSRange glyphRange) {
+ return OS.objc_msgSend(this.id, OS.sel_getGlyphs_1range_1, glyphArray, glyphRange);
+}
+
+public int getGlyphsInRange_glyphs_characterIndexes_glyphInscriptions_elasticBits_(NSRange glyphRange, int glyphBuffer, int charIndexBuffer, int inscribeBuffer, int elasticBuffer) {
+ return OS.objc_msgSend(this.id, OS.sel_getGlyphsInRange_1glyphs_1characterIndexes_1glyphInscriptions_1elasticBits_1, glyphRange, glyphBuffer, charIndexBuffer, inscribeBuffer, elasticBuffer);
+}
+
+public int getGlyphsInRange_glyphs_characterIndexes_glyphInscriptions_elasticBits_bidiLevels_(NSRange glyphRange, int glyphBuffer, int charIndexBuffer, int inscribeBuffer, int elasticBuffer, int bidiLevelBuffer) {
+ return OS.objc_msgSend(this.id, OS.sel_getGlyphsInRange_1glyphs_1characterIndexes_1glyphInscriptions_1elasticBits_1bidiLevels_1, glyphRange, glyphBuffer, charIndexBuffer, inscribeBuffer, elasticBuffer, bidiLevelBuffer);
+}
+
+public int getLineFragmentInsertionPointsForCharacterAtIndex(int charIndex, boolean aFlag, boolean dFlag, int positions, int charIndexes) {
+ return OS.objc_msgSend(this.id, OS.sel_getLineFragmentInsertionPointsForCharacterAtIndex_1alternatePositions_1inDisplayOrder_1positions_1characterIndexes_1, charIndex, aFlag, dFlag, positions, charIndexes);
+}
+
+public int glyphAtIndex_(int glyphIndex) {
+ return OS.objc_msgSend(this.id, OS.sel_glyphAtIndex_1, glyphIndex);
+}
+
+public int glyphAtIndex_isValidIndex_(int glyphIndex, int isValidIndex) {
+ return OS.objc_msgSend(this.id, OS.sel_glyphAtIndex_1isValidIndex_1, glyphIndex, isValidIndex);
+}
+
+public NSGlyphGenerator glyphGenerator() {
+ int result = OS.objc_msgSend(this.id, OS.sel_glyphGenerator);
+ return result != 0 ? new NSGlyphGenerator(result) : null;
+}
+
+public int glyphIndexForCharacterAtIndex(int charIndex) {
+ return OS.objc_msgSend(this.id, OS.sel_glyphIndexForCharacterAtIndex_1, charIndex);
+}
+
+public int glyphIndexForPoint_inTextContainer_(NSPoint point, NSTextContainer container) {
+ return OS.objc_msgSend(this.id, OS.sel_glyphIndexForPoint_1inTextContainer_1, point, container != null ? container.id : 0);
+}
+
+public int glyphIndexForPoint_inTextContainer_fractionOfDistanceThroughGlyph_(NSPoint point, NSTextContainer container, int partialFraction) {
+ return OS.objc_msgSend(this.id, OS.sel_glyphIndexForPoint_1inTextContainer_1fractionOfDistanceThroughGlyph_1, point, container != null ? container.id : 0, partialFraction);
+}
+
+public NSRange glyphRangeForBoundingRect(NSRect bounds, NSTextContainer container) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_glyphRangeForBoundingRect_1inTextContainer_1, bounds, container != null ? container.id : 0);
+ return result;
+}
+
+public NSRange glyphRangeForBoundingRectWithoutAdditionalLayout(NSRect bounds, NSTextContainer container) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_glyphRangeForBoundingRectWithoutAdditionalLayout_1inTextContainer_1, bounds, container != null ? container.id : 0);
+ return result;
+}
+
+public NSRange glyphRangeForCharacterRange(NSRange charRange, int actualCharRange) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_struct(result, this.id, OS.sel_glyphRangeForCharacterRange_1actualCharacterRange_1, charRange, actualCharRange);
+ return result;
+}
+
+public NSRange glyphRangeForTextContainer(NSTextContainer container) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_struct(result, this.id, OS.sel_glyphRangeForTextContainer_1, container != null ? container.id : 0);
+ return result;
+}
+
+public boolean hasNonContiguousLayout() {
+ return OS.objc_msgSend(this.id, OS.sel_hasNonContiguousLayout) != 0;
+}
+
+public float hyphenationFactor() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_hyphenationFactor);
+}
+
+public void insertGlyph(int glyph, int glyphIndex, int charIndex) {
+ OS.objc_msgSend(this.id, OS.sel_insertGlyph_1atGlyphIndex_1characterIndex_1, glyph, glyphIndex, charIndex);
+}
+
+public void insertGlyphs(int glyphs, int length, int glyphIndex, int charIndex) {
+ OS.objc_msgSend(this.id, OS.sel_insertGlyphs_1length_1forStartingGlyphAtIndex_1characterIndex_1, glyphs, length, glyphIndex, charIndex);
+}
+
+public void insertTextContainer(NSTextContainer container, int index) {
+ OS.objc_msgSend(this.id, OS.sel_insertTextContainer_1atIndex_1, container != null ? container.id : 0, index);
+}
+
+public int intAttribute(int attributeTag, int glyphIndex) {
+ return OS.objc_msgSend(this.id, OS.sel_intAttribute_1forGlyphAtIndex_1, attributeTag, glyphIndex);
+}
+
+public void invalidateDisplayForCharacterRange(NSRange charRange) {
+ OS.objc_msgSend(this.id, OS.sel_invalidateDisplayForCharacterRange_1, charRange);
+}
+
+public void invalidateDisplayForGlyphRange(NSRange glyphRange) {
+ OS.objc_msgSend(this.id, OS.sel_invalidateDisplayForGlyphRange_1, glyphRange);
+}
+
+public void invalidateGlyphsForCharacterRange(NSRange charRange, int delta, int actualCharRange) {
+ OS.objc_msgSend(this.id, OS.sel_invalidateGlyphsForCharacterRange_1changeInLength_1actualCharacterRange_1, charRange, delta, actualCharRange);
+}
+
+public void invalidateGlyphsOnLayoutInvalidationForGlyphRange(NSRange glyphRange) {
+ OS.objc_msgSend(this.id, OS.sel_invalidateGlyphsOnLayoutInvalidationForGlyphRange_1, glyphRange);
+}
+
+public void invalidateLayoutForCharacterRange_actualCharacterRange_(NSRange charRange, int actualCharRange) {
+ OS.objc_msgSend(this.id, OS.sel_invalidateLayoutForCharacterRange_1actualCharacterRange_1, charRange, actualCharRange);
+}
+
+public void invalidateLayoutForCharacterRange_isSoft_actualCharacterRange_(NSRange charRange, boolean flag, int actualCharRange) {
+ OS.objc_msgSend(this.id, OS.sel_invalidateLayoutForCharacterRange_1isSoft_1actualCharacterRange_1, charRange, flag, actualCharRange);
+}
+
+public boolean isValidGlyphIndex(int glyphIndex) {
+ return OS.objc_msgSend(this.id, OS.sel_isValidGlyphIndex_1, glyphIndex) != 0;
+}
+
+public boolean layoutManagerOwnsFirstResponderInWindow(NSWindow window) {
+ return OS.objc_msgSend(this.id, OS.sel_layoutManagerOwnsFirstResponderInWindow_1, window != null ? window.id : 0) != 0;
+}
+
+public int layoutOptions() {
+ return OS.objc_msgSend(this.id, OS.sel_layoutOptions);
+}
+
+public NSRect layoutRectForTextBlock_atIndex_effectiveRange_(NSTextBlock block, int glyphIndex, int effectiveGlyphRange) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_layoutRectForTextBlock_1atIndex_1effectiveRange_1, block != null ? block.id : 0, glyphIndex, effectiveGlyphRange);
+ return result;
+}
+
+public NSRect layoutRectForTextBlock_glyphRange_(NSTextBlock block, NSRange glyphRange) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_layoutRectForTextBlock_1glyphRange_1, block != null ? block.id : 0, glyphRange);
+ return result;
+}
+
+public NSRect lineFragmentRectForGlyphAtIndex_effectiveRange_(int glyphIndex, int effectiveGlyphRange) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_lineFragmentRectForGlyphAtIndex_1effectiveRange_1, glyphIndex, effectiveGlyphRange);
+ return result;
+}
+
+public NSRect lineFragmentRectForGlyphAtIndex_effectiveRange_withoutAdditionalLayout_(int glyphIndex, int effectiveGlyphRange, boolean flag) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_lineFragmentRectForGlyphAtIndex_1effectiveRange_1withoutAdditionalLayout_1, glyphIndex, effectiveGlyphRange, flag);
+ return result;
+}
+
+public NSRect lineFragmentUsedRectForGlyphAtIndex_effectiveRange_(int glyphIndex, int effectiveGlyphRange) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_lineFragmentUsedRectForGlyphAtIndex_1effectiveRange_1, glyphIndex, effectiveGlyphRange);
+ return result;
+}
+
+public NSRect lineFragmentUsedRectForGlyphAtIndex_effectiveRange_withoutAdditionalLayout_(int glyphIndex, int effectiveGlyphRange, boolean flag) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_lineFragmentUsedRectForGlyphAtIndex_1effectiveRange_1withoutAdditionalLayout_1, glyphIndex, effectiveGlyphRange, flag);
+ return result;
+}
+
+public NSPoint locationForGlyphAtIndex(int glyphIndex) {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_struct(result, this.id, OS.sel_locationForGlyphAtIndex_1, glyphIndex);
+ return result;
+}
+
+public boolean notShownAttributeForGlyphAtIndex(int glyphIndex) {
+ return OS.objc_msgSend(this.id, OS.sel_notShownAttributeForGlyphAtIndex_1, glyphIndex) != 0;
+}
+
+public int numberOfGlyphs() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfGlyphs);
+}
+
+public NSRange rangeOfNominallySpacedGlyphsContainingIndex(int glyphIndex) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfNominallySpacedGlyphsContainingIndex_1, glyphIndex);
+ return result;
+}
+
+public int rectArrayForCharacterRange(NSRange charRange, NSRange selCharRange, NSTextContainer container, int rectCount) {
+ return OS.objc_msgSend(this.id, OS.sel_rectArrayForCharacterRange_1withinSelectedCharacterRange_1inTextContainer_1rectCount_1, charRange, selCharRange, container != null ? container.id : 0, rectCount);
+}
+
+public int rectArrayForGlyphRange(NSRange glyphRange, NSRange selGlyphRange, NSTextContainer container, int rectCount) {
+ return OS.objc_msgSend(this.id, OS.sel_rectArrayForGlyphRange_1withinSelectedGlyphRange_1inTextContainer_1rectCount_1, glyphRange, selGlyphRange, container != null ? container.id : 0, rectCount);
+}
+
+public void removeTemporaryAttribute(NSString attrName, NSRange charRange) {
+ OS.objc_msgSend(this.id, OS.sel_removeTemporaryAttribute_1forCharacterRange_1, attrName != null ? attrName.id : 0, charRange);
+}
+
+public void removeTextContainerAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_removeTextContainerAtIndex_1, index);
+}
+
+public void replaceGlyphAtIndex(int glyphIndex, int newGlyph) {
+ OS.objc_msgSend(this.id, OS.sel_replaceGlyphAtIndex_1withGlyph_1, glyphIndex, newGlyph);
+}
+
+public void replaceTextStorage(NSTextStorage newTextStorage) {
+ OS.objc_msgSend(this.id, OS.sel_replaceTextStorage_1, newTextStorage != null ? newTextStorage.id : 0);
+}
+
+public NSView rulerAccessoryViewForTextView(NSTextView view, NSParagraphStyle style, NSRulerView ruler, boolean isEnabled) {
+ int result = OS.objc_msgSend(this.id, OS.sel_rulerAccessoryViewForTextView_1paragraphStyle_1ruler_1enabled_1, view != null ? view.id : 0, style != null ? style.id : 0, ruler != null ? ruler.id : 0, isEnabled);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public NSArray rulerMarkersForTextView(NSTextView view, NSParagraphStyle style, NSRulerView ruler) {
+ int result = OS.objc_msgSend(this.id, OS.sel_rulerMarkersForTextView_1paragraphStyle_1ruler_1, view != null ? view.id : 0, style != null ? style.id : 0, ruler != null ? ruler.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void setAllowsNonContiguousLayout(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsNonContiguousLayout_1, flag);
+}
+
+public void setAttachmentSize(NSSize attachmentSize, NSRange glyphRange) {
+ OS.objc_msgSend(this.id, OS.sel_setAttachmentSize_1forGlyphRange_1, attachmentSize, glyphRange);
+}
+
+public void setBackgroundLayoutEnabled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundLayoutEnabled_1, flag);
+}
+
+public void setBoundsRect(NSRect rect, NSTextBlock block, NSRange glyphRange) {
+ OS.objc_msgSend(this.id, OS.sel_setBoundsRect_1forTextBlock_1glyphRange_1, rect, block != null ? block.id : 0, glyphRange);
+}
+
+public void setCharacterIndex(int charIndex, int glyphIndex) {
+ OS.objc_msgSend(this.id, OS.sel_setCharacterIndex_1forGlyphAtIndex_1, charIndex, glyphIndex);
+}
+
+public void setDefaultAttachmentScaling(int scaling) {
+ OS.objc_msgSend(this.id, OS.sel_setDefaultAttachmentScaling_1, scaling);
+}
+
+public void setDelegate(id delegate) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegate != null ? delegate.id : 0);
+}
+
+public void setDrawsOutsideLineFragment(boolean flag, int glyphIndex) {
+ OS.objc_msgSend(this.id, OS.sel_setDrawsOutsideLineFragment_1forGlyphAtIndex_1, flag, glyphIndex);
+}
+
+public void setExtraLineFragmentRect(NSRect fragmentRect, NSRect usedRect, NSTextContainer container) {
+ OS.objc_msgSend(this.id, OS.sel_setExtraLineFragmentRect_1usedRect_1textContainer_1, fragmentRect, usedRect, container != null ? container.id : 0);
+}
+
+public void setGlyphGenerator(NSGlyphGenerator glyphGenerator) {
+ OS.objc_msgSend(this.id, OS.sel_setGlyphGenerator_1, glyphGenerator != null ? glyphGenerator.id : 0);
+}
+
+public void setHyphenationFactor(float factor) {
+ OS.objc_msgSend(this.id, OS.sel_setHyphenationFactor_1, factor);
+}
+
+public void setIntAttribute(int attributeTag, int val, int glyphIndex) {
+ OS.objc_msgSend(this.id, OS.sel_setIntAttribute_1value_1forGlyphAtIndex_1, attributeTag, val, glyphIndex);
+}
+
+public void setLayoutRect(NSRect rect, NSTextBlock block, NSRange glyphRange) {
+ OS.objc_msgSend(this.id, OS.sel_setLayoutRect_1forTextBlock_1glyphRange_1, rect, block != null ? block.id : 0, glyphRange);
+}
+
+public void setLineFragmentRect(NSRect fragmentRect, NSRange glyphRange, NSRect usedRect) {
+ OS.objc_msgSend(this.id, OS.sel_setLineFragmentRect_1forGlyphRange_1usedRect_1, fragmentRect, glyphRange, usedRect);
+}
+
+public void setLocation(NSPoint location, NSRange glyphRange) {
+ OS.objc_msgSend(this.id, OS.sel_setLocation_1forStartOfGlyphRange_1, location, glyphRange);
+}
+
+public void setLocations(int locations, int glyphIndexes, int count, NSRange glyphRange) {
+ OS.objc_msgSend(this.id, OS.sel_setLocations_1startingGlyphIndexes_1count_1forGlyphRange_1, locations, glyphIndexes, count, glyphRange);
+}
+
+public void setNotShownAttribute(boolean flag, int glyphIndex) {
+ OS.objc_msgSend(this.id, OS.sel_setNotShownAttribute_1forGlyphAtIndex_1, flag, glyphIndex);
+}
+
+public void setShowsControlCharacters(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setShowsControlCharacters_1, flag);
+}
+
+public void setShowsInvisibleCharacters(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setShowsInvisibleCharacters_1, flag);
+}
+
+public void setTemporaryAttributes(NSDictionary attrs, NSRange charRange) {
+ OS.objc_msgSend(this.id, OS.sel_setTemporaryAttributes_1forCharacterRange_1, attrs != null ? attrs.id : 0, charRange);
+}
+
+public void setTextContainer(NSTextContainer container, NSRange glyphRange) {
+ OS.objc_msgSend(this.id, OS.sel_setTextContainer_1forGlyphRange_1, container != null ? container.id : 0, glyphRange);
+}
+
+public void setTextStorage(NSTextStorage textStorage) {
+ OS.objc_msgSend(this.id, OS.sel_setTextStorage_1, textStorage != null ? textStorage.id : 0);
+}
+
+public void setTypesetter(NSTypesetter typesetter) {
+ OS.objc_msgSend(this.id, OS.sel_setTypesetter_1, typesetter != null ? typesetter.id : 0);
+}
+
+public void setTypesetterBehavior(int theBehavior) {
+ OS.objc_msgSend(this.id, OS.sel_setTypesetterBehavior_1, theBehavior);
+}
+
+public void setUsesFontLeading(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setUsesFontLeading_1, flag);
+}
+
+public void setUsesScreenFonts(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setUsesScreenFonts_1, flag);
+}
+
+public void showAttachmentCell(NSCell cell, NSRect rect, int attachmentIndex) {
+ OS.objc_msgSend(this.id, OS.sel_showAttachmentCell_1inRect_1characterIndex_1, cell != null ? cell.id : 0, rect, attachmentIndex);
+}
+
+public void showPackedGlyphs(int glyphs, int glyphLen, NSRange glyphRange, NSPoint point, NSFont font, NSColor color, NSSize printingAdjustment) {
+ OS.objc_msgSend(this.id, OS.sel_showPackedGlyphs_1length_1glyphRange_1atPoint_1font_1color_1printingAdjustment_1, glyphs, glyphLen, glyphRange, point, font != null ? font.id : 0, color != null ? color.id : 0, printingAdjustment);
+}
+
+public boolean showsControlCharacters() {
+ return OS.objc_msgSend(this.id, OS.sel_showsControlCharacters) != 0;
+}
+
+public boolean showsInvisibleCharacters() {
+ return OS.objc_msgSend(this.id, OS.sel_showsInvisibleCharacters) != 0;
+}
+
+public void strikethroughGlyphRange(NSRange glyphRange, int strikethroughVal, NSRect lineRect, NSRange lineGlyphRange, NSPoint containerOrigin) {
+ OS.objc_msgSend(this.id, OS.sel_strikethroughGlyphRange_1strikethroughType_1lineFragmentRect_1lineFragmentGlyphRange_1containerOrigin_1, glyphRange, strikethroughVal, lineRect, lineGlyphRange, containerOrigin);
+}
+
+public NSFont substituteFontForFont(NSFont originalFont) {
+ int result = OS.objc_msgSend(this.id, OS.sel_substituteFontForFont_1, originalFont != null ? originalFont.id : 0);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public id temporaryAttribute_atCharacterIndex_effectiveRange_(NSString attrName, int location, int range) {
+ int result = OS.objc_msgSend(this.id, OS.sel_temporaryAttribute_1atCharacterIndex_1effectiveRange_1, attrName != null ? attrName.id : 0, location, range);
+ return result != 0 ? new id(result) : null;
+}
+
+public id temporaryAttribute_atCharacterIndex_longestEffectiveRange_inRange_(NSString attrName, int location, int range, NSRange rangeLimit) {
+ int result = OS.objc_msgSend(this.id, OS.sel_temporaryAttribute_1atCharacterIndex_1longestEffectiveRange_1inRange_1, attrName != null ? attrName.id : 0, location, range, rangeLimit);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSDictionary temporaryAttributesAtCharacterIndex_effectiveRange_(int charIndex, int effectiveCharRange) {
+ int result = OS.objc_msgSend(this.id, OS.sel_temporaryAttributesAtCharacterIndex_1effectiveRange_1, charIndex, effectiveCharRange);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSDictionary temporaryAttributesAtCharacterIndex_longestEffectiveRange_inRange_(int location, int range, NSRange rangeLimit) {
+ int result = OS.objc_msgSend(this.id, OS.sel_temporaryAttributesAtCharacterIndex_1longestEffectiveRange_1inRange_1, location, range, rangeLimit);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public void textContainerChangedGeometry(NSTextContainer container) {
+ OS.objc_msgSend(this.id, OS.sel_textContainerChangedGeometry_1, container != null ? container.id : 0);
+}
+
+public void textContainerChangedTextView(NSTextContainer container) {
+ OS.objc_msgSend(this.id, OS.sel_textContainerChangedTextView_1, container != null ? container.id : 0);
+}
+
+public NSTextContainer textContainerForGlyphAtIndex_effectiveRange_(int glyphIndex, int effectiveGlyphRange) {
+ int result = OS.objc_msgSend(this.id, OS.sel_textContainerForGlyphAtIndex_1effectiveRange_1, glyphIndex, effectiveGlyphRange);
+ return result != 0 ? new NSTextContainer(result) : null;
+}
+
+public NSTextContainer textContainerForGlyphAtIndex_effectiveRange_withoutAdditionalLayout_(int glyphIndex, int effectiveGlyphRange, boolean flag) {
+ int result = OS.objc_msgSend(this.id, OS.sel_textContainerForGlyphAtIndex_1effectiveRange_1withoutAdditionalLayout_1, glyphIndex, effectiveGlyphRange, flag);
+ return result != 0 ? new NSTextContainer(result) : null;
+}
+
+public NSArray textContainers() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textContainers);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSTextStorage textStorage() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textStorage);
+ return result != 0 ? new NSTextStorage(result) : null;
+}
+
+public void textStorage_edited_range_changeInLength_invalidatedRange_(NSTextStorage str, int editedMask, NSRange newCharRange, int delta, NSRange invalidatedCharRange) {
+ OS.objc_msgSend(this.id, OS.sel_textStorage_1edited_1range_1changeInLength_1invalidatedRange_1, str != null ? str.id : 0, editedMask, newCharRange, delta, invalidatedCharRange);
+}
+
+public NSTextView textViewForBeginningOfSelection() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textViewForBeginningOfSelection);
+ return result != 0 ? new NSTextView(result) : null;
+}
+
+public NSTypesetter typesetter() {
+ int result = OS.objc_msgSend(this.id, OS.sel_typesetter);
+ return result != 0 ? new NSTypesetter(result) : null;
+}
+
+public int typesetterBehavior() {
+ return OS.objc_msgSend(this.id, OS.sel_typesetterBehavior);
+}
+
+public void underlineGlyphRange(NSRange glyphRange, int underlineVal, NSRect lineRect, NSRange lineGlyphRange, NSPoint containerOrigin) {
+ OS.objc_msgSend(this.id, OS.sel_underlineGlyphRange_1underlineType_1lineFragmentRect_1lineFragmentGlyphRange_1containerOrigin_1, glyphRange, underlineVal, lineRect, lineGlyphRange, containerOrigin);
+}
+
+public NSRect usedRectForTextContainer(NSTextContainer container) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_usedRectForTextContainer_1, container != null ? container.id : 0);
+ return result;
+}
+
+public boolean usesFontLeading() {
+ return OS.objc_msgSend(this.id, OS.sel_usesFontLeading) != 0;
+}
+
+public boolean usesScreenFonts() {
+ return OS.objc_msgSend(this.id, OS.sel_usesScreenFonts) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLevelIndicator.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLevelIndicator.java
new file mode 100644
index 0000000000..6756476344
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLevelIndicator.java
@@ -0,0 +1,79 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSLevelIndicator extends NSControl {
+
+public NSLevelIndicator() {
+ super();
+}
+
+public NSLevelIndicator(int id) {
+ super(id);
+}
+
+public double criticalValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_criticalValue);
+}
+
+public double maxValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_maxValue);
+}
+
+public double minValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_minValue);
+}
+
+public int numberOfMajorTickMarks() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfMajorTickMarks);
+}
+
+public int numberOfTickMarks() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfTickMarks);
+}
+
+public NSRect rectOfTickMarkAtIndex(int index) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rectOfTickMarkAtIndex_1, index);
+ return result;
+}
+
+public void setCriticalValue(double criticalValue) {
+ OS.objc_msgSend(this.id, OS.sel_setCriticalValue_1, criticalValue);
+}
+
+public void setMaxValue(double maxValue) {
+ OS.objc_msgSend(this.id, OS.sel_setMaxValue_1, maxValue);
+}
+
+public void setMinValue(double minValue) {
+ OS.objc_msgSend(this.id, OS.sel_setMinValue_1, minValue);
+}
+
+public void setNumberOfMajorTickMarks(int count) {
+ OS.objc_msgSend(this.id, OS.sel_setNumberOfMajorTickMarks_1, count);
+}
+
+public void setNumberOfTickMarks(int count) {
+ OS.objc_msgSend(this.id, OS.sel_setNumberOfTickMarks_1, count);
+}
+
+public void setTickMarkPosition(int position) {
+ OS.objc_msgSend(this.id, OS.sel_setTickMarkPosition_1, position);
+}
+
+public void setWarningValue(double warningValue) {
+ OS.objc_msgSend(this.id, OS.sel_setWarningValue_1, warningValue);
+}
+
+public int tickMarkPosition() {
+ return OS.objc_msgSend(this.id, OS.sel_tickMarkPosition);
+}
+
+public double tickMarkValueAtIndex(int index) {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_tickMarkValueAtIndex_1, index);
+}
+
+public double warningValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_warningValue);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLevelIndicatorCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLevelIndicatorCell.java
new file mode 100644
index 0000000000..0612afc929
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLevelIndicatorCell.java
@@ -0,0 +1,96 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSLevelIndicatorCell extends NSActionCell {
+
+public NSLevelIndicatorCell() {
+ super();
+}
+
+public NSLevelIndicatorCell(int id) {
+ super(id);
+}
+
+public double criticalValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_criticalValue);
+}
+
+public id initWithLevelIndicatorStyle(int levelIndicatorStyle) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithLevelIndicatorStyle_1, levelIndicatorStyle);
+ return result != 0 ? new id(result) : null;
+}
+
+public int levelIndicatorStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_levelIndicatorStyle);
+}
+
+public double maxValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_maxValue);
+}
+
+public double minValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_minValue);
+}
+
+public int numberOfMajorTickMarks() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfMajorTickMarks);
+}
+
+public int numberOfTickMarks() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfTickMarks);
+}
+
+public NSRect rectOfTickMarkAtIndex(int index) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rectOfTickMarkAtIndex_1, index);
+ return result;
+}
+
+public void setCriticalValue(double criticalValue) {
+ OS.objc_msgSend(this.id, OS.sel_setCriticalValue_1, criticalValue);
+}
+
+public void setImage(NSImage image) {
+ OS.objc_msgSend(this.id, OS.sel_setImage_1, image != null ? image.id : 0);
+}
+
+public void setLevelIndicatorStyle(int levelIndicatorStyle) {
+ OS.objc_msgSend(this.id, OS.sel_setLevelIndicatorStyle_1, levelIndicatorStyle);
+}
+
+public void setMaxValue(double maxValue) {
+ OS.objc_msgSend(this.id, OS.sel_setMaxValue_1, maxValue);
+}
+
+public void setMinValue(double minValue) {
+ OS.objc_msgSend(this.id, OS.sel_setMinValue_1, minValue);
+}
+
+public void setNumberOfMajorTickMarks(int count) {
+ OS.objc_msgSend(this.id, OS.sel_setNumberOfMajorTickMarks_1, count);
+}
+
+public void setNumberOfTickMarks(int count) {
+ OS.objc_msgSend(this.id, OS.sel_setNumberOfTickMarks_1, count);
+}
+
+public void setTickMarkPosition(int position) {
+ OS.objc_msgSend(this.id, OS.sel_setTickMarkPosition_1, position);
+}
+
+public void setWarningValue(double warningValue) {
+ OS.objc_msgSend(this.id, OS.sel_setWarningValue_1, warningValue);
+}
+
+public int tickMarkPosition() {
+ return OS.objc_msgSend(this.id, OS.sel_tickMarkPosition);
+}
+
+public double tickMarkValueAtIndex(int index) {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_tickMarkValueAtIndex_1, index);
+}
+
+public double warningValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_warningValue);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLocale.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLocale.java
new file mode 100644
index 0000000000..4cc54f8cc6
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLocale.java
@@ -0,0 +1,93 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSLocale extends NSObject {
+
+public NSLocale() {
+ super();
+}
+
+public NSLocale(int id) {
+ super(id);
+}
+
+public static NSArray ISOCountryCodes() {
+ int result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_ISOCountryCodes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray ISOCurrencyCodes() {
+ int result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_ISOCurrencyCodes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray ISOLanguageCodes() {
+ int result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_ISOLanguageCodes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static id autoupdatingCurrentLocale() {
+ int result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_autoupdatingCurrentLocale);
+ return result != 0 ? new id(result) : null;
+}
+
+public static NSArray availableLocaleIdentifiers() {
+ int result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_availableLocaleIdentifiers);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSString canonicalLocaleIdentifierFromString(NSString string) {
+ int result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_canonicalLocaleIdentifierFromString_1, string != null ? string.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSArray commonISOCurrencyCodes() {
+ int result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_commonISOCurrencyCodes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSDictionary componentsFromLocaleIdentifier(NSString string) {
+ int result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_componentsFromLocaleIdentifier_1, string != null ? string.id : 0);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public static id currentLocale() {
+ int result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_currentLocale);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString displayNameForKey(id key, id value) {
+ int result = OS.objc_msgSend(this.id, OS.sel_displayNameForKey_1value_1, key != null ? key.id : 0, value != null ? value.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id initWithLocaleIdentifier(NSString string) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithLocaleIdentifier_1, string != null ? string.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString localeIdentifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_localeIdentifier);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSString localeIdentifierFromComponents(NSDictionary dict) {
+ int result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_localeIdentifierFromComponents_1, dict != null ? dict.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id objectForKey(id key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectForKey_1, key != null ? key.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static NSArray preferredLanguages() {
+ int result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_preferredLanguages);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static id systemLocale() {
+ int result = OS.objc_msgSend(OS.class_NSLocale, OS.sel_systemLocale);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLock.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLock.java
new file mode 100644
index 0000000000..7214acd3c6
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLock.java
@@ -0,0 +1,30 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSLock extends NSObject {
+
+public NSLock() {
+ super();
+}
+
+public NSLock(int id) {
+ super(id);
+}
+
+public boolean lockBeforeDate(NSDate limit) {
+ return OS.objc_msgSend(this.id, OS.sel_lockBeforeDate_1, limit != null ? limit.id : 0) != 0;
+}
+
+public NSString name() {
+ int result = OS.objc_msgSend(this.id, OS.sel_name);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void setName(NSString n) {
+ OS.objc_msgSend(this.id, OS.sel_setName_1, n != null ? n.id : 0);
+}
+
+public boolean tryLock() {
+ return OS.objc_msgSend(this.id, OS.sel_tryLock) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLogicalTest.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLogicalTest.java
new file mode 100644
index 0000000000..ead6405080
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSLogicalTest.java
@@ -0,0 +1,28 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSLogicalTest extends NSScriptWhoseTest {
+
+public NSLogicalTest() {
+ super();
+}
+
+public NSLogicalTest(int id) {
+ super(id);
+}
+
+public id initAndTestWithTests(NSArray subTests) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initAndTestWithTests_1, subTests != null ? subTests.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initNotTestWithTest(NSScriptWhoseTest subTest) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initNotTestWithTest_1, subTest != null ? subTest.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initOrTestWithTests(NSArray subTests) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initOrTestWithTests_1, subTests != null ? subTests.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMachBootstrapServer.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMachBootstrapServer.java
new file mode 100644
index 0000000000..d5680e85cd
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMachBootstrapServer.java
@@ -0,0 +1,37 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMachBootstrapServer extends NSPortNameServer {
+
+public NSMachBootstrapServer() {
+ super();
+}
+
+public NSMachBootstrapServer(int id) {
+ super(id);
+}
+
+public NSPort portForName_(NSString name) {
+ int result = OS.objc_msgSend(this.id, OS.sel_portForName_1, name != null ? name.id : 0);
+ return result != 0 ? new NSPort(result) : null;
+}
+
+public NSPort portForName_host_(NSString name, NSString host) {
+ int result = OS.objc_msgSend(this.id, OS.sel_portForName_1host_1, name != null ? name.id : 0, host != null ? host.id : 0);
+ return result != 0 ? new NSPort(result) : null;
+}
+
+public boolean registerPort(NSPort port, NSString name) {
+ return OS.objc_msgSend(this.id, OS.sel_registerPort_1name_1, port != null ? port.id : 0, name != null ? name.id : 0) != 0;
+}
+
+public NSPort servicePortWithName(NSString name) {
+ int result = OS.objc_msgSend(this.id, OS.sel_servicePortWithName_1, name != null ? name.id : 0);
+ return result != 0 ? new NSPort(result) : null;
+}
+
+public static id sharedInstance() {
+ int result = OS.objc_msgSend(OS.class_NSMachBootstrapServer, OS.sel_sharedInstance);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMachPort.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMachPort.java
new file mode 100644
index 0000000000..4acc01308e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMachPort.java
@@ -0,0 +1,45 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMachPort extends NSPort {
+
+public NSMachPort() {
+ super();
+}
+
+public NSMachPort(int id) {
+ super(id);
+}
+
+public id initWithMachPort_(int machPort) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithMachPort_1, machPort);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithMachPort_options_(int machPort, int f) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithMachPort_1options_1, machPort, f);
+ return result != 0 ? new id(result) : null;
+}
+
+public int machPort() {
+ return OS.objc_msgSend(this.id, OS.sel_machPort);
+}
+
+public static NSPort static_portWithMachPort_(int machPort) {
+ int result = OS.objc_msgSend(OS.class_NSMachPort, OS.sel_portWithMachPort_1, machPort);
+ return result != 0 ? new NSPort(result) : null;
+}
+
+public static NSPort static_portWithMachPort_options_(int machPort, int f) {
+ int result = OS.objc_msgSend(OS.class_NSMachPort, OS.sel_portWithMachPort_1options_1, machPort, f);
+ return result != 0 ? new NSPort(result) : null;
+}
+
+public void removeFromRunLoop(NSRunLoop runLoop, NSString mode) {
+ OS.objc_msgSend(this.id, OS.sel_removeFromRunLoop_1forMode_1, runLoop != null ? runLoop.id : 0, mode != null ? mode.id : 0);
+}
+
+public void scheduleInRunLoop(NSRunLoop runLoop, NSString mode) {
+ OS.objc_msgSend(this.id, OS.sel_scheduleInRunLoop_1forMode_1, runLoop != null ? runLoop.id : 0, mode != null ? mode.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMapEnumerator.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMapEnumerator.java
new file mode 100644
index 0000000000..f380b0d32d
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMapEnumerator.java
@@ -0,0 +1,5 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMapEnumerator {
+//TODO
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMapTable.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMapTable.java
new file mode 100644
index 0000000000..b0d86c16b5
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMapTable.java
@@ -0,0 +1,94 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMapTable extends NSObject {
+
+public NSMapTable() {
+ super();
+}
+
+public NSMapTable(int id) {
+ super(id);
+}
+
+public int count() {
+ return OS.objc_msgSend(this.id, OS.sel_count);
+}
+
+public NSDictionary dictionaryRepresentation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_dictionaryRepresentation);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public id initWithKeyOptions(int keyOptions, int valueOptions, int initialCapacity) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithKeyOptions_1valueOptions_1capacity_1, keyOptions, valueOptions, initialCapacity);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithKeyPointerFunctions(NSPointerFunctions keyFunctions, NSPointerFunctions valueFunctions, int initialCapacity) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithKeyPointerFunctions_1valuePointerFunctions_1capacity_1, keyFunctions != null ? keyFunctions.id : 0, valueFunctions != null ? valueFunctions.id : 0, initialCapacity);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSEnumerator keyEnumerator() {
+ int result = OS.objc_msgSend(this.id, OS.sel_keyEnumerator);
+ return result != 0 ? new NSEnumerator(result) : null;
+}
+
+public NSPointerFunctions keyPointerFunctions() {
+ int result = OS.objc_msgSend(this.id, OS.sel_keyPointerFunctions);
+ return result != 0 ? new NSPointerFunctions(result) : null;
+}
+
+public static id mapTableWithKeyOptions(int keyOptions, int valueOptions) {
+ int result = OS.objc_msgSend(OS.class_NSMapTable, OS.sel_mapTableWithKeyOptions_1valueOptions_1, keyOptions, valueOptions);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id mapTableWithStrongToStrongObjects() {
+ int result = OS.objc_msgSend(OS.class_NSMapTable, OS.sel_mapTableWithStrongToStrongObjects);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id mapTableWithStrongToWeakObjects() {
+ int result = OS.objc_msgSend(OS.class_NSMapTable, OS.sel_mapTableWithStrongToWeakObjects);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id mapTableWithWeakToStrongObjects() {
+ int result = OS.objc_msgSend(OS.class_NSMapTable, OS.sel_mapTableWithWeakToStrongObjects);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id mapTableWithWeakToWeakObjects() {
+ int result = OS.objc_msgSend(OS.class_NSMapTable, OS.sel_mapTableWithWeakToWeakObjects);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSEnumerator objectEnumerator() {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectEnumerator);
+ return result != 0 ? new NSEnumerator(result) : null;
+}
+
+public id objectForKey(id aKey) {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectForKey_1, aKey != null ? aKey.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void removeAllObjects() {
+ OS.objc_msgSend(this.id, OS.sel_removeAllObjects);
+}
+
+public void removeObjectForKey(id aKey) {
+ OS.objc_msgSend(this.id, OS.sel_removeObjectForKey_1, aKey != null ? aKey.id : 0);
+}
+
+public void setObject(id anObject, id aKey) {
+ OS.objc_msgSend(this.id, OS.sel_setObject_1forKey_1, anObject != null ? anObject.id : 0, aKey != null ? aKey.id : 0);
+}
+
+public NSPointerFunctions valuePointerFunctions() {
+ int result = OS.objc_msgSend(this.id, OS.sel_valuePointerFunctions);
+ return result != 0 ? new NSPointerFunctions(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMapTableKeyCallBacks.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMapTableKeyCallBacks.java
new file mode 100644
index 0000000000..4cb19bb587
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMapTableKeyCallBacks.java
@@ -0,0 +1,5 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMapTableKeyCallBacks {
+//TODO
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMapTableValueCallBacks.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMapTableValueCallBacks.java
new file mode 100644
index 0000000000..3e95a5fb20
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMapTableValueCallBacks.java
@@ -0,0 +1,5 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMapTableValueCallBacks {
+//TODO
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMatrix.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMatrix.java
new file mode 100644
index 0000000000..7850576f92
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMatrix.java
@@ -0,0 +1,415 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMatrix extends NSControl {
+
+public NSMatrix() {
+ super();
+}
+
+public NSMatrix(int id) {
+ super(id);
+}
+
+public boolean acceptsFirstMouse(NSEvent theEvent) {
+ return OS.objc_msgSend(this.id, OS.sel_acceptsFirstMouse_1, theEvent != null ? theEvent.id : 0) != 0;
+}
+
+public void addColumn() {
+ OS.objc_msgSend(this.id, OS.sel_addColumn);
+}
+
+public void addColumnWithCells(NSArray newCells) {
+ OS.objc_msgSend(this.id, OS.sel_addColumnWithCells_1, newCells != null ? newCells.id : 0);
+}
+
+public void addRow() {
+ OS.objc_msgSend(this.id, OS.sel_addRow);
+}
+
+public void addRowWithCells(NSArray newCells) {
+ OS.objc_msgSend(this.id, OS.sel_addRowWithCells_1, newCells != null ? newCells.id : 0);
+}
+
+public boolean allowsEmptySelection() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsEmptySelection) != 0;
+}
+
+public boolean autosizesCells() {
+ return OS.objc_msgSend(this.id, OS.sel_autosizesCells) != 0;
+}
+
+public NSColor backgroundColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public id cellAtRow(int row, int col) {
+ int result = OS.objc_msgSend(this.id, OS.sel_cellAtRow_1column_1, row, col);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSColor cellBackgroundColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_cellBackgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+//public int cellClass() {
+// return OS.objc_msgSend(this.id, OS.sel_cellClass);
+//}
+
+public NSRect cellFrameAtRow(int row, int col) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_cellFrameAtRow_1column_1, row, col);
+ return result;
+}
+
+public NSSize cellSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_cellSize);
+ return result;
+}
+
+public id cellWithTag(int anInt) {
+ int result = OS.objc_msgSend(this.id, OS.sel_cellWithTag_1, anInt);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSArray cells() {
+ int result = OS.objc_msgSend(this.id, OS.sel_cells);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public void deselectAllCells() {
+ OS.objc_msgSend(this.id, OS.sel_deselectAllCells);
+}
+
+public void deselectSelectedCell() {
+ OS.objc_msgSend(this.id, OS.sel_deselectSelectedCell);
+}
+
+public int doubleAction() {
+ return OS.objc_msgSend(this.id, OS.sel_doubleAction);
+}
+
+public void drawCellAtRow(int row, int col) {
+ OS.objc_msgSend(this.id, OS.sel_drawCellAtRow_1column_1, row, col);
+}
+
+public boolean drawsBackground() {
+ return OS.objc_msgSend(this.id, OS.sel_drawsBackground) != 0;
+}
+
+public boolean drawsCellBackground() {
+ return OS.objc_msgSend(this.id, OS.sel_drawsCellBackground) != 0;
+}
+
+public void getNumberOfRows(int rowCount, int colCount) {
+ OS.objc_msgSend(this.id, OS.sel_getNumberOfRows_1columns_1, rowCount, colCount);
+}
+
+public boolean getRow_column_forPoint_(int row, int col, NSPoint aPoint) {
+ return OS.objc_msgSend(this.id, OS.sel_getRow_1column_1forPoint_1, row, col, aPoint) != 0;
+}
+
+public boolean getRow_column_ofCell_(int row, int col, NSCell aCell) {
+ return OS.objc_msgSend(this.id, OS.sel_getRow_1column_1ofCell_1, row, col, aCell != null ? aCell.id : 0) != 0;
+}
+
+public void highlightCell(boolean flag, int row, int col) {
+ OS.objc_msgSend(this.id, OS.sel_highlightCell_1atRow_1column_1, flag, row, col);
+}
+
+public id initWithFrame_(NSRect frameRect) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFrame_1, frameRect);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithFrame_mode_cellClass_numberOfRows_numberOfColumns_(NSRect frameRect, int aMode, int factoryId, int rowsHigh, int colsWide) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFrame_1mode_1cellClass_1numberOfRows_1numberOfColumns_1, frameRect, aMode, factoryId, rowsHigh, colsWide);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithFrame_mode_prototype_numberOfRows_numberOfColumns_(NSRect frameRect, int aMode, NSCell aCell, int rowsHigh, int colsWide) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFrame_1mode_1prototype_1numberOfRows_1numberOfColumns_1, frameRect, aMode, aCell != null ? aCell.id : 0, rowsHigh, colsWide);
+ return result != 0 ? new id(result) : null;
+}
+
+public void insertColumn_(int column) {
+ OS.objc_msgSend(this.id, OS.sel_insertColumn_1, column);
+}
+
+public void insertColumn_withCells_(int column, NSArray newCells) {
+ OS.objc_msgSend(this.id, OS.sel_insertColumn_1withCells_1, column, newCells != null ? newCells.id : 0);
+}
+
+public void insertRow_(int row) {
+ OS.objc_msgSend(this.id, OS.sel_insertRow_1, row);
+}
+
+public void insertRow_withCells_(int row, NSArray newCells) {
+ OS.objc_msgSend(this.id, OS.sel_insertRow_1withCells_1, row, newCells != null ? newCells.id : 0);
+}
+
+public NSSize intercellSpacing() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_intercellSpacing);
+ return result;
+}
+
+public boolean isAutoscroll() {
+ return OS.objc_msgSend(this.id, OS.sel_isAutoscroll) != 0;
+}
+
+public boolean isSelectionByRect() {
+ return OS.objc_msgSend(this.id, OS.sel_isSelectionByRect) != 0;
+}
+
+public id keyCell() {
+ int result = OS.objc_msgSend(this.id, OS.sel_keyCell);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSCell makeCellAtRow(int row, int col) {
+ int result = OS.objc_msgSend(this.id, OS.sel_makeCellAtRow_1column_1, row, col);
+ return result != 0 ? new NSCell(result) : null;
+}
+
+public int mode() {
+ return OS.objc_msgSend(this.id, OS.sel_mode);
+}
+
+public void mouseDown(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_mouseDown_1, theEvent != null ? theEvent.id : 0);
+}
+
+public int mouseDownFlags() {
+ return OS.objc_msgSend(this.id, OS.sel_mouseDownFlags);
+}
+
+public int numberOfColumns() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfColumns);
+}
+
+public int numberOfRows() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfRows);
+}
+
+public boolean performKeyEquivalent(NSEvent theEvent) {
+ return OS.objc_msgSend(this.id, OS.sel_performKeyEquivalent_1, theEvent != null ? theEvent.id : 0) != 0;
+}
+
+public id prototype() {
+ int result = OS.objc_msgSend(this.id, OS.sel_prototype);
+ return result != 0 ? new id(result) : null;
+}
+
+public void putCell(NSCell newCell, int row, int col) {
+ OS.objc_msgSend(this.id, OS.sel_putCell_1atRow_1column_1, newCell != null ? newCell.id : 0, row, col);
+}
+
+public void removeColumn(int col) {
+ OS.objc_msgSend(this.id, OS.sel_removeColumn_1, col);
+}
+
+public void removeRow(int row) {
+ OS.objc_msgSend(this.id, OS.sel_removeRow_1, row);
+}
+
+public void renewRows(int newRows, int newCols) {
+ OS.objc_msgSend(this.id, OS.sel_renewRows_1columns_1, newRows, newCols);
+}
+
+public void resetCursorRects() {
+ OS.objc_msgSend(this.id, OS.sel_resetCursorRects);
+}
+
+public void scrollCellToVisibleAtRow(int row, int col) {
+ OS.objc_msgSend(this.id, OS.sel_scrollCellToVisibleAtRow_1column_1, row, col);
+}
+
+public void selectAll(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectAll_1, sender != null ? sender.id : 0);
+}
+
+public void selectCellAtRow(int row, int col) {
+ OS.objc_msgSend(this.id, OS.sel_selectCellAtRow_1column_1, row, col);
+}
+
+public boolean selectCellWithTag(int anInt) {
+ return OS.objc_msgSend(this.id, OS.sel_selectCellWithTag_1, anInt) != 0;
+}
+
+public void selectText(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectText_1, sender != null ? sender.id : 0);
+}
+
+public id selectTextAtRow(int row, int col) {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectTextAtRow_1column_1, row, col);
+ return result != 0 ? new id(result) : null;
+}
+
+public id selectedCell() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedCell);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSArray selectedCells() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedCells);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public int selectedColumn() {
+ return OS.objc_msgSend(this.id, OS.sel_selectedColumn);
+}
+
+public int selectedRow() {
+ return OS.objc_msgSend(this.id, OS.sel_selectedRow);
+}
+
+public boolean sendAction() {
+ return OS.objc_msgSend(this.id, OS.sel_sendAction) != 0;
+}
+
+public void sendAction_to_forAllCells_(int aSelector, id anObject, boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_sendAction_1to_1forAllCells_1, aSelector, anObject != null ? anObject.id : 0, flag);
+}
+
+public void sendDoubleAction() {
+ OS.objc_msgSend(this.id, OS.sel_sendDoubleAction);
+}
+
+public void setAllowsEmptySelection(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsEmptySelection_1, flag);
+}
+
+public void setAutoscroll(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAutoscroll_1, flag);
+}
+
+public void setAutosizesCells(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAutosizesCells_1, flag);
+}
+
+public void setBackgroundColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color != null ? color.id : 0);
+}
+
+public void setCellBackgroundColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setCellBackgroundColor_1, color != null ? color.id : 0);
+}
+
+//public void setCellClass(int factoryId) {
+// OS.objc_msgSend(this.id, OS.sel_setCellClass_1, factoryId);
+//}
+
+public void setCellSize(NSSize aSize) {
+ OS.objc_msgSend(this.id, OS.sel_setCellSize_1, aSize);
+}
+
+public void setDelegate(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
+}
+
+public void setDoubleAction(int aSelector) {
+ OS.objc_msgSend(this.id, OS.sel_setDoubleAction_1, aSelector);
+}
+
+public void setDrawsBackground(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setDrawsBackground_1, flag);
+}
+
+public void setDrawsCellBackground(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setDrawsCellBackground_1, flag);
+}
+
+public void setIntercellSpacing(NSSize aSize) {
+ OS.objc_msgSend(this.id, OS.sel_setIntercellSpacing_1, aSize);
+}
+
+public void setKeyCell(NSCell keyCell) {
+ OS.objc_msgSend(this.id, OS.sel_setKeyCell_1, keyCell != null ? keyCell.id : 0);
+}
+
+public void setMode(int aMode) {
+ OS.objc_msgSend(this.id, OS.sel_setMode_1, aMode);
+}
+
+public void setPrototype(NSCell aCell) {
+ OS.objc_msgSend(this.id, OS.sel_setPrototype_1, aCell != null ? aCell.id : 0);
+}
+
+public void setScrollable(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setScrollable_1, flag);
+}
+
+public void setSelectionByRect(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectionByRect_1, flag);
+}
+
+public void setSelectionFrom(int startPos, int endPos, int anchorPos, boolean lit) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectionFrom_1to_1anchor_1highlight_1, startPos, endPos, anchorPos, lit);
+}
+
+public void setState(int value, int row, int col) {
+ OS.objc_msgSend(this.id, OS.sel_setState_1atRow_1column_1, value, row, col);
+}
+
+public void setTabKeyTraversesCells(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setTabKeyTraversesCells_1, flag);
+}
+
+public void setToolTip(NSString toolTipString, NSCell cell) {
+ OS.objc_msgSend(this.id, OS.sel_setToolTip_1forCell_1, toolTipString != null ? toolTipString.id : 0, cell != null ? cell.id : 0);
+}
+
+public void setValidateSize(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setValidateSize_1, flag);
+}
+
+public void sizeToCells() {
+ OS.objc_msgSend(this.id, OS.sel_sizeToCells);
+}
+
+public void sortUsingFunction(int compare, int context) {
+ OS.objc_msgSend(this.id, OS.sel_sortUsingFunction_1context_1, compare, context);
+}
+
+public void sortUsingSelector(int comparator) {
+ OS.objc_msgSend(this.id, OS.sel_sortUsingSelector_1, comparator);
+}
+
+public boolean tabKeyTraversesCells() {
+ return OS.objc_msgSend(this.id, OS.sel_tabKeyTraversesCells) != 0;
+}
+
+public void textDidBeginEditing(NSNotification notification) {
+ OS.objc_msgSend(this.id, OS.sel_textDidBeginEditing_1, notification != null ? notification.id : 0);
+}
+
+public void textDidChange(NSNotification notification) {
+ OS.objc_msgSend(this.id, OS.sel_textDidChange_1, notification != null ? notification.id : 0);
+}
+
+public void textDidEndEditing(NSNotification notification) {
+ OS.objc_msgSend(this.id, OS.sel_textDidEndEditing_1, notification != null ? notification.id : 0);
+}
+
+public boolean textShouldBeginEditing(NSText textObject) {
+ return OS.objc_msgSend(this.id, OS.sel_textShouldBeginEditing_1, textObject != null ? textObject.id : 0) != 0;
+}
+
+public boolean textShouldEndEditing(NSText textObject) {
+ return OS.objc_msgSend(this.id, OS.sel_textShouldEndEditing_1, textObject != null ? textObject.id : 0) != 0;
+}
+
+public NSString toolTipForCell(NSCell cell) {
+ int result = OS.objc_msgSend(this.id, OS.sel_toolTipForCell_1, cell != null ? cell.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenu.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenu.java
new file mode 100644
index 0000000000..27ca17cc7e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenu.java
@@ -0,0 +1,258 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMenu extends NSObject {
+
+public NSMenu() {
+ super();
+}
+
+public NSMenu(int id) {
+ super(id);
+}
+
+public void addItem(NSMenuItem newItem) {
+ OS.objc_msgSend(this.id, OS.sel_addItem_1, newItem != null ? newItem.id : 0);
+}
+
+public NSMenuItem addItemWithTitle(NSString aString, int aSelector, NSString charCode) {
+ int result = OS.objc_msgSend(this.id, OS.sel_addItemWithTitle_1action_1keyEquivalent_1, aString != null ? aString.id : 0, aSelector, charCode != null ? charCode.id : 0);
+ return result != 0 ? new NSMenuItem(result) : null;
+}
+
+public NSMenu attachedMenu() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attachedMenu);
+ return result == this.id ? this : (result != 0 ? new NSMenu(result) : null);
+}
+
+public boolean autoenablesItems() {
+ return OS.objc_msgSend(this.id, OS.sel_autoenablesItems) != 0;
+}
+
+public void cancelTracking() {
+ OS.objc_msgSend(this.id, OS.sel_cancelTracking);
+}
+
+public id contextMenuRepresentation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_contextMenuRepresentation);
+ return result != 0 ? new id(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public void helpRequested(NSEvent eventPtr) {
+ OS.objc_msgSend(this.id, OS.sel_helpRequested_1, eventPtr != null ? eventPtr.id : 0);
+}
+
+public NSMenuItem highlightedItem() {
+ int result = OS.objc_msgSend(this.id, OS.sel_highlightedItem);
+ return result != 0 ? new NSMenuItem(result) : null;
+}
+
+public int indexOfItem(NSMenuItem index) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfItem_1, index != null ? index.id : 0);
+}
+
+public int indexOfItemWithRepresentedObject(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfItemWithRepresentedObject_1, object != null ? object.id : 0);
+}
+
+public int indexOfItemWithSubmenu(NSMenu submenu) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfItemWithSubmenu_1, submenu != null ? submenu.id : 0);
+}
+
+public int indexOfItemWithTag(int aTag) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfItemWithTag_1, aTag);
+}
+
+public int indexOfItemWithTarget(id target, int actionSelector) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfItemWithTarget_1andAction_1, target != null ? target.id : 0, actionSelector);
+}
+
+public int indexOfItemWithTitle(NSString aTitle) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfItemWithTitle_1, aTitle != null ? aTitle.id : 0);
+}
+
+public NSMenu initWithTitle(NSString aTitle) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithTitle_1, aTitle != null ? aTitle.id : 0);
+ return result != 0 ? this : null;
+}
+
+public void insertItem(NSMenuItem newItem, int index) {
+ OS.objc_msgSend(this.id, OS.sel_insertItem_1atIndex_1, newItem != null ? newItem.id : 0, index);
+}
+
+public NSMenuItem insertItemWithTitle(NSString aString, int aSelector, NSString charCode, int index) {
+ int result = OS.objc_msgSend(this.id, OS.sel_insertItemWithTitle_1action_1keyEquivalent_1atIndex_1, aString != null ? aString.id : 0, aSelector, charCode != null ? charCode.id : 0, index);
+ return result != 0 ? new NSMenuItem(result) : null;
+}
+
+public boolean isAttached() {
+ return OS.objc_msgSend(this.id, OS.sel_isAttached) != 0;
+}
+
+public boolean isTornOff() {
+ return OS.objc_msgSend(this.id, OS.sel_isTornOff) != 0;
+}
+
+public NSArray itemArray() {
+ int result = OS.objc_msgSend(this.id, OS.sel_itemArray);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSMenuItem itemAtIndex(int index) {
+ int result = OS.objc_msgSend(this.id, OS.sel_itemAtIndex_1, index);
+ return result != 0 ? new NSMenuItem(result) : null;
+}
+
+public void itemChanged(NSMenuItem item) {
+ OS.objc_msgSend(this.id, OS.sel_itemChanged_1, item != null ? item.id : 0);
+}
+
+public NSMenuItem itemWithTag(int tag) {
+ int result = OS.objc_msgSend(this.id, OS.sel_itemWithTag_1, tag);
+ return result != 0 ? new NSMenuItem(result) : null;
+}
+
+public NSMenuItem itemWithTitle(NSString aTitle) {
+ int result = OS.objc_msgSend(this.id, OS.sel_itemWithTitle_1, aTitle != null ? aTitle.id : 0);
+ return result != 0 ? new NSMenuItem(result) : null;
+}
+
+public NSPoint locationForSubmenu(NSMenu aSubmenu) {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_locationForSubmenu_1, aSubmenu != null ? aSubmenu.id : 0);
+ return result;
+}
+
+public float menuBarHeight() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_menuBarHeight);
+}
+
+public static boolean menuBarVisible() {
+ return OS.objc_msgSend(OS.class_NSMenu, OS.sel_menuBarVisible) != 0;
+}
+
+public boolean menuChangedMessagesEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_menuChangedMessagesEnabled) != 0;
+}
+
+public id menuRepresentation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_menuRepresentation);
+ return result != 0 ? new id(result) : null;
+}
+
+public static int menuZone() {
+ return OS.objc_msgSend(OS.class_NSMenu, OS.sel_menuZone);
+}
+
+public int numberOfItems() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfItems);
+}
+
+public void performActionForItemAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_performActionForItemAtIndex_1, index);
+}
+
+public boolean performKeyEquivalent(NSEvent theEvent) {
+ return OS.objc_msgSend(this.id, OS.sel_performKeyEquivalent_1, theEvent != null ? theEvent.id : 0) != 0;
+}
+
+public static void static_popUpContextMenu_withEvent_forView_(NSMenu menu, NSEvent event, NSView view) {
+ OS.objc_msgSend(OS.class_NSMenu, OS.sel_popUpContextMenu_1withEvent_1forView_1, menu != null ? menu.id : 0, event != null ? event.id : 0, view != null ? view.id : 0);
+}
+
+public static void static_popUpContextMenu_withEvent_forView_withFont_(NSMenu menu, NSEvent event, NSView view, NSFont font) {
+ OS.objc_msgSend(OS.class_NSMenu, OS.sel_popUpContextMenu_1withEvent_1forView_1withFont_1, menu != null ? menu.id : 0, event != null ? event.id : 0, view != null ? view.id : 0, font != null ? font.id : 0);
+}
+
+public void removeItem(NSMenuItem item) {
+ OS.objc_msgSend(this.id, OS.sel_removeItem_1, item != null ? item.id : 0);
+}
+
+public void removeItemAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_removeItemAtIndex_1, index);
+}
+
+public void setAutoenablesItems(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAutoenablesItems_1, flag);
+}
+
+public void setContextMenuRepresentation(id menuRep) {
+ OS.objc_msgSend(this.id, OS.sel_setContextMenuRepresentation_1, menuRep != null ? menuRep.id : 0);
+}
+
+public void setDelegate(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
+}
+
+public static void setMenuBarVisible(boolean visible) {
+ OS.objc_msgSend(OS.class_NSMenu, OS.sel_setMenuBarVisible_1, visible);
+}
+
+public void setMenuChangedMessagesEnabled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setMenuChangedMessagesEnabled_1, flag);
+}
+
+public void setMenuRepresentation(id menuRep) {
+ OS.objc_msgSend(this.id, OS.sel_setMenuRepresentation_1, menuRep != null ? menuRep.id : 0);
+}
+
+public static void setMenuZone(int aZone) {
+ OS.objc_msgSend(OS.class_NSMenu, OS.sel_setMenuZone_1, aZone);
+}
+
+public void setShowsStateColumn(boolean showsState) {
+ OS.objc_msgSend(this.id, OS.sel_setShowsStateColumn_1, showsState);
+}
+
+public void setSubmenu(NSMenu aMenu, NSMenuItem anItem) {
+ OS.objc_msgSend(this.id, OS.sel_setSubmenu_1forItem_1, aMenu != null ? aMenu.id : 0, anItem != null ? anItem.id : 0);
+}
+
+public void setSupermenu(NSMenu supermenu) {
+ OS.objc_msgSend(this.id, OS.sel_setSupermenu_1, supermenu != null ? supermenu.id : 0);
+}
+
+public void setTearOffMenuRepresentation(id menuRep) {
+ OS.objc_msgSend(this.id, OS.sel_setTearOffMenuRepresentation_1, menuRep != null ? menuRep.id : 0);
+}
+
+public void setTitle(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString != null ? aString.id : 0);
+}
+
+public boolean showsStateColumn() {
+ return OS.objc_msgSend(this.id, OS.sel_showsStateColumn) != 0;
+}
+
+public void sizeToFit() {
+ OS.objc_msgSend(this.id, OS.sel_sizeToFit);
+}
+
+public void submenuAction(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_submenuAction_1, sender != null ? sender.id : 0);
+}
+
+public NSMenu supermenu() {
+ int result = OS.objc_msgSend(this.id, OS.sel_supermenu);
+ return result == this.id ? this : (result != 0 ? new NSMenu(result) : null);
+}
+
+public id tearOffMenuRepresentation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_tearOffMenuRepresentation);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString title() {
+ int result = OS.objc_msgSend(this.id, OS.sel_title);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void update() {
+ OS.objc_msgSend(this.id, OS.sel_update);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenuItem.java
new file mode 100644
index 0000000000..73207f64df
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenuItem.java
@@ -0,0 +1,250 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMenuItem extends NSObject {
+
+public NSMenuItem() {
+ super();
+}
+
+public NSMenuItem(int id) {
+ super(id);
+}
+
+public int action() {
+ return OS.objc_msgSend(this.id, OS.sel_action);
+}
+
+public NSAttributedString attributedTitle() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributedTitle);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public boolean hasSubmenu() {
+ return OS.objc_msgSend(this.id, OS.sel_hasSubmenu) != 0;
+}
+
+public NSImage image() {
+ int result = OS.objc_msgSend(this.id, OS.sel_image);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public int indentationLevel() {
+ return OS.objc_msgSend(this.id, OS.sel_indentationLevel);
+}
+
+public NSMenuItem initWithTitle(NSString aString, int aSelector, NSString charCode) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithTitle_1action_1keyEquivalent_1, aString != null ? aString.id : 0, aSelector, charCode != null ? charCode.id : 0);
+ return result != 0 ? this : null;
+}
+
+public boolean isAlternate() {
+ return OS.objc_msgSend(this.id, OS.sel_isAlternate) != 0;
+}
+
+public boolean isEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_isEnabled) != 0;
+}
+
+public boolean isHidden() {
+ return OS.objc_msgSend(this.id, OS.sel_isHidden) != 0;
+}
+
+public boolean isHiddenOrHasHiddenAncestor() {
+ return OS.objc_msgSend(this.id, OS.sel_isHiddenOrHasHiddenAncestor) != 0;
+}
+
+public boolean isHighlighted() {
+ return OS.objc_msgSend(this.id, OS.sel_isHighlighted) != 0;
+}
+
+public boolean isSeparatorItem() {
+ return OS.objc_msgSend(this.id, OS.sel_isSeparatorItem) != 0;
+}
+
+public NSString keyEquivalent() {
+ int result = OS.objc_msgSend(this.id, OS.sel_keyEquivalent);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int keyEquivalentModifierMask() {
+ return OS.objc_msgSend(this.id, OS.sel_keyEquivalentModifierMask);
+}
+
+public NSMenu menu() {
+ int result = OS.objc_msgSend(this.id, OS.sel_menu);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+public NSImage mixedStateImage() {
+ int result = OS.objc_msgSend(this.id, OS.sel_mixedStateImage);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public NSString mnemonic() {
+ int result = OS.objc_msgSend(this.id, OS.sel_mnemonic);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int mnemonicLocation() {
+ return OS.objc_msgSend(this.id, OS.sel_mnemonicLocation);
+}
+
+public NSImage offStateImage() {
+ int result = OS.objc_msgSend(this.id, OS.sel_offStateImage);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public NSImage onStateImage() {
+ int result = OS.objc_msgSend(this.id, OS.sel_onStateImage);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public id representedObject() {
+ int result = OS.objc_msgSend(this.id, OS.sel_representedObject);
+ return result != 0 ? new id(result) : null;
+}
+
+public static NSMenuItem separatorItem() {
+ int result = OS.objc_msgSend(OS.class_NSMenuItem, OS.sel_separatorItem);
+ return result != 0 ? new NSMenuItem(result) : null;
+}
+
+public void setAction(int aSelector) {
+ OS.objc_msgSend(this.id, OS.sel_setAction_1, aSelector);
+}
+
+public void setAlternate(boolean isAlternate) {
+ OS.objc_msgSend(this.id, OS.sel_setAlternate_1, isAlternate);
+}
+
+public void setAttributedTitle(NSAttributedString string) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributedTitle_1, string != null ? string.id : 0);
+}
+
+public void setEnabled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setEnabled_1, flag);
+}
+
+public void setHidden(boolean hidden) {
+ OS.objc_msgSend(this.id, OS.sel_setHidden_1, hidden);
+}
+
+public void setImage(NSImage menuImage) {
+ OS.objc_msgSend(this.id, OS.sel_setImage_1, menuImage != null ? menuImage.id : 0);
+}
+
+public void setIndentationLevel(int indentationLevel) {
+ OS.objc_msgSend(this.id, OS.sel_setIndentationLevel_1, indentationLevel);
+}
+
+public void setKeyEquivalent(NSString aKeyEquivalent) {
+ OS.objc_msgSend(this.id, OS.sel_setKeyEquivalent_1, aKeyEquivalent != null ? aKeyEquivalent.id : 0);
+}
+
+public void setKeyEquivalentModifierMask(int mask) {
+ OS.objc_msgSend(this.id, OS.sel_setKeyEquivalentModifierMask_1, mask);
+}
+
+public void setMenu(NSMenu menu) {
+ OS.objc_msgSend(this.id, OS.sel_setMenu_1, menu != null ? menu.id : 0);
+}
+
+public void setMixedStateImage(NSImage image) {
+ OS.objc_msgSend(this.id, OS.sel_setMixedStateImage_1, image != null ? image.id : 0);
+}
+
+public void setMnemonicLocation(int location) {
+ OS.objc_msgSend(this.id, OS.sel_setMnemonicLocation_1, location);
+}
+
+public void setOffStateImage(NSImage image) {
+ OS.objc_msgSend(this.id, OS.sel_setOffStateImage_1, image != null ? image.id : 0);
+}
+
+public void setOnStateImage(NSImage image) {
+ OS.objc_msgSend(this.id, OS.sel_setOnStateImage_1, image != null ? image.id : 0);
+}
+
+public void setRepresentedObject(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setRepresentedObject_1, anObject != null ? anObject.id : 0);
+}
+
+public void setState(int state) {
+ OS.objc_msgSend(this.id, OS.sel_setState_1, state);
+}
+
+public void setSubmenu(NSMenu submenu) {
+ OS.objc_msgSend(this.id, OS.sel_setSubmenu_1, submenu != null ? submenu.id : 0);
+}
+
+public void setTag(int anInt) {
+ OS.objc_msgSend(this.id, OS.sel_setTag_1, anInt);
+}
+
+public void setTarget(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setTarget_1, anObject != null ? anObject.id : 0);
+}
+
+public void setTitle(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString != null ? aString.id : 0);
+}
+
+public void setTitleWithMnemonic(NSString stringWithAmpersand) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleWithMnemonic_1, stringWithAmpersand != null ? stringWithAmpersand.id : 0);
+}
+
+public void setToolTip(NSString toolTip) {
+ OS.objc_msgSend(this.id, OS.sel_setToolTip_1, toolTip != null ? toolTip.id : 0);
+}
+
+public static void setUsesUserKeyEquivalents(boolean flag) {
+ OS.objc_msgSend(OS.class_NSMenuItem, OS.sel_setUsesUserKeyEquivalents_1, flag);
+}
+
+public void setView(NSView view) {
+ OS.objc_msgSend(this.id, OS.sel_setView_1, view != null ? view.id : 0);
+}
+
+public int state() {
+ return OS.objc_msgSend(this.id, OS.sel_state);
+}
+
+public NSMenu submenu() {
+ int result = OS.objc_msgSend(this.id, OS.sel_submenu);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+public int tag() {
+ return OS.objc_msgSend(this.id, OS.sel_tag);
+}
+
+public id target() {
+ int result = OS.objc_msgSend(this.id, OS.sel_target);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString title() {
+ int result = OS.objc_msgSend(this.id, OS.sel_title);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString toolTip() {
+ int result = OS.objc_msgSend(this.id, OS.sel_toolTip);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString userKeyEquivalent() {
+ int result = OS.objc_msgSend(this.id, OS.sel_userKeyEquivalent);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static boolean usesUserKeyEquivalents() {
+ return OS.objc_msgSend(OS.class_NSMenuItem, OS.sel_usesUserKeyEquivalents) != 0;
+}
+
+public NSView view() {
+ int result = OS.objc_msgSend(this.id, OS.sel_view);
+ return result != 0 ? new NSView(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenuItemCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenuItemCell.java
new file mode 100644
index 0000000000..1ab90c13e0
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenuItemCell.java
@@ -0,0 +1,113 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMenuItemCell extends NSButtonCell {
+
+public NSMenuItemCell() {
+ super();
+}
+
+public NSMenuItemCell(int id) {
+ super(id);
+}
+
+public void calcSize() {
+ OS.objc_msgSend(this.id, OS.sel_calcSize);
+}
+
+public void drawBorderAndBackgroundWithFrame(NSRect cellFrame, NSView controlView) {
+ OS.objc_msgSend(this.id, OS.sel_drawBorderAndBackgroundWithFrame_1inView_1, cellFrame, controlView != null ? controlView.id : 0);
+}
+
+public void drawImageWithFrame(NSRect cellFrame, NSView controlView) {
+ OS.objc_msgSend(this.id, OS.sel_drawImageWithFrame_1inView_1, cellFrame, controlView != null ? controlView.id : 0);
+}
+
+public void drawKeyEquivalentWithFrame(NSRect cellFrame, NSView controlView) {
+ OS.objc_msgSend(this.id, OS.sel_drawKeyEquivalentWithFrame_1inView_1, cellFrame, controlView != null ? controlView.id : 0);
+}
+
+public void drawSeparatorItemWithFrame(NSRect cellFrame, NSView controlView) {
+ OS.objc_msgSend(this.id, OS.sel_drawSeparatorItemWithFrame_1inView_1, cellFrame, controlView != null ? controlView.id : 0);
+}
+
+public void drawStateImageWithFrame(NSRect cellFrame, NSView controlView) {
+ OS.objc_msgSend(this.id, OS.sel_drawStateImageWithFrame_1inView_1, cellFrame, controlView != null ? controlView.id : 0);
+}
+
+public void drawTitleWithFrame(NSRect cellFrame, NSView controlView) {
+ OS.objc_msgSend(this.id, OS.sel_drawTitleWithFrame_1inView_1, cellFrame, controlView != null ? controlView.id : 0);
+}
+
+public float imageWidth() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_imageWidth);
+}
+
+public NSRect keyEquivalentRectForBounds(NSRect cellFrame) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_keyEquivalentRectForBounds_1, cellFrame);
+ return result;
+}
+
+public float keyEquivalentWidth() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_keyEquivalentWidth);
+}
+
+public NSMenuItem menuItem() {
+ int result = OS.objc_msgSend(this.id, OS.sel_menuItem);
+ return result != 0 ? new NSMenuItem(result) : null;
+}
+
+public NSMenuView menuView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_menuView);
+ return result != 0 ? new NSMenuView(result) : null;
+}
+
+public boolean needsDisplay() {
+ return OS.objc_msgSend(this.id, OS.sel_needsDisplay) != 0;
+}
+
+public boolean needsSizing() {
+ return OS.objc_msgSend(this.id, OS.sel_needsSizing) != 0;
+}
+
+public void setMenuItem(NSMenuItem item) {
+ OS.objc_msgSend(this.id, OS.sel_setMenuItem_1, item != null ? item.id : 0);
+}
+
+public void setMenuView(NSMenuView menuView) {
+ OS.objc_msgSend(this.id, OS.sel_setMenuView_1, menuView != null ? menuView.id : 0);
+}
+
+public void setNeedsDisplay(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setNeedsDisplay_1, flag);
+}
+
+public void setNeedsSizing(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setNeedsSizing_1, flag);
+}
+
+public NSRect stateImageRectForBounds(NSRect cellFrame) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_stateImageRectForBounds_1, cellFrame);
+ return result;
+}
+
+public float stateImageWidth() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_stateImageWidth);
+}
+
+public int tag() {
+ return OS.objc_msgSend(this.id, OS.sel_tag);
+}
+
+public NSRect titleRectForBounds(NSRect cellFrame) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_titleRectForBounds_1, cellFrame);
+ return result;
+}
+
+public float titleWidth() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_titleWidth);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenuView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenuView.java
new file mode 100644
index 0000000000..27f76e1eef
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMenuView.java
@@ -0,0 +1,189 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMenuView extends NSView {
+
+public NSMenuView() {
+ super();
+}
+
+public NSMenuView(int id) {
+ super(id);
+}
+
+public void attachSubmenuForItemAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_attachSubmenuForItemAtIndex_1, index);
+}
+
+public NSMenu attachedMenu() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attachedMenu);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+public NSMenuView attachedMenuView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attachedMenuView);
+ return result == this.id ? this : (result != 0 ? new NSMenuView(result) : null);
+}
+
+public void detachSubmenu() {
+ OS.objc_msgSend(this.id, OS.sel_detachSubmenu);
+}
+
+public NSFont font() {
+ int result = OS.objc_msgSend(this.id, OS.sel_font);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public int highlightedItemIndex() {
+ return OS.objc_msgSend(this.id, OS.sel_highlightedItemIndex);
+}
+
+public float horizontalEdgePadding() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_horizontalEdgePadding);
+}
+
+public float imageAndTitleOffset() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_imageAndTitleOffset);
+}
+
+public float imageAndTitleWidth() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_imageAndTitleWidth);
+}
+
+public int indexOfItemAtPoint(NSPoint point) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfItemAtPoint_1, point);
+}
+
+public NSMenuView initAsTearOff() {
+ int result = OS.objc_msgSend(this.id, OS.sel_initAsTearOff);
+ return result != 0 ? this : null;
+}
+
+public NSRect innerRect() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_innerRect);
+ return result;
+}
+
+public boolean isAttached() {
+ return OS.objc_msgSend(this.id, OS.sel_isAttached) != 0;
+}
+
+public boolean isHorizontal() {
+ return OS.objc_msgSend(this.id, OS.sel_isHorizontal) != 0;
+}
+
+public boolean isTornOff() {
+ return OS.objc_msgSend(this.id, OS.sel_isTornOff) != 0;
+}
+
+public void itemAdded(NSNotification notification) {
+ OS.objc_msgSend(this.id, OS.sel_itemAdded_1, notification != null ? notification.id : 0);
+}
+
+public void itemChanged(NSNotification notification) {
+ OS.objc_msgSend(this.id, OS.sel_itemChanged_1, notification != null ? notification.id : 0);
+}
+
+public void itemRemoved(NSNotification notification) {
+ OS.objc_msgSend(this.id, OS.sel_itemRemoved_1, notification != null ? notification.id : 0);
+}
+
+public float keyEquivalentOffset() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_keyEquivalentOffset);
+}
+
+public float keyEquivalentWidth() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_keyEquivalentWidth);
+}
+
+public NSPoint locationForSubmenu(NSMenu aSubmenu) {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_locationForSubmenu_1, aSubmenu != null ? aSubmenu.id : 0);
+ return result;
+}
+
+public NSMenu menu() {
+ int result = OS.objc_msgSend(this.id, OS.sel_menu);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+public static float menuBarHeight() {
+ return (float)OS.objc_msgSend_fpret(OS.class_NSMenuView, OS.sel_menuBarHeight);
+}
+
+public NSMenuItemCell menuItemCellForItemAtIndex(int index) {
+ int result = OS.objc_msgSend(this.id, OS.sel_menuItemCellForItemAtIndex_1, index);
+ return result != 0 ? new NSMenuItemCell(result) : null;
+}
+
+public boolean needsSizing() {
+ return OS.objc_msgSend(this.id, OS.sel_needsSizing) != 0;
+}
+
+public void performActionWithHighlightingForItemAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_performActionWithHighlightingForItemAtIndex_1, index);
+}
+
+public NSRect rectOfItemAtIndex(int index) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rectOfItemAtIndex_1, index);
+ return result;
+}
+
+public void setFont(NSFont font) {
+ OS.objc_msgSend(this.id, OS.sel_setFont_1, font != null ? font.id : 0);
+}
+
+public void setHighlightedItemIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_setHighlightedItemIndex_1, index);
+}
+
+public void setHorizontal(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setHorizontal_1, flag);
+}
+
+public void setHorizontalEdgePadding(float pad) {
+ OS.objc_msgSend(this.id, OS.sel_setHorizontalEdgePadding_1, pad);
+}
+
+public void setMenu(NSMenu menu) {
+ OS.objc_msgSend(this.id, OS.sel_setMenu_1, menu != null ? menu.id : 0);
+}
+
+public void setMenuItemCell(NSMenuItemCell cell, int index) {
+ OS.objc_msgSend(this.id, OS.sel_setMenuItemCell_1forItemAtIndex_1, cell != null ? cell.id : 0, index);
+}
+
+public void setNeedsDisplayForItemAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_setNeedsDisplayForItemAtIndex_1, index);
+}
+
+public void setNeedsSizing(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setNeedsSizing_1, flag);
+}
+
+public void setWindowFrameForAttachingToRect(NSRect screenRect, NSScreen screen, int edge, int selectedItemIndex) {
+ OS.objc_msgSend(this.id, OS.sel_setWindowFrameForAttachingToRect_1onScreen_1preferredEdge_1popUpSelectedItem_1, screenRect, screen != null ? screen.id : 0, edge, selectedItemIndex);
+}
+
+public void sizeToFit() {
+ OS.objc_msgSend(this.id, OS.sel_sizeToFit);
+}
+
+public float stateImageOffset() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_stateImageOffset);
+}
+
+public float stateImageWidth() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_stateImageWidth);
+}
+
+public boolean trackWithEvent(NSEvent event) {
+ return OS.objc_msgSend(this.id, OS.sel_trackWithEvent_1, event != null ? event.id : 0) != 0;
+}
+
+public void update() {
+ OS.objc_msgSend(this.id, OS.sel_update);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMessagePortNameServer.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMessagePortNameServer.java
new file mode 100644
index 0000000000..36a51c6c0e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMessagePortNameServer.java
@@ -0,0 +1,28 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMessagePortNameServer extends NSPortNameServer {
+
+public NSMessagePortNameServer() {
+ super();
+}
+
+public NSMessagePortNameServer(int id) {
+ super(id);
+}
+
+public NSPort portForName_(NSString name) {
+ int result = OS.objc_msgSend(this.id, OS.sel_portForName_1, name != null ? name.id : 0);
+ return result != 0 ? new NSPort(result) : null;
+}
+
+public NSPort portForName_host_(NSString name, NSString host) {
+ int result = OS.objc_msgSend(this.id, OS.sel_portForName_1host_1, name != null ? name.id : 0, host != null ? host.id : 0);
+ return result != 0 ? new NSPort(result) : null;
+}
+
+public static id sharedInstance() {
+ int result = OS.objc_msgSend(OS.class_NSMessagePortNameServer, OS.sel_sharedInstance);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMetadataItem.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMetadataItem.java
new file mode 100644
index 0000000000..7fbe584e56
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMetadataItem.java
@@ -0,0 +1,28 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMetadataItem extends NSObject {
+
+public NSMetadataItem() {
+ super();
+}
+
+public NSMetadataItem(int id) {
+ super(id);
+}
+
+public NSArray attributes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public id valueForAttribute(NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_valueForAttribute_1, key != null ? key.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSDictionary valuesForAttributes(NSArray keys) {
+ int result = OS.objc_msgSend(this.id, OS.sel_valuesForAttributes_1, keys != null ? keys.id : 0);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMetadataQuery.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMetadataQuery.java
new file mode 100644
index 0000000000..c96a67313a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMetadataQuery.java
@@ -0,0 +1,136 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMetadataQuery extends NSObject {
+
+public NSMetadataQuery() {
+ super();
+}
+
+public NSMetadataQuery(int id) {
+ super(id);
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public void disableUpdates() {
+ OS.objc_msgSend(this.id, OS.sel_disableUpdates);
+}
+
+public void enableUpdates() {
+ OS.objc_msgSend(this.id, OS.sel_enableUpdates);
+}
+
+public NSArray groupedResults() {
+ int result = OS.objc_msgSend(this.id, OS.sel_groupedResults);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray groupingAttributes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_groupingAttributes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public int indexOfResult(id result) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfResult_1, result != null ? result.id : 0);
+}
+
+public boolean isGathering() {
+ return OS.objc_msgSend(this.id, OS.sel_isGathering) != 0;
+}
+
+public boolean isStarted() {
+ return OS.objc_msgSend(this.id, OS.sel_isStarted) != 0;
+}
+
+public boolean isStopped() {
+ return OS.objc_msgSend(this.id, OS.sel_isStopped) != 0;
+}
+
+public double notificationBatchingInterval() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_notificationBatchingInterval);
+}
+
+public NSPredicate predicate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_predicate);
+ return result != 0 ? new NSPredicate(result) : null;
+}
+
+public id resultAtIndex(int idx) {
+ int result = OS.objc_msgSend(this.id, OS.sel_resultAtIndex_1, idx);
+ return result != 0 ? new id(result) : null;
+}
+
+public int resultCount() {
+ return OS.objc_msgSend(this.id, OS.sel_resultCount);
+}
+
+public NSArray results() {
+ int result = OS.objc_msgSend(this.id, OS.sel_results);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray searchScopes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_searchScopes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void setDelegate(id delegate) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegate != null ? delegate.id : 0);
+}
+
+public void setGroupingAttributes(NSArray attrs) {
+ OS.objc_msgSend(this.id, OS.sel_setGroupingAttributes_1, attrs != null ? attrs.id : 0);
+}
+
+public void setNotificationBatchingInterval(double ti) {
+ OS.objc_msgSend(this.id, OS.sel_setNotificationBatchingInterval_1, ti);
+}
+
+public void setPredicate(NSPredicate predicate) {
+ OS.objc_msgSend(this.id, OS.sel_setPredicate_1, predicate != null ? predicate.id : 0);
+}
+
+public void setSearchScopes(NSArray scopes) {
+ OS.objc_msgSend(this.id, OS.sel_setSearchScopes_1, scopes != null ? scopes.id : 0);
+}
+
+public void setSortDescriptors(NSArray descriptors) {
+ OS.objc_msgSend(this.id, OS.sel_setSortDescriptors_1, descriptors != null ? descriptors.id : 0);
+}
+
+public void setValueListAttributes(NSArray attrs) {
+ OS.objc_msgSend(this.id, OS.sel_setValueListAttributes_1, attrs != null ? attrs.id : 0);
+}
+
+public NSArray sortDescriptors() {
+ int result = OS.objc_msgSend(this.id, OS.sel_sortDescriptors);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean startQuery() {
+ return OS.objc_msgSend(this.id, OS.sel_startQuery) != 0;
+}
+
+public void stopQuery() {
+ OS.objc_msgSend(this.id, OS.sel_stopQuery);
+}
+
+public NSArray valueListAttributes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_valueListAttributes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSDictionary valueLists() {
+ int result = OS.objc_msgSend(this.id, OS.sel_valueLists);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public id valueOfAttribute(NSString attrName, int idx) {
+ int result = OS.objc_msgSend(this.id, OS.sel_valueOfAttribute_1forResultAtIndex_1, attrName != null ? attrName.id : 0, idx);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMetadataQueryAttributeValueTuple.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMetadataQueryAttributeValueTuple.java
new file mode 100644
index 0000000000..bba6a76e9c
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMetadataQueryAttributeValueTuple.java
@@ -0,0 +1,27 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMetadataQueryAttributeValueTuple extends NSObject {
+
+public NSMetadataQueryAttributeValueTuple() {
+ super();
+}
+
+public NSMetadataQueryAttributeValueTuple(int id) {
+ super(id);
+}
+
+public NSString attribute() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attribute);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int count() {
+ return OS.objc_msgSend(this.id, OS.sel_count);
+}
+
+public id value() {
+ int result = OS.objc_msgSend(this.id, OS.sel_value);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMetadataQueryResultGroup.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMetadataQueryResultGroup.java
new file mode 100644
index 0000000000..8b964f9ecd
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMetadataQueryResultGroup.java
@@ -0,0 +1,42 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMetadataQueryResultGroup extends NSObject {
+
+public NSMetadataQueryResultGroup() {
+ super();
+}
+
+public NSMetadataQueryResultGroup(int id) {
+ super(id);
+}
+
+public NSString attribute() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attribute);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id resultAtIndex(int idx) {
+ int result = OS.objc_msgSend(this.id, OS.sel_resultAtIndex_1, idx);
+ return result != 0 ? new id(result) : null;
+}
+
+public int resultCount() {
+ return OS.objc_msgSend(this.id, OS.sel_resultCount);
+}
+
+public NSArray results() {
+ int result = OS.objc_msgSend(this.id, OS.sel_results);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray subgroups() {
+ int result = OS.objc_msgSend(this.id, OS.sel_subgroups);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public id value() {
+ int result = OS.objc_msgSend(this.id, OS.sel_value);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMethodSignature.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMethodSignature.java
new file mode 100644
index 0000000000..710c086582
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMethodSignature.java
@@ -0,0 +1,42 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMethodSignature extends NSObject {
+
+public NSMethodSignature() {
+ super();
+}
+
+public NSMethodSignature(int id) {
+ super(id);
+}
+
+public int frameLength() {
+ return OS.objc_msgSend(this.id, OS.sel_frameLength);
+}
+
+public int getArgumentTypeAtIndex(int idx) {
+ return OS.objc_msgSend(this.id, OS.sel_getArgumentTypeAtIndex_1, idx);
+}
+
+public boolean isOneway() {
+ return OS.objc_msgSend(this.id, OS.sel_isOneway) != 0;
+}
+
+public int methodReturnLength() {
+ return OS.objc_msgSend(this.id, OS.sel_methodReturnLength);
+}
+
+public int methodReturnType() {
+ return OS.objc_msgSend(this.id, OS.sel_methodReturnType);
+}
+
+public int numberOfArguments() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfArguments);
+}
+
+public static NSMethodSignature signatureWithObjCTypes(int types) {
+ int result = OS.objc_msgSend(OS.class_NSMethodSignature, OS.sel_signatureWithObjCTypes_1, types);
+ return result != 0 ? new NSMethodSignature(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMoveCommand.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMoveCommand.java
new file mode 100644
index 0000000000..a085b63ae3
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMoveCommand.java
@@ -0,0 +1,22 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMoveCommand extends NSScriptCommand {
+
+public NSMoveCommand() {
+ super();
+}
+
+public NSMoveCommand(int id) {
+ super(id);
+}
+
+public NSScriptObjectSpecifier keySpecifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_keySpecifier);
+ return result != 0 ? new NSScriptObjectSpecifier(result) : null;
+}
+
+public void setReceiversSpecifier(NSScriptObjectSpecifier receiversRef) {
+ OS.objc_msgSend(this.id, OS.sel_setReceiversSpecifier_1, receiversRef != null ? receiversRef.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMovie.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMovie.java
new file mode 100644
index 0000000000..717418782e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMovie.java
@@ -0,0 +1,51 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMovie extends NSObject {
+
+public NSMovie() {
+ super();
+}
+
+public NSMovie(int id) {
+ super(id);
+}
+
+public int QTMovie() {
+ return OS.objc_msgSend(this.id, OS.sel_QTMovie);
+}
+
+public NSURL URL() {
+ int result = OS.objc_msgSend(this.id, OS.sel_URL);
+ return result != 0 ? new NSURL(result) : null;
+}
+
+public static boolean canInitWithPasteboard(NSPasteboard pasteboard) {
+ return OS.objc_msgSend(OS.class_NSMovie, OS.sel_canInitWithPasteboard_1, pasteboard != null ? pasteboard.id : 0) != 0;
+}
+
+public NSMovie initWithMovie(int movie) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithMovie_1, movie);
+ return result != 0 ? this : null;
+}
+
+public NSMovie initWithPasteboard(NSPasteboard pasteboard) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithPasteboard_1, pasteboard != null ? pasteboard.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSMovie initWithURL(NSURL url, boolean byRef) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithURL_1byReference_1, url != null ? url.id : 0, byRef);
+ return result != 0 ? this : null;
+}
+
+public static NSArray movieUnfilteredFileTypes() {
+ int result = OS.objc_msgSend(OS.class_NSMovie, OS.sel_movieUnfilteredFileTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray movieUnfilteredPasteboardTypes() {
+ int result = OS.objc_msgSend(OS.class_NSMovie, OS.sel_movieUnfilteredPasteboardTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMovieView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMovieView.java
new file mode 100644
index 0000000000..45926e0f3a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMovieView.java
@@ -0,0 +1,162 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMovieView extends NSView {
+
+public NSMovieView() {
+ super();
+}
+
+public NSMovieView(int id) {
+ super(id);
+}
+
+public void clear(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_clear_1, sender != null ? sender.id : 0);
+}
+
+public void copy(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_copy_1, sender != null ? sender.id : 0);
+}
+
+public void cut(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_cut_1, sender != null ? sender.id : 0);
+}
+
+public void delete(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_delete_1, sender != null ? sender.id : 0);
+}
+
+public void gotoBeginning(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_gotoBeginning_1, sender != null ? sender.id : 0);
+}
+
+public void gotoEnd(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_gotoEnd_1, sender != null ? sender.id : 0);
+}
+
+public void gotoPosterFrame(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_gotoPosterFrame_1, sender != null ? sender.id : 0);
+}
+
+public boolean isControllerVisible() {
+ return OS.objc_msgSend(this.id, OS.sel_isControllerVisible) != 0;
+}
+
+public boolean isEditable() {
+ return OS.objc_msgSend(this.id, OS.sel_isEditable) != 0;
+}
+
+public boolean isMuted() {
+ return OS.objc_msgSend(this.id, OS.sel_isMuted) != 0;
+}
+
+public boolean isPlaying() {
+ return OS.objc_msgSend(this.id, OS.sel_isPlaying) != 0;
+}
+
+public int loopMode() {
+ return OS.objc_msgSend(this.id, OS.sel_loopMode);
+}
+
+public NSMovie movie() {
+ int result = OS.objc_msgSend(this.id, OS.sel_movie);
+ return result != 0 ? new NSMovie(result) : null;
+}
+
+public int movieController() {
+ return OS.objc_msgSend(this.id, OS.sel_movieController);
+}
+
+public NSRect movieRect() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_movieRect);
+ return result;
+}
+
+public void paste(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_paste_1, sender != null ? sender.id : 0);
+}
+
+public boolean playsEveryFrame() {
+ return OS.objc_msgSend(this.id, OS.sel_playsEveryFrame) != 0;
+}
+
+public boolean playsSelectionOnly() {
+ return OS.objc_msgSend(this.id, OS.sel_playsSelectionOnly) != 0;
+}
+
+public float rate() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_rate);
+}
+
+public void resizeWithMagnification(float magnification) {
+ OS.objc_msgSend(this.id, OS.sel_resizeWithMagnification_1, magnification);
+}
+
+public void selectAll(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectAll_1, sender != null ? sender.id : 0);
+}
+
+public void setEditable(boolean editable) {
+ OS.objc_msgSend(this.id, OS.sel_setEditable_1, editable);
+}
+
+public void setLoopMode(int mode) {
+ OS.objc_msgSend(this.id, OS.sel_setLoopMode_1, mode);
+}
+
+public void setMovie(NSMovie movie) {
+ OS.objc_msgSend(this.id, OS.sel_setMovie_1, movie != null ? movie.id : 0);
+}
+
+public void setMuted(boolean mute) {
+ OS.objc_msgSend(this.id, OS.sel_setMuted_1, mute);
+}
+
+public void setPlaysEveryFrame(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setPlaysEveryFrame_1, flag);
+}
+
+public void setPlaysSelectionOnly(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setPlaysSelectionOnly_1, flag);
+}
+
+public void setRate(float rate) {
+ OS.objc_msgSend(this.id, OS.sel_setRate_1, rate);
+}
+
+public void setVolume(float volume) {
+ OS.objc_msgSend(this.id, OS.sel_setVolume_1, volume);
+}
+
+public void showController(boolean show, boolean adjustSize) {
+ OS.objc_msgSend(this.id, OS.sel_showController_1adjustingSize_1, show, adjustSize);
+}
+
+public NSSize sizeForMagnification(float magnification) {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_sizeForMagnification_1, magnification);
+ return result;
+}
+
+public void start(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_start_1, sender != null ? sender.id : 0);
+}
+
+public void stepBack(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_stepBack_1, sender != null ? sender.id : 0);
+}
+
+public void stepForward(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_stepForward_1, sender != null ? sender.id : 0);
+}
+
+public void stop(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_stop_1, sender != null ? sender.id : 0);
+}
+
+public float volume() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_volume);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableArray.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableArray.java
new file mode 100644
index 0000000000..21c9d3ad3b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableArray.java
@@ -0,0 +1,123 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMutableArray extends NSArray {
+
+public NSMutableArray() {
+ super();
+}
+
+public NSMutableArray(int id) {
+ super(id);
+}
+
+public void addObject(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_addObject_1, anObject != null ? anObject.id : 0);
+}
+
+public void addObjectsFromArray(NSArray otherArray) {
+ OS.objc_msgSend(this.id, OS.sel_addObjectsFromArray_1, otherArray != null ? otherArray.id : 0);
+}
+
+public static id arrayWithCapacity(int numItems) {
+ int result = OS.objc_msgSend(OS.class_NSMutableArray, OS.sel_arrayWithCapacity_1, numItems);
+ return result != 0 ? new id(result) : null;
+}
+
+public void exchangeObjectAtIndex(int idx1, int idx2) {
+ OS.objc_msgSend(this.id, OS.sel_exchangeObjectAtIndex_1withObjectAtIndex_1, idx1, idx2);
+}
+
+public void filterUsingPredicate(NSPredicate predicate) {
+ OS.objc_msgSend(this.id, OS.sel_filterUsingPredicate_1, predicate != null ? predicate.id : 0);
+}
+
+public NSMutableArray initWithCapacity(int numItems) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCapacity_1, numItems);
+ return result != 0 ? this : null;
+}
+
+public void insertObject(id anObject, int index) {
+ OS.objc_msgSend(this.id, OS.sel_insertObject_1atIndex_1, anObject != null ? anObject.id : 0, index);
+}
+
+public void insertObjects(NSArray objects, NSIndexSet indexes) {
+ OS.objc_msgSend(this.id, OS.sel_insertObjects_1atIndexes_1, objects != null ? objects.id : 0, indexes != null ? indexes.id : 0);
+}
+
+public void removeAllObjects() {
+ OS.objc_msgSend(this.id, OS.sel_removeAllObjects);
+}
+
+public void removeLastObject() {
+ OS.objc_msgSend(this.id, OS.sel_removeLastObject);
+}
+
+public void removeObject_(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_removeObject_1, anObject != null ? anObject.id : 0);
+}
+
+public void removeObject_inRange_(id anObject, NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_removeObject_1inRange_1, anObject != null ? anObject.id : 0, range);
+}
+
+public void removeObjectAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_removeObjectAtIndex_1, index);
+}
+
+public void removeObjectIdenticalTo_(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_removeObjectIdenticalTo_1, anObject != null ? anObject.id : 0);
+}
+
+public void removeObjectIdenticalTo_inRange_(id anObject, NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_removeObjectIdenticalTo_1inRange_1, anObject != null ? anObject.id : 0, range);
+}
+
+public void removeObjectsAtIndexes(NSIndexSet indexes) {
+ OS.objc_msgSend(this.id, OS.sel_removeObjectsAtIndexes_1, indexes != null ? indexes.id : 0);
+}
+
+public void removeObjectsFromIndices(int indices, int cnt) {
+ OS.objc_msgSend(this.id, OS.sel_removeObjectsFromIndices_1numIndices_1, indices, cnt);
+}
+
+public void removeObjectsInArray(NSArray otherArray) {
+ OS.objc_msgSend(this.id, OS.sel_removeObjectsInArray_1, otherArray != null ? otherArray.id : 0);
+}
+
+public void removeObjectsInRange(NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_removeObjectsInRange_1, range);
+}
+
+public void replaceObjectAtIndex(int index, id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_replaceObjectAtIndex_1withObject_1, index, anObject != null ? anObject.id : 0);
+}
+
+public void replaceObjectsAtIndexes(NSIndexSet indexes, NSArray objects) {
+ OS.objc_msgSend(this.id, OS.sel_replaceObjectsAtIndexes_1withObjects_1, indexes != null ? indexes.id : 0, objects != null ? objects.id : 0);
+}
+
+public void replaceObjectsInRange_withObjectsFromArray_(NSRange range, NSArray otherArray) {
+ OS.objc_msgSend(this.id, OS.sel_replaceObjectsInRange_1withObjectsFromArray_1, range, otherArray != null ? otherArray.id : 0);
+}
+
+public void replaceObjectsInRange_withObjectsFromArray_range_(NSRange range, NSArray otherArray, NSRange otherRange) {
+ OS.objc_msgSend(this.id, OS.sel_replaceObjectsInRange_1withObjectsFromArray_1range_1, range, otherArray != null ? otherArray.id : 0, otherRange);
+}
+
+public void setArray(NSArray otherArray) {
+ OS.objc_msgSend(this.id, OS.sel_setArray_1, otherArray != null ? otherArray.id : 0);
+}
+
+public void sortUsingDescriptors(NSArray sortDescriptors) {
+ OS.objc_msgSend(this.id, OS.sel_sortUsingDescriptors_1, sortDescriptors != null ? sortDescriptors.id : 0);
+}
+
+public void sortUsingFunction(int compare, int context) {
+ OS.objc_msgSend(this.id, OS.sel_sortUsingFunction_1context_1, compare, context);
+}
+
+public void sortUsingSelector(int comparator) {
+ OS.objc_msgSend(this.id, OS.sel_sortUsingSelector_1, comparator);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableAttributedString.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableAttributedString.java
new file mode 100644
index 0000000000..8ead3d50a9
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableAttributedString.java
@@ -0,0 +1,66 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMutableAttributedString extends NSAttributedString {
+
+public NSMutableAttributedString() {
+ super();
+}
+
+public NSMutableAttributedString(int id) {
+ super(id);
+}
+
+public void addAttribute(int name, id value, NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_addAttribute_1value_1range_1, name, value != null ? value.id : 0, range);
+}
+
+public void addAttributes(NSDictionary attrs, NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_addAttributes_1range_1, attrs != null ? attrs.id : 0, range);
+}
+
+public void appendAttributedString(NSAttributedString attrString) {
+ OS.objc_msgSend(this.id, OS.sel_appendAttributedString_1, attrString != null ? attrString.id : 0);
+}
+
+public void beginEditing() {
+ OS.objc_msgSend(this.id, OS.sel_beginEditing);
+}
+
+public void deleteCharactersInRange(NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_deleteCharactersInRange_1, range);
+}
+
+public void endEditing() {
+ OS.objc_msgSend(this.id, OS.sel_endEditing);
+}
+
+public void insertAttributedString(NSAttributedString attrString, int loc) {
+ OS.objc_msgSend(this.id, OS.sel_insertAttributedString_1atIndex_1, attrString != null ? attrString.id : 0, loc);
+}
+
+public NSMutableString mutableString() {
+ int result = OS.objc_msgSend(this.id, OS.sel_mutableString);
+ return result != 0 ? new NSMutableString(result) : null;
+}
+
+public void removeAttribute(NSString name, NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_removeAttribute_1range_1, name != null ? name.id : 0, range);
+}
+
+public void replaceCharactersInRange_withAttributedString_(NSRange range, NSAttributedString attrString) {
+ OS.objc_msgSend(this.id, OS.sel_replaceCharactersInRange_1withAttributedString_1, range, attrString != null ? attrString.id : 0);
+}
+
+public void replaceCharactersInRange_withString_(NSRange range, NSString str) {
+ OS.objc_msgSend(this.id, OS.sel_replaceCharactersInRange_1withString_1, range, str != null ? str.id : 0);
+}
+
+public void setAttributedString(NSAttributedString attrString) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributedString_1, attrString != null ? attrString.id : 0);
+}
+
+public void setAttributes(NSDictionary attrs, NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributes_1range_1, attrs != null ? attrs.id : 0, range);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableCharacterSet.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableCharacterSet.java
new file mode 100644
index 0000000000..c0c3b60888
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableCharacterSet.java
@@ -0,0 +1,41 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMutableCharacterSet extends NSCharacterSet {
+
+public NSMutableCharacterSet() {
+ super();
+}
+
+public NSMutableCharacterSet(int id) {
+ super(id);
+}
+
+public void addCharactersInRange(NSRange aRange) {
+ OS.objc_msgSend(this.id, OS.sel_addCharactersInRange_1, aRange);
+}
+
+public void addCharactersInString(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_addCharactersInString_1, aString != null ? aString.id : 0);
+}
+
+public void formIntersectionWithCharacterSet(NSCharacterSet otherSet) {
+ OS.objc_msgSend(this.id, OS.sel_formIntersectionWithCharacterSet_1, otherSet != null ? otherSet.id : 0);
+}
+
+public void formUnionWithCharacterSet(NSCharacterSet otherSet) {
+ OS.objc_msgSend(this.id, OS.sel_formUnionWithCharacterSet_1, otherSet != null ? otherSet.id : 0);
+}
+
+public void invert() {
+ OS.objc_msgSend(this.id, OS.sel_invert);
+}
+
+public void removeCharactersInRange(NSRange aRange) {
+ OS.objc_msgSend(this.id, OS.sel_removeCharactersInRange_1, aRange);
+}
+
+public void removeCharactersInString(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_removeCharactersInString_1, aString != null ? aString.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableData.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableData.java
new file mode 100644
index 0000000000..3fde7c4d2d
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableData.java
@@ -0,0 +1,69 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMutableData extends NSData {
+
+public NSMutableData() {
+ super();
+}
+
+public NSMutableData(int id) {
+ super(id);
+}
+
+public void appendBytes(int bytes, int length) {
+ OS.objc_msgSend(this.id, OS.sel_appendBytes_1length_1, bytes, length);
+}
+
+public void appendData(NSData other) {
+ OS.objc_msgSend(this.id, OS.sel_appendData_1, other != null ? other.id : 0);
+}
+
+public static id dataWithCapacity(int aNumItems) {
+ int result = OS.objc_msgSend(OS.class_NSMutableData, OS.sel_dataWithCapacity_1, aNumItems);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id dataWithLength(int length) {
+ int result = OS.objc_msgSend(OS.class_NSMutableData, OS.sel_dataWithLength_1, length);
+ return result != 0 ? new id(result) : null;
+}
+
+public void increaseLengthBy(int extraLength) {
+ OS.objc_msgSend(this.id, OS.sel_increaseLengthBy_1, extraLength);
+}
+
+public NSMutableData initWithCapacity(int capacity) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCapacity_1, capacity);
+ return result != 0 ? this : null;
+}
+
+public NSMutableData initWithLength(int length) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithLength_1, length);
+ return result != 0 ? this : null;
+}
+
+public int mutableBytes() {
+ return OS.objc_msgSend(this.id, OS.sel_mutableBytes);
+}
+
+public void replaceBytesInRange_withBytes_(NSRange range, int bytes) {
+ OS.objc_msgSend(this.id, OS.sel_replaceBytesInRange_1withBytes_1, range, bytes);
+}
+
+public void replaceBytesInRange_withBytes_length_(NSRange range, int replacementBytes, int replacementLength) {
+ OS.objc_msgSend(this.id, OS.sel_replaceBytesInRange_1withBytes_1length_1, range, replacementBytes, replacementLength);
+}
+
+public void resetBytesInRange(NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_resetBytesInRange_1, range);
+}
+
+public void setData(NSData data) {
+ OS.objc_msgSend(this.id, OS.sel_setData_1, data != null ? data.id : 0);
+}
+
+public void setLength(int length) {
+ OS.objc_msgSend(this.id, OS.sel_setLength_1, length);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableDictionary.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableDictionary.java
new file mode 100644
index 0000000000..d5b09aa570
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableDictionary.java
@@ -0,0 +1,55 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMutableDictionary extends NSDictionary {
+
+public NSMutableDictionary() {
+ super();
+}
+
+public NSMutableDictionary(int id) {
+ super(id);
+}
+
+public void addEntriesFromDictionary(NSDictionary otherDictionary) {
+ OS.objc_msgSend(this.id, OS.sel_addEntriesFromDictionary_1, otherDictionary != null ? otherDictionary.id : 0);
+}
+
+public static NSMutableDictionary dictionaryWithCapacity(int numItems) {
+ int result = OS.objc_msgSend(OS.class_NSMutableDictionary, OS.sel_dictionaryWithCapacity_1, numItems);
+ return result != 0 ? new NSMutableDictionary(result) : null;
+}
+
+public NSMutableDictionary initWithCapacity(int numItems) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCapacity_1, numItems);
+ return result != 0 ? this : null;
+}
+
+public void removeAllObjects() {
+ OS.objc_msgSend(this.id, OS.sel_removeAllObjects);
+}
+
+public void removeObjectForKey(id aKey) {
+ OS.objc_msgSend(this.id, OS.sel_removeObjectForKey_1, aKey != null ? aKey.id : 0);
+}
+
+public void removeObjectsForKeys(NSArray keyArray) {
+ OS.objc_msgSend(this.id, OS.sel_removeObjectsForKeys_1, keyArray != null ? keyArray.id : 0);
+}
+
+public void setDictionary(NSDictionary otherDictionary) {
+ OS.objc_msgSend(this.id, OS.sel_setDictionary_1, otherDictionary != null ? otherDictionary.id : 0);
+}
+
+public void setObject(id anObject, id aKey) {
+ OS.objc_msgSend(this.id, OS.sel_setObject_1forKey_1, anObject != null ? anObject.id : 0, aKey != null ? aKey.id : 0);
+}
+
+public void setObject(id anObject, int aKey) {
+ OS.objc_msgSend(this.id, OS.sel_setObject_1forKey_1, anObject != null ? anObject.id : 0, aKey);
+}
+
+public void setValue(id value, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_setValue_1forKey_1, value != null ? value.id : 0, key != null ? key.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableIndexSet.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableIndexSet.java
new file mode 100644
index 0000000000..d6e881ebbb
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableIndexSet.java
@@ -0,0 +1,45 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMutableIndexSet extends NSIndexSet {
+
+public NSMutableIndexSet() {
+ super();
+}
+
+public NSMutableIndexSet(int id) {
+ super(id);
+}
+
+public void addIndex(int value) {
+ OS.objc_msgSend(this.id, OS.sel_addIndex_1, value);
+}
+
+public void addIndexes(NSIndexSet indexSet) {
+ OS.objc_msgSend(this.id, OS.sel_addIndexes_1, indexSet != null ? indexSet.id : 0);
+}
+
+public void addIndexesInRange(NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_addIndexesInRange_1, range);
+}
+
+public void removeAllIndexes() {
+ OS.objc_msgSend(this.id, OS.sel_removeAllIndexes);
+}
+
+public void removeIndex(int value) {
+ OS.objc_msgSend(this.id, OS.sel_removeIndex_1, value);
+}
+
+public void removeIndexes(NSIndexSet indexSet) {
+ OS.objc_msgSend(this.id, OS.sel_removeIndexes_1, indexSet != null ? indexSet.id : 0);
+}
+
+public void removeIndexesInRange(NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_removeIndexesInRange_1, range);
+}
+
+public void shiftIndexesStartingAtIndex(int index, int delta) {
+ OS.objc_msgSend(this.id, OS.sel_shiftIndexesStartingAtIndex_1by_1, index, delta);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableParagraphStyle.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableParagraphStyle.java
new file mode 100644
index 0000000000..a26ef9c357
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableParagraphStyle.java
@@ -0,0 +1,101 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMutableParagraphStyle extends NSParagraphStyle {
+
+public NSMutableParagraphStyle() {
+ super();
+}
+
+public NSMutableParagraphStyle(int id) {
+ super(id);
+}
+
+public void addTabStop(NSTextTab anObject) {
+ OS.objc_msgSend(this.id, OS.sel_addTabStop_1, anObject != null ? anObject.id : 0);
+}
+
+public void removeTabStop(NSTextTab anObject) {
+ OS.objc_msgSend(this.id, OS.sel_removeTabStop_1, anObject != null ? anObject.id : 0);
+}
+
+public void setAlignment(int alignment) {
+ OS.objc_msgSend(this.id, OS.sel_setAlignment_1, alignment);
+}
+
+public void setBaseWritingDirection(int writingDirection) {
+ OS.objc_msgSend(this.id, OS.sel_setBaseWritingDirection_1, writingDirection);
+}
+
+public void setDefaultTabInterval(float aFloat) {
+ OS.objc_msgSend(this.id, OS.sel_setDefaultTabInterval_1, aFloat);
+}
+
+public void setFirstLineHeadIndent(float aFloat) {
+ OS.objc_msgSend(this.id, OS.sel_setFirstLineHeadIndent_1, aFloat);
+}
+
+public void setHeadIndent(float aFloat) {
+ OS.objc_msgSend(this.id, OS.sel_setHeadIndent_1, aFloat);
+}
+
+public void setHeaderLevel(int level) {
+ OS.objc_msgSend(this.id, OS.sel_setHeaderLevel_1, level);
+}
+
+public void setHyphenationFactor(float aFactor) {
+ OS.objc_msgSend(this.id, OS.sel_setHyphenationFactor_1, aFactor);
+}
+
+public void setLineBreakMode(int mode) {
+ OS.objc_msgSend(this.id, OS.sel_setLineBreakMode_1, mode);
+}
+
+public void setLineHeightMultiple(float aFloat) {
+ OS.objc_msgSend(this.id, OS.sel_setLineHeightMultiple_1, aFloat);
+}
+
+public void setLineSpacing(float aFloat) {
+ OS.objc_msgSend(this.id, OS.sel_setLineSpacing_1, aFloat);
+}
+
+public void setMaximumLineHeight(float aFloat) {
+ OS.objc_msgSend(this.id, OS.sel_setMaximumLineHeight_1, aFloat);
+}
+
+public void setMinimumLineHeight(float aFloat) {
+ OS.objc_msgSend(this.id, OS.sel_setMinimumLineHeight_1, aFloat);
+}
+
+public void setParagraphSpacing(float aFloat) {
+ OS.objc_msgSend(this.id, OS.sel_setParagraphSpacing_1, aFloat);
+}
+
+public void setParagraphSpacingBefore(float aFloat) {
+ OS.objc_msgSend(this.id, OS.sel_setParagraphSpacingBefore_1, aFloat);
+}
+
+public void setParagraphStyle(NSParagraphStyle obj) {
+ OS.objc_msgSend(this.id, OS.sel_setParagraphStyle_1, obj != null ? obj.id : 0);
+}
+
+public void setTabStops(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setTabStops_1, array != null ? array.id : 0);
+}
+
+public void setTailIndent(float aFloat) {
+ OS.objc_msgSend(this.id, OS.sel_setTailIndent_1, aFloat);
+}
+
+public void setTextBlocks(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setTextBlocks_1, array != null ? array.id : 0);
+}
+
+public void setTextLists(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setTextLists_1, array != null ? array.id : 0);
+}
+
+public void setTighteningFactorForTruncation(float aFactor) {
+ OS.objc_msgSend(this.id, OS.sel_setTighteningFactorForTruncation_1, aFactor);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableSet.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableSet.java
new file mode 100644
index 0000000000..f6847b8a67
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableSet.java
@@ -0,0 +1,59 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMutableSet extends NSSet {
+
+public NSMutableSet() {
+ super();
+}
+
+public NSMutableSet(int id) {
+ super(id);
+}
+
+public void addObject(id object) {
+ OS.objc_msgSend(this.id, OS.sel_addObject_1, object != null ? object.id : 0);
+}
+
+public void addObjectsFromArray(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_addObjectsFromArray_1, array != null ? array.id : 0);
+}
+
+public void filterUsingPredicate(NSPredicate predicate) {
+ OS.objc_msgSend(this.id, OS.sel_filterUsingPredicate_1, predicate != null ? predicate.id : 0);
+}
+
+public NSMutableSet initWithCapacity(int numItems) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCapacity_1, numItems);
+ return result != 0 ? this : null;
+}
+
+public void intersectSet(NSSet otherSet) {
+ OS.objc_msgSend(this.id, OS.sel_intersectSet_1, otherSet != null ? otherSet.id : 0);
+}
+
+public void minusSet(NSSet otherSet) {
+ OS.objc_msgSend(this.id, OS.sel_minusSet_1, otherSet != null ? otherSet.id : 0);
+}
+
+public void removeAllObjects() {
+ OS.objc_msgSend(this.id, OS.sel_removeAllObjects);
+}
+
+public void removeObject(id object) {
+ OS.objc_msgSend(this.id, OS.sel_removeObject_1, object != null ? object.id : 0);
+}
+
+public void setSet(NSSet otherSet) {
+ OS.objc_msgSend(this.id, OS.sel_setSet_1, otherSet != null ? otherSet.id : 0);
+}
+
+public static id setWithCapacity(int numItems) {
+ int result = OS.objc_msgSend(OS.class_NSMutableSet, OS.sel_setWithCapacity_1, numItems);
+ return result != 0 ? new id(result) : null;
+}
+
+public void unionSet(NSSet otherSet) {
+ OS.objc_msgSend(this.id, OS.sel_unionSet_1, otherSet != null ? otherSet.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableString.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableString.java
new file mode 100644
index 0000000000..a4b6bac367
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableString.java
@@ -0,0 +1,51 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMutableString extends NSString {
+
+public NSMutableString() {
+ super();
+}
+
+public NSMutableString(int id) {
+ super(id);
+}
+
+public void appendFormat(NSString appendFormat) {
+ OS.objc_msgSend(this.id, OS.sel_appendFormat_1, appendFormat != null ? appendFormat.id : 0);
+}
+
+public void appendString(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_appendString_1, aString != null ? aString.id : 0);
+}
+
+public void deleteCharactersInRange(NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_deleteCharactersInRange_1, range);
+}
+
+public NSMutableString initWithCapacity(int capacity) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCapacity_1, capacity);
+ return result != 0 ? this : null;
+}
+
+public void insertString(NSString aString, int loc) {
+ OS.objc_msgSend(this.id, OS.sel_insertString_1atIndex_1, aString != null ? aString.id : 0, loc);
+}
+
+public void replaceCharactersInRange(NSRange range, NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_replaceCharactersInRange_1withString_1, range, aString != null ? aString.id : 0);
+}
+
+public int replaceOccurrencesOfString(NSString target, NSString replacement, int options, NSRange searchRange) {
+ return OS.objc_msgSend(this.id, OS.sel_replaceOccurrencesOfString_1withString_1options_1range_1, target != null ? target.id : 0, replacement != null ? replacement.id : 0, options, searchRange);
+}
+
+public void setString(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setString_1, aString != null ? aString.id : 0);
+}
+
+public static id stringWithCapacity(int capacity) {
+ int result = OS.objc_msgSend(OS.class_NSMutableString, OS.sel_stringWithCapacity_1, capacity);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableURLRequest.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableURLRequest.java
new file mode 100644
index 0000000000..8bcc0bd957
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMutableURLRequest.java
@@ -0,0 +1,57 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSMutableURLRequest extends NSURLRequest {
+
+public NSMutableURLRequest() {
+ super();
+}
+
+public NSMutableURLRequest(int id) {
+ super(id);
+}
+
+public void addValue(NSString value, NSString field) {
+ OS.objc_msgSend(this.id, OS.sel_addValue_1forHTTPHeaderField_1, value != null ? value.id : 0, field != null ? field.id : 0);
+}
+
+public void setAllHTTPHeaderFields(NSDictionary headerFields) {
+ OS.objc_msgSend(this.id, OS.sel_setAllHTTPHeaderFields_1, headerFields != null ? headerFields.id : 0);
+}
+
+public void setCachePolicy(int policy) {
+ OS.objc_msgSend(this.id, OS.sel_setCachePolicy_1, policy);
+}
+
+public void setHTTPBody(NSData data) {
+ OS.objc_msgSend(this.id, OS.sel_setHTTPBody_1, data != null ? data.id : 0);
+}
+
+public void setHTTPBodyStream(NSInputStream inputStream) {
+ OS.objc_msgSend(this.id, OS.sel_setHTTPBodyStream_1, inputStream != null ? inputStream.id : 0);
+}
+
+public void setHTTPMethod(NSString method) {
+ OS.objc_msgSend(this.id, OS.sel_setHTTPMethod_1, method != null ? method.id : 0);
+}
+
+public void setHTTPShouldHandleCookies(boolean should) {
+ OS.objc_msgSend(this.id, OS.sel_setHTTPShouldHandleCookies_1, should);
+}
+
+public void setMainDocumentURL(NSURL URL) {
+ OS.objc_msgSend(this.id, OS.sel_setMainDocumentURL_1, URL != null ? URL.id : 0);
+}
+
+public void setTimeoutInterval(double seconds) {
+ OS.objc_msgSend(this.id, OS.sel_setTimeoutInterval_1, seconds);
+}
+
+public void setURL(NSURL URL) {
+ OS.objc_msgSend(this.id, OS.sel_setURL_1, URL != null ? URL.id : 0);
+}
+
+public void setValue(NSString value, NSString field) {
+ OS.objc_msgSend(this.id, OS.sel_setValue_1forHTTPHeaderField_1, value != null ? value.id : 0, field != null ? field.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNameSpecifier.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNameSpecifier.java
new file mode 100644
index 0000000000..73521fb4a4
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNameSpecifier.java
@@ -0,0 +1,27 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSNameSpecifier extends NSScriptObjectSpecifier {
+
+public NSNameSpecifier() {
+ super();
+}
+
+public NSNameSpecifier(int id) {
+ super(id);
+}
+
+public id initWithContainerClassDescription(NSScriptClassDescription classDesc, NSScriptObjectSpecifier container, NSString property, NSString name) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContainerClassDescription_1containerSpecifier_1key_1name_1, classDesc != null ? classDesc.id : 0, container != null ? container.id : 0, property != null ? property.id : 0, name != null ? name.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString name() {
+ int result = OS.objc_msgSend(this.id, OS.sel_name);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void setName(NSString name) {
+ OS.objc_msgSend(this.id, OS.sel_setName_1, name != null ? name.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNetService.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNetService.java
new file mode 100644
index 0000000000..a02a0dea4f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNetService.java
@@ -0,0 +1,129 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSNetService extends NSObject {
+
+public NSNetService() {
+ super();
+}
+
+public NSNetService(int id) {
+ super(id);
+}
+
+public NSData TXTRecordData() {
+ int result = OS.objc_msgSend(this.id, OS.sel_TXTRecordData);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSArray addresses() {
+ int result = OS.objc_msgSend(this.id, OS.sel_addresses);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSData dataFromTXTRecordDictionary(NSDictionary txtDictionary) {
+ int result = OS.objc_msgSend(OS.class_NSNetService, OS.sel_dataFromTXTRecordDictionary_1, txtDictionary != null ? txtDictionary.id : 0);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public static NSDictionary dictionaryFromTXTRecordData(NSData txtData) {
+ int result = OS.objc_msgSend(OS.class_NSNetService, OS.sel_dictionaryFromTXTRecordData_1, txtData != null ? txtData.id : 0);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSString domain() {
+ int result = OS.objc_msgSend(this.id, OS.sel_domain);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean getInputStream(int inputStream, int outputStream) {
+ return OS.objc_msgSend(this.id, OS.sel_getInputStream_1outputStream_1, inputStream, outputStream) != 0;
+}
+
+public NSString hostName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_hostName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id initWithDomain_type_name_(NSString domain, NSString type, NSString name) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithDomain_1type_1name_1, domain != null ? domain.id : 0, type != null ? type.id : 0, name != null ? name.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithDomain_type_name_port_(NSString domain, NSString type, NSString name, int port) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithDomain_1type_1name_1port_1, domain != null ? domain.id : 0, type != null ? type.id : 0, name != null ? name.id : 0, port);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString name() {
+ int result = OS.objc_msgSend(this.id, OS.sel_name);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int port() {
+ return OS.objc_msgSend(this.id, OS.sel_port);
+}
+
+public NSString protocolSpecificInformation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_protocolSpecificInformation);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void publish() {
+ OS.objc_msgSend(this.id, OS.sel_publish);
+}
+
+public void publishWithOptions(int options) {
+ OS.objc_msgSend(this.id, OS.sel_publishWithOptions_1, options);
+}
+
+public void removeFromRunLoop(NSRunLoop aRunLoop, NSString mode) {
+ OS.objc_msgSend(this.id, OS.sel_removeFromRunLoop_1forMode_1, aRunLoop != null ? aRunLoop.id : 0, mode != null ? mode.id : 0);
+}
+
+public void resolve() {
+ OS.objc_msgSend(this.id, OS.sel_resolve);
+}
+
+public void resolveWithTimeout(double timeout) {
+ OS.objc_msgSend(this.id, OS.sel_resolveWithTimeout_1, timeout);
+}
+
+public void scheduleInRunLoop(NSRunLoop aRunLoop, NSString mode) {
+ OS.objc_msgSend(this.id, OS.sel_scheduleInRunLoop_1forMode_1, aRunLoop != null ? aRunLoop.id : 0, mode != null ? mode.id : 0);
+}
+
+public void setDelegate(id delegate) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegate != null ? delegate.id : 0);
+}
+
+public void setProtocolSpecificInformation(NSString specificInformation) {
+ OS.objc_msgSend(this.id, OS.sel_setProtocolSpecificInformation_1, specificInformation != null ? specificInformation.id : 0);
+}
+
+public boolean setTXTRecordData(NSData recordData) {
+ return OS.objc_msgSend(this.id, OS.sel_setTXTRecordData_1, recordData != null ? recordData.id : 0) != 0;
+}
+
+public void startMonitoring() {
+ OS.objc_msgSend(this.id, OS.sel_startMonitoring);
+}
+
+public void stop() {
+ OS.objc_msgSend(this.id, OS.sel_stop);
+}
+
+public void stopMonitoring() {
+ OS.objc_msgSend(this.id, OS.sel_stopMonitoring);
+}
+
+public NSString type() {
+ int result = OS.objc_msgSend(this.id, OS.sel_type);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNetServiceBrowser.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNetServiceBrowser.java
new file mode 100644
index 0000000000..8d387a62cf
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNetServiceBrowser.java
@@ -0,0 +1,50 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSNetServiceBrowser extends NSObject {
+
+public NSNetServiceBrowser() {
+ super();
+}
+
+public NSNetServiceBrowser(int id) {
+ super(id);
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public void removeFromRunLoop(NSRunLoop aRunLoop, NSString mode) {
+ OS.objc_msgSend(this.id, OS.sel_removeFromRunLoop_1forMode_1, aRunLoop != null ? aRunLoop.id : 0, mode != null ? mode.id : 0);
+}
+
+public void scheduleInRunLoop(NSRunLoop aRunLoop, NSString mode) {
+ OS.objc_msgSend(this.id, OS.sel_scheduleInRunLoop_1forMode_1, aRunLoop != null ? aRunLoop.id : 0, mode != null ? mode.id : 0);
+}
+
+public void searchForAllDomains() {
+ OS.objc_msgSend(this.id, OS.sel_searchForAllDomains);
+}
+
+public void searchForBrowsableDomains() {
+ OS.objc_msgSend(this.id, OS.sel_searchForBrowsableDomains);
+}
+
+public void searchForRegistrationDomains() {
+ OS.objc_msgSend(this.id, OS.sel_searchForRegistrationDomains);
+}
+
+public void searchForServicesOfType(NSString type, NSString domainString) {
+ OS.objc_msgSend(this.id, OS.sel_searchForServicesOfType_1inDomain_1, type != null ? type.id : 0, domainString != null ? domainString.id : 0);
+}
+
+public void setDelegate(id delegate) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegate != null ? delegate.id : 0);
+}
+
+public void stop() {
+ OS.objc_msgSend(this.id, OS.sel_stop);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNib.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNib.java
new file mode 100644
index 0000000000..739c3ca821
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNib.java
@@ -0,0 +1,31 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSNib extends NSObject {
+
+public NSNib() {
+ super();
+}
+
+public NSNib(int id) {
+ super(id);
+}
+
+public id initWithContentsOfURL(NSURL nibFileURL) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1, nibFileURL != null ? nibFileURL.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithNibNamed(NSString nibName, NSBundle bundle) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithNibNamed_1bundle_1, nibName != null ? nibName.id : 0, bundle != null ? bundle.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean instantiateNibWithExternalNameTable(NSDictionary externalNameTable) {
+ return OS.objc_msgSend(this.id, OS.sel_instantiateNibWithExternalNameTable_1, externalNameTable != null ? externalNameTable.id : 0) != 0;
+}
+
+public boolean instantiateNibWithOwner(id owner, int topLevelObjects) {
+ return OS.objc_msgSend(this.id, OS.sel_instantiateNibWithOwner_1topLevelObjects_1, owner != null ? owner.id : 0, topLevelObjects) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNibConnector.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNibConnector.java
new file mode 100644
index 0000000000..f2fb25e8f8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNibConnector.java
@@ -0,0 +1,48 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSNibConnector extends NSObject {
+
+public NSNibConnector() {
+ super();
+}
+
+public NSNibConnector(int id) {
+ super(id);
+}
+
+public id destination() {
+ int result = OS.objc_msgSend(this.id, OS.sel_destination);
+ return result != 0 ? new id(result) : null;
+}
+
+public void establishConnection() {
+ OS.objc_msgSend(this.id, OS.sel_establishConnection);
+}
+
+public NSString label() {
+ int result = OS.objc_msgSend(this.id, OS.sel_label);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void replaceObject(id oldObject, id newObject) {
+ OS.objc_msgSend(this.id, OS.sel_replaceObject_1withObject_1, oldObject != null ? oldObject.id : 0, newObject != null ? newObject.id : 0);
+}
+
+public void setDestination(id destination) {
+ OS.objc_msgSend(this.id, OS.sel_setDestination_1, destination != null ? destination.id : 0);
+}
+
+public void setLabel(NSString label) {
+ OS.objc_msgSend(this.id, OS.sel_setLabel_1, label != null ? label.id : 0);
+}
+
+public void setSource(id source) {
+ OS.objc_msgSend(this.id, OS.sel_setSource_1, source != null ? source.id : 0);
+}
+
+public id source() {
+ int result = OS.objc_msgSend(this.id, OS.sel_source);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNibControlConnector.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNibControlConnector.java
new file mode 100644
index 0000000000..69de38e45f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNibControlConnector.java
@@ -0,0 +1,17 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSNibControlConnector extends NSObject {
+
+public NSNibControlConnector() {
+ super();
+}
+
+public NSNibControlConnector(int id) {
+ super(id);
+}
+
+public void establishConnection() {
+ OS.objc_msgSend(this.id, OS.sel_establishConnection);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNibOutletConnector.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNibOutletConnector.java
new file mode 100644
index 0000000000..9d095f0921
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNibOutletConnector.java
@@ -0,0 +1,17 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSNibOutletConnector extends NSNibConnector {
+
+public NSNibOutletConnector() {
+ super();
+}
+
+public NSNibOutletConnector(int id) {
+ super(id);
+}
+
+public void establishConnection() {
+ OS.objc_msgSend(this.id, OS.sel_establishConnection);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNotification.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNotification.java
new file mode 100644
index 0000000000..7c5efa8d8d
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNotification.java
@@ -0,0 +1,38 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSNotification extends NSObject {
+
+public NSNotification() {
+ super();
+}
+
+public NSNotification(int id) {
+ super(id);
+}
+
+public NSString name() {
+ int result = OS.objc_msgSend(this.id, OS.sel_name);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static id static_notificationWithName_object_(NSString aName, id anObject) {
+ int result = OS.objc_msgSend(OS.class_NSNotification, OS.sel_notificationWithName_1object_1, aName != null ? aName.id : 0, anObject != null ? anObject.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_notificationWithName_object_userInfo_(NSString aName, id anObject, NSDictionary aUserInfo) {
+ int result = OS.objc_msgSend(OS.class_NSNotification, OS.sel_notificationWithName_1object_1userInfo_1, aName != null ? aName.id : 0, anObject != null ? anObject.id : 0, aUserInfo != null ? aUserInfo.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id object() {
+ int result = OS.objc_msgSend(this.id, OS.sel_object);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSDictionary userInfo() {
+ int result = OS.objc_msgSend(this.id, OS.sel_userInfo);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNotificationCenter.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNotificationCenter.java
new file mode 100644
index 0000000000..55f801f057
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNotificationCenter.java
@@ -0,0 +1,42 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSNotificationCenter extends NSObject {
+
+public NSNotificationCenter() {
+ super();
+}
+
+public NSNotificationCenter(int id) {
+ super(id);
+}
+
+public void addObserver(id observer, int aSelector, NSString aName, id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_addObserver_1selector_1name_1object_1, observer != null ? observer.id : 0, aSelector, aName != null ? aName.id : 0, anObject != null ? anObject.id : 0);
+}
+
+public static id defaultCenter() {
+ int result = OS.objc_msgSend(OS.class_NSNotificationCenter, OS.sel_defaultCenter);
+ return result != 0 ? new id(result) : null;
+}
+
+public void postNotification(NSNotification notification) {
+ OS.objc_msgSend(this.id, OS.sel_postNotification_1, notification != null ? notification.id : 0);
+}
+
+public void postNotificationName_object_(NSString aName, id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_postNotificationName_1object_1, aName != null ? aName.id : 0, anObject != null ? anObject.id : 0);
+}
+
+public void postNotificationName_object_userInfo_(NSString aName, id anObject, NSDictionary aUserInfo) {
+ OS.objc_msgSend(this.id, OS.sel_postNotificationName_1object_1userInfo_1, aName != null ? aName.id : 0, anObject != null ? anObject.id : 0, aUserInfo != null ? aUserInfo.id : 0);
+}
+
+public void removeObserver_(id observer) {
+ OS.objc_msgSend(this.id, OS.sel_removeObserver_1, observer != null ? observer.id : 0);
+}
+
+public void removeObserver_name_object_(id observer, NSString aName, id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_removeObserver_1name_1object_1, observer != null ? observer.id : 0, aName != null ? aName.id : 0, anObject != null ? anObject.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNotificationQueue.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNotificationQueue.java
new file mode 100644
index 0000000000..903a6fe505
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNotificationQueue.java
@@ -0,0 +1,35 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSNotificationQueue extends NSObject {
+
+public NSNotificationQueue() {
+ super();
+}
+
+public NSNotificationQueue(int id) {
+ super(id);
+}
+
+public static id defaultQueue() {
+ int result = OS.objc_msgSend(OS.class_NSNotificationQueue, OS.sel_defaultQueue);
+ return result != 0 ? new id(result) : null;
+}
+
+public void dequeueNotificationsMatching(NSNotification notification, int coalesceMask) {
+ OS.objc_msgSend(this.id, OS.sel_dequeueNotificationsMatching_1coalesceMask_1, notification != null ? notification.id : 0, coalesceMask);
+}
+
+public void enqueueNotification_postingStyle_(NSNotification notification, int postingStyle) {
+ OS.objc_msgSend(this.id, OS.sel_enqueueNotification_1postingStyle_1, notification != null ? notification.id : 0, postingStyle);
+}
+
+public void enqueueNotification_postingStyle_coalesceMask_forModes_(NSNotification notification, int postingStyle, int coalesceMask, NSArray modes) {
+ OS.objc_msgSend(this.id, OS.sel_enqueueNotification_1postingStyle_1coalesceMask_1forModes_1, notification != null ? notification.id : 0, postingStyle, coalesceMask, modes != null ? modes.id : 0);
+}
+
+public id initWithNotificationCenter(NSNotificationCenter notificationCenter) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithNotificationCenter_1, notificationCenter != null ? notificationCenter.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNull.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNull.java
new file mode 100644
index 0000000000..12cbd6cc4b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNull.java
@@ -0,0 +1,18 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSNull extends NSObject {
+
+public NSNull() {
+ super();
+}
+
+public NSNull(int id) {
+ super(id);
+}
+
+public static NSNull null_() {
+ int result = OS.objc_msgSend(OS.class_NSNull, OS.sel_null);
+ return result != 0 ? new NSNull(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNumber.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNumber.java
new file mode 100644
index 0000000000..922c42bcd8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNumber.java
@@ -0,0 +1,247 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSNumber extends NSValue {
+
+public NSNumber() {
+ super();
+}
+
+public NSNumber(int id) {
+ super(id);
+}
+
+public boolean boolValue() {
+ return OS.objc_msgSend(this.id, OS.sel_boolValue) != 0;
+}
+
+public byte charValue() {
+ return (byte)OS.objc_msgSend(this.id, OS.sel_charValue);
+}
+
+public int compare(NSNumber otherNumber) {
+ return OS.objc_msgSend(this.id, OS.sel_compare_1, otherNumber != null ? otherNumber.id : 0);
+}
+
+public NSDecimal decimalValue() {
+ NSDecimal result = new NSDecimal();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_decimalValue);
+ return result;
+}
+
+public NSString descriptionWithLocale(id locale) {
+ int result = OS.objc_msgSend(this.id, OS.sel_descriptionWithLocale_1, locale != null ? locale.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public double doubleValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_doubleValue);
+}
+
+public float floatValue() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_floatValue);
+}
+
+public id initWithBool(boolean value) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithBool_1, value);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithChar(byte value) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithChar_1, value);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithDouble(double value) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithDouble_1, value);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithFloat(float value) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFloat_1, value);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithInt(int value) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithInt_1, value);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithInteger(int value) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithInteger_1, value);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithLong(int value) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithLong_1, value);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithLongLong(long value) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithLongLong_1, value);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithShort(short value) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithShort_1, value);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithUnsignedChar(byte value) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithUnsignedChar_1, value);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithUnsignedInt(int value) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithUnsignedInt_1, value);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithUnsignedInteger(int value) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithUnsignedInteger_1, value);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithUnsignedLong(int value) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithUnsignedLong_1, value);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithUnsignedLongLong(long value) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithUnsignedLongLong_1, value);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithUnsignedShort(short value) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithUnsignedShort_1, value);
+ return result != 0 ? new id(result) : null;
+}
+
+public int intValue() {
+ return OS.objc_msgSend(this.id, OS.sel_intValue);
+}
+
+public int integerValue() {
+ return OS.objc_msgSend(this.id, OS.sel_integerValue);
+}
+
+public boolean isEqualToNumber(NSNumber number) {
+ return OS.objc_msgSend(this.id, OS.sel_isEqualToNumber_1, number != null ? number.id : 0) != 0;
+}
+
+public long longLongValue() {
+ return (long)OS.objc_msgSend(this.id, OS.sel_longLongValue);
+}
+
+public int longValue() {
+ return OS.objc_msgSend(this.id, OS.sel_longValue);
+}
+
+public static NSNumber numberWithBool(boolean value) {
+ int result = OS.objc_msgSend(OS.class_NSNumber, OS.sel_numberWithBool_1, value);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public static NSNumber numberWithChar(byte value) {
+ int result = OS.objc_msgSend(OS.class_NSNumber, OS.sel_numberWithChar_1, value);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public static NSNumber numberWithDouble(double value) {
+ int result = OS.objc_msgSend(OS.class_NSNumber, OS.sel_numberWithDouble_1, value);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public static NSNumber numberWithFloat(float value) {
+ int result = OS.objc_msgSend(OS.class_NSNumber, OS.sel_numberWithFloat_1, value);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public static NSNumber numberWithInt(int value) {
+ int result = OS.objc_msgSend(OS.class_NSNumber, OS.sel_numberWithInt_1, value);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public static NSNumber numberWithInteger(int value) {
+ int result = OS.objc_msgSend(OS.class_NSNumber, OS.sel_numberWithInteger_1, value);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public static NSNumber numberWithLong(int value) {
+ int result = OS.objc_msgSend(OS.class_NSNumber, OS.sel_numberWithLong_1, value);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public static NSNumber numberWithLongLong(long value) {
+ int result = OS.objc_msgSend(OS.class_NSNumber, OS.sel_numberWithLongLong_1, value);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public static NSNumber numberWithShort(short value) {
+ int result = OS.objc_msgSend(OS.class_NSNumber, OS.sel_numberWithShort_1, value);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public static NSNumber numberWithUnsignedChar(byte value) {
+ int result = OS.objc_msgSend(OS.class_NSNumber, OS.sel_numberWithUnsignedChar_1, value);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public static NSNumber numberWithUnsignedInt(int value) {
+ int result = OS.objc_msgSend(OS.class_NSNumber, OS.sel_numberWithUnsignedInt_1, value);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public static NSNumber numberWithUnsignedInteger(int value) {
+ int result = OS.objc_msgSend(OS.class_NSNumber, OS.sel_numberWithUnsignedInteger_1, value);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public static NSNumber numberWithUnsignedLong(int value) {
+ int result = OS.objc_msgSend(OS.class_NSNumber, OS.sel_numberWithUnsignedLong_1, value);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public static NSNumber numberWithUnsignedLongLong(long value) {
+ int result = OS.objc_msgSend(OS.class_NSNumber, OS.sel_numberWithUnsignedLongLong_1, value);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public static NSNumber numberWithUnsignedShort(short value) {
+ int result = OS.objc_msgSend(OS.class_NSNumber, OS.sel_numberWithUnsignedShort_1, value);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public short shortValue() {
+ return (short)OS.objc_msgSend(this.id, OS.sel_shortValue);
+}
+
+public NSString stringValue() {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringValue);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public byte unsignedCharValue() {
+ return (byte)OS.objc_msgSend(this.id, OS.sel_unsignedCharValue);
+}
+
+public int unsignedIntValue() {
+ return OS.objc_msgSend(this.id, OS.sel_unsignedIntValue);
+}
+
+public int unsignedIntegerValue() {
+ return OS.objc_msgSend(this.id, OS.sel_unsignedIntegerValue);
+}
+
+public long unsignedLongLongValue() {
+ return (long)OS.objc_msgSend(this.id, OS.sel_unsignedLongLongValue);
+}
+
+public int unsignedLongValue() {
+ return OS.objc_msgSend(this.id, OS.sel_unsignedLongValue);
+}
+
+public short unsignedShortValue() {
+ return (short)OS.objc_msgSend(this.id, OS.sel_unsignedShortValue);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNumberFormatter.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNumberFormatter.java
new file mode 100644
index 0000000000..862898b3b1
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSNumberFormatter.java
@@ -0,0 +1,589 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSNumberFormatter extends NSFormatter {
+
+public NSNumberFormatter() {
+ super();
+}
+
+public NSNumberFormatter(int id) {
+ super(id);
+}
+
+public boolean allowsFloats() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsFloats) != 0;
+}
+
+public boolean alwaysShowsDecimalSeparator() {
+ return OS.objc_msgSend(this.id, OS.sel_alwaysShowsDecimalSeparator) != 0;
+}
+
+public NSAttributedString attributedStringForNil() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributedStringForNil);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public NSAttributedString attributedStringForNotANumber() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributedStringForNotANumber);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public NSAttributedString attributedStringForZero() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributedStringForZero);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public NSString currencyCode() {
+ int result = OS.objc_msgSend(this.id, OS.sel_currencyCode);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString currencyDecimalSeparator() {
+ int result = OS.objc_msgSend(this.id, OS.sel_currencyDecimalSeparator);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString currencyGroupingSeparator() {
+ int result = OS.objc_msgSend(this.id, OS.sel_currencyGroupingSeparator);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString currencySymbol() {
+ int result = OS.objc_msgSend(this.id, OS.sel_currencySymbol);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString decimalSeparator() {
+ int result = OS.objc_msgSend(this.id, OS.sel_decimalSeparator);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static int defaultFormatterBehavior() {
+ return OS.objc_msgSend(OS.class_NSNumberFormatter, OS.sel_defaultFormatterBehavior);
+}
+
+public NSString exponentSymbol() {
+ int result = OS.objc_msgSend(this.id, OS.sel_exponentSymbol);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString format() {
+ int result = OS.objc_msgSend(this.id, OS.sel_format);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int formatWidth() {
+ return OS.objc_msgSend(this.id, OS.sel_formatWidth);
+}
+
+public int formatterBehavior() {
+ return OS.objc_msgSend(this.id, OS.sel_formatterBehavior);
+}
+
+public boolean generatesDecimalNumbers() {
+ return OS.objc_msgSend(this.id, OS.sel_generatesDecimalNumbers) != 0;
+}
+
+public boolean getObjectValue(int obj, NSString string, int rangep, int error) {
+ return OS.objc_msgSend(this.id, OS.sel_getObjectValue_1forString_1range_1error_1, obj, string != null ? string.id : 0, rangep, error) != 0;
+}
+
+public NSString groupingSeparator() {
+ int result = OS.objc_msgSend(this.id, OS.sel_groupingSeparator);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int groupingSize() {
+ return OS.objc_msgSend(this.id, OS.sel_groupingSize);
+}
+
+public boolean hasThousandSeparators() {
+ return OS.objc_msgSend(this.id, OS.sel_hasThousandSeparators) != 0;
+}
+
+public NSString internationalCurrencySymbol() {
+ int result = OS.objc_msgSend(this.id, OS.sel_internationalCurrencySymbol);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean isLenient() {
+ return OS.objc_msgSend(this.id, OS.sel_isLenient) != 0;
+}
+
+public boolean isPartialStringValidationEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_isPartialStringValidationEnabled) != 0;
+}
+
+public NSLocale locale() {
+ int result = OS.objc_msgSend(this.id, OS.sel_locale);
+ return result != 0 ? new NSLocale(result) : null;
+}
+
+public boolean localizesFormat() {
+ return OS.objc_msgSend(this.id, OS.sel_localizesFormat) != 0;
+}
+
+public NSNumber maximum() {
+ int result = OS.objc_msgSend(this.id, OS.sel_maximum);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public int maximumFractionDigits() {
+ return OS.objc_msgSend(this.id, OS.sel_maximumFractionDigits);
+}
+
+public int maximumIntegerDigits() {
+ return OS.objc_msgSend(this.id, OS.sel_maximumIntegerDigits);
+}
+
+public int maximumSignificantDigits() {
+ return OS.objc_msgSend(this.id, OS.sel_maximumSignificantDigits);
+}
+
+public NSNumber minimum() {
+ int result = OS.objc_msgSend(this.id, OS.sel_minimum);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public int minimumFractionDigits() {
+ return OS.objc_msgSend(this.id, OS.sel_minimumFractionDigits);
+}
+
+public int minimumIntegerDigits() {
+ return OS.objc_msgSend(this.id, OS.sel_minimumIntegerDigits);
+}
+
+public int minimumSignificantDigits() {
+ return OS.objc_msgSend(this.id, OS.sel_minimumSignificantDigits);
+}
+
+public NSString minusSign() {
+ int result = OS.objc_msgSend(this.id, OS.sel_minusSign);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSNumber multiplier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_multiplier);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public NSString negativeFormat() {
+ int result = OS.objc_msgSend(this.id, OS.sel_negativeFormat);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString negativeInfinitySymbol() {
+ int result = OS.objc_msgSend(this.id, OS.sel_negativeInfinitySymbol);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString negativePrefix() {
+ int result = OS.objc_msgSend(this.id, OS.sel_negativePrefix);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString negativeSuffix() {
+ int result = OS.objc_msgSend(this.id, OS.sel_negativeSuffix);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString nilSymbol() {
+ int result = OS.objc_msgSend(this.id, OS.sel_nilSymbol);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString notANumberSymbol() {
+ int result = OS.objc_msgSend(this.id, OS.sel_notANumberSymbol);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSNumber numberFromString(NSString string) {
+ int result = OS.objc_msgSend(this.id, OS.sel_numberFromString_1, string != null ? string.id : 0);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public int numberStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_numberStyle);
+}
+
+public NSString paddingCharacter() {
+ int result = OS.objc_msgSend(this.id, OS.sel_paddingCharacter);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int paddingPosition() {
+ return OS.objc_msgSend(this.id, OS.sel_paddingPosition);
+}
+
+public NSString perMillSymbol() {
+ int result = OS.objc_msgSend(this.id, OS.sel_perMillSymbol);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString percentSymbol() {
+ int result = OS.objc_msgSend(this.id, OS.sel_percentSymbol);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString plusSign() {
+ int result = OS.objc_msgSend(this.id, OS.sel_plusSign);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString positiveFormat() {
+ int result = OS.objc_msgSend(this.id, OS.sel_positiveFormat);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString positiveInfinitySymbol() {
+ int result = OS.objc_msgSend(this.id, OS.sel_positiveInfinitySymbol);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString positivePrefix() {
+ int result = OS.objc_msgSend(this.id, OS.sel_positivePrefix);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString positiveSuffix() {
+ int result = OS.objc_msgSend(this.id, OS.sel_positiveSuffix);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSDecimalNumberHandler roundingBehavior() {
+ int result = OS.objc_msgSend(this.id, OS.sel_roundingBehavior);
+ return result != 0 ? new NSDecimalNumberHandler(result) : null;
+}
+
+public NSNumber roundingIncrement() {
+ int result = OS.objc_msgSend(this.id, OS.sel_roundingIncrement);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public int roundingMode() {
+ return OS.objc_msgSend(this.id, OS.sel_roundingMode);
+}
+
+public int secondaryGroupingSize() {
+ return OS.objc_msgSend(this.id, OS.sel_secondaryGroupingSize);
+}
+
+public void setAllowsFloats(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsFloats_1, flag);
+}
+
+public void setAlwaysShowsDecimalSeparator(boolean b) {
+ OS.objc_msgSend(this.id, OS.sel_setAlwaysShowsDecimalSeparator_1, b);
+}
+
+public void setAttributedStringForNil(NSAttributedString newAttributedString) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributedStringForNil_1, newAttributedString != null ? newAttributedString.id : 0);
+}
+
+public void setAttributedStringForNotANumber(NSAttributedString newAttributedString) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributedStringForNotANumber_1, newAttributedString != null ? newAttributedString.id : 0);
+}
+
+public void setAttributedStringForZero(NSAttributedString newAttributedString) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributedStringForZero_1, newAttributedString != null ? newAttributedString.id : 0);
+}
+
+public void setCurrencyCode(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setCurrencyCode_1, string != null ? string.id : 0);
+}
+
+public void setCurrencyDecimalSeparator(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setCurrencyDecimalSeparator_1, string != null ? string.id : 0);
+}
+
+public void setCurrencyGroupingSeparator(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setCurrencyGroupingSeparator_1, string != null ? string.id : 0);
+}
+
+public void setCurrencySymbol(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setCurrencySymbol_1, string != null ? string.id : 0);
+}
+
+public void setDecimalSeparator(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setDecimalSeparator_1, string != null ? string.id : 0);
+}
+
+public static void setDefaultFormatterBehavior(int behavior) {
+ OS.objc_msgSend(OS.class_NSNumberFormatter, OS.sel_setDefaultFormatterBehavior_1, behavior);
+}
+
+public void setExponentSymbol(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setExponentSymbol_1, string != null ? string.id : 0);
+}
+
+public void setFormat(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setFormat_1, string != null ? string.id : 0);
+}
+
+public void setFormatWidth(int number) {
+ OS.objc_msgSend(this.id, OS.sel_setFormatWidth_1, number);
+}
+
+public void setFormatterBehavior(int behavior) {
+ OS.objc_msgSend(this.id, OS.sel_setFormatterBehavior_1, behavior);
+}
+
+public void setGeneratesDecimalNumbers(boolean b) {
+ OS.objc_msgSend(this.id, OS.sel_setGeneratesDecimalNumbers_1, b);
+}
+
+public void setGroupingSeparator(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setGroupingSeparator_1, string != null ? string.id : 0);
+}
+
+public void setGroupingSize(int number) {
+ OS.objc_msgSend(this.id, OS.sel_setGroupingSize_1, number);
+}
+
+public void setHasThousandSeparators(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setHasThousandSeparators_1, flag);
+}
+
+public void setInternationalCurrencySymbol(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setInternationalCurrencySymbol_1, string != null ? string.id : 0);
+}
+
+public void setLenient(boolean b) {
+ OS.objc_msgSend(this.id, OS.sel_setLenient_1, b);
+}
+
+public void setLocale(NSLocale locale) {
+ OS.objc_msgSend(this.id, OS.sel_setLocale_1, locale != null ? locale.id : 0);
+}
+
+public void setLocalizesFormat(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setLocalizesFormat_1, flag);
+}
+
+public void setMaximum(NSNumber number) {
+ OS.objc_msgSend(this.id, OS.sel_setMaximum_1, number != null ? number.id : 0);
+}
+
+public void setMaximumFractionDigits(int number) {
+ OS.objc_msgSend(this.id, OS.sel_setMaximumFractionDigits_1, number);
+}
+
+public void setMaximumIntegerDigits(int number) {
+ OS.objc_msgSend(this.id, OS.sel_setMaximumIntegerDigits_1, number);
+}
+
+public void setMaximumSignificantDigits(int number) {
+ OS.objc_msgSend(this.id, OS.sel_setMaximumSignificantDigits_1, number);
+}
+
+public void setMinimum(NSNumber number) {
+ OS.objc_msgSend(this.id, OS.sel_setMinimum_1, number != null ? number.id : 0);
+}
+
+public void setMinimumFractionDigits(int number) {
+ OS.objc_msgSend(this.id, OS.sel_setMinimumFractionDigits_1, number);
+}
+
+public void setMinimumIntegerDigits(int number) {
+ OS.objc_msgSend(this.id, OS.sel_setMinimumIntegerDigits_1, number);
+}
+
+public void setMinimumSignificantDigits(int number) {
+ OS.objc_msgSend(this.id, OS.sel_setMinimumSignificantDigits_1, number);
+}
+
+public void setMinusSign(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setMinusSign_1, string != null ? string.id : 0);
+}
+
+public void setMultiplier(NSNumber number) {
+ OS.objc_msgSend(this.id, OS.sel_setMultiplier_1, number != null ? number.id : 0);
+}
+
+public void setNegativeFormat(NSString format) {
+ OS.objc_msgSend(this.id, OS.sel_setNegativeFormat_1, format != null ? format.id : 0);
+}
+
+public void setNegativeInfinitySymbol(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setNegativeInfinitySymbol_1, string != null ? string.id : 0);
+}
+
+public void setNegativePrefix(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setNegativePrefix_1, string != null ? string.id : 0);
+}
+
+public void setNegativeSuffix(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setNegativeSuffix_1, string != null ? string.id : 0);
+}
+
+public void setNilSymbol(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setNilSymbol_1, string != null ? string.id : 0);
+}
+
+public void setNotANumberSymbol(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setNotANumberSymbol_1, string != null ? string.id : 0);
+}
+
+public void setNumberStyle(int style) {
+ OS.objc_msgSend(this.id, OS.sel_setNumberStyle_1, style);
+}
+
+public void setPaddingCharacter(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setPaddingCharacter_1, string != null ? string.id : 0);
+}
+
+public void setPaddingPosition(int position) {
+ OS.objc_msgSend(this.id, OS.sel_setPaddingPosition_1, position);
+}
+
+public void setPartialStringValidationEnabled(boolean b) {
+ OS.objc_msgSend(this.id, OS.sel_setPartialStringValidationEnabled_1, b);
+}
+
+public void setPerMillSymbol(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setPerMillSymbol_1, string != null ? string.id : 0);
+}
+
+public void setPercentSymbol(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setPercentSymbol_1, string != null ? string.id : 0);
+}
+
+public void setPlusSign(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setPlusSign_1, string != null ? string.id : 0);
+}
+
+public void setPositiveFormat(NSString format) {
+ OS.objc_msgSend(this.id, OS.sel_setPositiveFormat_1, format != null ? format.id : 0);
+}
+
+public void setPositiveInfinitySymbol(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setPositiveInfinitySymbol_1, string != null ? string.id : 0);
+}
+
+public void setPositivePrefix(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setPositivePrefix_1, string != null ? string.id : 0);
+}
+
+public void setPositiveSuffix(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setPositiveSuffix_1, string != null ? string.id : 0);
+}
+
+public void setRoundingBehavior(NSDecimalNumberHandler newRoundingBehavior) {
+ OS.objc_msgSend(this.id, OS.sel_setRoundingBehavior_1, newRoundingBehavior != null ? newRoundingBehavior.id : 0);
+}
+
+public void setRoundingIncrement(NSNumber number) {
+ OS.objc_msgSend(this.id, OS.sel_setRoundingIncrement_1, number != null ? number.id : 0);
+}
+
+public void setRoundingMode(int mode) {
+ OS.objc_msgSend(this.id, OS.sel_setRoundingMode_1, mode);
+}
+
+public void setSecondaryGroupingSize(int number) {
+ OS.objc_msgSend(this.id, OS.sel_setSecondaryGroupingSize_1, number);
+}
+
+public void setTextAttributesForNegativeInfinity(NSDictionary newAttributes) {
+ OS.objc_msgSend(this.id, OS.sel_setTextAttributesForNegativeInfinity_1, newAttributes != null ? newAttributes.id : 0);
+}
+
+public void setTextAttributesForNegativeValues(NSDictionary newAttributes) {
+ OS.objc_msgSend(this.id, OS.sel_setTextAttributesForNegativeValues_1, newAttributes != null ? newAttributes.id : 0);
+}
+
+public void setTextAttributesForNil(NSDictionary newAttributes) {
+ OS.objc_msgSend(this.id, OS.sel_setTextAttributesForNil_1, newAttributes != null ? newAttributes.id : 0);
+}
+
+public void setTextAttributesForNotANumber(NSDictionary newAttributes) {
+ OS.objc_msgSend(this.id, OS.sel_setTextAttributesForNotANumber_1, newAttributes != null ? newAttributes.id : 0);
+}
+
+public void setTextAttributesForPositiveInfinity(NSDictionary newAttributes) {
+ OS.objc_msgSend(this.id, OS.sel_setTextAttributesForPositiveInfinity_1, newAttributes != null ? newAttributes.id : 0);
+}
+
+public void setTextAttributesForPositiveValues(NSDictionary newAttributes) {
+ OS.objc_msgSend(this.id, OS.sel_setTextAttributesForPositiveValues_1, newAttributes != null ? newAttributes.id : 0);
+}
+
+public void setTextAttributesForZero(NSDictionary newAttributes) {
+ OS.objc_msgSend(this.id, OS.sel_setTextAttributesForZero_1, newAttributes != null ? newAttributes.id : 0);
+}
+
+public void setThousandSeparator(NSString newSeparator) {
+ OS.objc_msgSend(this.id, OS.sel_setThousandSeparator_1, newSeparator != null ? newSeparator.id : 0);
+}
+
+public void setUsesGroupingSeparator(boolean b) {
+ OS.objc_msgSend(this.id, OS.sel_setUsesGroupingSeparator_1, b);
+}
+
+public void setUsesSignificantDigits(boolean b) {
+ OS.objc_msgSend(this.id, OS.sel_setUsesSignificantDigits_1, b);
+}
+
+public void setZeroSymbol(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setZeroSymbol_1, string != null ? string.id : 0);
+}
+
+public NSString stringFromNumber(NSNumber number) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringFromNumber_1, number != null ? number.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSDictionary textAttributesForNegativeInfinity() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textAttributesForNegativeInfinity);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSDictionary textAttributesForNegativeValues() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textAttributesForNegativeValues);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSDictionary textAttributesForNil() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textAttributesForNil);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSDictionary textAttributesForNotANumber() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textAttributesForNotANumber);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSDictionary textAttributesForPositiveInfinity() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textAttributesForPositiveInfinity);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSDictionary textAttributesForPositiveValues() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textAttributesForPositiveValues);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSDictionary textAttributesForZero() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textAttributesForZero);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSString thousandSeparator() {
+ int result = OS.objc_msgSend(this.id, OS.sel_thousandSeparator);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean usesGroupingSeparator() {
+ return OS.objc_msgSend(this.id, OS.sel_usesGroupingSeparator) != 0;
+}
+
+public boolean usesSignificantDigits() {
+ return OS.objc_msgSend(this.id, OS.sel_usesSignificantDigits) != 0;
+}
+
+public NSString zeroSymbol() {
+ int result = OS.objc_msgSend(this.id, OS.sel_zeroSymbol);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSObject.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSObject.java
new file mode 100644
index 0000000000..741ef2d63e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSObject.java
@@ -0,0 +1,1177 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSObject extends id {
+
+public NSObject() {
+ super();
+}
+
+public NSObject(int id) {
+ super(id);
+}
+
+public void URL_resourceDataDidBecomeAvailable_(NSURL sender, NSData newBytes) {
+ OS.objc_msgSend(this.id, OS.sel_URL_1resourceDataDidBecomeAvailable_1, sender != null ? sender.id : 0, newBytes != null ? newBytes.id : 0);
+}
+
+public void URL_resourceDidFailLoadingWithReason_(NSURL sender, NSString reason) {
+ OS.objc_msgSend(this.id, OS.sel_URL_1resourceDidFailLoadingWithReason_1, sender != null ? sender.id : 0, reason != null ? reason.id : 0);
+}
+
+public void URLHandle_resourceDataDidBecomeAvailable_(NSURLHandle sender, NSData newBytes) {
+ OS.objc_msgSend(this.id, OS.sel_URLHandle_1resourceDataDidBecomeAvailable_1, sender != null ? sender.id : 0, newBytes != null ? newBytes.id : 0);
+}
+
+public void URLHandle_resourceDidFailLoadingWithReason_(NSURLHandle sender, NSString reason) {
+ OS.objc_msgSend(this.id, OS.sel_URLHandle_1resourceDidFailLoadingWithReason_1, sender != null ? sender.id : 0, reason != null ? reason.id : 0);
+}
+
+public void URLHandleResourceDidBeginLoading(NSURLHandle sender) {
+ OS.objc_msgSend(this.id, OS.sel_URLHandleResourceDidBeginLoading_1, sender != null ? sender.id : 0);
+}
+
+public void URLHandleResourceDidCancelLoading(NSURLHandle sender) {
+ OS.objc_msgSend(this.id, OS.sel_URLHandleResourceDidCancelLoading_1, sender != null ? sender.id : 0);
+}
+
+public void URLHandleResourceDidFinishLoading(NSURLHandle sender) {
+ OS.objc_msgSend(this.id, OS.sel_URLHandleResourceDidFinishLoading_1, sender != null ? sender.id : 0);
+}
+
+public void URLProtocol_cachedResponseIsValid_(NSURLProtocol protocol, NSCachedURLResponse cachedResponse) {
+ OS.objc_msgSend(this.id, OS.sel_URLProtocol_1cachedResponseIsValid_1, protocol != null ? protocol.id : 0, cachedResponse != null ? cachedResponse.id : 0);
+}
+
+public void URLProtocol_didCancelAuthenticationChallenge_(NSURLProtocol protocol, NSURLAuthenticationChallenge challenge) {
+ OS.objc_msgSend(this.id, OS.sel_URLProtocol_1didCancelAuthenticationChallenge_1, protocol != null ? protocol.id : 0, challenge != null ? challenge.id : 0);
+}
+
+public void URLProtocol_didFailWithError_(NSURLProtocol protocol, NSError error) {
+ OS.objc_msgSend(this.id, OS.sel_URLProtocol_1didFailWithError_1, protocol != null ? protocol.id : 0, error != null ? error.id : 0);
+}
+
+public void URLProtocol_didLoadData_(NSURLProtocol protocol, NSData data) {
+ OS.objc_msgSend(this.id, OS.sel_URLProtocol_1didLoadData_1, protocol != null ? protocol.id : 0, data != null ? data.id : 0);
+}
+
+public void URLProtocol_didReceiveAuthenticationChallenge_(NSURLProtocol protocol, NSURLAuthenticationChallenge challenge) {
+ OS.objc_msgSend(this.id, OS.sel_URLProtocol_1didReceiveAuthenticationChallenge_1, protocol != null ? protocol.id : 0, challenge != null ? challenge.id : 0);
+}
+
+public void URLProtocol_didReceiveResponse_cacheStoragePolicy_(NSURLProtocol protocol, NSURLResponse response, int policy) {
+ OS.objc_msgSend(this.id, OS.sel_URLProtocol_1didReceiveResponse_1cacheStoragePolicy_1, protocol != null ? protocol.id : 0, response != null ? response.id : 0, policy);
+}
+
+public void URLProtocol_wasRedirectedToRequest_redirectResponse_(NSURLProtocol protocol, NSURLRequest request, NSURLResponse redirectResponse) {
+ OS.objc_msgSend(this.id, OS.sel_URLProtocol_1wasRedirectedToRequest_1redirectResponse_1, protocol != null ? protocol.id : 0, request != null ? request.id : 0, redirectResponse != null ? redirectResponse.id : 0);
+}
+
+public void URLProtocolDidFinishLoading(NSURLProtocol protocol) {
+ OS.objc_msgSend(this.id, OS.sel_URLProtocolDidFinishLoading_1, protocol != null ? protocol.id : 0);
+}
+
+public void URLResourceDidCancelLoading(NSURL sender) {
+ OS.objc_msgSend(this.id, OS.sel_URLResourceDidCancelLoading_1, sender != null ? sender.id : 0);
+}
+
+public void URLResourceDidFinishLoading(NSURL sender) {
+ OS.objc_msgSend(this.id, OS.sel_URLResourceDidFinishLoading_1, sender != null ? sender.id : 0);
+}
+
+public static boolean accessInstanceVariablesDirectly() {
+ return OS.objc_msgSend(OS.class_NSObject, OS.sel_accessInstanceVariablesDirectly) != 0;
+}
+
+public void addObserver(NSObject observer, NSString keyPath, int options, int context) {
+ OS.objc_msgSend(this.id, OS.sel_addObserver_1forKeyPath_1options_1context_1, observer != null ? observer.id : 0, keyPath != null ? keyPath.id : 0, options, context);
+}
+
+public NSObject alloc() {
+ int result = OS.objc_msgSend(get_class(), OS.sel_alloc);
+ this.id = result;
+ return result != 0 ? this : null;
+}
+
+public int get_class() {
+ String name = getClass().getName();
+ int index = name.lastIndexOf('.');
+ if (index != -1) name = name.substring(index + 1);
+ return OS.objc_getClass(name);
+}
+
+public static id allocWithZone(int zone) {
+ int result = OS.objc_msgSend(OS.class_NSObject, OS.sel_allocWithZone_1, zone);
+ return result != 0 ? new id(result) : null;
+}
+
+public void archiver_didEncodeObject_(NSKeyedArchiver archiver, id object) {
+ OS.objc_msgSend(this.id, OS.sel_archiver_1didEncodeObject_1, archiver != null ? archiver.id : 0, object != null ? object.id : 0);
+}
+
+public id archiver_willEncodeObject_(NSKeyedArchiver archiver, id object) {
+ int result = OS.objc_msgSend(this.id, OS.sel_archiver_1willEncodeObject_1, archiver != null ? archiver.id : 0, object != null ? object.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void archiver_willReplaceObject_withObject_(NSKeyedArchiver archiver, id object, id newObject) {
+ OS.objc_msgSend(this.id, OS.sel_archiver_1willReplaceObject_1withObject_1, archiver != null ? archiver.id : 0, object != null ? object.id : 0, newObject != null ? newObject.id : 0);
+}
+
+public void archiverDidFinish(NSKeyedArchiver archiver) {
+ OS.objc_msgSend(this.id, OS.sel_archiverDidFinish_1, archiver != null ? archiver.id : 0);
+}
+
+public void archiverWillFinish(NSKeyedArchiver archiver) {
+ OS.objc_msgSend(this.id, OS.sel_archiverWillFinish_1, archiver != null ? archiver.id : 0);
+}
+
+public boolean attemptRecoveryFromError_optionIndex_(NSError error, int recoveryOptionIndex) {
+ return OS.objc_msgSend(this.id, OS.sel_attemptRecoveryFromError_1optionIndex_1, error != null ? error.id : 0, recoveryOptionIndex) != 0;
+}
+
+public void attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_(NSError error, int recoveryOptionIndex, id delegate, int didRecoverSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_attemptRecoveryFromError_1optionIndex_1delegate_1didRecoverSelector_1contextInfo_1, error != null ? error.id : 0, recoveryOptionIndex, delegate != null ? delegate.id : 0, didRecoverSelector, contextInfo);
+}
+
+public NSArray attributeKeys() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributeKeys);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean authenticateComponents(NSArray components, NSData signature) {
+ return OS.objc_msgSend(this.id, OS.sel_authenticateComponents_1withData_1, components != null ? components.id : 0, signature != null ? signature.id : 0) != 0;
+}
+
+public NSData authenticationDataForComponents(NSArray components) {
+ int result = OS.objc_msgSend(this.id, OS.sel_authenticationDataForComponents_1, components != null ? components.id : 0);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public static boolean automaticallyNotifiesObserversForKey(NSString key) {
+ return OS.objc_msgSend(OS.class_NSObject, OS.sel_automaticallyNotifiesObserversForKey_1, key != null ? key.id : 0) != 0;
+}
+
+public id autorelease() {
+ int result = OS.objc_msgSend(this.id, OS.sel_autorelease);
+ return result != 0 ? new id(result) : null;
+}
+
+public id awakeAfterUsingCoder(NSCoder aDecoder) {
+ int result = OS.objc_msgSend(this.id, OS.sel_awakeAfterUsingCoder_1, aDecoder != null ? aDecoder.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void cancelAuthenticationChallenge(NSURLAuthenticationChallenge challenge) {
+ OS.objc_msgSend(this.id, OS.sel_cancelAuthenticationChallenge_1, challenge != null ? challenge.id : 0);
+}
+
+public static void static_cancelPreviousPerformRequestsWithTarget_(id aTarget) {
+ OS.objc_msgSend(OS.class_NSObject, OS.sel_cancelPreviousPerformRequestsWithTarget_1, aTarget != null ? aTarget.id : 0);
+}
+
+public static void static_cancelPreviousPerformRequestsWithTarget_selector_object_(id aTarget, int aSelector, id anArgument) {
+ OS.objc_msgSend(OS.class_NSObject, OS.sel_cancelPreviousPerformRequestsWithTarget_1selector_1object_1, aTarget != null ? aTarget.id : 0, aSelector, anArgument != null ? anArgument.id : 0);
+}
+
+public static int static_class() {
+ return OS.objc_msgSend(OS.class_NSObject, OS.sel_class);
+}
+
+//public int class() {
+// return OS.objc_msgSend(this.id, OS.sel_class);
+//}
+
+public int classCode() {
+ return OS.objc_msgSend(this.id, OS.sel_classCode);
+}
+
+public NSClassDescription classDescription() {
+ int result = OS.objc_msgSend(this.id, OS.sel_classDescription);
+ return result != 0 ? new NSClassDescription(result) : null;
+}
+
+public static NSArray classFallbacksForKeyedArchiver() {
+ int result = OS.objc_msgSend(OS.class_NSObject, OS.sel_classFallbacksForKeyedArchiver);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public int classForArchiver() {
+ return OS.objc_msgSend(this.id, OS.sel_classForArchiver);
+}
+
+public int classForCoder() {
+ return OS.objc_msgSend(this.id, OS.sel_classForCoder);
+}
+
+public int classForKeyedArchiver() {
+ return OS.objc_msgSend(this.id, OS.sel_classForKeyedArchiver);
+}
+
+public static int classForKeyedUnarchiver() {
+ return OS.objc_msgSend(OS.class_NSObject, OS.sel_classForKeyedUnarchiver);
+}
+
+public int classForPortCoder() {
+ return OS.objc_msgSend(this.id, OS.sel_classForPortCoder);
+}
+
+public NSString className() {
+ int result = OS.objc_msgSend(this.id, OS.sel_className);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id coerceValue(id value, NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_coerceValue_1forKey_1, value != null ? value.id : 0, key != null ? key.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+//public boolean conformsToProtocol_(Protocol aProtocol) {
+// return OS.objc_msgSend(this.id, OS.sel_conformsToProtocol_1, aProtocol != null ? aProtocol.id : 0) != 0;
+//}
+//
+//public static boolean static_conformsToProtocol_(Protocol protocol) {
+// return OS.objc_msgSend(OS.class_NSObject, OS.sel_conformsToProtocol_1, protocol != null ? protocol.id : 0) != 0;
+//}
+
+public void connection_didCancelAuthenticationChallenge_(NSURLConnection connection, NSURLAuthenticationChallenge challenge) {
+ OS.objc_msgSend(this.id, OS.sel_connection_1didCancelAuthenticationChallenge_1, connection != null ? connection.id : 0, challenge != null ? challenge.id : 0);
+}
+
+public void connection_didFailWithError_(NSURLConnection connection, NSError error) {
+ OS.objc_msgSend(this.id, OS.sel_connection_1didFailWithError_1, connection != null ? connection.id : 0, error != null ? error.id : 0);
+}
+
+public void connection_didReceiveAuthenticationChallenge_(NSURLConnection connection, NSURLAuthenticationChallenge challenge) {
+ OS.objc_msgSend(this.id, OS.sel_connection_1didReceiveAuthenticationChallenge_1, connection != null ? connection.id : 0, challenge != null ? challenge.id : 0);
+}
+
+public void connection_didReceiveData_(NSURLConnection connection, NSData data) {
+ OS.objc_msgSend(this.id, OS.sel_connection_1didReceiveData_1, connection != null ? connection.id : 0, data != null ? data.id : 0);
+}
+
+public void connection_didReceiveResponse_(NSURLConnection connection, NSURLResponse response) {
+ OS.objc_msgSend(this.id, OS.sel_connection_1didReceiveResponse_1, connection != null ? connection.id : 0, response != null ? response.id : 0);
+}
+
+public boolean connection_handleRequest_(NSConnection connection, NSDistantObjectRequest doreq) {
+ return OS.objc_msgSend(this.id, OS.sel_connection_1handleRequest_1, connection != null ? connection.id : 0, doreq != null ? doreq.id : 0) != 0;
+}
+
+public boolean connection_shouldMakeNewConnection_(NSConnection ancestor, NSConnection conn) {
+ return OS.objc_msgSend(this.id, OS.sel_connection_1shouldMakeNewConnection_1, ancestor != null ? ancestor.id : 0, conn != null ? conn.id : 0) != 0;
+}
+
+public NSCachedURLResponse connection_willCacheResponse_(NSURLConnection connection, NSCachedURLResponse cachedResponse) {
+ int result = OS.objc_msgSend(this.id, OS.sel_connection_1willCacheResponse_1, connection != null ? connection.id : 0, cachedResponse != null ? cachedResponse.id : 0);
+ return result != 0 ? new NSCachedURLResponse(result) : null;
+}
+
+public NSURLRequest connection_willSendRequest_redirectResponse_(NSURLConnection connection, NSURLRequest request, NSURLResponse response) {
+ int result = OS.objc_msgSend(this.id, OS.sel_connection_1willSendRequest_1redirectResponse_1, connection != null ? connection.id : 0, request != null ? request.id : 0, response != null ? response.id : 0);
+ return result != 0 ? new NSURLRequest(result) : null;
+}
+
+public void connectionDidFinishLoading(NSURLConnection connection) {
+ OS.objc_msgSend(this.id, OS.sel_connectionDidFinishLoading_1, connection != null ? connection.id : 0);
+}
+
+public void continueWithoutCredentialForAuthenticationChallenge(NSURLAuthenticationChallenge challenge) {
+ OS.objc_msgSend(this.id, OS.sel_continueWithoutCredentialForAuthenticationChallenge_1, challenge != null ? challenge.id : 0);
+}
+
+public id copy() {
+ int result = OS.objc_msgSend(this.id, OS.sel_copy);
+ return result != 0 ? new id(result) : null;
+}
+
+public id copyScriptingValue(id value, NSString key, NSDictionary properties) {
+ int result = OS.objc_msgSend(this.id, OS.sel_copyScriptingValue_1forKey_1withProperties_1, value != null ? value.id : 0, key != null ? key.id : 0, properties != null ? properties.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id copyWithZone_(int zone) {
+ int result = OS.objc_msgSend(this.id, OS.sel_copyWithZone_1, zone);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_copyWithZone_(int zone) {
+ int result = OS.objc_msgSend(OS.class_NSObject, OS.sel_copyWithZone_1, zone);
+ return result != 0 ? new id(result) : null;
+}
+
+public int countByEnumeratingWithState(int state, int stackbuf, int len) {
+ return OS.objc_msgSend(this.id, OS.sel_countByEnumeratingWithState_1objects_1count_1, state, stackbuf, len);
+}
+
+public id createConversationForConnection(NSConnection conn) {
+ int result = OS.objc_msgSend(this.id, OS.sel_createConversationForConnection_1, conn != null ? conn.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void dealloc() {
+ OS.objc_msgSend(this.id, OS.sel_dealloc);
+}
+
+public NSString description() {
+ int result = OS.objc_msgSend(this.id, OS.sel_description);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSString static_description() {
+ int result = OS.objc_msgSend(OS.class_NSObject, OS.sel_description);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSDictionary dictionaryWithValuesForKeys(NSArray keys) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dictionaryWithValuesForKeys_1, keys != null ? keys.id : 0);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public void didChange(int changeKind, NSIndexSet indexes, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_didChange_1valuesAtIndexes_1forKey_1, changeKind, indexes != null ? indexes.id : 0, key != null ? key.id : 0);
+}
+
+public void didChangeValueForKey_(NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_didChangeValueForKey_1, key != null ? key.id : 0);
+}
+
+public void didChangeValueForKey_withSetMutation_usingObjects_(NSString key, int mutationKind, NSSet objects) {
+ OS.objc_msgSend(this.id, OS.sel_didChangeValueForKey_1withSetMutation_1usingObjects_1, key != null ? key.id : 0, mutationKind, objects != null ? objects.id : 0);
+}
+
+public boolean doesContain(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_doesContain_1, object != null ? object.id : 0) != 0;
+}
+
+public void doesNotRecognizeSelector(int aSelector) {
+ OS.objc_msgSend(this.id, OS.sel_doesNotRecognizeSelector_1, aSelector);
+}
+
+public void download_decideDestinationWithSuggestedFilename_(NSURLDownload download, NSString filename) {
+ OS.objc_msgSend(this.id, OS.sel_download_1decideDestinationWithSuggestedFilename_1, download != null ? download.id : 0, filename != null ? filename.id : 0);
+}
+
+public void download_didCancelAuthenticationChallenge_(NSURLDownload download, NSURLAuthenticationChallenge challenge) {
+ OS.objc_msgSend(this.id, OS.sel_download_1didCancelAuthenticationChallenge_1, download != null ? download.id : 0, challenge != null ? challenge.id : 0);
+}
+
+public void download_didCreateDestination_(NSURLDownload download, NSString path) {
+ OS.objc_msgSend(this.id, OS.sel_download_1didCreateDestination_1, download != null ? download.id : 0, path != null ? path.id : 0);
+}
+
+public void download_didFailWithError_(NSURLDownload download, NSError error) {
+ OS.objc_msgSend(this.id, OS.sel_download_1didFailWithError_1, download != null ? download.id : 0, error != null ? error.id : 0);
+}
+
+public void download_didReceiveAuthenticationChallenge_(NSURLDownload download, NSURLAuthenticationChallenge challenge) {
+ OS.objc_msgSend(this.id, OS.sel_download_1didReceiveAuthenticationChallenge_1, download != null ? download.id : 0, challenge != null ? challenge.id : 0);
+}
+
+public void download_didReceiveDataOfLength_(NSURLDownload download, int length) {
+ OS.objc_msgSend(this.id, OS.sel_download_1didReceiveDataOfLength_1, download != null ? download.id : 0, length);
+}
+
+public void download_didReceiveResponse_(NSURLDownload download, NSURLResponse response) {
+ OS.objc_msgSend(this.id, OS.sel_download_1didReceiveResponse_1, download != null ? download.id : 0, response != null ? response.id : 0);
+}
+
+public boolean download_shouldDecodeSourceDataOfMIMEType_(NSURLDownload download, NSString encodingType) {
+ return OS.objc_msgSend(this.id, OS.sel_download_1shouldDecodeSourceDataOfMIMEType_1, download != null ? download.id : 0, encodingType != null ? encodingType.id : 0) != 0;
+}
+
+public void download_willResumeWithResponse_fromByte_(NSURLDownload download, NSURLResponse response, long startingByte) {
+ OS.objc_msgSend(this.id, OS.sel_download_1willResumeWithResponse_1fromByte_1, download != null ? download.id : 0, response != null ? response.id : 0, startingByte);
+}
+
+public NSURLRequest download_willSendRequest_redirectResponse_(NSURLDownload download, NSURLRequest request, NSURLResponse redirectResponse) {
+ int result = OS.objc_msgSend(this.id, OS.sel_download_1willSendRequest_1redirectResponse_1, download != null ? download.id : 0, request != null ? request.id : 0, redirectResponse != null ? redirectResponse.id : 0);
+ return result != 0 ? new NSURLRequest(result) : null;
+}
+
+public void downloadDidBegin(NSURLDownload download) {
+ OS.objc_msgSend(this.id, OS.sel_downloadDidBegin_1, download != null ? download.id : 0);
+}
+
+public void downloadDidFinish(NSURLDownload download) {
+ OS.objc_msgSend(this.id, OS.sel_downloadDidFinish_1, download != null ? download.id : 0);
+}
+
+public void encodeWithCoder(NSCoder aCoder) {
+ OS.objc_msgSend(this.id, OS.sel_encodeWithCoder_1, aCoder != null ? aCoder.id : 0);
+}
+
+public NSDecimalNumber exceptionDuringOperation(int operation, int error, NSDecimalNumber leftOperand, NSDecimalNumber rightOperand) {
+ int result = OS.objc_msgSend(this.id, OS.sel_exceptionDuringOperation_1error_1leftOperand_1rightOperand_1, operation, error, leftOperand != null ? leftOperand.id : 0, rightOperand != null ? rightOperand.id : 0);
+ return result != 0 ? new NSDecimalNumber(result) : null;
+}
+
+public boolean fileManager_shouldCopyItemAtPath_toPath_(NSFileManager fileManager, NSString srcPath, NSString dstPath) {
+ return OS.objc_msgSend(this.id, OS.sel_fileManager_1shouldCopyItemAtPath_1toPath_1, fileManager != null ? fileManager.id : 0, srcPath != null ? srcPath.id : 0, dstPath != null ? dstPath.id : 0) != 0;
+}
+
+public boolean fileManager_shouldLinkItemAtPath_toPath_(NSFileManager fileManager, NSString srcPath, NSString dstPath) {
+ return OS.objc_msgSend(this.id, OS.sel_fileManager_1shouldLinkItemAtPath_1toPath_1, fileManager != null ? fileManager.id : 0, srcPath != null ? srcPath.id : 0, dstPath != null ? dstPath.id : 0) != 0;
+}
+
+public boolean fileManager_shouldMoveItemAtPath_toPath_(NSFileManager fileManager, NSString srcPath, NSString dstPath) {
+ return OS.objc_msgSend(this.id, OS.sel_fileManager_1shouldMoveItemAtPath_1toPath_1, fileManager != null ? fileManager.id : 0, srcPath != null ? srcPath.id : 0, dstPath != null ? dstPath.id : 0) != 0;
+}
+
+public boolean fileManager_shouldProceedAfterError_(NSFileManager fm, NSDictionary errorInfo) {
+ return OS.objc_msgSend(this.id, OS.sel_fileManager_1shouldProceedAfterError_1, fm != null ? fm.id : 0, errorInfo != null ? errorInfo.id : 0) != 0;
+}
+
+public boolean fileManager_shouldProceedAfterError_copyingItemAtPath_toPath_(NSFileManager fileManager, NSError error, NSString srcPath, NSString dstPath) {
+ return OS.objc_msgSend(this.id, OS.sel_fileManager_1shouldProceedAfterError_1copyingItemAtPath_1toPath_1, fileManager != null ? fileManager.id : 0, error != null ? error.id : 0, srcPath != null ? srcPath.id : 0, dstPath != null ? dstPath.id : 0) != 0;
+}
+
+public boolean fileManager_shouldProceedAfterError_linkingItemAtPath_toPath_(NSFileManager fileManager, NSError error, NSString srcPath, NSString dstPath) {
+ return OS.objc_msgSend(this.id, OS.sel_fileManager_1shouldProceedAfterError_1linkingItemAtPath_1toPath_1, fileManager != null ? fileManager.id : 0, error != null ? error.id : 0, srcPath != null ? srcPath.id : 0, dstPath != null ? dstPath.id : 0) != 0;
+}
+
+public boolean fileManager_shouldProceedAfterError_movingItemAtPath_toPath_(NSFileManager fileManager, NSError error, NSString srcPath, NSString dstPath) {
+ return OS.objc_msgSend(this.id, OS.sel_fileManager_1shouldProceedAfterError_1movingItemAtPath_1toPath_1, fileManager != null ? fileManager.id : 0, error != null ? error.id : 0, srcPath != null ? srcPath.id : 0, dstPath != null ? dstPath.id : 0) != 0;
+}
+
+public boolean fileManager_shouldProceedAfterError_removingItemAtPath_(NSFileManager fileManager, NSError error, NSString path) {
+ return OS.objc_msgSend(this.id, OS.sel_fileManager_1shouldProceedAfterError_1removingItemAtPath_1, fileManager != null ? fileManager.id : 0, error != null ? error.id : 0, path != null ? path.id : 0) != 0;
+}
+
+public boolean fileManager_shouldRemoveItemAtPath_(NSFileManager fileManager, NSString path) {
+ return OS.objc_msgSend(this.id, OS.sel_fileManager_1shouldRemoveItemAtPath_1, fileManager != null ? fileManager.id : 0, path != null ? path.id : 0) != 0;
+}
+
+public void fileManager_willProcessPath_(NSFileManager fm, NSString path) {
+ OS.objc_msgSend(this.id, OS.sel_fileManager_1willProcessPath_1, fm != null ? fm.id : 0, path != null ? path.id : 0);
+}
+
+public void finalizeXX() {
+ OS.objc_msgSend(this.id, OS.sel_finalize);
+}
+
+public void forwardInvocation(NSInvocation anInvocation) {
+ OS.objc_msgSend(this.id, OS.sel_forwardInvocation_1, anInvocation != null ? anInvocation.id : 0);
+}
+
+public void handleMachMessage(int msg) {
+ OS.objc_msgSend(this.id, OS.sel_handleMachMessage_1, msg);
+}
+
+public void handlePortMessage(NSPortMessage message) {
+ OS.objc_msgSend(this.id, OS.sel_handlePortMessage_1, message != null ? message.id : 0);
+}
+
+public id handleQueryWithUnboundKey(NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_handleQueryWithUnboundKey_1, key != null ? key.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void handleTakeValue(id value, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_handleTakeValue_1forUnboundKey_1, value != null ? value.id : 0, key != null ? key.id : 0);
+}
+
+public int hash() {
+ return OS.objc_msgSend(this.id, OS.sel_hash);
+}
+
+public NSArray indicesOfObjectsByEvaluatingObjectSpecifier(NSScriptObjectSpecifier specifier) {
+ int result = OS.objc_msgSend(this.id, OS.sel_indicesOfObjectsByEvaluatingObjectSpecifier_1, specifier != null ? specifier.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSObject init() {
+ int result = OS.objc_msgSend(this.id, OS.sel_init);
+ return result != 0 ? this : null;
+}
+
+public NSObject initWithCoder(NSCoder aDecoder) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCoder_1, aDecoder != null ? aDecoder.id : 0);
+ return result != 0 ? this : null;
+}
+
+public static void initialize() {
+ OS.objc_msgSend(OS.class_NSObject, OS.sel_initialize);
+}
+
+public void insertValue_atIndex_inPropertyWithKey_(id value, int index, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_insertValue_1atIndex_1inPropertyWithKey_1, value != null ? value.id : 0, index, key != null ? key.id : 0);
+}
+
+public void insertValue_inPropertyWithKey_(id value, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_insertValue_1inPropertyWithKey_1, value != null ? value.id : 0, key != null ? key.id : 0);
+}
+
+public static int instanceMethodForSelector(int aSelector) {
+ return OS.objc_msgSend(OS.class_NSObject, OS.sel_instanceMethodForSelector_1, aSelector);
+}
+
+public static NSMethodSignature instanceMethodSignatureForSelector(int aSelector) {
+ int result = OS.objc_msgSend(OS.class_NSObject, OS.sel_instanceMethodSignatureForSelector_1, aSelector);
+ return result != 0 ? new NSMethodSignature(result) : null;
+}
+
+public static boolean instancesRespondToSelector(int aSelector) {
+ return OS.objc_msgSend(OS.class_NSObject, OS.sel_instancesRespondToSelector_1, aSelector) != 0;
+}
+
+public NSString inverseForRelationshipKey(NSString relationshipKey) {
+ int result = OS.objc_msgSend(this.id, OS.sel_inverseForRelationshipKey_1, relationshipKey != null ? relationshipKey.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean isCaseInsensitiveLike(NSString object) {
+ return OS.objc_msgSend(this.id, OS.sel_isCaseInsensitiveLike_1, object != null ? object.id : 0) != 0;
+}
+
+public boolean isEqual(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_isEqual_1, object != null ? object.id : 0) != 0;
+}
+
+public boolean isEqualTo(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_isEqualTo_1, object != null ? object.id : 0) != 0;
+}
+
+public boolean isGreaterThan(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_isGreaterThan_1, object != null ? object.id : 0) != 0;
+}
+
+public boolean isGreaterThanOrEqualTo(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_isGreaterThanOrEqualTo_1, object != null ? object.id : 0) != 0;
+}
+
+public boolean isKindOfClass(int aClass) {
+ return OS.objc_msgSend(this.id, OS.sel_isKindOfClass_1, aClass) != 0;
+}
+
+public boolean isLessThan(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_isLessThan_1, object != null ? object.id : 0) != 0;
+}
+
+public boolean isLessThanOrEqualTo(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_isLessThanOrEqualTo_1, object != null ? object.id : 0) != 0;
+}
+
+public boolean isLike(NSString object) {
+ return OS.objc_msgSend(this.id, OS.sel_isLike_1, object != null ? object.id : 0) != 0;
+}
+
+public boolean isMemberOfClass(int aClass) {
+ return OS.objc_msgSend(this.id, OS.sel_isMemberOfClass_1, aClass) != 0;
+}
+
+public boolean isNotEqualTo(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_isNotEqualTo_1, object != null ? object.id : 0) != 0;
+}
+
+public boolean isProxy() {
+ return OS.objc_msgSend(this.id, OS.sel_isProxy) != 0;
+}
+
+public static boolean isSubclassOfClass(int aClass) {
+ return OS.objc_msgSend(OS.class_NSObject, OS.sel_isSubclassOfClass_1, aClass) != 0;
+}
+
+public static NSSet keyPathsForValuesAffectingValueForKey(NSString key) {
+ int result = OS.objc_msgSend(OS.class_NSObject, OS.sel_keyPathsForValuesAffectingValueForKey_1, key != null ? key.id : 0);
+ return result != 0 ? new NSSet(result) : null;
+}
+
+public static void load() {
+ OS.objc_msgSend(OS.class_NSObject, OS.sel_load);
+}
+
+public void lock() {
+ OS.objc_msgSend(this.id, OS.sel_lock);
+}
+
+public boolean makeNewConnection(NSConnection conn, NSConnection ancestor) {
+ return OS.objc_msgSend(this.id, OS.sel_makeNewConnection_1sender_1, conn != null ? conn.id : 0, ancestor != null ? ancestor.id : 0) != 0;
+}
+
+public id metadataQuery_replacementObjectForResultObject_(NSMetadataQuery query, NSMetadataItem result) {
+ int r = OS.objc_msgSend(this.id, OS.sel_metadataQuery_1replacementObjectForResultObject_1, query != null ? query.id : 0, result != null ? result.id : 0);
+ return r != 0 ? new id(r) : null;
+}
+
+public id metadataQuery_replacementValueForAttribute_value_(NSMetadataQuery query, NSString attrName, id attrValue) {
+ int result = OS.objc_msgSend(this.id, OS.sel_metadataQuery_1replacementValueForAttribute_1value_1, query != null ? query.id : 0, attrName != null ? attrName.id : 0, attrValue != null ? attrValue.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public int methodForSelector(int aSelector) {
+ return OS.objc_msgSend(this.id, OS.sel_methodForSelector_1, aSelector);
+}
+
+public NSMethodSignature methodSignatureForSelector(int aSelector) {
+ int result = OS.objc_msgSend(this.id, OS.sel_methodSignatureForSelector_1, aSelector);
+ return result != 0 ? new NSMethodSignature(result) : null;
+}
+
+public NSMutableArray mutableArrayValueForKey(NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_mutableArrayValueForKey_1, key != null ? key.id : 0);
+ return result != 0 ? new NSMutableArray(result) : null;
+}
+
+public NSMutableArray mutableArrayValueForKeyPath(NSString keyPath) {
+ int result = OS.objc_msgSend(this.id, OS.sel_mutableArrayValueForKeyPath_1, keyPath != null ? keyPath.id : 0);
+ return result != 0 ? new NSMutableArray(result) : null;
+}
+
+public id mutableCopy() {
+ int result = OS.objc_msgSend(this.id, OS.sel_mutableCopy);
+ return result != 0 ? new id(result) : null;
+}
+
+public id mutableCopyWithZone_(int zone) {
+ int result = OS.objc_msgSend(this.id, OS.sel_mutableCopyWithZone_1, zone);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_mutableCopyWithZone_(int zone) {
+ int result = OS.objc_msgSend(OS.class_NSObject, OS.sel_mutableCopyWithZone_1, zone);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSMutableSet mutableSetValueForKey(NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_mutableSetValueForKey_1, key != null ? key.id : 0);
+ return result != 0 ? new NSMutableSet(result) : null;
+}
+
+public NSMutableSet mutableSetValueForKeyPath(NSString keyPath) {
+ int result = OS.objc_msgSend(this.id, OS.sel_mutableSetValueForKeyPath_1, keyPath != null ? keyPath.id : 0);
+ return result != 0 ? new NSMutableSet(result) : null;
+}
+
+public void netService_didNotPublish_(NSNetService sender, NSDictionary errorDict) {
+ OS.objc_msgSend(this.id, OS.sel_netService_1didNotPublish_1, sender != null ? sender.id : 0, errorDict != null ? errorDict.id : 0);
+}
+
+public void netService_didNotResolve_(NSNetService sender, NSDictionary errorDict) {
+ OS.objc_msgSend(this.id, OS.sel_netService_1didNotResolve_1, sender != null ? sender.id : 0, errorDict != null ? errorDict.id : 0);
+}
+
+public void netService_didUpdateTXTRecordData_(NSNetService sender, NSData data) {
+ OS.objc_msgSend(this.id, OS.sel_netService_1didUpdateTXTRecordData_1, sender != null ? sender.id : 0, data != null ? data.id : 0);
+}
+
+public void netServiceBrowser_didFindDomain_moreComing_(NSNetServiceBrowser aNetServiceBrowser, NSString domainString, boolean moreComing) {
+ OS.objc_msgSend(this.id, OS.sel_netServiceBrowser_1didFindDomain_1moreComing_1, aNetServiceBrowser != null ? aNetServiceBrowser.id : 0, domainString != null ? domainString.id : 0, moreComing);
+}
+
+public void netServiceBrowser_didFindService_moreComing_(NSNetServiceBrowser aNetServiceBrowser, NSNetService aNetService, boolean moreComing) {
+ OS.objc_msgSend(this.id, OS.sel_netServiceBrowser_1didFindService_1moreComing_1, aNetServiceBrowser != null ? aNetServiceBrowser.id : 0, aNetService != null ? aNetService.id : 0, moreComing);
+}
+
+public void netServiceBrowser_didNotSearch_(NSNetServiceBrowser aNetServiceBrowser, NSDictionary errorDict) {
+ OS.objc_msgSend(this.id, OS.sel_netServiceBrowser_1didNotSearch_1, aNetServiceBrowser != null ? aNetServiceBrowser.id : 0, errorDict != null ? errorDict.id : 0);
+}
+
+public void netServiceBrowser_didRemoveDomain_moreComing_(NSNetServiceBrowser aNetServiceBrowser, NSString domainString, boolean moreComing) {
+ OS.objc_msgSend(this.id, OS.sel_netServiceBrowser_1didRemoveDomain_1moreComing_1, aNetServiceBrowser != null ? aNetServiceBrowser.id : 0, domainString != null ? domainString.id : 0, moreComing);
+}
+
+public void netServiceBrowser_didRemoveService_moreComing_(NSNetServiceBrowser aNetServiceBrowser, NSNetService aNetService, boolean moreComing) {
+ OS.objc_msgSend(this.id, OS.sel_netServiceBrowser_1didRemoveService_1moreComing_1, aNetServiceBrowser != null ? aNetServiceBrowser.id : 0, aNetService != null ? aNetService.id : 0, moreComing);
+}
+
+public void netServiceBrowserDidStopSearch(NSNetServiceBrowser aNetServiceBrowser) {
+ OS.objc_msgSend(this.id, OS.sel_netServiceBrowserDidStopSearch_1, aNetServiceBrowser != null ? aNetServiceBrowser.id : 0);
+}
+
+public void netServiceBrowserWillSearch(NSNetServiceBrowser aNetServiceBrowser) {
+ OS.objc_msgSend(this.id, OS.sel_netServiceBrowserWillSearch_1, aNetServiceBrowser != null ? aNetServiceBrowser.id : 0);
+}
+
+public void netServiceDidPublish(NSNetService sender) {
+ OS.objc_msgSend(this.id, OS.sel_netServiceDidPublish_1, sender != null ? sender.id : 0);
+}
+
+public void netServiceDidResolveAddress(NSNetService sender) {
+ OS.objc_msgSend(this.id, OS.sel_netServiceDidResolveAddress_1, sender != null ? sender.id : 0);
+}
+
+public void netServiceDidStop(NSNetService sender) {
+ OS.objc_msgSend(this.id, OS.sel_netServiceDidStop_1, sender != null ? sender.id : 0);
+}
+
+public void netServiceWillPublish(NSNetService sender) {
+ OS.objc_msgSend(this.id, OS.sel_netServiceWillPublish_1, sender != null ? sender.id : 0);
+}
+
+public void netServiceWillResolve(NSNetService sender) {
+ OS.objc_msgSend(this.id, OS.sel_netServiceWillResolve_1, sender != null ? sender.id : 0);
+}
+
+//public static id new() {
+// int result = OS.objc_msgSend(OS.class_NSObject, OS.sel_new);
+// return result != 0 ? new id(result) : null;
+//}
+
+public id newScriptingObjectOfClass(int objectClass, NSString key, id contentsValue, NSDictionary properties) {
+ int result = OS.objc_msgSend(this.id, OS.sel_newScriptingObjectOfClass_1forValueForKey_1withContentsValue_1properties_1, objectClass, key != null ? key.id : 0, contentsValue != null ? contentsValue.id : 0, properties != null ? properties.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSScriptObjectSpecifier objectSpecifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectSpecifier);
+ return result != 0 ? new NSScriptObjectSpecifier(result) : null;
+}
+
+public int observationInfo() {
+ return OS.objc_msgSend(this.id, OS.sel_observationInfo);
+}
+
+public void observeValueForKeyPath(NSString keyPath, id object, NSDictionary change, int context) {
+ OS.objc_msgSend(this.id, OS.sel_observeValueForKeyPath_1ofObject_1change_1context_1, keyPath != null ? keyPath.id : 0, object != null ? object.id : 0, change != null ? change.id : 0, context);
+}
+
+public void parser_didEndElement_namespaceURI_qualifiedName_(NSXMLParser parser, NSString elementName, NSString namespaceURI, NSString qName) {
+ OS.objc_msgSend(this.id, OS.sel_parser_1didEndElement_1namespaceURI_1qualifiedName_1, parser != null ? parser.id : 0, elementName != null ? elementName.id : 0, namespaceURI != null ? namespaceURI.id : 0, qName != null ? qName.id : 0);
+}
+
+public void parser_didEndMappingPrefix_(NSXMLParser parser, NSString prefix) {
+ OS.objc_msgSend(this.id, OS.sel_parser_1didEndMappingPrefix_1, parser != null ? parser.id : 0, prefix != null ? prefix.id : 0);
+}
+
+public void parser_didStartElement_namespaceURI_qualifiedName_attributes_(NSXMLParser parser, NSString elementName, NSString namespaceURI, NSString qName, NSDictionary attributeDict) {
+ OS.objc_msgSend(this.id, OS.sel_parser_1didStartElement_1namespaceURI_1qualifiedName_1attributes_1, parser != null ? parser.id : 0, elementName != null ? elementName.id : 0, namespaceURI != null ? namespaceURI.id : 0, qName != null ? qName.id : 0, attributeDict != null ? attributeDict.id : 0);
+}
+
+public void parser_didStartMappingPrefix_toURI_(NSXMLParser parser, NSString prefix, NSString namespaceURI) {
+ OS.objc_msgSend(this.id, OS.sel_parser_1didStartMappingPrefix_1toURI_1, parser != null ? parser.id : 0, prefix != null ? prefix.id : 0, namespaceURI != null ? namespaceURI.id : 0);
+}
+
+public void parser_foundAttributeDeclarationWithName_forElement_type_defaultValue_(NSXMLParser parser, NSString attributeName, NSString elementName, NSString type, NSString defaultValue) {
+ OS.objc_msgSend(this.id, OS.sel_parser_1foundAttributeDeclarationWithName_1forElement_1type_1defaultValue_1, parser != null ? parser.id : 0, attributeName != null ? attributeName.id : 0, elementName != null ? elementName.id : 0, type != null ? type.id : 0, defaultValue != null ? defaultValue.id : 0);
+}
+
+public void parser_foundCDATA_(NSXMLParser parser, NSData CDATABlock) {
+ OS.objc_msgSend(this.id, OS.sel_parser_1foundCDATA_1, parser != null ? parser.id : 0, CDATABlock != null ? CDATABlock.id : 0);
+}
+
+public void parser_foundCharacters_(NSXMLParser parser, NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_parser_1foundCharacters_1, parser != null ? parser.id : 0, string != null ? string.id : 0);
+}
+
+public void parser_foundComment_(NSXMLParser parser, NSString comment) {
+ OS.objc_msgSend(this.id, OS.sel_parser_1foundComment_1, parser != null ? parser.id : 0, comment != null ? comment.id : 0);
+}
+
+public void parser_foundElementDeclarationWithName_model_(NSXMLParser parser, NSString elementName, NSString model) {
+ OS.objc_msgSend(this.id, OS.sel_parser_1foundElementDeclarationWithName_1model_1, parser != null ? parser.id : 0, elementName != null ? elementName.id : 0, model != null ? model.id : 0);
+}
+
+public void parser_foundExternalEntityDeclarationWithName_publicID_systemID_(NSXMLParser parser, NSString name, NSString publicID, NSString systemID) {
+ OS.objc_msgSend(this.id, OS.sel_parser_1foundExternalEntityDeclarationWithName_1publicID_1systemID_1, parser != null ? parser.id : 0, name != null ? name.id : 0, publicID != null ? publicID.id : 0, systemID != null ? systemID.id : 0);
+}
+
+public void parser_foundIgnorableWhitespace_(NSXMLParser parser, NSString whitespaceString) {
+ OS.objc_msgSend(this.id, OS.sel_parser_1foundIgnorableWhitespace_1, parser != null ? parser.id : 0, whitespaceString != null ? whitespaceString.id : 0);
+}
+
+public void parser_foundInternalEntityDeclarationWithName_value_(NSXMLParser parser, NSString name, NSString value) {
+ OS.objc_msgSend(this.id, OS.sel_parser_1foundInternalEntityDeclarationWithName_1value_1, parser != null ? parser.id : 0, name != null ? name.id : 0, value != null ? value.id : 0);
+}
+
+public void parser_foundNotationDeclarationWithName_publicID_systemID_(NSXMLParser parser, NSString name, NSString publicID, NSString systemID) {
+ OS.objc_msgSend(this.id, OS.sel_parser_1foundNotationDeclarationWithName_1publicID_1systemID_1, parser != null ? parser.id : 0, name != null ? name.id : 0, publicID != null ? publicID.id : 0, systemID != null ? systemID.id : 0);
+}
+
+public void parser_foundProcessingInstructionWithTarget_data_(NSXMLParser parser, NSString target, NSString data) {
+ OS.objc_msgSend(this.id, OS.sel_parser_1foundProcessingInstructionWithTarget_1data_1, parser != null ? parser.id : 0, target != null ? target.id : 0, data != null ? data.id : 0);
+}
+
+public void parser_foundUnparsedEntityDeclarationWithName_publicID_systemID_notationName_(NSXMLParser parser, NSString name, NSString publicID, NSString systemID, NSString notationName) {
+ OS.objc_msgSend(this.id, OS.sel_parser_1foundUnparsedEntityDeclarationWithName_1publicID_1systemID_1notationName_1, parser != null ? parser.id : 0, name != null ? name.id : 0, publicID != null ? publicID.id : 0, systemID != null ? systemID.id : 0, notationName != null ? notationName.id : 0);
+}
+
+public void parser_parseErrorOccurred_(NSXMLParser parser, NSError parseError) {
+ OS.objc_msgSend(this.id, OS.sel_parser_1parseErrorOccurred_1, parser != null ? parser.id : 0, parseError != null ? parseError.id : 0);
+}
+
+public NSData parser_resolveExternalEntityName_systemID_(NSXMLParser parser, NSString name, NSString systemID) {
+ int result = OS.objc_msgSend(this.id, OS.sel_parser_1resolveExternalEntityName_1systemID_1, parser != null ? parser.id : 0, name != null ? name.id : 0, systemID != null ? systemID.id : 0);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public void parser_validationErrorOccurred_(NSXMLParser parser, NSError validationError) {
+ OS.objc_msgSend(this.id, OS.sel_parser_1validationErrorOccurred_1, parser != null ? parser.id : 0, validationError != null ? validationError.id : 0);
+}
+
+public void parserDidEndDocument(NSXMLParser parser) {
+ OS.objc_msgSend(this.id, OS.sel_parserDidEndDocument_1, parser != null ? parser.id : 0);
+}
+
+public void parserDidStartDocument(NSXMLParser parser) {
+ OS.objc_msgSend(this.id, OS.sel_parserDidStartDocument_1, parser != null ? parser.id : 0);
+}
+
+public id performSelector_(int aSelector) {
+ int result = OS.objc_msgSend(this.id, OS.sel_performSelector_1, aSelector);
+ return result != 0 ? new id(result) : null;
+}
+
+public void performSelector_onThread_withObject_waitUntilDone_(int aSelector, NSThread thr, id arg, boolean wait) {
+ OS.objc_msgSend(this.id, OS.sel_performSelector_1onThread_1withObject_1waitUntilDone_1, aSelector, thr != null ? thr.id : 0, arg != null ? arg.id : 0, wait);
+}
+
+public void performSelector_onThread_withObject_waitUntilDone_modes_(int aSelector, NSThread thr, id arg, boolean wait, NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_performSelector_1onThread_1withObject_1waitUntilDone_1modes_1, aSelector, thr != null ? thr.id : 0, arg != null ? arg.id : 0, wait, array != null ? array.id : 0);
+}
+
+public id performSelector_withObject_(int aSelector, id object) {
+ int result = OS.objc_msgSend(this.id, OS.sel_performSelector_1withObject_1, aSelector, object != null ? object.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void performSelector_withObject_afterDelay_(int aSelector, id anArgument, double delay) {
+ OS.objc_msgSend(this.id, OS.sel_performSelector_1withObject_1afterDelay_1, aSelector, anArgument != null ? anArgument.id : 0, delay);
+}
+
+public void performSelector_withObject_afterDelay_inModes_(int aSelector, id anArgument, double delay, NSArray modes) {
+ OS.objc_msgSend(this.id, OS.sel_performSelector_1withObject_1afterDelay_1inModes_1, aSelector, anArgument != null ? anArgument.id : 0, delay, modes != null ? modes.id : 0);
+}
+
+public id performSelector_withObject_withObject_(int aSelector, id object1, id object2) {
+ int result = OS.objc_msgSend(this.id, OS.sel_performSelector_1withObject_1withObject_1, aSelector, object1 != null ? object1.id : 0, object2 != null ? object2.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void performSelectorInBackground(int aSelector, id arg) {
+ OS.objc_msgSend(this.id, OS.sel_performSelectorInBackground_1withObject_1, aSelector, arg != null ? arg.id : 0);
+}
+
+public void performSelectorOnMainThread_withObject_waitUntilDone_(int aSelector, id arg, boolean wait) {
+ OS.objc_msgSend(this.id, OS.sel_performSelectorOnMainThread_1withObject_1waitUntilDone_1, aSelector, arg != null ? arg.id : 0, wait);
+}
+
+public void performSelectorOnMainThread_withObject_waitUntilDone_modes_(int aSelector, id arg, boolean wait, NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_performSelectorOnMainThread_1withObject_1waitUntilDone_1modes_1, aSelector, arg != null ? arg.id : 0, wait, array != null ? array.id : 0);
+}
+
+public static void poseAsClass(int aClass) {
+ OS.objc_msgSend(OS.class_NSObject, OS.sel_poseAsClass_1, aClass);
+}
+
+public void release() {
+ OS.objc_msgSend(this.id, OS.sel_release);
+}
+
+public void removeObserver(NSObject observer, NSString keyPath) {
+ OS.objc_msgSend(this.id, OS.sel_removeObserver_1forKeyPath_1, observer != null ? observer.id : 0, keyPath != null ? keyPath.id : 0);
+}
+
+public void removeValueAtIndex(int index, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_removeValueAtIndex_1fromPropertyWithKey_1, index, key != null ? key.id : 0);
+}
+
+public void replaceValueAtIndex(int index, NSString key, id value) {
+ OS.objc_msgSend(this.id, OS.sel_replaceValueAtIndex_1inPropertyWithKey_1withValue_1, index, key != null ? key.id : 0, value != null ? value.id : 0);
+}
+
+public id replacementObjectForArchiver(NSArchiver archiver) {
+ int result = OS.objc_msgSend(this.id, OS.sel_replacementObjectForArchiver_1, archiver != null ? archiver.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id replacementObjectForCoder(NSCoder aCoder) {
+ int result = OS.objc_msgSend(this.id, OS.sel_replacementObjectForCoder_1, aCoder != null ? aCoder.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id replacementObjectForKeyedArchiver(NSKeyedArchiver archiver) {
+ int result = OS.objc_msgSend(this.id, OS.sel_replacementObjectForKeyedArchiver_1, archiver != null ? archiver.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id replacementObjectForPortCoder(NSPortCoder coder) {
+ int result = OS.objc_msgSend(this.id, OS.sel_replacementObjectForPortCoder_1, coder != null ? coder.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static boolean resolveClassMethod(int sel) {
+ return OS.objc_msgSend(OS.class_NSObject, OS.sel_resolveClassMethod_1, sel) != 0;
+}
+
+public static boolean resolveInstanceMethod(int sel) {
+ return OS.objc_msgSend(OS.class_NSObject, OS.sel_resolveInstanceMethod_1, sel) != 0;
+}
+
+public boolean respondsToSelector(int aSelector) {
+ return OS.objc_msgSend(this.id, OS.sel_respondsToSelector_1, aSelector) != 0;
+}
+
+public id retain() {
+ int result = OS.objc_msgSend(this.id, OS.sel_retain);
+ return result != 0 ? new id(result) : null;
+}
+
+public int retainCount() {
+ return OS.objc_msgSend(this.id, OS.sel_retainCount);
+}
+
+public int roundingMode() {
+ return OS.objc_msgSend(this.id, OS.sel_roundingMode);
+}
+
+public short scale() {
+ return (short)OS.objc_msgSend(this.id, OS.sel_scale);
+}
+
+public boolean scriptingBeginsWith(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_scriptingBeginsWith_1, object != null ? object.id : 0) != 0;
+}
+
+public boolean scriptingContains(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_scriptingContains_1, object != null ? object.id : 0) != 0;
+}
+
+public boolean scriptingEndsWith(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_scriptingEndsWith_1, object != null ? object.id : 0) != 0;
+}
+
+public boolean scriptingIsEqualTo(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_scriptingIsEqualTo_1, object != null ? object.id : 0) != 0;
+}
+
+public boolean scriptingIsGreaterThan(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_scriptingIsGreaterThan_1, object != null ? object.id : 0) != 0;
+}
+
+public boolean scriptingIsGreaterThanOrEqualTo(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_scriptingIsGreaterThanOrEqualTo_1, object != null ? object.id : 0) != 0;
+}
+
+public boolean scriptingIsLessThan(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_scriptingIsLessThan_1, object != null ? object.id : 0) != 0;
+}
+
+public boolean scriptingIsLessThanOrEqualTo(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_scriptingIsLessThanOrEqualTo_1, object != null ? object.id : 0) != 0;
+}
+
+public NSDictionary scriptingProperties() {
+ int result = OS.objc_msgSend(this.id, OS.sel_scriptingProperties);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public id scriptingValueForSpecifier(NSScriptObjectSpecifier objectSpecifier) {
+ int result = OS.objc_msgSend(this.id, OS.sel_scriptingValueForSpecifier_1, objectSpecifier != null ? objectSpecifier.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id self() {
+ int result = OS.objc_msgSend(this.id, OS.sel_self);
+ return result != 0 ? new id(result) : null;
+}
+
+public static void setKeys(NSArray keys, NSString dependentKey) {
+ OS.objc_msgSend(OS.class_NSObject, OS.sel_setKeys_1triggerChangeNotificationsForDependentKey_1, keys != null ? keys.id : 0, dependentKey != null ? dependentKey.id : 0);
+}
+
+public void setNilValueForKey(NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_setNilValueForKey_1, key != null ? key.id : 0);
+}
+
+public void setObservationInfo(int observationInfo) {
+ OS.objc_msgSend(this.id, OS.sel_setObservationInfo_1, observationInfo);
+}
+
+public void setScriptingProperties(NSDictionary properties) {
+ OS.objc_msgSend(this.id, OS.sel_setScriptingProperties_1, properties != null ? properties.id : 0);
+}
+
+public void setValue_forKey_(id value, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_setValue_1forKey_1, value != null ? value.id : 0, key != null ? key.id : 0);
+}
+
+public void setValue_forKeyPath_(id value, NSString keyPath) {
+ OS.objc_msgSend(this.id, OS.sel_setValue_1forKeyPath_1, value != null ? value.id : 0, keyPath != null ? keyPath.id : 0);
+}
+
+public void setValue_forUndefinedKey_(id value, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_setValue_1forUndefinedKey_1, value != null ? value.id : 0, key != null ? key.id : 0);
+}
+
+public void setValuesForKeysWithDictionary(NSDictionary keyedValues) {
+ OS.objc_msgSend(this.id, OS.sel_setValuesForKeysWithDictionary_1, keyedValues != null ? keyedValues.id : 0);
+}
+
+public static void setVersion(int aVersion) {
+ OS.objc_msgSend(OS.class_NSObject, OS.sel_setVersion_1, aVersion);
+}
+
+public NSRange spellServer_checkGrammarInString_language_details_(NSSpellServer sender, NSString stringToCheck, NSString language, int details) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_spellServer_1checkGrammarInString_1language_1details_1, sender != null ? sender.id : 0, stringToCheck != null ? stringToCheck.id : 0, language != null ? language.id : 0, details);
+ return result;
+}
+
+public void spellServer_didForgetWord_inLanguage_(NSSpellServer sender, NSString word, NSString language) {
+ OS.objc_msgSend(this.id, OS.sel_spellServer_1didForgetWord_1inLanguage_1, sender != null ? sender.id : 0, word != null ? word.id : 0, language != null ? language.id : 0);
+}
+
+public void spellServer_didLearnWord_inLanguage_(NSSpellServer sender, NSString word, NSString language) {
+ OS.objc_msgSend(this.id, OS.sel_spellServer_1didLearnWord_1inLanguage_1, sender != null ? sender.id : 0, word != null ? word.id : 0, language != null ? language.id : 0);
+}
+
+public NSRange spellServer_findMisspelledWordInString_language_wordCount_countOnly_(NSSpellServer sender, NSString stringToCheck, NSString language, int wordCount, boolean countOnly) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_spellServer_1findMisspelledWordInString_1language_1wordCount_1countOnly_1, sender != null ? sender.id : 0, stringToCheck != null ? stringToCheck.id : 0, language != null ? language.id : 0, wordCount, countOnly);
+ return result;
+}
+
+public NSArray spellServer_suggestCompletionsForPartialWordRange_inString_language_(NSSpellServer sender, NSRange range, NSString string, NSString language) {
+ int result = OS.objc_msgSend(this.id, OS.sel_spellServer_1suggestCompletionsForPartialWordRange_1inString_1language_1, sender != null ? sender.id : 0, range, string != null ? string.id : 0, language != null ? language.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray spellServer_suggestGuessesForWord_inLanguage_(NSSpellServer sender, NSString word, NSString language) {
+ int result = OS.objc_msgSend(this.id, OS.sel_spellServer_1suggestGuessesForWord_1inLanguage_1, sender != null ? sender.id : 0, word != null ? word.id : 0, language != null ? language.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public id storedValueForKey(NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_storedValueForKey_1, key != null ? key.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void stream(NSStream aStream, int eventCode) {
+ OS.objc_msgSend(this.id, OS.sel_stream_1handleEvent_1, aStream != null ? aStream.id : 0, eventCode);
+}
+
+public static int static_superclass() {
+ return OS.objc_msgSend(OS.class_NSObject, OS.sel_superclass);
+}
+
+public int superclass() {
+ return OS.objc_msgSend(this.id, OS.sel_superclass);
+}
+
+public void takeStoredValue(id value, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_takeStoredValue_1forKey_1, value != null ? value.id : 0, key != null ? key.id : 0);
+}
+
+public void takeValue_forKey_(id value, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_takeValue_1forKey_1, value != null ? value.id : 0, key != null ? key.id : 0);
+}
+
+public void takeValue_forKeyPath_(id value, NSString keyPath) {
+ OS.objc_msgSend(this.id, OS.sel_takeValue_1forKeyPath_1, value != null ? value.id : 0, keyPath != null ? keyPath.id : 0);
+}
+
+public void takeValuesFromDictionary(NSDictionary properties) {
+ OS.objc_msgSend(this.id, OS.sel_takeValuesFromDictionary_1, properties != null ? properties.id : 0);
+}
+
+public NSArray toManyRelationshipKeys() {
+ int result = OS.objc_msgSend(this.id, OS.sel_toManyRelationshipKeys);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray toOneRelationshipKeys() {
+ int result = OS.objc_msgSend(this.id, OS.sel_toOneRelationshipKeys);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void unableToSetNilForKey(NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_unableToSetNilForKey_1, key != null ? key.id : 0);
+}
+
+public int unarchiver_cannotDecodeObjectOfClassName_originalClasses_(NSKeyedUnarchiver unarchiver, NSString name, NSArray classNames) {
+ return OS.objc_msgSend(this.id, OS.sel_unarchiver_1cannotDecodeObjectOfClassName_1originalClasses_1, unarchiver != null ? unarchiver.id : 0, name != null ? name.id : 0, classNames != null ? classNames.id : 0);
+}
+
+public id unarchiver_didDecodeObject_(NSKeyedUnarchiver unarchiver, id object) {
+ int result = OS.objc_msgSend(this.id, OS.sel_unarchiver_1didDecodeObject_1, unarchiver != null ? unarchiver.id : 0, object != null ? object.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void unarchiver_willReplaceObject_withObject_(NSKeyedUnarchiver unarchiver, id object, id newObject) {
+ OS.objc_msgSend(this.id, OS.sel_unarchiver_1willReplaceObject_1withObject_1, unarchiver != null ? unarchiver.id : 0, object != null ? object.id : 0, newObject != null ? newObject.id : 0);
+}
+
+public void unarchiverDidFinish(NSKeyedUnarchiver unarchiver) {
+ OS.objc_msgSend(this.id, OS.sel_unarchiverDidFinish_1, unarchiver != null ? unarchiver.id : 0);
+}
+
+public void unarchiverWillFinish(NSKeyedUnarchiver unarchiver) {
+ OS.objc_msgSend(this.id, OS.sel_unarchiverWillFinish_1, unarchiver != null ? unarchiver.id : 0);
+}
+
+public void unlock() {
+ OS.objc_msgSend(this.id, OS.sel_unlock);
+}
+
+public void useCredential(NSURLCredential credential, NSURLAuthenticationChallenge challenge) {
+ OS.objc_msgSend(this.id, OS.sel_useCredential_1forAuthenticationChallenge_1, credential != null ? credential.id : 0, challenge != null ? challenge.id : 0);
+}
+
+public static boolean useStoredAccessor() {
+ return OS.objc_msgSend(OS.class_NSObject, OS.sel_useStoredAccessor) != 0;
+}
+
+public boolean validateValue_forKey_error_(int ioValue, NSString inKey, int outError) {
+ return OS.objc_msgSend(this.id, OS.sel_validateValue_1forKey_1error_1, ioValue, inKey != null ? inKey.id : 0, outError) != 0;
+}
+
+public boolean validateValue_forKeyPath_error_(int ioValue, NSString inKeyPath, int outError) {
+ return OS.objc_msgSend(this.id, OS.sel_validateValue_1forKeyPath_1error_1, ioValue, inKeyPath != null ? inKeyPath.id : 0, outError) != 0;
+}
+
+public id valueAtIndex(int index, NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_valueAtIndex_1inPropertyWithKey_1, index, key != null ? key.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id valueForKey(NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_valueForKey_1, key != null ? key.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id valueForKeyPath(NSString keyPath) {
+ int result = OS.objc_msgSend(this.id, OS.sel_valueForKeyPath_1, keyPath != null ? keyPath.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id valueForUndefinedKey(NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_valueForUndefinedKey_1, key != null ? key.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id valueWithName(NSString name, NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_valueWithName_1inPropertyWithKey_1, name != null ? name.id : 0, key != null ? key.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id valueWithUniqueID(id uniqueID, NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_valueWithUniqueID_1inPropertyWithKey_1, uniqueID != null ? uniqueID.id : 0, key != null ? key.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSDictionary valuesForKeys(NSArray keys) {
+ int result = OS.objc_msgSend(this.id, OS.sel_valuesForKeys_1, keys != null ? keys.id : 0);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public static int version() {
+ return OS.objc_msgSend(OS.class_NSObject, OS.sel_version);
+}
+
+public void willChange(int changeKind, NSIndexSet indexes, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_willChange_1valuesAtIndexes_1forKey_1, changeKind, indexes != null ? indexes.id : 0, key != null ? key.id : 0);
+}
+
+public void willChangeValueForKey_(NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_willChangeValueForKey_1, key != null ? key.id : 0);
+}
+
+public void willChangeValueForKey_withSetMutation_usingObjects_(NSString key, int mutationKind, NSSet objects) {
+ OS.objc_msgSend(this.id, OS.sel_willChangeValueForKey_1withSetMutation_1usingObjects_1, key != null ? key.id : 0, mutationKind, objects != null ? objects.id : 0);
+}
+
+public int zone() {
+ return OS.objc_msgSend(this.id, OS.sel_zone);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSObjectController.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSObjectController.java
new file mode 100644
index 0000000000..899fc03b01
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSObjectController.java
@@ -0,0 +1,146 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSObjectController extends NSController {
+
+public NSObjectController() {
+ super();
+}
+
+public NSObjectController(int id) {
+ super(id);
+}
+
+public void add(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_add_1, sender != null ? sender.id : 0);
+}
+
+public void addObject(id object) {
+ OS.objc_msgSend(this.id, OS.sel_addObject_1, object != null ? object.id : 0);
+}
+
+public boolean automaticallyPreparesContent() {
+ return OS.objc_msgSend(this.id, OS.sel_automaticallyPreparesContent) != 0;
+}
+
+public boolean canAdd() {
+ return OS.objc_msgSend(this.id, OS.sel_canAdd) != 0;
+}
+
+public boolean canRemove() {
+ return OS.objc_msgSend(this.id, OS.sel_canRemove) != 0;
+}
+
+public id content() {
+ int result = OS.objc_msgSend(this.id, OS.sel_content);
+ return result != 0 ? new id(result) : null;
+}
+
+//public NSFetchRequest defaultFetchRequest() {
+// int result = OS.objc_msgSend(this.id, OS.sel_defaultFetchRequest);
+// return result != 0 ? new NSFetchRequest(result) : null;
+//}
+
+public NSString entityName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_entityName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void fetch(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_fetch_1, sender != null ? sender.id : 0);
+}
+
+public NSPredicate fetchPredicate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fetchPredicate);
+ return result != 0 ? new NSPredicate(result) : null;
+}
+//
+//public boolean fetchWithRequest(NSFetchRequest fetchRequest, boolean merge, int error) {
+// return OS.objc_msgSend(this.id, OS.sel_fetchWithRequest_1merge_1error_1, fetchRequest != null ? fetchRequest.id : 0, merge, error) != 0;
+//}
+
+public NSObjectController initWithContent(id content) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContent_1, content != null ? content.id : 0);
+ return result != 0 ? this : null;
+}
+
+public boolean isEditable() {
+ return OS.objc_msgSend(this.id, OS.sel_isEditable) != 0;
+}
+
+//public NSManagedObjectContext managedObjectContext() {
+// int result = OS.objc_msgSend(this.id, OS.sel_managedObjectContext);
+// return result != 0 ? new NSManagedObjectContext(result) : null;
+//}
+
+public id newObject() {
+ int result = OS.objc_msgSend(this.id, OS.sel_newObject);
+ return result != 0 ? new id(result) : null;
+}
+
+public int objectClass() {
+ return OS.objc_msgSend(this.id, OS.sel_objectClass);
+}
+
+public void prepareContent() {
+ OS.objc_msgSend(this.id, OS.sel_prepareContent);
+}
+
+public void remove(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_remove_1, sender != null ? sender.id : 0);
+}
+
+public void removeObject(id object) {
+ OS.objc_msgSend(this.id, OS.sel_removeObject_1, object != null ? object.id : 0);
+}
+
+public NSArray selectedObjects() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedObjects);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public id selection() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selection);
+ return result != 0 ? new id(result) : null;
+}
+
+public void setAutomaticallyPreparesContent(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAutomaticallyPreparesContent_1, flag);
+}
+
+public void setContent(id content) {
+ OS.objc_msgSend(this.id, OS.sel_setContent_1, content != null ? content.id : 0);
+}
+
+public void setEditable(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setEditable_1, flag);
+}
+
+public void setEntityName(NSString entityName) {
+ OS.objc_msgSend(this.id, OS.sel_setEntityName_1, entityName != null ? entityName.id : 0);
+}
+
+public void setFetchPredicate(NSPredicate predicate) {
+ OS.objc_msgSend(this.id, OS.sel_setFetchPredicate_1, predicate != null ? predicate.id : 0);
+}
+
+//public void setManagedObjectContext(NSManagedObjectContext managedObjectContext) {
+// OS.objc_msgSend(this.id, OS.sel_setManagedObjectContext_1, managedObjectContext != null ? managedObjectContext.id : 0);
+//}
+
+public void setObjectClass(int objectClass) {
+ OS.objc_msgSend(this.id, OS.sel_setObjectClass_1, objectClass);
+}
+
+public void setUsesLazyFetching(boolean enabled) {
+ OS.objc_msgSend(this.id, OS.sel_setUsesLazyFetching_1, enabled);
+}
+
+public boolean usesLazyFetching() {
+ return OS.objc_msgSend(this.id, OS.sel_usesLazyFetching) != 0;
+}
+
+public boolean validateUserInterfaceItem(id item) {
+ return OS.objc_msgSend(this.id, OS.sel_validateUserInterfaceItem_1, item != null ? item.id : 0) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenGLContext.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenGLContext.java
new file mode 100644
index 0000000000..662a1681ee
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenGLContext.java
@@ -0,0 +1,109 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSOpenGLContext extends NSObject {
+
+public NSOpenGLContext() {
+ super();
+}
+
+public NSOpenGLContext(int id) {
+ super(id);
+}
+
+public int CGLContextObj() {
+ return OS.objc_msgSend(this.id, OS.sel_CGLContextObj);
+}
+
+public static void clearCurrentContext() {
+ OS.objc_msgSend(OS.class_NSOpenGLContext, OS.sel_clearCurrentContext);
+}
+
+public void clearDrawable() {
+ OS.objc_msgSend(this.id, OS.sel_clearDrawable);
+}
+
+public void copyAttributesFromContext(NSOpenGLContext context, int mask) {
+ OS.objc_msgSend(this.id, OS.sel_copyAttributesFromContext_1withMask_1, context != null ? context.id : 0, mask);
+}
+
+public void createTexture(int target, NSView view, int format) {
+ OS.objc_msgSend(this.id, OS.sel_createTexture_1fromView_1internalFormat_1, target, view != null ? view.id : 0, format);
+}
+
+public static NSOpenGLContext currentContext() {
+ int result = OS.objc_msgSend(OS.class_NSOpenGLContext, OS.sel_currentContext);
+ return result != 0 ? new NSOpenGLContext(result) : null;
+}
+
+public int currentVirtualScreen() {
+ return OS.objc_msgSend(this.id, OS.sel_currentVirtualScreen);
+}
+
+public void flushBuffer() {
+ OS.objc_msgSend(this.id, OS.sel_flushBuffer);
+}
+
+public void getValues(int vals, int param) {
+ OS.objc_msgSend(this.id, OS.sel_getValues_1forParameter_1, vals, param);
+}
+
+public NSOpenGLContext initWithFormat(NSOpenGLPixelFormat format, NSOpenGLContext share) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFormat_1shareContext_1, format != null ? format.id : 0, share != null ? share.id : 0);
+ return result != 0 ? this : null;
+}
+
+public void makeCurrentContext() {
+ OS.objc_msgSend(this.id, OS.sel_makeCurrentContext);
+}
+
+public NSOpenGLPixelBuffer pixelBuffer() {
+ int result = OS.objc_msgSend(this.id, OS.sel_pixelBuffer);
+ return result != 0 ? new NSOpenGLPixelBuffer(result) : null;
+}
+
+public int pixelBufferCubeMapFace() {
+ return OS.objc_msgSend(this.id, OS.sel_pixelBufferCubeMapFace);
+}
+
+public int pixelBufferMipMapLevel() {
+ return OS.objc_msgSend(this.id, OS.sel_pixelBufferMipMapLevel);
+}
+
+public void setCurrentVirtualScreen(int screen) {
+ OS.objc_msgSend(this.id, OS.sel_setCurrentVirtualScreen_1, screen);
+}
+
+public void setFullScreen() {
+ OS.objc_msgSend(this.id, OS.sel_setFullScreen);
+}
+
+public void setOffScreen(int baseaddr, int width, int height, int rowbytes) {
+ OS.objc_msgSend(this.id, OS.sel_setOffScreen_1width_1height_1rowbytes_1, baseaddr, width, height, rowbytes);
+}
+
+public void setPixelBuffer(NSOpenGLPixelBuffer pixelBuffer, int face, int level, int screen) {
+ OS.objc_msgSend(this.id, OS.sel_setPixelBuffer_1cubeMapFace_1mipMapLevel_1currentVirtualScreen_1, pixelBuffer != null ? pixelBuffer.id : 0, face, level, screen);
+}
+
+public void setTextureImageToPixelBuffer(NSOpenGLPixelBuffer pixelBuffer, int source) {
+ OS.objc_msgSend(this.id, OS.sel_setTextureImageToPixelBuffer_1colorBuffer_1, pixelBuffer != null ? pixelBuffer.id : 0, source);
+}
+
+public void setValues(int vals, int param) {
+ OS.objc_msgSend(this.id, OS.sel_setValues_1forParameter_1, vals, param);
+}
+
+public void setView(NSView view) {
+ OS.objc_msgSend(this.id, OS.sel_setView_1, view != null ? view.id : 0);
+}
+
+public void update() {
+ OS.objc_msgSend(this.id, OS.sel_update);
+}
+
+public NSView view() {
+ int result = OS.objc_msgSend(this.id, OS.sel_view);
+ return result != 0 ? new NSView(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenGLPixelBuffer.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenGLPixelBuffer.java
new file mode 100644
index 0000000000..ca53cb48b3
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenGLPixelBuffer.java
@@ -0,0 +1,38 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSOpenGLPixelBuffer extends NSObject {
+
+public NSOpenGLPixelBuffer() {
+ super();
+}
+
+public NSOpenGLPixelBuffer(int id) {
+ super(id);
+}
+
+public NSOpenGLPixelBuffer initWithTextureTarget(int target, int format, int maxLevel, int pixelsWide, int pixelsHigh) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithTextureTarget_1textureInternalFormat_1textureMaxMipMapLevel_1pixelsWide_1pixelsHigh_1, target, format, maxLevel, pixelsWide, pixelsHigh);
+ return result != 0 ? this : null;
+}
+
+public int pixelsHigh() {
+ return OS.objc_msgSend(this.id, OS.sel_pixelsHigh);
+}
+
+public int pixelsWide() {
+ return OS.objc_msgSend(this.id, OS.sel_pixelsWide);
+}
+
+public int textureInternalFormat() {
+ return OS.objc_msgSend(this.id, OS.sel_textureInternalFormat);
+}
+
+public int textureMaxMipMapLevel() {
+ return OS.objc_msgSend(this.id, OS.sel_textureMaxMipMapLevel);
+}
+
+public int textureTarget() {
+ return OS.objc_msgSend(this.id, OS.sel_textureTarget);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenGLPixelFormat.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenGLPixelFormat.java
new file mode 100644
index 0000000000..b98d599a2f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenGLPixelFormat.java
@@ -0,0 +1,44 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSOpenGLPixelFormat extends NSObject {
+
+public NSOpenGLPixelFormat() {
+ super();
+}
+
+public NSOpenGLPixelFormat(int id) {
+ super(id);
+}
+
+public int CGLPixelFormatObj() {
+ return OS.objc_msgSend(this.id, OS.sel_CGLPixelFormatObj);
+}
+
+public NSData attributes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributes);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public void getValues(int vals, int attrib, int screen) {
+ OS.objc_msgSend(this.id, OS.sel_getValues_1forAttribute_1forVirtualScreen_1, vals, attrib, screen);
+}
+
+public NSOpenGLPixelFormat initWithAttributes(int attribs) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithAttributes_1, attribs);
+ return result != 0 ? this : null;
+}
+
+public NSOpenGLPixelFormat initWithData(NSData attribs) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithData_1, attribs != null ? attribs.id : 0);
+ return result != 0 ? this : null;
+}
+
+public int numberOfVirtualScreens() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfVirtualScreens);
+}
+
+public void setAttributes(NSData attribs) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributes_1, attribs != null ? attribs.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenGLView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenGLView.java
new file mode 100644
index 0000000000..7d5403c1c2
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenGLView.java
@@ -0,0 +1,57 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSOpenGLView extends NSView {
+
+public NSOpenGLView() {
+ super();
+}
+
+public NSOpenGLView(int id) {
+ super(id);
+}
+
+public void clearGLContext() {
+ OS.objc_msgSend(this.id, OS.sel_clearGLContext);
+}
+
+public static NSOpenGLPixelFormat defaultPixelFormat() {
+ int result = OS.objc_msgSend(OS.class_NSOpenGLView, OS.sel_defaultPixelFormat);
+ return result != 0 ? new NSOpenGLPixelFormat(result) : null;
+}
+
+public NSOpenGLView initWithFrame(NSRect frameRect, NSOpenGLPixelFormat format) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFrame_1pixelFormat_1, frameRect, format != null ? format.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSOpenGLContext openGLContext() {
+ int result = OS.objc_msgSend(this.id, OS.sel_openGLContext);
+ return result != 0 ? new NSOpenGLContext(result) : null;
+}
+
+public NSOpenGLPixelFormat pixelFormat() {
+ int result = OS.objc_msgSend(this.id, OS.sel_pixelFormat);
+ return result != 0 ? new NSOpenGLPixelFormat(result) : null;
+}
+
+public void prepareOpenGL() {
+ OS.objc_msgSend(this.id, OS.sel_prepareOpenGL);
+}
+
+public void reshape() {
+ OS.objc_msgSend(this.id, OS.sel_reshape);
+}
+
+public void setOpenGLContext(NSOpenGLContext context) {
+ OS.objc_msgSend(this.id, OS.sel_setOpenGLContext_1, context != null ? context.id : 0);
+}
+
+public void setPixelFormat(NSOpenGLPixelFormat pixelFormat) {
+ OS.objc_msgSend(this.id, OS.sel_setPixelFormat_1, pixelFormat != null ? pixelFormat.id : 0);
+}
+
+public void update() {
+ OS.objc_msgSend(this.id, OS.sel_update);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenPanel.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenPanel.java
new file mode 100644
index 0000000000..0cd2c5aa3a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOpenPanel.java
@@ -0,0 +1,76 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSOpenPanel extends NSSavePanel {
+
+public NSOpenPanel() {
+ super();
+}
+
+public NSOpenPanel(int id) {
+ super(id);
+}
+
+public NSArray URLs() {
+ int result = OS.objc_msgSend(this.id, OS.sel_URLs);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean allowsMultipleSelection() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsMultipleSelection) != 0;
+}
+
+public void beginForDirectory(NSString path, NSString name, NSArray fileTypes, id delegate, int didEndSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_beginForDirectory_1file_1types_1modelessDelegate_1didEndSelector_1contextInfo_1, path != null ? path.id : 0, name != null ? name.id : 0, fileTypes != null ? fileTypes.id : 0, delegate != null ? delegate.id : 0, didEndSelector, contextInfo);
+}
+
+public void beginSheetForDirectory(NSString path, NSString name, NSArray fileTypes, NSWindow docWindow, id delegate, int didEndSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_beginSheetForDirectory_1file_1types_1modalForWindow_1modalDelegate_1didEndSelector_1contextInfo_1, path != null ? path.id : 0, name != null ? name.id : 0, fileTypes != null ? fileTypes.id : 0, docWindow != null ? docWindow.id : 0, delegate != null ? delegate.id : 0, didEndSelector, contextInfo);
+}
+
+public boolean canChooseDirectories() {
+ return OS.objc_msgSend(this.id, OS.sel_canChooseDirectories) != 0;
+}
+
+public boolean canChooseFiles() {
+ return OS.objc_msgSend(this.id, OS.sel_canChooseFiles) != 0;
+}
+
+public NSArray filenames() {
+ int result = OS.objc_msgSend(this.id, OS.sel_filenames);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSOpenPanel openPanel() {
+ int result = OS.objc_msgSend(OS.class_NSOpenPanel, OS.sel_openPanel);
+ return result != 0 ? new NSOpenPanel(result) : null;
+}
+
+public boolean resolvesAliases() {
+ return OS.objc_msgSend(this.id, OS.sel_resolvesAliases) != 0;
+}
+
+public int runModalForDirectory(NSString path, NSString name, NSArray fileTypes) {
+ return OS.objc_msgSend(this.id, OS.sel_runModalForDirectory_1file_1types_1, path != null ? path.id : 0, name != null ? name.id : 0, fileTypes != null ? fileTypes.id : 0);
+}
+
+public int runModalForTypes(NSArray fileTypes) {
+ return OS.objc_msgSend(this.id, OS.sel_runModalForTypes_1, fileTypes != null ? fileTypes.id : 0);
+}
+
+public void setAllowsMultipleSelection(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsMultipleSelection_1, flag);
+}
+
+public void setCanChooseDirectories(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setCanChooseDirectories_1, flag);
+}
+
+public void setCanChooseFiles(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setCanChooseFiles_1, flag);
+}
+
+public void setResolvesAliases(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setResolvesAliases_1, flag);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOperation.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOperation.java
new file mode 100644
index 0000000000..5b27ac5cd3
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOperation.java
@@ -0,0 +1,66 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSOperation extends NSObject {
+
+public NSOperation() {
+ super();
+}
+
+public NSOperation(int id) {
+ super(id);
+}
+
+public void addDependency(NSOperation op) {
+ OS.objc_msgSend(this.id, OS.sel_addDependency_1, op != null ? op.id : 0);
+}
+
+public void cancel() {
+ OS.objc_msgSend(this.id, OS.sel_cancel);
+}
+
+public NSArray dependencies() {
+ int result = OS.objc_msgSend(this.id, OS.sel_dependencies);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean isCancelled() {
+ return OS.objc_msgSend(this.id, OS.sel_isCancelled) != 0;
+}
+
+public boolean isConcurrent() {
+ return OS.objc_msgSend(this.id, OS.sel_isConcurrent) != 0;
+}
+
+public boolean isExecuting() {
+ return OS.objc_msgSend(this.id, OS.sel_isExecuting) != 0;
+}
+
+public boolean isFinished() {
+ return OS.objc_msgSend(this.id, OS.sel_isFinished) != 0;
+}
+
+public boolean isReady() {
+ return OS.objc_msgSend(this.id, OS.sel_isReady) != 0;
+}
+
+public void main() {
+ OS.objc_msgSend(this.id, OS.sel_main);
+}
+
+public int queuePriority() {
+ return OS.objc_msgSend(this.id, OS.sel_queuePriority);
+}
+
+public void removeDependency(NSOperation op) {
+ OS.objc_msgSend(this.id, OS.sel_removeDependency_1, op != null ? op.id : 0);
+}
+
+public void setQueuePriority(int p) {
+ OS.objc_msgSend(this.id, OS.sel_setQueuePriority_1, p);
+}
+
+public void start() {
+ OS.objc_msgSend(this.id, OS.sel_start);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOperationQueue.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOperationQueue.java
new file mode 100644
index 0000000000..a25fc09f93
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOperationQueue.java
@@ -0,0 +1,46 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSOperationQueue extends NSObject {
+
+public NSOperationQueue() {
+ super();
+}
+
+public NSOperationQueue(int id) {
+ super(id);
+}
+
+public void addOperation(NSOperation op) {
+ OS.objc_msgSend(this.id, OS.sel_addOperation_1, op != null ? op.id : 0);
+}
+
+public void cancelAllOperations() {
+ OS.objc_msgSend(this.id, OS.sel_cancelAllOperations);
+}
+
+public boolean isSuspended() {
+ return OS.objc_msgSend(this.id, OS.sel_isSuspended) != 0;
+}
+
+public int maxConcurrentOperationCount() {
+ return OS.objc_msgSend(this.id, OS.sel_maxConcurrentOperationCount);
+}
+
+public NSArray operations() {
+ int result = OS.objc_msgSend(this.id, OS.sel_operations);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void setMaxConcurrentOperationCount(int cnt) {
+ OS.objc_msgSend(this.id, OS.sel_setMaxConcurrentOperationCount_1, cnt);
+}
+
+public void setSuspended(boolean b) {
+ OS.objc_msgSend(this.id, OS.sel_setSuspended_1, b);
+}
+
+public void waitUntilAllOperationsAreFinished() {
+ OS.objc_msgSend(this.id, OS.sel_waitUntilAllOperationsAreFinished);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOutlineView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOutlineView.java
new file mode 100644
index 0000000000..8d4f16ce7a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOutlineView.java
@@ -0,0 +1,122 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSOutlineView extends NSTableView {
+
+public NSOutlineView() {
+ super();
+}
+
+public NSOutlineView(int id) {
+ super(id);
+}
+
+public boolean autoresizesOutlineColumn() {
+ return OS.objc_msgSend(this.id, OS.sel_autoresizesOutlineColumn) != 0;
+}
+
+public boolean autosaveExpandedItems() {
+ return OS.objc_msgSend(this.id, OS.sel_autosaveExpandedItems) != 0;
+}
+
+public void collapseItem_(id item) {
+ OS.objc_msgSend(this.id, OS.sel_collapseItem_1, item != null ? item.id : 0);
+}
+
+public void collapseItem_collapseChildren_(id item, boolean collapseChildren) {
+ OS.objc_msgSend(this.id, OS.sel_collapseItem_1collapseChildren_1, item != null ? item.id : 0, collapseChildren);
+}
+
+public void expandItem_(id item) {
+ OS.objc_msgSend(this.id, OS.sel_expandItem_1, item != null ? item.id : 0);
+}
+
+public void expandItem_expandChildren_(id item, boolean expandChildren) {
+ OS.objc_msgSend(this.id, OS.sel_expandItem_1expandChildren_1, item != null ? item.id : 0, expandChildren);
+}
+
+public NSRect frameOfOutlineCellAtRow(int row) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_frameOfOutlineCellAtRow_1, row);
+ return result;
+}
+
+public boolean indentationMarkerFollowsCell() {
+ return OS.objc_msgSend(this.id, OS.sel_indentationMarkerFollowsCell) != 0;
+}
+
+public float indentationPerLevel() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_indentationPerLevel);
+}
+
+public boolean isExpandable(id item) {
+ return OS.objc_msgSend(this.id, OS.sel_isExpandable_1, item != null ? item.id : 0) != 0;
+}
+
+public boolean isItemExpanded(id item) {
+ return OS.objc_msgSend(this.id, OS.sel_isItemExpanded_1, item != null ? item.id : 0) != 0;
+}
+
+public id itemAtRow(int row) {
+ int result = OS.objc_msgSend(this.id, OS.sel_itemAtRow_1, row);
+ return result != 0 ? new id(result) : null;
+}
+
+public int levelForItem(id item) {
+ return OS.objc_msgSend(this.id, OS.sel_levelForItem_1, item != null ? item.id : 0);
+}
+
+public int levelForRow(int row) {
+ return OS.objc_msgSend(this.id, OS.sel_levelForRow_1, row);
+}
+
+public NSTableColumn outlineTableColumn() {
+ int result = OS.objc_msgSend(this.id, OS.sel_outlineTableColumn);
+ return result != 0 ? new NSTableColumn(result) : null;
+}
+
+public id parentForItem(id item) {
+ int result = OS.objc_msgSend(this.id, OS.sel_parentForItem_1, item != null ? item.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void reloadItem_(id item) {
+ OS.objc_msgSend(this.id, OS.sel_reloadItem_1, item != null ? item.id : 0);
+}
+
+public void reloadItem_reloadChildren_(id item, boolean reloadChildren) {
+ OS.objc_msgSend(this.id, OS.sel_reloadItem_1reloadChildren_1, item != null ? item.id : 0, reloadChildren);
+}
+
+public int rowForItem(id item) {
+ return OS.objc_msgSend(this.id, OS.sel_rowForItem_1, item != null ? item.id : 0);
+}
+
+public void setAutoresizesOutlineColumn(boolean resize) {
+ OS.objc_msgSend(this.id, OS.sel_setAutoresizesOutlineColumn_1, resize);
+}
+
+public void setAutosaveExpandedItems(boolean save) {
+ OS.objc_msgSend(this.id, OS.sel_setAutosaveExpandedItems_1, save);
+}
+
+public void setDropItem(id item, int index) {
+ OS.objc_msgSend(this.id, OS.sel_setDropItem_1dropChildIndex_1, item != null ? item.id : 0, index);
+}
+
+public void setIndentationMarkerFollowsCell(boolean drawInCell) {
+ OS.objc_msgSend(this.id, OS.sel_setIndentationMarkerFollowsCell_1, drawInCell);
+}
+
+public void setIndentationPerLevel(float indentationPerLevel) {
+ OS.objc_msgSend(this.id, OS.sel_setIndentationPerLevel_1, indentationPerLevel);
+}
+
+public void setOutlineTableColumn(NSTableColumn outlineTableColumn) {
+ OS.objc_msgSend(this.id, OS.sel_setOutlineTableColumn_1, outlineTableColumn != null ? outlineTableColumn.id : 0);
+}
+
+public boolean shouldCollapseAutoExpandedItemsForDeposited(boolean deposited) {
+ return OS.objc_msgSend(this.id, OS.sel_shouldCollapseAutoExpandedItemsForDeposited_1, deposited) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOutputStream.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOutputStream.java
new file mode 100644
index 0000000000..8cfecd37a8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSOutputStream.java
@@ -0,0 +1,51 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSOutputStream extends NSStream {
+
+public NSOutputStream() {
+ super();
+}
+
+public NSOutputStream(int id) {
+ super(id);
+}
+
+public boolean hasSpaceAvailable() {
+ return OS.objc_msgSend(this.id, OS.sel_hasSpaceAvailable) != 0;
+}
+
+public NSOutputStream initToBuffer(int buffer, int capacity) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initToBuffer_1capacity_1, buffer, capacity);
+ return result != 0 ? this : null;
+}
+
+public NSOutputStream initToFileAtPath(NSString path, boolean shouldAppend) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initToFileAtPath_1append_1, path != null ? path.id : 0, shouldAppend);
+ return result != 0 ? this : null;
+}
+
+public NSOutputStream initToMemory() {
+ int result = OS.objc_msgSend(this.id, OS.sel_initToMemory);
+ return result != 0 ? this : null;
+}
+
+public static id outputStreamToBuffer(int buffer, int capacity) {
+ int result = OS.objc_msgSend(OS.class_NSOutputStream, OS.sel_outputStreamToBuffer_1capacity_1, buffer, capacity);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id outputStreamToFileAtPath(NSString path, boolean shouldAppend) {
+ int result = OS.objc_msgSend(OS.class_NSOutputStream, OS.sel_outputStreamToFileAtPath_1append_1, path != null ? path.id : 0, shouldAppend);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id outputStreamToMemory() {
+ int result = OS.objc_msgSend(OS.class_NSOutputStream, OS.sel_outputStreamToMemory);
+ return result != 0 ? new id(result) : null;
+}
+
+public int write(int buffer, int len) {
+ return OS.objc_msgSend(this.id, OS.sel_write_1maxLength_1, buffer, len);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPDFImageRep.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPDFImageRep.java
new file mode 100644
index 0000000000..4fead26b8b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPDFImageRep.java
@@ -0,0 +1,46 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPDFImageRep extends NSImageRep {
+
+public NSPDFImageRep() {
+ super();
+}
+
+public NSPDFImageRep(int id) {
+ super(id);
+}
+
+public NSData PDFRepresentation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_PDFRepresentation);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSRect bounds() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_bounds);
+ return result;
+}
+
+public int currentPage() {
+ return OS.objc_msgSend(this.id, OS.sel_currentPage);
+}
+
+public static id imageRepWithData(NSData pdfData) {
+ int result = OS.objc_msgSend(OS.class_NSPDFImageRep, OS.sel_imageRepWithData_1, pdfData != null ? pdfData.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSPDFImageRep initWithData(NSData pdfData) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithData_1, pdfData != null ? pdfData.id : 0);
+ return result != 0 ? this : null;
+}
+
+public int pageCount() {
+ return OS.objc_msgSend(this.id, OS.sel_pageCount);
+}
+
+public void setCurrentPage(int page) {
+ OS.objc_msgSend(this.id, OS.sel_setCurrentPage_1, page);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPICTImageRep.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPICTImageRep.java
new file mode 100644
index 0000000000..66a5860af9
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPICTImageRep.java
@@ -0,0 +1,34 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPICTImageRep extends NSImageRep {
+
+public NSPICTImageRep() {
+ super();
+}
+
+public NSPICTImageRep(int id) {
+ super(id);
+}
+
+public NSData PICTRepresentation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_PICTRepresentation);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSRect boundingBox() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_boundingBox);
+ return result;
+}
+
+public static id imageRepWithData(NSData pictData) {
+ int result = OS.objc_msgSend(OS.class_NSPICTImageRep, OS.sel_imageRepWithData_1, pictData != null ? pictData.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSPICTImageRep initWithData(NSData pictData) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithData_1, pictData != null ? pictData.id : 0);
+ return result != 0 ? this : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPageLayout.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPageLayout.java
new file mode 100644
index 0000000000..f027e7904f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPageLayout.java
@@ -0,0 +1,65 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPageLayout extends NSObject {
+
+public NSPageLayout() {
+ super();
+}
+
+public NSPageLayout(int id) {
+ super(id);
+}
+
+public NSArray accessoryControllers() {
+ int result = OS.objc_msgSend(this.id, OS.sel_accessoryControllers);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSView accessoryView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_accessoryView);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public void addAccessoryController(NSViewController accessoryController) {
+ OS.objc_msgSend(this.id, OS.sel_addAccessoryController_1, accessoryController != null ? accessoryController.id : 0);
+}
+
+public void beginSheetWithPrintInfo(NSPrintInfo printInfo, NSWindow docWindow, id delegate, int didEndSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_beginSheetWithPrintInfo_1modalForWindow_1delegate_1didEndSelector_1contextInfo_1, printInfo != null ? printInfo.id : 0, docWindow != null ? docWindow.id : 0, delegate != null ? delegate.id : 0, didEndSelector, contextInfo);
+}
+
+public static NSPageLayout pageLayout() {
+ int result = OS.objc_msgSend(OS.class_NSPageLayout, OS.sel_pageLayout);
+ return result != 0 ? new NSPageLayout(result) : null;
+}
+
+public NSPrintInfo printInfo() {
+ int result = OS.objc_msgSend(this.id, OS.sel_printInfo);
+ return result != 0 ? new NSPrintInfo(result) : null;
+}
+
+public void readPrintInfo() {
+ OS.objc_msgSend(this.id, OS.sel_readPrintInfo);
+}
+
+public void removeAccessoryController(NSViewController accessoryController) {
+ OS.objc_msgSend(this.id, OS.sel_removeAccessoryController_1, accessoryController != null ? accessoryController.id : 0);
+}
+
+public int runModal() {
+ return OS.objc_msgSend(this.id, OS.sel_runModal);
+}
+
+public int runModalWithPrintInfo(NSPrintInfo printInfo) {
+ return OS.objc_msgSend(this.id, OS.sel_runModalWithPrintInfo_1, printInfo != null ? printInfo.id : 0);
+}
+
+public void setAccessoryView(NSView accessoryView) {
+ OS.objc_msgSend(this.id, OS.sel_setAccessoryView_1, accessoryView != null ? accessoryView.id : 0);
+}
+
+public void writePrintInfo() {
+ OS.objc_msgSend(this.id, OS.sel_writePrintInfo);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPanel.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPanel.java
new file mode 100644
index 0000000000..e25065fd2e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPanel.java
@@ -0,0 +1,37 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPanel extends NSWindow {
+
+public NSPanel() {
+ super();
+}
+
+public NSPanel(int id) {
+ super(id);
+}
+
+public boolean becomesKeyOnlyIfNeeded() {
+ return OS.objc_msgSend(this.id, OS.sel_becomesKeyOnlyIfNeeded) != 0;
+}
+
+public boolean isFloatingPanel() {
+ return OS.objc_msgSend(this.id, OS.sel_isFloatingPanel) != 0;
+}
+
+public void setBecomesKeyOnlyIfNeeded(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setBecomesKeyOnlyIfNeeded_1, flag);
+}
+
+public void setFloatingPanel(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setFloatingPanel_1, flag);
+}
+
+public void setWorksWhenModal(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setWorksWhenModal_1, flag);
+}
+
+public boolean worksWhenModal() {
+ return OS.objc_msgSend(this.id, OS.sel_worksWhenModal) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSParagraphStyle.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSParagraphStyle.java
new file mode 100644
index 0000000000..1d175e2955
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSParagraphStyle.java
@@ -0,0 +1,101 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSParagraphStyle extends NSObject {
+
+public NSParagraphStyle() {
+ super();
+}
+
+public NSParagraphStyle(int id) {
+ super(id);
+}
+
+public int alignment() {
+ return OS.objc_msgSend(this.id, OS.sel_alignment);
+}
+
+public int baseWritingDirection() {
+ return OS.objc_msgSend(this.id, OS.sel_baseWritingDirection);
+}
+
+public static NSParagraphStyle defaultParagraphStyle() {
+ int result = OS.objc_msgSend(OS.class_NSParagraphStyle, OS.sel_defaultParagraphStyle);
+ return result != 0 ? new NSParagraphStyle(result) : null;
+}
+
+public float defaultTabInterval() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_defaultTabInterval);
+}
+
+public static int defaultWritingDirectionForLanguage(NSString languageName) {
+ return OS.objc_msgSend(OS.class_NSParagraphStyle, OS.sel_defaultWritingDirectionForLanguage_1, languageName != null ? languageName.id : 0);
+}
+
+public float firstLineHeadIndent() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_firstLineHeadIndent);
+}
+
+public float headIndent() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_headIndent);
+}
+
+public int headerLevel() {
+ return OS.objc_msgSend(this.id, OS.sel_headerLevel);
+}
+
+public float hyphenationFactor() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_hyphenationFactor);
+}
+
+public int lineBreakMode() {
+ return OS.objc_msgSend(this.id, OS.sel_lineBreakMode);
+}
+
+public float lineHeightMultiple() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_lineHeightMultiple);
+}
+
+public float lineSpacing() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_lineSpacing);
+}
+
+public float maximumLineHeight() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_maximumLineHeight);
+}
+
+public float minimumLineHeight() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_minimumLineHeight);
+}
+
+public float paragraphSpacing() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_paragraphSpacing);
+}
+
+public float paragraphSpacingBefore() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_paragraphSpacingBefore);
+}
+
+public NSArray tabStops() {
+ int result = OS.objc_msgSend(this.id, OS.sel_tabStops);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public float tailIndent() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_tailIndent);
+}
+
+public NSArray textBlocks() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textBlocks);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray textLists() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textLists);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public float tighteningFactorForTruncation() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_tighteningFactorForTruncation);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPasteboard.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPasteboard.java
new file mode 100644
index 0000000000..4a1d9cbf98
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPasteboard.java
@@ -0,0 +1,124 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPasteboard extends NSObject {
+
+public NSPasteboard() {
+ super();
+}
+
+public NSPasteboard(int id) {
+ super(id);
+}
+
+public int addTypes(NSArray newTypes, id newOwner) {
+ return OS.objc_msgSend(this.id, OS.sel_addTypes_1owner_1, newTypes != null ? newTypes.id : 0, newOwner != null ? newOwner.id : 0);
+}
+
+public NSString availableTypeFromArray(NSArray types) {
+ int result = OS.objc_msgSend(this.id, OS.sel_availableTypeFromArray_1, types != null ? types.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int changeCount() {
+ return OS.objc_msgSend(this.id, OS.sel_changeCount);
+}
+
+public NSData dataForType(NSString dataType) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dataForType_1, dataType != null ? dataType.id : 0);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public int declareTypes(NSArray newTypes, id newOwner) {
+ return OS.objc_msgSend(this.id, OS.sel_declareTypes_1owner_1, newTypes != null ? newTypes.id : 0, newOwner != null ? newOwner.id : 0);
+}
+
+public static NSPasteboard generalPasteboard() {
+ int result = OS.objc_msgSend(OS.class_NSPasteboard, OS.sel_generalPasteboard);
+ return result != 0 ? new NSPasteboard(result) : null;
+}
+
+public NSString name() {
+ int result = OS.objc_msgSend(this.id, OS.sel_name);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSPasteboard pasteboardByFilteringData(NSData data, NSString type) {
+ int result = OS.objc_msgSend(OS.class_NSPasteboard, OS.sel_pasteboardByFilteringData_1ofType_1, data != null ? data.id : 0, type != null ? type.id : 0);
+ return result != 0 ? new NSPasteboard(result) : null;
+}
+
+public static NSPasteboard pasteboardByFilteringFile(NSString filename) {
+ int result = OS.objc_msgSend(OS.class_NSPasteboard, OS.sel_pasteboardByFilteringFile_1, filename != null ? filename.id : 0);
+ return result != 0 ? new NSPasteboard(result) : null;
+}
+
+public static NSPasteboard pasteboardByFilteringTypesInPasteboard(NSPasteboard pboard) {
+ int result = OS.objc_msgSend(OS.class_NSPasteboard, OS.sel_pasteboardByFilteringTypesInPasteboard_1, pboard != null ? pboard.id : 0);
+ return result != 0 ? new NSPasteboard(result) : null;
+}
+
+public static NSPasteboard pasteboardWithName(NSString name) {
+ int result = OS.objc_msgSend(OS.class_NSPasteboard, OS.sel_pasteboardWithName_1, name != null ? name.id : 0);
+ return result != 0 ? new NSPasteboard(result) : null;
+}
+
+public static NSPasteboard pasteboardWithUniqueName() {
+ int result = OS.objc_msgSend(OS.class_NSPasteboard, OS.sel_pasteboardWithUniqueName);
+ return result != 0 ? new NSPasteboard(result) : null;
+}
+
+public id propertyListForType(NSString dataType) {
+ int result = OS.objc_msgSend(this.id, OS.sel_propertyListForType_1, dataType != null ? dataType.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString readFileContentsType(NSString type, NSString filename) {
+ int result = OS.objc_msgSend(this.id, OS.sel_readFileContentsType_1toFile_1, type != null ? type.id : 0, filename != null ? filename.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSFileWrapper readFileWrapper() {
+ int result = OS.objc_msgSend(this.id, OS.sel_readFileWrapper);
+ return result != 0 ? new NSFileWrapper(result) : null;
+}
+
+public void releaseGlobally() {
+ OS.objc_msgSend(this.id, OS.sel_releaseGlobally);
+}
+
+public boolean setData(NSData data, NSString dataType) {
+ return OS.objc_msgSend(this.id, OS.sel_setData_1forType_1, data != null ? data.id : 0, dataType != null ? dataType.id : 0) != 0;
+}
+
+public boolean setPropertyList(id plist, NSString dataType) {
+ return OS.objc_msgSend(this.id, OS.sel_setPropertyList_1forType_1, plist != null ? plist.id : 0, dataType != null ? dataType.id : 0) != 0;
+}
+
+public boolean setString(NSString string, NSString dataType) {
+ return OS.objc_msgSend(this.id, OS.sel_setString_1forType_1, string != null ? string.id : 0, dataType != null ? dataType.id : 0) != 0;
+}
+
+public NSString stringForType(NSString dataType) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringForType_1, dataType != null ? dataType.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSArray types() {
+ int result = OS.objc_msgSend(this.id, OS.sel_types);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray typesFilterableTo(NSString type) {
+ int result = OS.objc_msgSend(OS.class_NSPasteboard, OS.sel_typesFilterableTo_1, type != null ? type.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean writeFileContents(NSString filename) {
+ return OS.objc_msgSend(this.id, OS.sel_writeFileContents_1, filename != null ? filename.id : 0) != 0;
+}
+
+public boolean writeFileWrapper(NSFileWrapper wrapper) {
+ return OS.objc_msgSend(this.id, OS.sel_writeFileWrapper_1, wrapper != null ? wrapper.id : 0) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPathCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPathCell.java
new file mode 100644
index 0000000000..884fd18c13
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPathCell.java
@@ -0,0 +1,128 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPathCell extends NSActionCell {
+
+public NSPathCell() {
+ super();
+}
+
+public NSPathCell(int id) {
+ super(id);
+}
+
+public NSURL URL() {
+ int result = OS.objc_msgSend(this.id, OS.sel_URL);
+ return result != 0 ? new NSURL(result) : null;
+}
+
+public NSArray allowedTypes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_allowedTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSColor backgroundColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public NSPathComponentCell clickedPathComponentCell() {
+ int result = OS.objc_msgSend(this.id, OS.sel_clickedPathComponentCell);
+ return result != 0 ? new NSPathComponentCell(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public int doubleAction() {
+ return OS.objc_msgSend(this.id, OS.sel_doubleAction);
+}
+
+public void mouseEntered(NSEvent event, NSRect frame, NSView view) {
+ OS.objc_msgSend(this.id, OS.sel_mouseEntered_1withFrame_1inView_1, event != null ? event.id : 0, frame, view != null ? view.id : 0);
+}
+
+public void mouseExited(NSEvent event, NSRect frame, NSView view) {
+ OS.objc_msgSend(this.id, OS.sel_mouseExited_1withFrame_1inView_1, event != null ? event.id : 0, frame, view != null ? view.id : 0);
+}
+
+public NSPathComponentCell pathComponentCellAtPoint(NSPoint point, NSRect frame, NSView view) {
+ int result = OS.objc_msgSend(this.id, OS.sel_pathComponentCellAtPoint_1withFrame_1inView_1, point, frame, view != null ? view.id : 0);
+ return result != 0 ? new NSPathComponentCell(result) : null;
+}
+
+public static int pathComponentCellClass() {
+ return OS.objc_msgSend(OS.class_NSPathCell, OS.sel_pathComponentCellClass);
+}
+
+public NSArray pathComponentCells() {
+ int result = OS.objc_msgSend(this.id, OS.sel_pathComponentCells);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public int pathStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_pathStyle);
+}
+
+public NSAttributedString placeholderAttributedString() {
+ int result = OS.objc_msgSend(this.id, OS.sel_placeholderAttributedString);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public NSString placeholderString() {
+ int result = OS.objc_msgSend(this.id, OS.sel_placeholderString);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSRect rectOfPathComponentCell(NSPathComponentCell cell, NSRect frame, NSView view) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rectOfPathComponentCell_1withFrame_1inView_1, cell != null ? cell.id : 0, frame, view != null ? view.id : 0);
+ return result;
+}
+
+public void setAllowedTypes(NSArray allowedTypes) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowedTypes_1, allowedTypes != null ? allowedTypes.id : 0);
+}
+
+public void setBackgroundColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color != null ? color.id : 0);
+}
+
+public void setControlSize(int size) {
+ OS.objc_msgSend(this.id, OS.sel_setControlSize_1, size);
+}
+
+public void setDelegate(id value) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, value != null ? value.id : 0);
+}
+
+public void setDoubleAction(int action) {
+ OS.objc_msgSend(this.id, OS.sel_setDoubleAction_1, action);
+}
+
+public void setObjectValue(id obj) {
+ OS.objc_msgSend(this.id, OS.sel_setObjectValue_1, obj != null ? obj.id : 0);
+}
+
+public void setPathComponentCells(NSArray cells) {
+ OS.objc_msgSend(this.id, OS.sel_setPathComponentCells_1, cells != null ? cells.id : 0);
+}
+
+public void setPathStyle(int style) {
+ OS.objc_msgSend(this.id, OS.sel_setPathStyle_1, style);
+}
+
+public void setPlaceholderAttributedString(NSAttributedString string) {
+ OS.objc_msgSend(this.id, OS.sel_setPlaceholderAttributedString_1, string != null ? string.id : 0);
+}
+
+public void setPlaceholderString(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setPlaceholderString_1, string != null ? string.id : 0);
+}
+
+public void setURL(NSURL url) {
+ OS.objc_msgSend(this.id, OS.sel_setURL_1, url != null ? url.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPathComponentCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPathComponentCell.java
new file mode 100644
index 0000000000..af06b230b7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPathComponentCell.java
@@ -0,0 +1,31 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPathComponentCell extends NSTextFieldCell {
+
+public NSPathComponentCell() {
+ super();
+}
+
+public NSPathComponentCell(int id) {
+ super(id);
+}
+
+public NSURL URL() {
+ int result = OS.objc_msgSend(this.id, OS.sel_URL);
+ return result != 0 ? new NSURL(result) : null;
+}
+
+public NSImage image() {
+ int result = OS.objc_msgSend(this.id, OS.sel_image);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public void setImage(NSImage value) {
+ OS.objc_msgSend(this.id, OS.sel_setImage_1, value != null ? value.id : 0);
+}
+
+public void setURL(NSURL url) {
+ OS.objc_msgSend(this.id, OS.sel_setURL_1, url != null ? url.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPathControl.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPathControl.java
new file mode 100644
index 0000000000..e294a63d8b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPathControl.java
@@ -0,0 +1,74 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPathControl extends NSControl {
+
+public NSPathControl() {
+ super();
+}
+
+public NSPathControl(int id) {
+ super(id);
+}
+
+public NSURL URL() {
+ int result = OS.objc_msgSend(this.id, OS.sel_URL);
+ return result != 0 ? new NSURL(result) : null;
+}
+
+public NSColor backgroundColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public NSPathComponentCell clickedPathComponentCell() {
+ int result = OS.objc_msgSend(this.id, OS.sel_clickedPathComponentCell);
+ return result != 0 ? new NSPathComponentCell(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public int doubleAction() {
+ return OS.objc_msgSend(this.id, OS.sel_doubleAction);
+}
+
+public NSArray pathComponentCells() {
+ int result = OS.objc_msgSend(this.id, OS.sel_pathComponentCells);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public int pathStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_pathStyle);
+}
+
+public void setBackgroundColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color != null ? color.id : 0);
+}
+
+public void setDelegate(id delegate) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegate != null ? delegate.id : 0);
+}
+
+public void setDoubleAction(int action) {
+ OS.objc_msgSend(this.id, OS.sel_setDoubleAction_1, action);
+}
+
+public void setDraggingSourceOperationMask(int mask, boolean isLocal) {
+ OS.objc_msgSend(this.id, OS.sel_setDraggingSourceOperationMask_1forLocal_1, mask, isLocal);
+}
+
+public void setPathComponentCells(NSArray cells) {
+ OS.objc_msgSend(this.id, OS.sel_setPathComponentCells_1, cells != null ? cells.id : 0);
+}
+
+public void setPathStyle(int style) {
+ OS.objc_msgSend(this.id, OS.sel_setPathStyle_1, style);
+}
+
+public void setURL(NSURL url) {
+ OS.objc_msgSend(this.id, OS.sel_setURL_1, url != null ? url.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPersistentDocument.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPersistentDocument.java
new file mode 100644
index 0000000000..7eaeec1ffb
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPersistentDocument.java
@@ -0,0 +1,52 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPersistentDocument extends NSDocument {
+
+public NSPersistentDocument() {
+ super();
+}
+
+public NSPersistentDocument(int id) {
+ super(id);
+}
+
+public boolean configurePersistentStoreCoordinatorForURL_ofType_error_(NSURL url, NSString fileType, int error) {
+ return OS.objc_msgSend(this.id, OS.sel_configurePersistentStoreCoordinatorForURL_1ofType_1error_1, url != null ? url.id : 0, fileType != null ? fileType.id : 0, error) != 0;
+}
+
+public boolean configurePersistentStoreCoordinatorForURL_ofType_modelConfiguration_storeOptions_error_(NSURL url, NSString fileType, NSString configuration, NSDictionary storeOptions, int error) {
+ return OS.objc_msgSend(this.id, OS.sel_configurePersistentStoreCoordinatorForURL_1ofType_1modelConfiguration_1storeOptions_1error_1, url != null ? url.id : 0, fileType != null ? fileType.id : 0, configuration != null ? configuration.id : 0, storeOptions != null ? storeOptions.id : 0, error) != 0;
+}
+
+//public NSManagedObjectContext managedObjectContext() {
+// int result = OS.objc_msgSend(this.id, OS.sel_managedObjectContext);
+// return result != 0 ? new NSManagedObjectContext(result) : null;
+//}
+
+public id managedObjectModel() {
+ int result = OS.objc_msgSend(this.id, OS.sel_managedObjectModel);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString persistentStoreTypeForFileType(NSString fileType) {
+ int result = OS.objc_msgSend(this.id, OS.sel_persistentStoreTypeForFileType_1, fileType != null ? fileType.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean readFromURL(NSURL absoluteURL, NSString typeName, int error) {
+ return OS.objc_msgSend(this.id, OS.sel_readFromURL_1ofType_1error_1, absoluteURL != null ? absoluteURL.id : 0, typeName != null ? typeName.id : 0, error) != 0;
+}
+
+public boolean revertToContentsOfURL(NSURL inAbsoluteURL, NSString inTypeName, int outError) {
+ return OS.objc_msgSend(this.id, OS.sel_revertToContentsOfURL_1ofType_1error_1, inAbsoluteURL != null ? inAbsoluteURL.id : 0, inTypeName != null ? inTypeName.id : 0, outError) != 0;
+}
+
+//public void setManagedObjectContext(NSManagedObjectContext managedObjectContext) {
+// OS.objc_msgSend(this.id, OS.sel_setManagedObjectContext_1, managedObjectContext != null ? managedObjectContext.id : 0);
+//}
+
+public boolean writeToURL(NSURL absoluteURL, NSString typeName, int saveOperation, NSURL absoluteOriginalContentsURL, int error) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToURL_1ofType_1forSaveOperation_1originalContentsURL_1error_1, absoluteURL != null ? absoluteURL.id : 0, typeName != null ? typeName.id : 0, saveOperation, absoluteOriginalContentsURL != null ? absoluteOriginalContentsURL.id : 0, error) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPipe.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPipe.java
new file mode 100644
index 0000000000..ae9cd1ab7c
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPipe.java
@@ -0,0 +1,28 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPipe extends NSObject {
+
+public NSPipe() {
+ super();
+}
+
+public NSPipe(int id) {
+ super(id);
+}
+
+public NSFileHandle fileHandleForReading() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileHandleForReading);
+ return result != 0 ? new NSFileHandle(result) : null;
+}
+
+public NSFileHandle fileHandleForWriting() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileHandleForWriting);
+ return result != 0 ? new NSFileHandle(result) : null;
+}
+
+public static id pipe() {
+ int result = OS.objc_msgSend(OS.class_NSPipe, OS.sel_pipe);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPoint.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPoint.java
new file mode 100755
index 0000000000..d670518f17
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPoint.java
@@ -0,0 +1,19 @@
+/**********************************************************************
+ * Copyright (c) 2003-2006 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ **********************************************************************/
+package org.eclipse.swt.internal.cocoa;
+
+
+public class NSPoint {
+ public float x;
+ public float y;
+ public static final int sizeof = 8;
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPointerArray.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPointerArray.java
new file mode 100644
index 0000000000..90e97cb2fb
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPointerArray.java
@@ -0,0 +1,85 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPointerArray extends NSObject {
+
+public NSPointerArray() {
+ super();
+}
+
+public NSPointerArray(int id) {
+ super(id);
+}
+
+public void addPointer(int pointer) {
+ OS.objc_msgSend(this.id, OS.sel_addPointer_1, pointer);
+}
+
+public NSArray allObjects() {
+ int result = OS.objc_msgSend(this.id, OS.sel_allObjects);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void compact() {
+ OS.objc_msgSend(this.id, OS.sel_compact);
+}
+
+public int count() {
+ return OS.objc_msgSend(this.id, OS.sel_count);
+}
+
+public NSPointerArray initWithOptions(int options) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithOptions_1, options);
+ return result != 0 ? this : null;
+}
+
+public id initWithPointerFunctions(NSPointerFunctions functions) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithPointerFunctions_1, functions != null ? functions.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void insertPointer(int item, int index) {
+ OS.objc_msgSend(this.id, OS.sel_insertPointer_1atIndex_1, item, index);
+}
+
+public static id pointerArrayWithOptions(int options) {
+ int result = OS.objc_msgSend(OS.class_NSPointerArray, OS.sel_pointerArrayWithOptions_1, options);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id pointerArrayWithPointerFunctions(NSPointerFunctions functions) {
+ int result = OS.objc_msgSend(OS.class_NSPointerArray, OS.sel_pointerArrayWithPointerFunctions_1, functions != null ? functions.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id pointerArrayWithStrongObjects() {
+ int result = OS.objc_msgSend(OS.class_NSPointerArray, OS.sel_pointerArrayWithStrongObjects);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id pointerArrayWithWeakObjects() {
+ int result = OS.objc_msgSend(OS.class_NSPointerArray, OS.sel_pointerArrayWithWeakObjects);
+ return result != 0 ? new id(result) : null;
+}
+
+public int pointerAtIndex(int index) {
+ return OS.objc_msgSend(this.id, OS.sel_pointerAtIndex_1, index);
+}
+
+public NSPointerFunctions pointerFunctions() {
+ int result = OS.objc_msgSend(this.id, OS.sel_pointerFunctions);
+ return result != 0 ? new NSPointerFunctions(result) : null;
+}
+
+public void removePointerAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_removePointerAtIndex_1, index);
+}
+
+public void replacePointerAtIndex(int index, int item) {
+ OS.objc_msgSend(this.id, OS.sel_replacePointerAtIndex_1withPointer_1, index, item);
+}
+
+public void setCount(int count) {
+ OS.objc_msgSend(this.id, OS.sel_setCount_1, count);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPointerFunctions.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPointerFunctions.java
new file mode 100644
index 0000000000..a6ac084e4c
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPointerFunctions.java
@@ -0,0 +1,39 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPointerFunctions extends NSObject {
+
+public NSPointerFunctions() {
+ super();
+}
+
+public NSPointerFunctions(int id) {
+ super(id);
+}
+
+public NSPointerFunctions initWithOptions(int options) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithOptions_1, options);
+ return result != 0 ? this : null;
+}
+
+public static id pointerFunctionsWithOptions(int options) {
+ int result = OS.objc_msgSend(OS.class_NSPointerFunctions, OS.sel_pointerFunctionsWithOptions_1, options);
+ return result != 0 ? new id(result) : null;
+}
+
+//public void setUsesStrongWriteBarrier(boolean ) {
+// OS.objc_msgSend(this.id, OS.sel_setUsesStrongWriteBarrier_1, );
+//}
+//
+//public void setUsesWeakReadAndWriteBarriers(boolean ) {
+// OS.objc_msgSend(this.id, OS.sel_setUsesWeakReadAndWriteBarriers_1, );
+//}
+
+public boolean usesStrongWriteBarrier() {
+ return OS.objc_msgSend(this.id, OS.sel_usesStrongWriteBarrier) != 0;
+}
+
+public boolean usesWeakReadAndWriteBarriers() {
+ return OS.objc_msgSend(this.id, OS.sel_usesWeakReadAndWriteBarriers) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPopUpButton.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPopUpButton.java
new file mode 100644
index 0000000000..c26e298c34
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPopUpButton.java
@@ -0,0 +1,167 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPopUpButton extends NSButton {
+
+public NSPopUpButton() {
+ super();
+}
+
+public NSPopUpButton(int id) {
+ super(id);
+}
+
+public void addItemWithTitle(NSString title) {
+ OS.objc_msgSend(this.id, OS.sel_addItemWithTitle_1, title != null ? title.id : 0);
+}
+
+public void addItemsWithTitles(NSArray itemTitles) {
+ OS.objc_msgSend(this.id, OS.sel_addItemsWithTitles_1, itemTitles != null ? itemTitles.id : 0);
+}
+
+public boolean autoenablesItems() {
+ return OS.objc_msgSend(this.id, OS.sel_autoenablesItems) != 0;
+}
+
+public int indexOfItem(NSMenuItem item) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfItem_1, item != null ? item.id : 0);
+}
+
+public int indexOfItemWithRepresentedObject(id obj) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfItemWithRepresentedObject_1, obj != null ? obj.id : 0);
+}
+
+public int indexOfItemWithTag(int tag) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfItemWithTag_1, tag);
+}
+
+public int indexOfItemWithTarget(id target, int actionSelector) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfItemWithTarget_1andAction_1, target != null ? target.id : 0, actionSelector);
+}
+
+public int indexOfItemWithTitle(NSString title) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfItemWithTitle_1, title != null ? title.id : 0);
+}
+
+public int indexOfSelectedItem() {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfSelectedItem);
+}
+
+public NSPopUpButton initWithFrame(NSRect buttonFrame, boolean flag) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFrame_1pullsDown_1, buttonFrame, flag);
+ return result != 0 ? this : null;
+}
+
+public void insertItemWithTitle(NSString title, int index) {
+ OS.objc_msgSend(this.id, OS.sel_insertItemWithTitle_1atIndex_1, title != null ? title.id : 0, index);
+}
+
+public NSArray itemArray() {
+ int result = OS.objc_msgSend(this.id, OS.sel_itemArray);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSMenuItem itemAtIndex(int index) {
+ int result = OS.objc_msgSend(this.id, OS.sel_itemAtIndex_1, index);
+ return result != 0 ? new NSMenuItem(result) : null;
+}
+
+public NSString itemTitleAtIndex(int index) {
+ int result = OS.objc_msgSend(this.id, OS.sel_itemTitleAtIndex_1, index);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSArray itemTitles() {
+ int result = OS.objc_msgSend(this.id, OS.sel_itemTitles);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSMenuItem itemWithTitle(NSString title) {
+ int result = OS.objc_msgSend(this.id, OS.sel_itemWithTitle_1, title != null ? title.id : 0);
+ return result != 0 ? new NSMenuItem(result) : null;
+}
+
+public NSMenuItem lastItem() {
+ int result = OS.objc_msgSend(this.id, OS.sel_lastItem);
+ return result != 0 ? new NSMenuItem(result) : null;
+}
+
+public NSMenu menu() {
+ int result = OS.objc_msgSend(this.id, OS.sel_menu);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+public int numberOfItems() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfItems);
+}
+
+public int preferredEdge() {
+ return OS.objc_msgSend(this.id, OS.sel_preferredEdge);
+}
+
+public boolean pullsDown() {
+ return OS.objc_msgSend(this.id, OS.sel_pullsDown) != 0;
+}
+
+public void removeAllItems() {
+ OS.objc_msgSend(this.id, OS.sel_removeAllItems);
+}
+
+public void removeItemAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_removeItemAtIndex_1, index);
+}
+
+public void removeItemWithTitle(NSString title) {
+ OS.objc_msgSend(this.id, OS.sel_removeItemWithTitle_1, title != null ? title.id : 0);
+}
+
+public void selectItem(NSMenuItem item) {
+ OS.objc_msgSend(this.id, OS.sel_selectItem_1, item != null ? item.id : 0);
+}
+
+public void selectItemAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_selectItemAtIndex_1, index);
+}
+
+public boolean selectItemWithTag(int tag) {
+ return OS.objc_msgSend(this.id, OS.sel_selectItemWithTag_1, tag) != 0;
+}
+
+public void selectItemWithTitle(NSString title) {
+ OS.objc_msgSend(this.id, OS.sel_selectItemWithTitle_1, title != null ? title.id : 0);
+}
+
+public NSMenuItem selectedItem() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedItem);
+ return result != 0 ? new NSMenuItem(result) : null;
+}
+
+public void setAutoenablesItems(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAutoenablesItems_1, flag);
+}
+
+public void setMenu(NSMenu menu) {
+ OS.objc_msgSend(this.id, OS.sel_setMenu_1, menu != null ? menu.id : 0);
+}
+
+public void setPreferredEdge(int edge) {
+ OS.objc_msgSend(this.id, OS.sel_setPreferredEdge_1, edge);
+}
+
+public void setPullsDown(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setPullsDown_1, flag);
+}
+
+public void setTitle(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString != null ? aString.id : 0);
+}
+
+public void synchronizeTitleAndSelectedItem() {
+ OS.objc_msgSend(this.id, OS.sel_synchronizeTitleAndSelectedItem);
+}
+
+public NSString titleOfSelectedItem() {
+ int result = OS.objc_msgSend(this.id, OS.sel_titleOfSelectedItem);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPopUpButtonCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPopUpButtonCell.java
new file mode 100644
index 0000000000..9be103c4c5
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPopUpButtonCell.java
@@ -0,0 +1,212 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPopUpButtonCell extends NSMenuItemCell {
+
+public NSPopUpButtonCell() {
+ super();
+}
+
+public NSPopUpButtonCell(int id) {
+ super(id);
+}
+
+public void addItemWithTitle(NSString title) {
+ OS.objc_msgSend(this.id, OS.sel_addItemWithTitle_1, title != null ? title.id : 0);
+}
+
+public void addItemsWithTitles(NSArray itemTitles) {
+ OS.objc_msgSend(this.id, OS.sel_addItemsWithTitles_1, itemTitles != null ? itemTitles.id : 0);
+}
+
+public boolean altersStateOfSelectedItem() {
+ return OS.objc_msgSend(this.id, OS.sel_altersStateOfSelectedItem) != 0;
+}
+
+public int arrowPosition() {
+ return OS.objc_msgSend(this.id, OS.sel_arrowPosition);
+}
+
+public void attachPopUpWithFrame(NSRect cellFrame, NSView controlView) {
+ OS.objc_msgSend(this.id, OS.sel_attachPopUpWithFrame_1inView_1, cellFrame, controlView != null ? controlView.id : 0);
+}
+
+public boolean autoenablesItems() {
+ return OS.objc_msgSend(this.id, OS.sel_autoenablesItems) != 0;
+}
+
+public void dismissPopUp() {
+ OS.objc_msgSend(this.id, OS.sel_dismissPopUp);
+}
+
+public int indexOfItem(NSMenuItem item) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfItem_1, item != null ? item.id : 0);
+}
+
+public int indexOfItemWithRepresentedObject(id obj) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfItemWithRepresentedObject_1, obj != null ? obj.id : 0);
+}
+
+public int indexOfItemWithTag(int tag) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfItemWithTag_1, tag);
+}
+
+public int indexOfItemWithTarget(id target, int actionSelector) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfItemWithTarget_1andAction_1, target != null ? target.id : 0, actionSelector);
+}
+
+public int indexOfItemWithTitle(NSString title) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfItemWithTitle_1, title != null ? title.id : 0);
+}
+
+public int indexOfSelectedItem() {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfSelectedItem);
+}
+
+public NSPopUpButtonCell initTextCell(NSString stringValue, boolean pullDown) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initTextCell_1pullsDown_1, stringValue != null ? stringValue.id : 0, pullDown);
+ return result != 0 ? this : null;
+}
+
+public void insertItemWithTitle(NSString title, int index) {
+ OS.objc_msgSend(this.id, OS.sel_insertItemWithTitle_1atIndex_1, title != null ? title.id : 0, index);
+}
+
+public NSArray itemArray() {
+ int result = OS.objc_msgSend(this.id, OS.sel_itemArray);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSMenuItem itemAtIndex(int index) {
+ int result = OS.objc_msgSend(this.id, OS.sel_itemAtIndex_1, index);
+ return result != 0 ? new NSMenuItem(result) : null;
+}
+
+public NSString itemTitleAtIndex(int index) {
+ int result = OS.objc_msgSend(this.id, OS.sel_itemTitleAtIndex_1, index);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSArray itemTitles() {
+ int result = OS.objc_msgSend(this.id, OS.sel_itemTitles);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSMenuItem itemWithTitle(NSString title) {
+ int result = OS.objc_msgSend(this.id, OS.sel_itemWithTitle_1, title != null ? title.id : 0);
+ return result != 0 ? new NSMenuItem(result) : null;
+}
+
+public NSMenuItem lastItem() {
+ int result = OS.objc_msgSend(this.id, OS.sel_lastItem);
+ return result != 0 ? new NSMenuItem(result) : null;
+}
+
+public NSMenu menu() {
+ int result = OS.objc_msgSend(this.id, OS.sel_menu);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+public int numberOfItems() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfItems);
+}
+
+public id objectValue() {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectValue);
+ return result != 0 ? new id(result) : null;
+}
+
+public void performClickWithFrame(NSRect frame, NSView controlView) {
+ OS.objc_msgSend(this.id, OS.sel_performClickWithFrame_1inView_1, frame, controlView != null ? controlView.id : 0);
+}
+
+public int preferredEdge() {
+ return OS.objc_msgSend(this.id, OS.sel_preferredEdge);
+}
+
+public boolean pullsDown() {
+ return OS.objc_msgSend(this.id, OS.sel_pullsDown) != 0;
+}
+
+public void removeAllItems() {
+ OS.objc_msgSend(this.id, OS.sel_removeAllItems);
+}
+
+public void removeItemAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_removeItemAtIndex_1, index);
+}
+
+public void removeItemWithTitle(NSString title) {
+ OS.objc_msgSend(this.id, OS.sel_removeItemWithTitle_1, title != null ? title.id : 0);
+}
+
+public void selectItem(NSMenuItem item) {
+ OS.objc_msgSend(this.id, OS.sel_selectItem_1, item != null ? item.id : 0);
+}
+
+public void selectItemAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_selectItemAtIndex_1, index);
+}
+
+public boolean selectItemWithTag(int tag) {
+ return OS.objc_msgSend(this.id, OS.sel_selectItemWithTag_1, tag) != 0;
+}
+
+public void selectItemWithTitle(NSString title) {
+ OS.objc_msgSend(this.id, OS.sel_selectItemWithTitle_1, title != null ? title.id : 0);
+}
+
+public NSMenuItem selectedItem() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedItem);
+ return result != 0 ? new NSMenuItem(result) : null;
+}
+
+public void setAltersStateOfSelectedItem(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAltersStateOfSelectedItem_1, flag);
+}
+
+public void setArrowPosition(int position) {
+ OS.objc_msgSend(this.id, OS.sel_setArrowPosition_1, position);
+}
+
+public void setAutoenablesItems(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAutoenablesItems_1, flag);
+}
+
+public void setMenu(NSMenu menu) {
+ OS.objc_msgSend(this.id, OS.sel_setMenu_1, menu != null ? menu.id : 0);
+}
+
+public void setObjectValue(id obj) {
+ OS.objc_msgSend(this.id, OS.sel_setObjectValue_1, obj != null ? obj.id : 0);
+}
+
+public void setPreferredEdge(int edge) {
+ OS.objc_msgSend(this.id, OS.sel_setPreferredEdge_1, edge);
+}
+
+public void setPullsDown(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setPullsDown_1, flag);
+}
+
+public void setTitle(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString != null ? aString.id : 0);
+}
+
+public void setUsesItemFromMenu(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setUsesItemFromMenu_1, flag);
+}
+
+public void synchronizeTitleAndSelectedItem() {
+ OS.objc_msgSend(this.id, OS.sel_synchronizeTitleAndSelectedItem);
+}
+
+public NSString titleOfSelectedItem() {
+ int result = OS.objc_msgSend(this.id, OS.sel_titleOfSelectedItem);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean usesItemFromMenu() {
+ return OS.objc_msgSend(this.id, OS.sel_usesItemFromMenu) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPort.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPort.java
new file mode 100644
index 0000000000..190bbd1d44
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPort.java
@@ -0,0 +1,68 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPort extends NSObject {
+
+public NSPort() {
+ super();
+}
+
+public NSPort(int id) {
+ super(id);
+}
+
+public void addConnection(NSConnection conn, NSRunLoop runLoop, NSString mode) {
+ OS.objc_msgSend(this.id, OS.sel_addConnection_1toRunLoop_1forMode_1, conn != null ? conn.id : 0, runLoop != null ? runLoop.id : 0, mode != null ? mode.id : 0);
+}
+
+public static id allocWithZone(int zone) {
+ int result = OS.objc_msgSend(OS.class_NSPort, OS.sel_allocWithZone_1, zone);
+ return result != 0 ? new id(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public void invalidate() {
+ OS.objc_msgSend(this.id, OS.sel_invalidate);
+}
+
+public boolean isValid() {
+ return OS.objc_msgSend(this.id, OS.sel_isValid) != 0;
+}
+
+public static NSPort port() {
+ int result = OS.objc_msgSend(OS.class_NSPort, OS.sel_port);
+ return result != 0 ? new NSPort(result) : null;
+}
+
+public void removeConnection(NSConnection conn, NSRunLoop runLoop, NSString mode) {
+ OS.objc_msgSend(this.id, OS.sel_removeConnection_1fromRunLoop_1forMode_1, conn != null ? conn.id : 0, runLoop != null ? runLoop.id : 0, mode != null ? mode.id : 0);
+}
+
+public void removeFromRunLoop(NSRunLoop runLoop, NSString mode) {
+ OS.objc_msgSend(this.id, OS.sel_removeFromRunLoop_1forMode_1, runLoop != null ? runLoop.id : 0, mode != null ? mode.id : 0);
+}
+
+public int reservedSpaceLength() {
+ return OS.objc_msgSend(this.id, OS.sel_reservedSpaceLength);
+}
+
+public void scheduleInRunLoop(NSRunLoop runLoop, NSString mode) {
+ OS.objc_msgSend(this.id, OS.sel_scheduleInRunLoop_1forMode_1, runLoop != null ? runLoop.id : 0, mode != null ? mode.id : 0);
+}
+
+public boolean sendBeforeDate_components_from_reserved_(NSDate limitDate, NSMutableArray components, NSPort receivePort, int headerSpaceReserved) {
+ return OS.objc_msgSend(this.id, OS.sel_sendBeforeDate_1components_1from_1reserved_1, limitDate != null ? limitDate.id : 0, components != null ? components.id : 0, receivePort != null ? receivePort.id : 0, headerSpaceReserved) != 0;
+}
+
+public boolean sendBeforeDate_msgid_components_from_reserved_(NSDate limitDate, int msgID, NSMutableArray components, NSPort receivePort, int headerSpaceReserved) {
+ return OS.objc_msgSend(this.id, OS.sel_sendBeforeDate_1msgid_1components_1from_1reserved_1, limitDate != null ? limitDate.id : 0, msgID, components != null ? components.id : 0, receivePort != null ? receivePort.id : 0, headerSpaceReserved) != 0;
+}
+
+public void setDelegate(id anId) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anId != null ? anId.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPortCoder.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPortCoder.java
new file mode 100644
index 0000000000..35f3b6b90a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPortCoder.java
@@ -0,0 +1,49 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPortCoder extends NSCoder {
+
+public NSPortCoder() {
+ super();
+}
+
+public NSPortCoder(int id) {
+ super(id);
+}
+
+public NSConnection connection() {
+ int result = OS.objc_msgSend(this.id, OS.sel_connection);
+ return result != 0 ? new NSConnection(result) : null;
+}
+
+public NSPort decodePortObject() {
+ int result = OS.objc_msgSend(this.id, OS.sel_decodePortObject);
+ return result != 0 ? new NSPort(result) : null;
+}
+
+public void dispatch() {
+ OS.objc_msgSend(this.id, OS.sel_dispatch);
+}
+
+public void encodePortObject(NSPort aport) {
+ OS.objc_msgSend(this.id, OS.sel_encodePortObject_1, aport != null ? aport.id : 0);
+}
+
+public NSPortCoder initWithReceivePort(NSPort rcvPort, NSPort sndPort, NSArray comps) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithReceivePort_1sendPort_1components_1, rcvPort != null ? rcvPort.id : 0, sndPort != null ? sndPort.id : 0, comps != null ? comps.id : 0);
+ return result != 0 ? this : null;
+}
+
+public boolean isBycopy() {
+ return OS.objc_msgSend(this.id, OS.sel_isBycopy) != 0;
+}
+
+public boolean isByref() {
+ return OS.objc_msgSend(this.id, OS.sel_isByref) != 0;
+}
+
+public static id portCoderWithReceivePort(NSPort rcvPort, NSPort sndPort, NSArray comps) {
+ int result = OS.objc_msgSend(OS.class_NSPortCoder, OS.sel_portCoderWithReceivePort_1sendPort_1components_1, rcvPort != null ? rcvPort.id : 0, sndPort != null ? sndPort.id : 0, comps != null ? comps.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPortMessage.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPortMessage.java
new file mode 100644
index 0000000000..6cc3e612ab
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPortMessage.java
@@ -0,0 +1,45 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPortMessage extends NSObject {
+
+public NSPortMessage() {
+ super();
+}
+
+public NSPortMessage(int id) {
+ super(id);
+}
+
+public NSArray components() {
+ int result = OS.objc_msgSend(this.id, OS.sel_components);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSPortMessage initWithSendPort(NSPort sendPort, NSPort replyPort, NSArray components) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithSendPort_1receivePort_1components_1, sendPort != null ? sendPort.id : 0, replyPort != null ? replyPort.id : 0, components != null ? components.id : 0);
+ return result != 0 ? this : null;
+}
+
+public int msgid() {
+ return OS.objc_msgSend(this.id, OS.sel_msgid);
+}
+
+public NSPort receivePort() {
+ int result = OS.objc_msgSend(this.id, OS.sel_receivePort);
+ return result != 0 ? new NSPort(result) : null;
+}
+
+public boolean sendBeforeDate(NSDate date) {
+ return OS.objc_msgSend(this.id, OS.sel_sendBeforeDate_1, date != null ? date.id : 0) != 0;
+}
+
+public NSPort sendPort() {
+ int result = OS.objc_msgSend(this.id, OS.sel_sendPort);
+ return result != 0 ? new NSPort(result) : null;
+}
+
+public void setMsgid(int msgid) {
+ OS.objc_msgSend(this.id, OS.sel_setMsgid_1, msgid);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPortNameServer.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPortNameServer.java
new file mode 100644
index 0000000000..1699c821e3
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPortNameServer.java
@@ -0,0 +1,36 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPortNameServer extends NSObject {
+
+public NSPortNameServer() {
+ super();
+}
+
+public NSPortNameServer(int id) {
+ super(id);
+}
+
+public NSPort portForName_(NSString name) {
+ int result = OS.objc_msgSend(this.id, OS.sel_portForName_1, name != null ? name.id : 0);
+ return result != 0 ? new NSPort(result) : null;
+}
+
+public NSPort portForName_host_(NSString name, NSString host) {
+ int result = OS.objc_msgSend(this.id, OS.sel_portForName_1host_1, name != null ? name.id : 0, host != null ? host.id : 0);
+ return result != 0 ? new NSPort(result) : null;
+}
+
+public boolean registerPort(NSPort port, NSString name) {
+ return OS.objc_msgSend(this.id, OS.sel_registerPort_1name_1, port != null ? port.id : 0, name != null ? name.id : 0) != 0;
+}
+
+public boolean removePortForName(NSString name) {
+ return OS.objc_msgSend(this.id, OS.sel_removePortForName_1, name != null ? name.id : 0) != 0;
+}
+
+public static NSPortNameServer systemDefaultPortNameServer() {
+ int result = OS.objc_msgSend(OS.class_NSPortNameServer, OS.sel_systemDefaultPortNameServer);
+ return result != 0 ? new NSPortNameServer(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPositionalSpecifier.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPositionalSpecifier.java
new file mode 100644
index 0000000000..4383f8021e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPositionalSpecifier.java
@@ -0,0 +1,53 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPositionalSpecifier extends NSObject {
+
+public NSPositionalSpecifier() {
+ super();
+}
+
+public NSPositionalSpecifier(int id) {
+ super(id);
+}
+
+public void evaluate() {
+ OS.objc_msgSend(this.id, OS.sel_evaluate);
+}
+
+public NSPositionalSpecifier initWithPosition(int position, NSScriptObjectSpecifier specifier) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithPosition_1objectSpecifier_1, position, specifier != null ? specifier.id : 0);
+ return result != 0 ? this : null;
+}
+
+public id insertionContainer() {
+ int result = OS.objc_msgSend(this.id, OS.sel_insertionContainer);
+ return result != 0 ? new id(result) : null;
+}
+
+public int insertionIndex() {
+ return OS.objc_msgSend(this.id, OS.sel_insertionIndex);
+}
+
+public NSString insertionKey() {
+ int result = OS.objc_msgSend(this.id, OS.sel_insertionKey);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean insertionReplaces() {
+ return OS.objc_msgSend(this.id, OS.sel_insertionReplaces) != 0;
+}
+
+public NSScriptObjectSpecifier objectSpecifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectSpecifier);
+ return result != 0 ? new NSScriptObjectSpecifier(result) : null;
+}
+
+public int position() {
+ return OS.objc_msgSend(this.id, OS.sel_position);
+}
+
+public void setInsertionClassDescription(NSScriptClassDescription classDescription) {
+ OS.objc_msgSend(this.id, OS.sel_setInsertionClassDescription_1, classDescription != null ? classDescription.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPredicate.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPredicate.java
new file mode 100644
index 0000000000..e50ae94fbb
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPredicate.java
@@ -0,0 +1,51 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPredicate extends NSObject {
+
+public NSPredicate() {
+ super();
+}
+
+public NSPredicate(int id) {
+ super(id);
+}
+
+public boolean evaluateWithObject_(id object) {
+ return OS.objc_msgSend(this.id, OS.sel_evaluateWithObject_1, object != null ? object.id : 0) != 0;
+}
+
+public boolean evaluateWithObject_substitutionVariables_(id object, NSDictionary bindings) {
+ return OS.objc_msgSend(this.id, OS.sel_evaluateWithObject_1substitutionVariables_1, object != null ? object.id : 0, bindings != null ? bindings.id : 0) != 0;
+}
+
+public NSString predicateFormat() {
+ int result = OS.objc_msgSend(this.id, OS.sel_predicateFormat);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSPredicate static_predicateWithFormat_(NSString predicateWithFormat) {
+ int result = OS.objc_msgSend(OS.class_NSPredicate, OS.sel_predicateWithFormat_1, predicateWithFormat != null ? predicateWithFormat.id : 0);
+ return result != 0 ? new NSPredicate(result) : null;
+}
+
+public static NSPredicate static_predicateWithFormat_argumentArray_(NSString predicateFormat, NSArray arguments) {
+ int result = OS.objc_msgSend(OS.class_NSPredicate, OS.sel_predicateWithFormat_1argumentArray_1, predicateFormat != null ? predicateFormat.id : 0, arguments != null ? arguments.id : 0);
+ return result != 0 ? new NSPredicate(result) : null;
+}
+
+public static NSPredicate static_predicateWithFormat_arguments_(NSString predicateFormat, int argList) {
+ int result = OS.objc_msgSend(OS.class_NSPredicate, OS.sel_predicateWithFormat_1arguments_1, predicateFormat != null ? predicateFormat.id : 0, argList);
+ return result != 0 ? new NSPredicate(result) : null;
+}
+
+public NSPredicate predicateWithSubstitutionVariables(NSDictionary variables) {
+ int result = OS.objc_msgSend(this.id, OS.sel_predicateWithSubstitutionVariables_1, variables != null ? variables.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSPredicate(result) : null);
+}
+
+public static NSPredicate predicateWithValue(boolean value) {
+ int result = OS.objc_msgSend(OS.class_NSPredicate, OS.sel_predicateWithValue_1, value);
+ return result != 0 ? new NSPredicate(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPredicateEditor.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPredicateEditor.java
new file mode 100644
index 0000000000..b269449041
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPredicateEditor.java
@@ -0,0 +1,22 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPredicateEditor extends NSRuleEditor {
+
+public NSPredicateEditor() {
+ super();
+}
+
+public NSPredicateEditor(int id) {
+ super(id);
+}
+
+public NSArray rowTemplates() {
+ int result = OS.objc_msgSend(this.id, OS.sel_rowTemplates);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void setRowTemplates(NSArray rowTemplates) {
+ OS.objc_msgSend(this.id, OS.sel_setRowTemplates_1, rowTemplates != null ? rowTemplates.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPredicateEditorRowTemplate.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPredicateEditorRowTemplate.java
new file mode 100644
index 0000000000..28497e1e6d
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPredicateEditorRowTemplate.java
@@ -0,0 +1,88 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPredicateEditorRowTemplate extends NSObject {
+
+public NSPredicateEditorRowTemplate() {
+ super();
+}
+
+public NSPredicateEditorRowTemplate(int id) {
+ super(id);
+}
+
+public NSArray compoundTypes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_compoundTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray displayableSubpredicatesOfPredicate(NSPredicate predicate) {
+ int result = OS.objc_msgSend(this.id, OS.sel_displayableSubpredicatesOfPredicate_1, predicate != null ? predicate.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public id initWithCompoundTypes(NSArray compoundTypes) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCompoundTypes_1, compoundTypes != null ? compoundTypes.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithLeftExpressions_rightExpressionAttributeType_modifier_operators_options_(NSArray leftExpressions, int attributeType, int modifier, NSArray operators, int options) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithLeftExpressions_1rightExpressionAttributeType_1modifier_1operators_1options_1, leftExpressions != null ? leftExpressions.id : 0, attributeType, modifier, operators != null ? operators.id : 0, options);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithLeftExpressions_rightExpressions_modifier_operators_options_(NSArray leftExpressions, NSArray rightExpressions, int modifier, NSArray operators, int options) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithLeftExpressions_1rightExpressions_1modifier_1operators_1options_1, leftExpressions != null ? leftExpressions.id : 0, rightExpressions != null ? rightExpressions.id : 0, modifier, operators != null ? operators.id : 0, options);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSArray leftExpressions() {
+ int result = OS.objc_msgSend(this.id, OS.sel_leftExpressions);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public double matchForPredicate(NSPredicate predicate) {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_matchForPredicate_1, predicate != null ? predicate.id : 0);
+}
+
+public int modifier() {
+ return OS.objc_msgSend(this.id, OS.sel_modifier);
+}
+
+public NSArray operators() {
+ int result = OS.objc_msgSend(this.id, OS.sel_operators);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public int options() {
+ return OS.objc_msgSend(this.id, OS.sel_options);
+}
+
+public NSPredicate predicateWithSubpredicates(NSArray subpredicates) {
+ int result = OS.objc_msgSend(this.id, OS.sel_predicateWithSubpredicates_1, subpredicates != null ? subpredicates.id : 0);
+ return result != 0 ? new NSPredicate(result) : null;
+}
+
+public int rightExpressionAttributeType() {
+ return OS.objc_msgSend(this.id, OS.sel_rightExpressionAttributeType);
+}
+
+public NSArray rightExpressions() {
+ int result = OS.objc_msgSend(this.id, OS.sel_rightExpressions);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void setPredicate(NSPredicate predicate) {
+ OS.objc_msgSend(this.id, OS.sel_setPredicate_1, predicate != null ? predicate.id : 0);
+}
+
+public NSArray templateViews() {
+ int result = OS.objc_msgSend(this.id, OS.sel_templateViews);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+//public static NSArray templatesWithAttributeKeyPaths(NSArray keyPaths, NSEntityDescription entityDescription) {
+// int result = OS.objc_msgSend(OS.class_NSPredicateEditorRowTemplate, OS.sel_templatesWithAttributeKeyPaths_1inEntityDescription_1, keyPaths != null ? keyPaths.id : 0, entityDescription != null ? entityDescription.id : 0);
+// return result != 0 ? new NSArray(result) : null;
+//}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrintInfo.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrintInfo.java
new file mode 100644
index 0000000000..153e5bbc83
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrintInfo.java
@@ -0,0 +1,196 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPrintInfo extends NSObject {
+
+public NSPrintInfo() {
+ super();
+}
+
+public NSPrintInfo(int id) {
+ super(id);
+}
+
+public int PMPageFormat() {
+ return OS.objc_msgSend(this.id, OS.sel_PMPageFormat);
+}
+
+public int PMPrintSession() {
+ return OS.objc_msgSend(this.id, OS.sel_PMPrintSession);
+}
+
+public int PMPrintSettings() {
+ return OS.objc_msgSend(this.id, OS.sel_PMPrintSettings);
+}
+
+public float bottomMargin() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_bottomMargin);
+}
+
+public static NSPrinter defaultPrinter() {
+ int result = OS.objc_msgSend(OS.class_NSPrintInfo, OS.sel_defaultPrinter);
+ return result != 0 ? new NSPrinter(result) : null;
+}
+
+public NSMutableDictionary dictionary() {
+ int result = OS.objc_msgSend(this.id, OS.sel_dictionary);
+ return result != 0 ? new NSMutableDictionary(result) : null;
+}
+
+public int horizontalPagination() {
+ return OS.objc_msgSend(this.id, OS.sel_horizontalPagination);
+}
+
+public NSRect imageablePageBounds() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_imageablePageBounds);
+ return result;
+}
+
+public id initWithDictionary(NSDictionary attributes) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithDictionary_1, attributes != null ? attributes.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isHorizontallyCentered() {
+ return OS.objc_msgSend(this.id, OS.sel_isHorizontallyCentered) != 0;
+}
+
+public boolean isVerticallyCentered() {
+ return OS.objc_msgSend(this.id, OS.sel_isVerticallyCentered) != 0;
+}
+
+public NSString jobDisposition() {
+ int result = OS.objc_msgSend(this.id, OS.sel_jobDisposition);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public float leftMargin() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_leftMargin);
+}
+
+public NSString localizedPaperName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_localizedPaperName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int orientation() {
+ return OS.objc_msgSend(this.id, OS.sel_orientation);
+}
+
+public NSString paperName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_paperName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSSize paperSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_paperSize);
+ return result;
+}
+
+public NSMutableDictionary printSettings() {
+ int result = OS.objc_msgSend(this.id, OS.sel_printSettings);
+ return result != 0 ? new NSMutableDictionary(result) : null;
+}
+
+public NSPrinter printer() {
+ int result = OS.objc_msgSend(this.id, OS.sel_printer);
+ return result != 0 ? new NSPrinter(result) : null;
+}
+
+public float rightMargin() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_rightMargin);
+}
+
+public void setBottomMargin(float margin) {
+ OS.objc_msgSend(this.id, OS.sel_setBottomMargin_1, margin);
+}
+
+public static void setDefaultPrinter(NSPrinter printer) {
+ OS.objc_msgSend(OS.class_NSPrintInfo, OS.sel_setDefaultPrinter_1, printer != null ? printer.id : 0);
+}
+
+public void setHorizontalPagination(int mode) {
+ OS.objc_msgSend(this.id, OS.sel_setHorizontalPagination_1, mode);
+}
+
+public void setHorizontallyCentered(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setHorizontallyCentered_1, flag);
+}
+
+public void setJobDisposition(NSString disposition) {
+ OS.objc_msgSend(this.id, OS.sel_setJobDisposition_1, disposition != null ? disposition.id : 0);
+}
+
+public void setLeftMargin(float margin) {
+ OS.objc_msgSend(this.id, OS.sel_setLeftMargin_1, margin);
+}
+
+public void setOrientation(int orientation) {
+ OS.objc_msgSend(this.id, OS.sel_setOrientation_1, orientation);
+}
+
+public void setPaperName(NSString name) {
+ OS.objc_msgSend(this.id, OS.sel_setPaperName_1, name != null ? name.id : 0);
+}
+
+public void setPaperSize(NSSize size) {
+ OS.objc_msgSend(this.id, OS.sel_setPaperSize_1, size);
+}
+
+public void setPrinter(NSPrinter printer) {
+ OS.objc_msgSend(this.id, OS.sel_setPrinter_1, printer != null ? printer.id : 0);
+}
+
+public void setRightMargin(float margin) {
+ OS.objc_msgSend(this.id, OS.sel_setRightMargin_1, margin);
+}
+
+public static void setSharedPrintInfo(NSPrintInfo printInfo) {
+ OS.objc_msgSend(OS.class_NSPrintInfo, OS.sel_setSharedPrintInfo_1, printInfo != null ? printInfo.id : 0);
+}
+
+public void setTopMargin(float margin) {
+ OS.objc_msgSend(this.id, OS.sel_setTopMargin_1, margin);
+}
+
+public void setUpPrintOperationDefaultValues() {
+ OS.objc_msgSend(this.id, OS.sel_setUpPrintOperationDefaultValues);
+}
+
+public void setVerticalPagination(int mode) {
+ OS.objc_msgSend(this.id, OS.sel_setVerticalPagination_1, mode);
+}
+
+public void setVerticallyCentered(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setVerticallyCentered_1, flag);
+}
+
+public static NSPrintInfo sharedPrintInfo() {
+ int result = OS.objc_msgSend(OS.class_NSPrintInfo, OS.sel_sharedPrintInfo);
+ return result != 0 ? new NSPrintInfo(result) : null;
+}
+
+public static NSSize sizeForPaperName(NSString name) {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, OS.class_NSPrintInfo, OS.sel_sizeForPaperName_1, name != null ? name.id : 0);
+ return result;
+}
+
+public float topMargin() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_topMargin);
+}
+
+public void updateFromPMPageFormat() {
+ OS.objc_msgSend(this.id, OS.sel_updateFromPMPageFormat);
+}
+
+public void updateFromPMPrintSettings() {
+ OS.objc_msgSend(this.id, OS.sel_updateFromPMPrintSettings);
+}
+
+public int verticalPagination() {
+ return OS.objc_msgSend(this.id, OS.sel_verticalPagination);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrintOperation.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrintOperation.java
new file mode 100644
index 0000000000..82dc824e79
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrintOperation.java
@@ -0,0 +1,196 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPrintOperation extends NSObject {
+
+public NSPrintOperation() {
+ super();
+}
+
+public NSPrintOperation(int id) {
+ super(id);
+}
+
+public static NSPrintOperation static_EPSOperationWithView_insideRect_toData_(NSView view, NSRect rect, NSMutableData data) {
+ int result = OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_EPSOperationWithView_1insideRect_1toData_1, view != null ? view.id : 0, rect, data != null ? data.id : 0);
+ return result != 0 ? new NSPrintOperation(result) : null;
+}
+
+public static NSPrintOperation static_EPSOperationWithView_insideRect_toData_printInfo_(NSView view, NSRect rect, NSMutableData data, NSPrintInfo printInfo) {
+ int result = OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_EPSOperationWithView_1insideRect_1toData_1printInfo_1, view != null ? view.id : 0, rect, data != null ? data.id : 0, printInfo != null ? printInfo.id : 0);
+ return result != 0 ? new NSPrintOperation(result) : null;
+}
+
+public static NSPrintOperation static_EPSOperationWithView_insideRect_toPath_printInfo_(NSView view, NSRect rect, NSString path, NSPrintInfo printInfo) {
+ int result = OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_EPSOperationWithView_1insideRect_1toPath_1printInfo_1, view != null ? view.id : 0, rect, path != null ? path.id : 0, printInfo != null ? printInfo.id : 0);
+ return result != 0 ? new NSPrintOperation(result) : null;
+}
+
+public static NSPrintOperation static_PDFOperationWithView_insideRect_toData_(NSView view, NSRect rect, NSMutableData data) {
+ int result = OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_PDFOperationWithView_1insideRect_1toData_1, view != null ? view.id : 0, rect, data != null ? data.id : 0);
+ return result != 0 ? new NSPrintOperation(result) : null;
+}
+
+public static NSPrintOperation static_PDFOperationWithView_insideRect_toData_printInfo_(NSView view, NSRect rect, NSMutableData data, NSPrintInfo printInfo) {
+ int result = OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_PDFOperationWithView_1insideRect_1toData_1printInfo_1, view != null ? view.id : 0, rect, data != null ? data.id : 0, printInfo != null ? printInfo.id : 0);
+ return result != 0 ? new NSPrintOperation(result) : null;
+}
+
+public static NSPrintOperation static_PDFOperationWithView_insideRect_toPath_printInfo_(NSView view, NSRect rect, NSString path, NSPrintInfo printInfo) {
+ int result = OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_PDFOperationWithView_1insideRect_1toPath_1printInfo_1, view != null ? view.id : 0, rect, path != null ? path.id : 0, printInfo != null ? printInfo.id : 0);
+ return result != 0 ? new NSPrintOperation(result) : null;
+}
+
+public NSView accessoryView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_accessoryView);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public boolean canSpawnSeparateThread() {
+ return OS.objc_msgSend(this.id, OS.sel_canSpawnSeparateThread) != 0;
+}
+
+public void cleanUpOperation() {
+ OS.objc_msgSend(this.id, OS.sel_cleanUpOperation);
+}
+
+public NSGraphicsContext context() {
+ int result = OS.objc_msgSend(this.id, OS.sel_context);
+ return result != 0 ? new NSGraphicsContext(result) : null;
+}
+
+public NSGraphicsContext createContext() {
+ int result = OS.objc_msgSend(this.id, OS.sel_createContext);
+ return result != 0 ? new NSGraphicsContext(result) : null;
+}
+
+public static NSPrintOperation currentOperation() {
+ int result = OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_currentOperation);
+ return result != 0 ? new NSPrintOperation(result) : null;
+}
+
+public int currentPage() {
+ return OS.objc_msgSend(this.id, OS.sel_currentPage);
+}
+
+public boolean deliverResult() {
+ return OS.objc_msgSend(this.id, OS.sel_deliverResult) != 0;
+}
+
+public void destroyContext() {
+ OS.objc_msgSend(this.id, OS.sel_destroyContext);
+}
+
+public boolean isCopyingOperation() {
+ return OS.objc_msgSend(this.id, OS.sel_isCopyingOperation) != 0;
+}
+
+public NSString jobStyleHint() {
+ int result = OS.objc_msgSend(this.id, OS.sel_jobStyleHint);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString jobTitle() {
+ int result = OS.objc_msgSend(this.id, OS.sel_jobTitle);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int pageOrder() {
+ return OS.objc_msgSend(this.id, OS.sel_pageOrder);
+}
+
+public NSRange pageRange() {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_pageRange);
+ return result;
+}
+
+public NSPrintInfo printInfo() {
+ int result = OS.objc_msgSend(this.id, OS.sel_printInfo);
+ return result != 0 ? new NSPrintInfo(result) : null;
+}
+
+public static NSPrintOperation static_printOperationWithView_(NSView view) {
+ int result = OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_printOperationWithView_1, view != null ? view.id : 0);
+ return result != 0 ? new NSPrintOperation(result) : null;
+}
+
+public static NSPrintOperation static_printOperationWithView_printInfo_(NSView view, NSPrintInfo printInfo) {
+ int result = OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_printOperationWithView_1printInfo_1, view != null ? view.id : 0, printInfo != null ? printInfo.id : 0);
+ return result != 0 ? new NSPrintOperation(result) : null;
+}
+
+public NSPrintPanel printPanel() {
+ int result = OS.objc_msgSend(this.id, OS.sel_printPanel);
+ return result != 0 ? new NSPrintPanel(result) : null;
+}
+
+public boolean runOperation() {
+ return OS.objc_msgSend(this.id, OS.sel_runOperation) != 0;
+}
+
+public void runOperationModalForWindow(NSWindow docWindow, id delegate, int didRunSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_runOperationModalForWindow_1delegate_1didRunSelector_1contextInfo_1, docWindow != null ? docWindow.id : 0, delegate != null ? delegate.id : 0, didRunSelector, contextInfo);
+}
+
+public void setAccessoryView(NSView view) {
+ OS.objc_msgSend(this.id, OS.sel_setAccessoryView_1, view != null ? view.id : 0);
+}
+
+public void setCanSpawnSeparateThread(boolean canSpawnSeparateThread) {
+ OS.objc_msgSend(this.id, OS.sel_setCanSpawnSeparateThread_1, canSpawnSeparateThread);
+}
+
+public static void setCurrentOperation(NSPrintOperation operation) {
+ OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_setCurrentOperation_1, operation != null ? operation.id : 0);
+}
+
+public void setJobStyleHint(NSString hint) {
+ OS.objc_msgSend(this.id, OS.sel_setJobStyleHint_1, hint != null ? hint.id : 0);
+}
+
+public void setJobTitle(NSString jobTitle) {
+ OS.objc_msgSend(this.id, OS.sel_setJobTitle_1, jobTitle != null ? jobTitle.id : 0);
+}
+
+public void setPageOrder(int pageOrder) {
+ OS.objc_msgSend(this.id, OS.sel_setPageOrder_1, pageOrder);
+}
+
+public void setPrintInfo(NSPrintInfo printInfo) {
+ OS.objc_msgSend(this.id, OS.sel_setPrintInfo_1, printInfo != null ? printInfo.id : 0);
+}
+
+public void setPrintPanel(NSPrintPanel panel) {
+ OS.objc_msgSend(this.id, OS.sel_setPrintPanel_1, panel != null ? panel.id : 0);
+}
+
+public void setShowPanels(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setShowPanels_1, flag);
+}
+
+public void setShowsPrintPanel(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setShowsPrintPanel_1, flag);
+}
+
+public void setShowsProgressPanel(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setShowsProgressPanel_1, flag);
+}
+
+public boolean showPanels() {
+ return OS.objc_msgSend(this.id, OS.sel_showPanels) != 0;
+}
+
+public boolean showsPrintPanel() {
+ return OS.objc_msgSend(this.id, OS.sel_showsPrintPanel) != 0;
+}
+
+public boolean showsProgressPanel() {
+ return OS.objc_msgSend(this.id, OS.sel_showsProgressPanel) != 0;
+}
+
+public NSView view() {
+ int result = OS.objc_msgSend(this.id, OS.sel_view);
+ return result != 0 ? new NSView(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrintPanel.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrintPanel.java
new file mode 100644
index 0000000000..b630e909ec
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrintPanel.java
@@ -0,0 +1,100 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPrintPanel extends NSObject {
+
+public NSPrintPanel() {
+ super();
+}
+
+public NSPrintPanel(int id) {
+ super(id);
+}
+
+public NSArray accessoryControllers() {
+ int result = OS.objc_msgSend(this.id, OS.sel_accessoryControllers);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSView accessoryView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_accessoryView);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public void addAccessoryController(NSViewController accessoryController) {
+ OS.objc_msgSend(this.id, OS.sel_addAccessoryController_1, accessoryController != null ? accessoryController.id : 0);
+}
+
+public void beginSheetWithPrintInfo(NSPrintInfo printInfo, NSWindow docWindow, id delegate, int didEndSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_beginSheetWithPrintInfo_1modalForWindow_1delegate_1didEndSelector_1contextInfo_1, printInfo != null ? printInfo.id : 0, docWindow != null ? docWindow.id : 0, delegate != null ? delegate.id : 0, didEndSelector, contextInfo);
+}
+
+public NSString defaultButtonTitle() {
+ int result = OS.objc_msgSend(this.id, OS.sel_defaultButtonTitle);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void finalWritePrintInfo() {
+ OS.objc_msgSend(this.id, OS.sel_finalWritePrintInfo);
+}
+
+public NSString helpAnchor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_helpAnchor);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString jobStyleHint() {
+ int result = OS.objc_msgSend(this.id, OS.sel_jobStyleHint);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int options() {
+ return OS.objc_msgSend(this.id, OS.sel_options);
+}
+
+public NSPrintInfo printInfo() {
+ int result = OS.objc_msgSend(this.id, OS.sel_printInfo);
+ return result != 0 ? new NSPrintInfo(result) : null;
+}
+
+public static NSPrintPanel printPanel() {
+ int result = OS.objc_msgSend(OS.class_NSPrintPanel, OS.sel_printPanel);
+ return result != 0 ? new NSPrintPanel(result) : null;
+}
+
+public void removeAccessoryController(NSViewController accessoryController) {
+ OS.objc_msgSend(this.id, OS.sel_removeAccessoryController_1, accessoryController != null ? accessoryController.id : 0);
+}
+
+public int runModal() {
+ return OS.objc_msgSend(this.id, OS.sel_runModal);
+}
+
+public int runModalWithPrintInfo(NSPrintInfo printInfo) {
+ return OS.objc_msgSend(this.id, OS.sel_runModalWithPrintInfo_1, printInfo != null ? printInfo.id : 0);
+}
+
+public void setAccessoryView(NSView accessoryView) {
+ OS.objc_msgSend(this.id, OS.sel_setAccessoryView_1, accessoryView != null ? accessoryView.id : 0);
+}
+
+public void setDefaultButtonTitle(NSString defaultButtonTitle) {
+ OS.objc_msgSend(this.id, OS.sel_setDefaultButtonTitle_1, defaultButtonTitle != null ? defaultButtonTitle.id : 0);
+}
+
+public void setHelpAnchor(NSString helpAnchor) {
+ OS.objc_msgSend(this.id, OS.sel_setHelpAnchor_1, helpAnchor != null ? helpAnchor.id : 0);
+}
+
+public void setJobStyleHint(NSString hint) {
+ OS.objc_msgSend(this.id, OS.sel_setJobStyleHint_1, hint != null ? hint.id : 0);
+}
+
+public void setOptions(int options) {
+ OS.objc_msgSend(this.id, OS.sel_setOptions_1, options);
+}
+
+public void updateFromPrintInfo() {
+ OS.objc_msgSend(this.id, OS.sel_updateFromPrintInfo);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrinter.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrinter.java
new file mode 100644
index 0000000000..a18dd9e0c7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPrinter.java
@@ -0,0 +1,142 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPrinter extends NSObject {
+
+public NSPrinter() {
+ super();
+}
+
+public NSPrinter(int id) {
+ super(id);
+}
+
+public boolean acceptsBinary() {
+ return OS.objc_msgSend(this.id, OS.sel_acceptsBinary) != 0;
+}
+
+public boolean booleanForKey(NSString key, NSString table) {
+ return OS.objc_msgSend(this.id, OS.sel_booleanForKey_1inTable_1, key != null ? key.id : 0, table != null ? table.id : 0) != 0;
+}
+
+public NSDictionary deviceDescription() {
+ int result = OS.objc_msgSend(this.id, OS.sel_deviceDescription);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSString domain() {
+ int result = OS.objc_msgSend(this.id, OS.sel_domain);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public float floatForKey(NSString key, NSString table) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_floatForKey_1inTable_1, key != null ? key.id : 0, table != null ? table.id : 0);
+}
+
+public NSString host() {
+ int result = OS.objc_msgSend(this.id, OS.sel_host);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSRect imageRectForPaper(NSString paperName) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_imageRectForPaper_1, paperName != null ? paperName.id : 0);
+ return result;
+}
+
+public int intForKey(NSString key, NSString table) {
+ return OS.objc_msgSend(this.id, OS.sel_intForKey_1inTable_1, key != null ? key.id : 0, table != null ? table.id : 0);
+}
+
+public boolean isColor() {
+ return OS.objc_msgSend(this.id, OS.sel_isColor) != 0;
+}
+
+public boolean isFontAvailable(NSString faceName) {
+ return OS.objc_msgSend(this.id, OS.sel_isFontAvailable_1, faceName != null ? faceName.id : 0) != 0;
+}
+
+public boolean isKey(NSString key, NSString table) {
+ return OS.objc_msgSend(this.id, OS.sel_isKey_1inTable_1, key != null ? key.id : 0, table != null ? table.id : 0) != 0;
+}
+
+public boolean isOutputStackInReverseOrder() {
+ return OS.objc_msgSend(this.id, OS.sel_isOutputStackInReverseOrder) != 0;
+}
+
+public int languageLevel() {
+ return OS.objc_msgSend(this.id, OS.sel_languageLevel);
+}
+
+public NSString name() {
+ int result = OS.objc_msgSend(this.id, OS.sel_name);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString note() {
+ int result = OS.objc_msgSend(this.id, OS.sel_note);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSSize pageSizeForPaper(NSString paperName) {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_pageSizeForPaper_1, paperName != null ? paperName.id : 0);
+ return result;
+}
+
+public static NSArray printerNames() {
+ int result = OS.objc_msgSend(OS.class_NSPrinter, OS.sel_printerNames);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray printerTypes() {
+ int result = OS.objc_msgSend(OS.class_NSPrinter, OS.sel_printerTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSPrinter static_printerWithName_(NSString name) {
+ int result = OS.objc_msgSend(OS.class_NSPrinter, OS.sel_printerWithName_1, name != null ? name.id : 0);
+ return result != 0 ? new NSPrinter(result) : null;
+}
+
+public static NSPrinter static_printerWithName_domain_includeUnavailable_(NSString name, NSString domain, boolean flag) {
+ int result = OS.objc_msgSend(OS.class_NSPrinter, OS.sel_printerWithName_1domain_1includeUnavailable_1, name != null ? name.id : 0, domain != null ? domain.id : 0, flag);
+ return result != 0 ? new NSPrinter(result) : null;
+}
+
+public static NSPrinter printerWithType(NSString type) {
+ int result = OS.objc_msgSend(OS.class_NSPrinter, OS.sel_printerWithType_1, type != null ? type.id : 0);
+ return result != 0 ? new NSPrinter(result) : null;
+}
+
+public NSRect rectForKey(NSString key, NSString table) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rectForKey_1inTable_1, key != null ? key.id : 0, table != null ? table.id : 0);
+ return result;
+}
+
+public NSSize sizeForKey(NSString key, NSString table) {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_sizeForKey_1inTable_1, key != null ? key.id : 0, table != null ? table.id : 0);
+ return result;
+}
+
+public int statusForTable(NSString tableName) {
+ return OS.objc_msgSend(this.id, OS.sel_statusForTable_1, tableName != null ? tableName.id : 0);
+}
+
+public NSString stringForKey(NSString key, NSString table) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringForKey_1inTable_1, key != null ? key.id : 0, table != null ? table.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSArray stringListForKey(NSString key, NSString table) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringListForKey_1inTable_1, key != null ? key.id : 0, table != null ? table.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString type() {
+ int result = OS.objc_msgSend(this.id, OS.sel_type);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSProcessInfo.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSProcessInfo.java
new file mode 100644
index 0000000000..a45743d2e6
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSProcessInfo.java
@@ -0,0 +1,77 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSProcessInfo extends NSObject {
+
+public NSProcessInfo() {
+ super();
+}
+
+public NSProcessInfo(int id) {
+ super(id);
+}
+
+public int activeProcessorCount() {
+ return OS.objc_msgSend(this.id, OS.sel_activeProcessorCount);
+}
+
+public NSArray arguments() {
+ int result = OS.objc_msgSend(this.id, OS.sel_arguments);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSDictionary environment() {
+ int result = OS.objc_msgSend(this.id, OS.sel_environment);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSString globallyUniqueString() {
+ int result = OS.objc_msgSend(this.id, OS.sel_globallyUniqueString);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString hostName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_hostName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int operatingSystem() {
+ return OS.objc_msgSend(this.id, OS.sel_operatingSystem);
+}
+
+public NSString operatingSystemName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_operatingSystemName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString operatingSystemVersionString() {
+ int result = OS.objc_msgSend(this.id, OS.sel_operatingSystemVersionString);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public long physicalMemory() {
+ return (long)OS.objc_msgSend(this.id, OS.sel_physicalMemory);
+}
+
+public int processIdentifier() {
+ return OS.objc_msgSend(this.id, OS.sel_processIdentifier);
+}
+
+public static NSProcessInfo processInfo() {
+ int result = OS.objc_msgSend(OS.class_NSProcessInfo, OS.sel_processInfo);
+ return result != 0 ? new NSProcessInfo(result) : null;
+}
+
+public NSString processName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_processName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int processorCount() {
+ return OS.objc_msgSend(this.id, OS.sel_processorCount);
+}
+
+public void setProcessName(NSString newName) {
+ OS.objc_msgSend(this.id, OS.sel_setProcessName_1, newName != null ? newName.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSProgressIndicator.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSProgressIndicator.java
new file mode 100644
index 0000000000..4751141e44
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSProgressIndicator.java
@@ -0,0 +1,121 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSProgressIndicator extends NSView {
+
+public NSProgressIndicator() {
+ super();
+}
+
+public NSProgressIndicator(int id) {
+ super(id);
+}
+
+public void animate(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_animate_1, sender != null ? sender.id : 0);
+}
+
+public double animationDelay() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_animationDelay);
+}
+
+public int controlSize() {
+ return OS.objc_msgSend(this.id, OS.sel_controlSize);
+}
+
+public int controlTint() {
+ return OS.objc_msgSend(this.id, OS.sel_controlTint);
+}
+
+public double doubleValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_doubleValue);
+}
+
+public void incrementBy(double delta) {
+ OS.objc_msgSend(this.id, OS.sel_incrementBy_1, delta);
+}
+
+public boolean isBezeled() {
+ return OS.objc_msgSend(this.id, OS.sel_isBezeled) != 0;
+}
+
+public boolean isDisplayedWhenStopped() {
+ return OS.objc_msgSend(this.id, OS.sel_isDisplayedWhenStopped) != 0;
+}
+
+public boolean isIndeterminate() {
+ return OS.objc_msgSend(this.id, OS.sel_isIndeterminate) != 0;
+}
+
+public double maxValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_maxValue);
+}
+
+public double minValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_minValue);
+}
+
+public void setAnimationDelay(double delay) {
+ OS.objc_msgSend(this.id, OS.sel_setAnimationDelay_1, delay);
+}
+
+public void setBezeled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setBezeled_1, flag);
+}
+
+public void setControlSize(int size) {
+ OS.objc_msgSend(this.id, OS.sel_setControlSize_1, size);
+}
+
+public void setControlTint(int tint) {
+ OS.objc_msgSend(this.id, OS.sel_setControlTint_1, tint);
+}
+
+public void setDisplayedWhenStopped(boolean isDisplayed) {
+ OS.objc_msgSend(this.id, OS.sel_setDisplayedWhenStopped_1, isDisplayed);
+}
+
+public void setDoubleValue(double doubleValue) {
+ OS.objc_msgSend(this.id, OS.sel_setDoubleValue_1, doubleValue);
+}
+
+public void setIndeterminate(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setIndeterminate_1, flag);
+}
+
+public void setMaxValue(double newMaximum) {
+ OS.objc_msgSend(this.id, OS.sel_setMaxValue_1, newMaximum);
+}
+
+public void setMinValue(double newMinimum) {
+ OS.objc_msgSend(this.id, OS.sel_setMinValue_1, newMinimum);
+}
+
+public void setStyle(int style) {
+ OS.objc_msgSend(this.id, OS.sel_setStyle_1, style);
+}
+
+public void setUsesThreadedAnimation(boolean threadedAnimation) {
+ OS.objc_msgSend(this.id, OS.sel_setUsesThreadedAnimation_1, threadedAnimation);
+}
+
+public void sizeToFit() {
+ OS.objc_msgSend(this.id, OS.sel_sizeToFit);
+}
+
+public void startAnimation(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_startAnimation_1, sender != null ? sender.id : 0);
+}
+
+public void stopAnimation(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_stopAnimation_1, sender != null ? sender.id : 0);
+}
+
+public int style() {
+ return OS.objc_msgSend(this.id, OS.sel_style);
+}
+
+public boolean usesThreadedAnimation() {
+ return OS.objc_msgSend(this.id, OS.sel_usesThreadedAnimation) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPropertyListSerialization.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPropertyListSerialization.java
new file mode 100644
index 0000000000..4ab249bdce
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSPropertyListSerialization.java
@@ -0,0 +1,27 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSPropertyListSerialization extends NSObject {
+
+public NSPropertyListSerialization() {
+ super();
+}
+
+public NSPropertyListSerialization(int id) {
+ super(id);
+}
+
+public static NSData dataFromPropertyList(id plist, int format, int errorString) {
+ int result = OS.objc_msgSend(OS.class_NSPropertyListSerialization, OS.sel_dataFromPropertyList_1format_1errorDescription_1, plist != null ? plist.id : 0, format, errorString);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public static boolean propertyList(id plist, int format) {
+ return OS.objc_msgSend(OS.class_NSPropertyListSerialization, OS.sel_propertyList_1isValidForFormat_1, plist != null ? plist.id : 0, format) != 0;
+}
+
+public static id propertyListFromData(NSData data, int opt, int format, int errorString) {
+ int result = OS.objc_msgSend(OS.class_NSPropertyListSerialization, OS.sel_propertyListFromData_1mutabilityOption_1format_1errorDescription_1, data != null ? data.id : 0, opt, format, errorString);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSProtocolChecker.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSProtocolChecker.java
new file mode 100644
index 0000000000..1c0ae6524f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSProtocolChecker.java
@@ -0,0 +1,33 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSProtocolChecker extends NSProxy {
+
+public NSProtocolChecker() {
+ super();
+}
+
+public NSProtocolChecker(int id) {
+ super(id);
+}
+
+//public id initWithTarget(NSObject anObject, Protocol aProtocol) {
+// int result = OS.objc_msgSend(this.id, OS.sel_initWithTarget_1protocol_1, anObject != null ? anObject.id : 0, aProtocol != null ? aProtocol.id : 0);
+// return result != 0 ? new id(result) : null;
+//}
+//
+//public Protocol protocol() {
+// int result = OS.objc_msgSend(this.id, OS.sel_protocol);
+// return result != 0 ? new Protocol(result) : null;
+//}
+//
+//public static id protocolCheckerWithTarget(NSObject anObject, Protocol aProtocol) {
+// int result = OS.objc_msgSend(OS.class_NSProtocolChecker, OS.sel_protocolCheckerWithTarget_1protocol_1, anObject != null ? anObject.id : 0, aProtocol != null ? aProtocol.id : 0);
+// return result != 0 ? new id(result) : null;
+//}
+
+public NSObject target() {
+ int result = OS.objc_msgSend(this.id, OS.sel_target);
+ return result != 0 ? new NSObject(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSProxy.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSProxy.java
new file mode 100644
index 0000000000..f16abc4f1c
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSProxy.java
@@ -0,0 +1,53 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSProxy extends NSObject {
+
+public NSProxy() {
+ super();
+}
+
+public NSProxy(int id) {
+ super(id);
+}
+
+//public static id alloc() {
+// int result = OS.objc_msgSend(OS.class_NSProxy, OS.sel_alloc);
+// return result != 0 ? new id(result) : null;
+//}
+
+public static id allocWithZone(int zone) {
+ int result = OS.objc_msgSend(OS.class_NSProxy, OS.sel_allocWithZone_1, zone);
+ return result != 0 ? new id(result) : null;
+}
+
+//public static int class() {
+// return OS.objc_msgSend(OS.class_NSProxy, OS.sel_class);
+//}
+
+public void dealloc() {
+ OS.objc_msgSend(this.id, OS.sel_dealloc);
+}
+
+public NSString description() {
+ int result = OS.objc_msgSend(this.id, OS.sel_description);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void finalize() {
+ OS.objc_msgSend(this.id, OS.sel_finalize);
+}
+
+public void forwardInvocation(NSInvocation invocation) {
+ OS.objc_msgSend(this.id, OS.sel_forwardInvocation_1, invocation != null ? invocation.id : 0);
+}
+
+public NSMethodSignature methodSignatureForSelector(int sel) {
+ int result = OS.objc_msgSend(this.id, OS.sel_methodSignatureForSelector_1, sel);
+ return result != 0 ? new NSMethodSignature(result) : null;
+}
+
+//public static boolean respondsToSelector(int aSelector) {
+// return OS.objc_msgSend(OS.class_NSProxy, OS.sel_respondsToSelector_1, aSelector) != 0;
+//}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSQuickDrawView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSQuickDrawView.java
new file mode 100644
index 0000000000..d4ed6b483f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSQuickDrawView.java
@@ -0,0 +1,17 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSQuickDrawView extends NSView {
+
+public NSQuickDrawView() {
+ super();
+}
+
+public NSQuickDrawView(int id) {
+ super(id);
+}
+
+public int qdPort() {
+ return OS.objc_msgSend(this.id, OS.sel_qdPort);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSQuitCommand.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSQuitCommand.java
new file mode 100644
index 0000000000..2c0121255a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSQuitCommand.java
@@ -0,0 +1,17 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSQuitCommand extends NSScriptCommand {
+
+public NSQuitCommand() {
+ super();
+}
+
+public NSQuitCommand(int id) {
+ super(id);
+}
+
+public int saveOptions() {
+ return OS.objc_msgSend(this.id, OS.sel_saveOptions);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRange.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRange.java
new file mode 100644
index 0000000000..74345f2711
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRange.java
@@ -0,0 +1,8 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSRange {
+public int location;
+public int length;
+
+public static int sizeof = 8;
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRangeSpecifier.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRangeSpecifier.java
new file mode 100644
index 0000000000..b65ab45f62
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRangeSpecifier.java
@@ -0,0 +1,36 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSRangeSpecifier extends NSScriptObjectSpecifier {
+
+public NSRangeSpecifier() {
+ super();
+}
+
+public NSRangeSpecifier(int id) {
+ super(id);
+}
+
+public NSScriptObjectSpecifier endSpecifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_endSpecifier);
+ return result != 0 ? new NSScriptObjectSpecifier(result) : null;
+}
+
+public id initWithContainerClassDescription(NSScriptClassDescription classDesc, NSScriptObjectSpecifier container, NSString property, NSScriptObjectSpecifier startSpec, NSScriptObjectSpecifier endSpec) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContainerClassDescription_1containerSpecifier_1key_1startSpecifier_1endSpecifier_1, classDesc != null ? classDesc.id : 0, container != null ? container.id : 0, property != null ? property.id : 0, startSpec != null ? startSpec.id : 0, endSpec != null ? endSpec.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void setEndSpecifier(NSScriptObjectSpecifier endSpec) {
+ OS.objc_msgSend(this.id, OS.sel_setEndSpecifier_1, endSpec != null ? endSpec.id : 0);
+}
+
+public void setStartSpecifier(NSScriptObjectSpecifier startSpec) {
+ OS.objc_msgSend(this.id, OS.sel_setStartSpecifier_1, startSpec != null ? startSpec.id : 0);
+}
+
+public NSScriptObjectSpecifier startSpecifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_startSpecifier);
+ return result != 0 ? new NSScriptObjectSpecifier(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRect.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRect.java
new file mode 100755
index 0000000000..d11412fcb8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRect.java
@@ -0,0 +1,21 @@
+/**********************************************************************
+ * Copyright (c) 2003-2006 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ **********************************************************************/
+package org.eclipse.swt.internal.cocoa;
+
+
+public class NSRect {
+ public float x;
+ public float y;
+ public float width;
+ public float height;
+ public static final int sizeof = 16;
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRecursiveLock.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRecursiveLock.java
new file mode 100644
index 0000000000..81a8bcb5a9
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRecursiveLock.java
@@ -0,0 +1,30 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSRecursiveLock extends NSObject {
+
+public NSRecursiveLock() {
+ super();
+}
+
+public NSRecursiveLock(int id) {
+ super(id);
+}
+
+public boolean lockBeforeDate(NSDate limit) {
+ return OS.objc_msgSend(this.id, OS.sel_lockBeforeDate_1, limit != null ? limit.id : 0) != 0;
+}
+
+public NSString name() {
+ int result = OS.objc_msgSend(this.id, OS.sel_name);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void setName(NSString n) {
+ OS.objc_msgSend(this.id, OS.sel_setName_1, n != null ? n.id : 0);
+}
+
+public boolean tryLock() {
+ return OS.objc_msgSend(this.id, OS.sel_tryLock) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRelativeSpecifier.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRelativeSpecifier.java
new file mode 100644
index 0000000000..e7888ed7fc
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRelativeSpecifier.java
@@ -0,0 +1,35 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSRelativeSpecifier extends NSScriptObjectSpecifier {
+
+public NSRelativeSpecifier() {
+ super();
+}
+
+public NSRelativeSpecifier(int id) {
+ super(id);
+}
+
+public NSScriptObjectSpecifier baseSpecifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_baseSpecifier);
+ return result != 0 ? new NSScriptObjectSpecifier(result) : null;
+}
+
+public id initWithContainerClassDescription(NSScriptClassDescription classDesc, NSScriptObjectSpecifier container, NSString property, int relPos, NSScriptObjectSpecifier baseSpecifier) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContainerClassDescription_1containerSpecifier_1key_1relativePosition_1baseSpecifier_1, classDesc != null ? classDesc.id : 0, container != null ? container.id : 0, property != null ? property.id : 0, relPos, baseSpecifier != null ? baseSpecifier.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public int relativePosition() {
+ return OS.objc_msgSend(this.id, OS.sel_relativePosition);
+}
+
+public void setBaseSpecifier(NSScriptObjectSpecifier baseSpecifier) {
+ OS.objc_msgSend(this.id, OS.sel_setBaseSpecifier_1, baseSpecifier != null ? baseSpecifier.id : 0);
+}
+
+public void setRelativePosition(int relPos) {
+ OS.objc_msgSend(this.id, OS.sel_setRelativePosition_1, relPos);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSResponder.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSResponder.java
new file mode 100644
index 0000000000..c4cae3e03c
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSResponder.java
@@ -0,0 +1,466 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSResponder extends NSObject {
+
+public NSResponder() {
+ super();
+}
+
+public NSResponder(int id) {
+ super(id);
+}
+
+public boolean acceptsFirstResponder() {
+ return OS.objc_msgSend(this.id, OS.sel_acceptsFirstResponder) != 0;
+}
+
+public boolean becomeFirstResponder() {
+ return OS.objc_msgSend(this.id, OS.sel_becomeFirstResponder) != 0;
+}
+
+public void cancelOperation(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_cancelOperation_1, sender != null ? sender.id : 0);
+}
+
+public void capitalizeWord(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_capitalizeWord_1, sender != null ? sender.id : 0);
+}
+
+public void centerSelectionInVisibleArea(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_centerSelectionInVisibleArea_1, sender != null ? sender.id : 0);
+}
+
+public void changeCaseOfLetter(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_changeCaseOfLetter_1, sender != null ? sender.id : 0);
+}
+
+public void complete(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_complete_1, sender != null ? sender.id : 0);
+}
+
+public void cursorUpdate(NSEvent event) {
+ OS.objc_msgSend(this.id, OS.sel_cursorUpdate_1, event != null ? event.id : 0);
+}
+
+public void deleteBackward(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_deleteBackward_1, sender != null ? sender.id : 0);
+}
+
+public void deleteBackwardByDecomposingPreviousCharacter(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_deleteBackwardByDecomposingPreviousCharacter_1, sender != null ? sender.id : 0);
+}
+
+public void deleteForward(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_deleteForward_1, sender != null ? sender.id : 0);
+}
+
+public void deleteToBeginningOfLine(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_deleteToBeginningOfLine_1, sender != null ? sender.id : 0);
+}
+
+public void deleteToBeginningOfParagraph(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_deleteToBeginningOfParagraph_1, sender != null ? sender.id : 0);
+}
+
+public void deleteToEndOfLine(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_deleteToEndOfLine_1, sender != null ? sender.id : 0);
+}
+
+public void deleteToEndOfParagraph(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_deleteToEndOfParagraph_1, sender != null ? sender.id : 0);
+}
+
+public void deleteToMark(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_deleteToMark_1, sender != null ? sender.id : 0);
+}
+
+public void deleteWordBackward(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_deleteWordBackward_1, sender != null ? sender.id : 0);
+}
+
+public void deleteWordForward(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_deleteWordForward_1, sender != null ? sender.id : 0);
+}
+
+public void doCommandBySelector(int aSelector) {
+ OS.objc_msgSend(this.id, OS.sel_doCommandBySelector_1, aSelector);
+}
+
+public void flagsChanged(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_flagsChanged_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void flushBufferedKeyEvents() {
+ OS.objc_msgSend(this.id, OS.sel_flushBufferedKeyEvents);
+}
+
+public void helpRequested(NSEvent eventPtr) {
+ OS.objc_msgSend(this.id, OS.sel_helpRequested_1, eventPtr != null ? eventPtr.id : 0);
+}
+
+public void indent(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_indent_1, sender != null ? sender.id : 0);
+}
+
+public void insertBacktab(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_insertBacktab_1, sender != null ? sender.id : 0);
+}
+
+public void insertContainerBreak(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_insertContainerBreak_1, sender != null ? sender.id : 0);
+}
+
+public void insertLineBreak(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_insertLineBreak_1, sender != null ? sender.id : 0);
+}
+
+public void insertNewline(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_insertNewline_1, sender != null ? sender.id : 0);
+}
+
+public void insertNewlineIgnoringFieldEditor(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_insertNewlineIgnoringFieldEditor_1, sender != null ? sender.id : 0);
+}
+
+public void insertParagraphSeparator(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_insertParagraphSeparator_1, sender != null ? sender.id : 0);
+}
+
+public void insertTab(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_insertTab_1, sender != null ? sender.id : 0);
+}
+
+public void insertTabIgnoringFieldEditor(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_insertTabIgnoringFieldEditor_1, sender != null ? sender.id : 0);
+}
+
+public void insertText(id insertString) {
+ OS.objc_msgSend(this.id, OS.sel_insertText_1, insertString != null ? insertString.id : 0);
+}
+
+public int interfaceStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_interfaceStyle);
+}
+
+public void interpretKeyEvents(NSArray eventArray) {
+ OS.objc_msgSend(this.id, OS.sel_interpretKeyEvents_1, eventArray != null ? eventArray.id : 0);
+}
+
+public void keyDown(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_keyDown_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void keyUp(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_keyUp_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void lowercaseWord(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_lowercaseWord_1, sender != null ? sender.id : 0);
+}
+
+public NSMenu menu() {
+ int result = OS.objc_msgSend(this.id, OS.sel_menu);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+public void mouseDown(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_mouseDown_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void mouseDragged(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_mouseDragged_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void mouseEntered(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_mouseEntered_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void mouseExited(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_mouseExited_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void mouseMoved(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_mouseMoved_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void mouseUp(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_mouseUp_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void moveBackward(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveBackward_1, sender != null ? sender.id : 0);
+}
+
+public void moveBackwardAndModifySelection(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveBackwardAndModifySelection_1, sender != null ? sender.id : 0);
+}
+
+public void moveDown(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveDown_1, sender != null ? sender.id : 0);
+}
+
+public void moveDownAndModifySelection(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveDownAndModifySelection_1, sender != null ? sender.id : 0);
+}
+
+public void moveForward(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveForward_1, sender != null ? sender.id : 0);
+}
+
+public void moveForwardAndModifySelection(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveForwardAndModifySelection_1, sender != null ? sender.id : 0);
+}
+
+public void moveLeft(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveLeft_1, sender != null ? sender.id : 0);
+}
+
+public void moveLeftAndModifySelection(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveLeftAndModifySelection_1, sender != null ? sender.id : 0);
+}
+
+public void moveRight(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveRight_1, sender != null ? sender.id : 0);
+}
+
+public void moveRightAndModifySelection(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveRightAndModifySelection_1, sender != null ? sender.id : 0);
+}
+
+public void moveToBeginningOfDocument(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveToBeginningOfDocument_1, sender != null ? sender.id : 0);
+}
+
+public void moveToBeginningOfLine(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveToBeginningOfLine_1, sender != null ? sender.id : 0);
+}
+
+public void moveToBeginningOfParagraph(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveToBeginningOfParagraph_1, sender != null ? sender.id : 0);
+}
+
+public void moveToEndOfDocument(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveToEndOfDocument_1, sender != null ? sender.id : 0);
+}
+
+public void moveToEndOfLine(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveToEndOfLine_1, sender != null ? sender.id : 0);
+}
+
+public void moveToEndOfParagraph(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveToEndOfParagraph_1, sender != null ? sender.id : 0);
+}
+
+public void moveUp(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveUp_1, sender != null ? sender.id : 0);
+}
+
+public void moveUpAndModifySelection(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveUpAndModifySelection_1, sender != null ? sender.id : 0);
+}
+
+public void moveWordBackward(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveWordBackward_1, sender != null ? sender.id : 0);
+}
+
+public void moveWordBackwardAndModifySelection(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveWordBackwardAndModifySelection_1, sender != null ? sender.id : 0);
+}
+
+public void moveWordForward(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveWordForward_1, sender != null ? sender.id : 0);
+}
+
+public void moveWordForwardAndModifySelection(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveWordForwardAndModifySelection_1, sender != null ? sender.id : 0);
+}
+
+public void moveWordLeft(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveWordLeft_1, sender != null ? sender.id : 0);
+}
+
+public void moveWordLeftAndModifySelection(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveWordLeftAndModifySelection_1, sender != null ? sender.id : 0);
+}
+
+public void moveWordRight(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveWordRight_1, sender != null ? sender.id : 0);
+}
+
+public void moveWordRightAndModifySelection(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_moveWordRightAndModifySelection_1, sender != null ? sender.id : 0);
+}
+
+public NSResponder nextResponder() {
+ int result = OS.objc_msgSend(this.id, OS.sel_nextResponder);
+ return result == this.id ? this : (result != 0 ? new NSResponder(result) : null);
+}
+
+public void noResponderFor(int eventSelector) {
+ OS.objc_msgSend(this.id, OS.sel_noResponderFor_1, eventSelector);
+}
+
+public void otherMouseDown(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_otherMouseDown_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void otherMouseDragged(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_otherMouseDragged_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void otherMouseUp(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_otherMouseUp_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void pageDown(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_pageDown_1, sender != null ? sender.id : 0);
+}
+
+public void pageUp(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_pageUp_1, sender != null ? sender.id : 0);
+}
+
+public boolean performKeyEquivalent(NSEvent theEvent) {
+ return OS.objc_msgSend(this.id, OS.sel_performKeyEquivalent_1, theEvent != null ? theEvent.id : 0) != 0;
+}
+
+public boolean performMnemonic(NSString theString) {
+ return OS.objc_msgSend(this.id, OS.sel_performMnemonic_1, theString != null ? theString.id : 0) != 0;
+}
+
+public boolean presentError_(NSError error) {
+ return OS.objc_msgSend(this.id, OS.sel_presentError_1, error != null ? error.id : 0) != 0;
+}
+
+public void presentError_modalForWindow_delegate_didPresentSelector_contextInfo_(NSError error, NSWindow window, id delegate, int didPresentSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_presentError_1modalForWindow_1delegate_1didPresentSelector_1contextInfo_1, error != null ? error.id : 0, window != null ? window.id : 0, delegate != null ? delegate.id : 0, didPresentSelector, contextInfo);
+}
+
+public boolean resignFirstResponder() {
+ return OS.objc_msgSend(this.id, OS.sel_resignFirstResponder) != 0;
+}
+
+public void rightMouseDown(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_rightMouseDown_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void rightMouseDragged(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_rightMouseDragged_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void rightMouseUp(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_rightMouseUp_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void scrollLineDown(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_scrollLineDown_1, sender != null ? sender.id : 0);
+}
+
+public void scrollLineUp(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_scrollLineUp_1, sender != null ? sender.id : 0);
+}
+
+public void scrollPageDown(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_scrollPageDown_1, sender != null ? sender.id : 0);
+}
+
+public void scrollPageUp(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_scrollPageUp_1, sender != null ? sender.id : 0);
+}
+
+public void scrollWheel(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_scrollWheel_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void selectAll(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectAll_1, sender != null ? sender.id : 0);
+}
+
+public void selectLine(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectLine_1, sender != null ? sender.id : 0);
+}
+
+public void selectParagraph(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectParagraph_1, sender != null ? sender.id : 0);
+}
+
+public void selectToMark(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectToMark_1, sender != null ? sender.id : 0);
+}
+
+public void selectWord(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectWord_1, sender != null ? sender.id : 0);
+}
+
+public void setInterfaceStyle(int interfaceStyle) {
+ OS.objc_msgSend(this.id, OS.sel_setInterfaceStyle_1, interfaceStyle);
+}
+
+public void setMark(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_setMark_1, sender != null ? sender.id : 0);
+}
+
+public void setMenu(NSMenu menu) {
+ OS.objc_msgSend(this.id, OS.sel_setMenu_1, menu != null ? menu.id : 0);
+}
+
+public void setNextResponder(NSResponder aResponder) {
+ OS.objc_msgSend(this.id, OS.sel_setNextResponder_1, aResponder != null ? aResponder.id : 0);
+}
+
+public boolean shouldBeTreatedAsInkEvent(NSEvent theEvent) {
+ return OS.objc_msgSend(this.id, OS.sel_shouldBeTreatedAsInkEvent_1, theEvent != null ? theEvent.id : 0) != 0;
+}
+
+public void showContextHelp(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_showContextHelp_1, sender != null ? sender.id : 0);
+}
+
+public void swapWithMark(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_swapWithMark_1, sender != null ? sender.id : 0);
+}
+
+public void tabletPoint(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_tabletPoint_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void tabletProximity(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_tabletProximity_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void transpose(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_transpose_1, sender != null ? sender.id : 0);
+}
+
+public void transposeWords(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_transposeWords_1, sender != null ? sender.id : 0);
+}
+
+public boolean tryToPerform(int anAction, id anObject) {
+ return OS.objc_msgSend(this.id, OS.sel_tryToPerform_1with_1, anAction, anObject != null ? anObject.id : 0) != 0;
+}
+
+public NSUndoManager undoManager() {
+ int result = OS.objc_msgSend(this.id, OS.sel_undoManager);
+ return result != 0 ? new NSUndoManager(result) : null;
+}
+
+public void uppercaseWord(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_uppercaseWord_1, sender != null ? sender.id : 0);
+}
+
+public id validRequestorForSendType(NSString sendType, NSString returnType) {
+ int result = OS.objc_msgSend(this.id, OS.sel_validRequestorForSendType_1returnType_1, sendType != null ? sendType.id : 0, returnType != null ? returnType.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSError willPresentError(NSError error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_willPresentError_1, error != null ? error.id : 0);
+ return result != 0 ? new NSError(result) : null;
+}
+
+public void yank(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_yank_1, sender != null ? sender.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRuleEditor.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRuleEditor.java
new file mode 100644
index 0000000000..6b10cba1c8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRuleEditor.java
@@ -0,0 +1,194 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSRuleEditor extends NSControl {
+
+public NSRuleEditor() {
+ super();
+}
+
+public NSRuleEditor(int id) {
+ super(id);
+}
+
+public void addRow(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_addRow_1, sender != null ? sender.id : 0);
+}
+
+public boolean canRemoveAllRows() {
+ return OS.objc_msgSend(this.id, OS.sel_canRemoveAllRows) != 0;
+}
+
+public NSArray criteriaForRow(int row) {
+ int result = OS.objc_msgSend(this.id, OS.sel_criteriaForRow_1, row);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString criteriaKeyPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_criteriaKeyPath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSArray displayValuesForRow(int row) {
+ int result = OS.objc_msgSend(this.id, OS.sel_displayValuesForRow_1, row);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString displayValuesKeyPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_displayValuesKeyPath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSDictionary formattingDictionary() {
+ int result = OS.objc_msgSend(this.id, OS.sel_formattingDictionary);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSString formattingStringsFilename() {
+ int result = OS.objc_msgSend(this.id, OS.sel_formattingStringsFilename);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void insertRowAtIndex(int rowIndex, int rowType, int parentRow, boolean shouldAnimate) {
+ OS.objc_msgSend(this.id, OS.sel_insertRowAtIndex_1withType_1asSubrowOfRow_1animate_1, rowIndex, rowType, parentRow, shouldAnimate);
+}
+
+public boolean isEditable() {
+ return OS.objc_msgSend(this.id, OS.sel_isEditable) != 0;
+}
+
+public int nestingMode() {
+ return OS.objc_msgSend(this.id, OS.sel_nestingMode);
+}
+
+public int numberOfRows() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfRows);
+}
+
+public int parentRowForRow(int rowIndex) {
+ return OS.objc_msgSend(this.id, OS.sel_parentRowForRow_1, rowIndex);
+}
+
+public NSPredicate predicate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_predicate);
+ return result != 0 ? new NSPredicate(result) : null;
+}
+
+public NSPredicate predicateForRow(int row) {
+ int result = OS.objc_msgSend(this.id, OS.sel_predicateForRow_1, row);
+ return result != 0 ? new NSPredicate(result) : null;
+}
+
+public void reloadCriteria() {
+ OS.objc_msgSend(this.id, OS.sel_reloadCriteria);
+}
+
+public void reloadPredicate() {
+ OS.objc_msgSend(this.id, OS.sel_reloadPredicate);
+}
+
+public void removeRowAtIndex(int rowIndex) {
+ OS.objc_msgSend(this.id, OS.sel_removeRowAtIndex_1, rowIndex);
+}
+
+public void removeRowsAtIndexes(NSIndexSet rowIndexes, boolean includeSubrows) {
+ OS.objc_msgSend(this.id, OS.sel_removeRowsAtIndexes_1includeSubrows_1, rowIndexes != null ? rowIndexes.id : 0, includeSubrows);
+}
+
+public int rowClass() {
+ return OS.objc_msgSend(this.id, OS.sel_rowClass);
+}
+
+public int rowForDisplayValue(id displayValue) {
+ return OS.objc_msgSend(this.id, OS.sel_rowForDisplayValue_1, displayValue != null ? displayValue.id : 0);
+}
+
+public float rowHeight() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_rowHeight);
+}
+
+public int rowTypeForRow(int rowIndex) {
+ return OS.objc_msgSend(this.id, OS.sel_rowTypeForRow_1, rowIndex);
+}
+
+public NSString rowTypeKeyPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_rowTypeKeyPath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void selectRowIndexes(NSIndexSet indexes, boolean extend) {
+ OS.objc_msgSend(this.id, OS.sel_selectRowIndexes_1byExtendingSelection_1, indexes != null ? indexes.id : 0, extend);
+}
+
+public NSIndexSet selectedRowIndexes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedRowIndexes);
+ return result != 0 ? new NSIndexSet(result) : null;
+}
+
+public void setCanRemoveAllRows(boolean val) {
+ OS.objc_msgSend(this.id, OS.sel_setCanRemoveAllRows_1, val);
+}
+
+public void setCriteria(NSArray criteria, NSArray values, int rowIndex) {
+ OS.objc_msgSend(this.id, OS.sel_setCriteria_1andDisplayValues_1forRowAtIndex_1, criteria != null ? criteria.id : 0, values != null ? values.id : 0, rowIndex);
+}
+
+public void setCriteriaKeyPath(NSString keyPath) {
+ OS.objc_msgSend(this.id, OS.sel_setCriteriaKeyPath_1, keyPath != null ? keyPath.id : 0);
+}
+
+public void setDelegate(id delegate) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegate != null ? delegate.id : 0);
+}
+
+public void setDisplayValuesKeyPath(NSString keyPath) {
+ OS.objc_msgSend(this.id, OS.sel_setDisplayValuesKeyPath_1, keyPath != null ? keyPath.id : 0);
+}
+
+public void setEditable(boolean editable) {
+ OS.objc_msgSend(this.id, OS.sel_setEditable_1, editable);
+}
+
+public void setFormattingDictionary(NSDictionary dictionary) {
+ OS.objc_msgSend(this.id, OS.sel_setFormattingDictionary_1, dictionary != null ? dictionary.id : 0);
+}
+
+public void setFormattingStringsFilename(NSString stringsFilename) {
+ OS.objc_msgSend(this.id, OS.sel_setFormattingStringsFilename_1, stringsFilename != null ? stringsFilename.id : 0);
+}
+
+public void setNestingMode(int mode) {
+ OS.objc_msgSend(this.id, OS.sel_setNestingMode_1, mode);
+}
+
+public void setRowClass(int rowClass) {
+ OS.objc_msgSend(this.id, OS.sel_setRowClass_1, rowClass);
+}
+
+public void setRowHeight(float height) {
+ OS.objc_msgSend(this.id, OS.sel_setRowHeight_1, height);
+}
+
+public void setRowTypeKeyPath(NSString keyPath) {
+ OS.objc_msgSend(this.id, OS.sel_setRowTypeKeyPath_1, keyPath != null ? keyPath.id : 0);
+}
+
+public void setSubrowsKeyPath(NSString keyPath) {
+ OS.objc_msgSend(this.id, OS.sel_setSubrowsKeyPath_1, keyPath != null ? keyPath.id : 0);
+}
+
+public NSIndexSet subrowIndexesForRow(int rowIndex) {
+ int result = OS.objc_msgSend(this.id, OS.sel_subrowIndexesForRow_1, rowIndex);
+ return result != 0 ? new NSIndexSet(result) : null;
+}
+
+public NSString subrowsKeyPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_subrowsKeyPath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRulerMarker.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRulerMarker.java
new file mode 100644
index 0000000000..271beacd21
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRulerMarker.java
@@ -0,0 +1,97 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSRulerMarker extends NSObject {
+
+public NSRulerMarker() {
+ super();
+}
+
+public NSRulerMarker(int id) {
+ super(id);
+}
+
+public void drawRect(NSRect rect) {
+ OS.objc_msgSend(this.id, OS.sel_drawRect_1, rect);
+}
+
+public NSImage image() {
+ int result = OS.objc_msgSend(this.id, OS.sel_image);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public NSPoint imageOrigin() {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_imageOrigin);
+ return result;
+}
+
+public NSRect imageRectInRuler() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_imageRectInRuler);
+ return result;
+}
+
+public id initWithRulerView(NSRulerView ruler, float location, NSImage image, NSPoint imageOrigin) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithRulerView_1markerLocation_1image_1imageOrigin_1, ruler != null ? ruler.id : 0, location, image != null ? image.id : 0, imageOrigin);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isDragging() {
+ return OS.objc_msgSend(this.id, OS.sel_isDragging) != 0;
+}
+
+public boolean isMovable() {
+ return OS.objc_msgSend(this.id, OS.sel_isMovable) != 0;
+}
+
+public boolean isRemovable() {
+ return OS.objc_msgSend(this.id, OS.sel_isRemovable) != 0;
+}
+
+public float markerLocation() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_markerLocation);
+}
+
+public id representedObject() {
+ int result = OS.objc_msgSend(this.id, OS.sel_representedObject);
+ return result != 0 ? new id (result) : null;
+}
+
+public NSRulerView ruler() {
+ int result = OS.objc_msgSend(this.id, OS.sel_ruler);
+ return result != 0 ? new NSRulerView(result) : null;
+}
+
+public void setImage(NSImage image) {
+ OS.objc_msgSend(this.id, OS.sel_setImage_1, image != null ? image.id : 0);
+}
+
+public void setImageOrigin(NSPoint imageOrigin) {
+ OS.objc_msgSend(this.id, OS.sel_setImageOrigin_1, imageOrigin);
+}
+
+public void setMarkerLocation(float location) {
+ OS.objc_msgSend(this.id, OS.sel_setMarkerLocation_1, location);
+}
+
+public void setMovable(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setMovable_1, flag);
+}
+
+public void setRemovable(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setRemovable_1, flag);
+}
+
+public void setRepresentedObject(id representedObject) {
+ OS.objc_msgSend(this.id, OS.sel_setRepresentedObject_1, representedObject != null ? representedObject.id : 0);
+}
+
+public float thicknessRequiredInRuler() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_thicknessRequiredInRuler);
+}
+
+public boolean trackMouse(NSEvent mouseDownEvent, boolean isAdding) {
+ return OS.objc_msgSend(this.id, OS.sel_trackMouse_1adding_1, mouseDownEvent != null ? mouseDownEvent.id : 0, isAdding) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRulerView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRulerView.java
new file mode 100644
index 0000000000..913eb3f8e3
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRulerView.java
@@ -0,0 +1,147 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSRulerView extends NSView {
+
+public NSRulerView() {
+ super();
+}
+
+public NSRulerView(int id) {
+ super(id);
+}
+
+public NSView accessoryView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_accessoryView);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public void addMarker(NSRulerMarker marker) {
+ OS.objc_msgSend(this.id, OS.sel_addMarker_1, marker != null ? marker.id : 0);
+}
+
+public float baselineLocation() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_baselineLocation);
+}
+
+public NSView clientView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_clientView);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public void drawHashMarksAndLabelsInRect(NSRect rect) {
+ OS.objc_msgSend(this.id, OS.sel_drawHashMarksAndLabelsInRect_1, rect);
+}
+
+public void drawMarkersInRect(NSRect rect) {
+ OS.objc_msgSend(this.id, OS.sel_drawMarkersInRect_1, rect);
+}
+
+public NSRulerView initWithScrollView(NSScrollView scrollView, int orientation) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithScrollView_1orientation_1, scrollView != null ? scrollView.id : 0, orientation);
+ return result != 0 ? this : null;
+}
+
+public void invalidateHashMarks() {
+ OS.objc_msgSend(this.id, OS.sel_invalidateHashMarks);
+}
+
+public boolean isFlipped() {
+ return OS.objc_msgSend(this.id, OS.sel_isFlipped) != 0;
+}
+
+public NSArray markers() {
+ int result = OS.objc_msgSend(this.id, OS.sel_markers);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString measurementUnits() {
+ int result = OS.objc_msgSend(this.id, OS.sel_measurementUnits);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void moveRulerlineFromLocation(float oldLocation, float newLocation) {
+ OS.objc_msgSend(this.id, OS.sel_moveRulerlineFromLocation_1toLocation_1, oldLocation, newLocation);
+}
+
+public int orientation() {
+ return OS.objc_msgSend(this.id, OS.sel_orientation);
+}
+
+public float originOffset() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_originOffset);
+}
+
+public static void registerUnitWithName(NSString unitName, NSString abbreviation, float conversionFactor, NSArray stepUpCycle, NSArray stepDownCycle) {
+ OS.objc_msgSend(OS.class_NSRulerView, OS.sel_registerUnitWithName_1abbreviation_1unitToPointsConversionFactor_1stepUpCycle_1stepDownCycle_1, unitName != null ? unitName.id : 0, abbreviation != null ? abbreviation.id : 0, conversionFactor, stepUpCycle != null ? stepUpCycle.id : 0, stepDownCycle != null ? stepDownCycle.id : 0);
+}
+
+public void removeMarker(NSRulerMarker marker) {
+ OS.objc_msgSend(this.id, OS.sel_removeMarker_1, marker != null ? marker.id : 0);
+}
+
+public float requiredThickness() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_requiredThickness);
+}
+
+public float reservedThicknessForAccessoryView() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_reservedThicknessForAccessoryView);
+}
+
+public float reservedThicknessForMarkers() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_reservedThicknessForMarkers);
+}
+
+public float ruleThickness() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_ruleThickness);
+}
+
+public NSScrollView scrollView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_scrollView);
+ return result != 0 ? new NSScrollView(result) : null;
+}
+
+public void setAccessoryView(NSView accessory) {
+ OS.objc_msgSend(this.id, OS.sel_setAccessoryView_1, accessory != null ? accessory.id : 0);
+}
+
+public void setClientView(NSView client) {
+ OS.objc_msgSend(this.id, OS.sel_setClientView_1, client != null ? client.id : 0);
+}
+
+public void setMarkers(NSArray markers) {
+ OS.objc_msgSend(this.id, OS.sel_setMarkers_1, markers != null ? markers.id : 0);
+}
+
+public void setMeasurementUnits(NSString unitName) {
+ OS.objc_msgSend(this.id, OS.sel_setMeasurementUnits_1, unitName != null ? unitName.id : 0);
+}
+
+public void setOrientation(int orientation) {
+ OS.objc_msgSend(this.id, OS.sel_setOrientation_1, orientation);
+}
+
+public void setOriginOffset(float offset) {
+ OS.objc_msgSend(this.id, OS.sel_setOriginOffset_1, offset);
+}
+
+public void setReservedThicknessForAccessoryView(float thickness) {
+ OS.objc_msgSend(this.id, OS.sel_setReservedThicknessForAccessoryView_1, thickness);
+}
+
+public void setReservedThicknessForMarkers(float thickness) {
+ OS.objc_msgSend(this.id, OS.sel_setReservedThicknessForMarkers_1, thickness);
+}
+
+public void setRuleThickness(float thickness) {
+ OS.objc_msgSend(this.id, OS.sel_setRuleThickness_1, thickness);
+}
+
+public void setScrollView(NSScrollView scrollView) {
+ OS.objc_msgSend(this.id, OS.sel_setScrollView_1, scrollView != null ? scrollView.id : 0);
+}
+
+public boolean trackMarker(NSRulerMarker marker, NSEvent event) {
+ return OS.objc_msgSend(this.id, OS.sel_trackMarker_1withMouseEvent_1, marker != null ? marker.id : 0, event != null ? event.id : 0) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRunLoop.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRunLoop.java
new file mode 100644
index 0000000000..ac313f1e34
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSRunLoop.java
@@ -0,0 +1,81 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSRunLoop extends NSObject {
+
+public NSRunLoop() {
+ super();
+}
+
+public NSRunLoop(int id) {
+ super(id);
+}
+
+public void acceptInputForMode(NSString mode, NSDate limitDate) {
+ OS.objc_msgSend(this.id, OS.sel_acceptInputForMode_1beforeDate_1, mode != null ? mode.id : 0, limitDate != null ? limitDate.id : 0);
+}
+
+public void addPort(NSPort aPort, NSString mode) {
+ OS.objc_msgSend(this.id, OS.sel_addPort_1forMode_1, aPort != null ? aPort.id : 0, mode != null ? mode.id : 0);
+}
+
+public void addTimer(NSTimer timer, NSString mode) {
+ OS.objc_msgSend(this.id, OS.sel_addTimer_1forMode_1, timer != null ? timer.id : 0, mode != null ? mode.id : 0);
+}
+
+public void cancelPerformSelector(int aSelector, id target, id arg) {
+ OS.objc_msgSend(this.id, OS.sel_cancelPerformSelector_1target_1argument_1, aSelector, target != null ? target.id : 0, arg != null ? arg.id : 0);
+}
+
+public void cancelPerformSelectorsWithTarget(id target) {
+ OS.objc_msgSend(this.id, OS.sel_cancelPerformSelectorsWithTarget_1, target != null ? target.id : 0);
+}
+
+public void configureAsServer() {
+ OS.objc_msgSend(this.id, OS.sel_configureAsServer);
+}
+
+public NSString currentMode() {
+ int result = OS.objc_msgSend(this.id, OS.sel_currentMode);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSRunLoop currentRunLoop() {
+ int result = OS.objc_msgSend(OS.class_NSRunLoop, OS.sel_currentRunLoop);
+ return result != 0 ? new NSRunLoop(result) : null;
+}
+
+public int getCFRunLoop() {
+ return OS.objc_msgSend(this.id, OS.sel_getCFRunLoop);
+}
+
+public NSDate limitDateForMode(NSString mode) {
+ int result = OS.objc_msgSend(this.id, OS.sel_limitDateForMode_1, mode != null ? mode.id : 0);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public static NSRunLoop mainRunLoop() {
+ int result = OS.objc_msgSend(OS.class_NSRunLoop, OS.sel_mainRunLoop);
+ return result != 0 ? new NSRunLoop(result) : null;
+}
+
+public void performSelector(int aSelector, id target, id arg, int order, NSArray modes) {
+ OS.objc_msgSend(this.id, OS.sel_performSelector_1target_1argument_1order_1modes_1, aSelector, target != null ? target.id : 0, arg != null ? arg.id : 0, order, modes != null ? modes.id : 0);
+}
+
+public void removePort(NSPort aPort, NSString mode) {
+ OS.objc_msgSend(this.id, OS.sel_removePort_1forMode_1, aPort != null ? aPort.id : 0, mode != null ? mode.id : 0);
+}
+
+public void run() {
+ OS.objc_msgSend(this.id, OS.sel_run);
+}
+
+public boolean runMode(NSString mode, NSDate limitDate) {
+ return OS.objc_msgSend(this.id, OS.sel_runMode_1beforeDate_1, mode != null ? mode.id : 0, limitDate != null ? limitDate.id : 0) != 0;
+}
+
+public void runUntilDate(NSDate limitDate) {
+ OS.objc_msgSend(this.id, OS.sel_runUntilDate_1, limitDate != null ? limitDate.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSavePanel.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSavePanel.java
new file mode 100644
index 0000000000..3be1e72870
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSavePanel.java
@@ -0,0 +1,181 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSavePanel extends NSPanel {
+
+public NSSavePanel() {
+ super();
+}
+
+public NSSavePanel(int id) {
+ super(id);
+}
+
+public NSURL URL() {
+ int result = OS.objc_msgSend(this.id, OS.sel_URL);
+ return result != 0 ? new NSURL(result) : null;
+}
+
+public NSView accessoryView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_accessoryView);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public NSArray allowedFileTypes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_allowedFileTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean allowsOtherFileTypes() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsOtherFileTypes) != 0;
+}
+
+public void beginSheetForDirectory(NSString path, NSString name, NSWindow docWindow, id delegate, int didEndSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_beginSheetForDirectory_1file_1modalForWindow_1modalDelegate_1didEndSelector_1contextInfo_1, path != null ? path.id : 0, name != null ? name.id : 0, docWindow != null ? docWindow.id : 0, delegate != null ? delegate.id : 0, didEndSelector, contextInfo);
+}
+
+public boolean canCreateDirectories() {
+ return OS.objc_msgSend(this.id, OS.sel_canCreateDirectories) != 0;
+}
+
+public boolean canSelectHiddenExtension() {
+ return OS.objc_msgSend(this.id, OS.sel_canSelectHiddenExtension) != 0;
+}
+
+public void cancel(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_cancel_1, sender != null ? sender.id : 0);
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString directory() {
+ int result = OS.objc_msgSend(this.id, OS.sel_directory);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString filename() {
+ int result = OS.objc_msgSend(this.id, OS.sel_filename);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean isExpanded() {
+ return OS.objc_msgSend(this.id, OS.sel_isExpanded) != 0;
+}
+
+public boolean isExtensionHidden() {
+ return OS.objc_msgSend(this.id, OS.sel_isExtensionHidden) != 0;
+}
+
+public NSString message() {
+ int result = OS.objc_msgSend(this.id, OS.sel_message);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString nameFieldLabel() {
+ int result = OS.objc_msgSend(this.id, OS.sel_nameFieldLabel);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void ok(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_ok_1, sender != null ? sender.id : 0);
+}
+
+public NSString prompt() {
+ int result = OS.objc_msgSend(this.id, OS.sel_prompt);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString requiredFileType() {
+ int result = OS.objc_msgSend(this.id, OS.sel_requiredFileType);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int runModal() {
+ return OS.objc_msgSend(this.id, OS.sel_runModal);
+}
+
+public int runModalForDirectory(NSString path, NSString name) {
+ return OS.objc_msgSend(this.id, OS.sel_runModalForDirectory_1file_1, path != null ? path.id : 0, name != null ? name.id : 0);
+}
+
+public static NSSavePanel savePanel() {
+ int result = OS.objc_msgSend(OS.class_NSSavePanel, OS.sel_savePanel);
+ return result != 0 ? new NSSavePanel(result) : null;
+}
+
+public void selectText(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectText_1, sender != null ? sender.id : 0);
+}
+
+public void setAccessoryView(NSView view) {
+ OS.objc_msgSend(this.id, OS.sel_setAccessoryView_1, view != null ? view.id : 0);
+}
+
+public void setAllowedFileTypes(NSArray types) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowedFileTypes_1, types != null ? types.id : 0);
+}
+
+public void setAllowsOtherFileTypes(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsOtherFileTypes_1, flag);
+}
+
+public void setCanCreateDirectories(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setCanCreateDirectories_1, flag);
+}
+
+public void setCanSelectHiddenExtension(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setCanSelectHiddenExtension_1, flag);
+}
+
+public void setDelegate(id delegate) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegate != null ? delegate.id : 0);
+}
+
+public void setDirectory(NSString path) {
+ OS.objc_msgSend(this.id, OS.sel_setDirectory_1, path != null ? path.id : 0);
+}
+
+public void setExtensionHidden(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setExtensionHidden_1, flag);
+}
+
+public void setMessage(NSString message) {
+ OS.objc_msgSend(this.id, OS.sel_setMessage_1, message != null ? message.id : 0);
+}
+
+public void setNameFieldLabel(NSString label) {
+ OS.objc_msgSend(this.id, OS.sel_setNameFieldLabel_1, label != null ? label.id : 0);
+}
+
+public void setPrompt(NSString prompt) {
+ OS.objc_msgSend(this.id, OS.sel_setPrompt_1, prompt != null ? prompt.id : 0);
+}
+
+public void setRequiredFileType(NSString type) {
+ OS.objc_msgSend(this.id, OS.sel_setRequiredFileType_1, type != null ? type.id : 0);
+}
+
+public void setTitle(NSString title) {
+ OS.objc_msgSend(this.id, OS.sel_setTitle_1, title != null ? title.id : 0);
+}
+
+public void setTreatsFilePackagesAsDirectories(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setTreatsFilePackagesAsDirectories_1, flag);
+}
+
+public NSString title() {
+ int result = OS.objc_msgSend(this.id, OS.sel_title);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean treatsFilePackagesAsDirectories() {
+ return OS.objc_msgSend(this.id, OS.sel_treatsFilePackagesAsDirectories) != 0;
+}
+
+public void validateVisibleColumns() {
+ OS.objc_msgSend(this.id, OS.sel_validateVisibleColumns);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScanner.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScanner.java
new file mode 100644
index 0000000000..a5a289083f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScanner.java
@@ -0,0 +1,127 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSScanner extends NSObject {
+
+public NSScanner() {
+ super();
+}
+
+public NSScanner(int id) {
+ super(id);
+}
+
+public boolean caseSensitive() {
+ return OS.objc_msgSend(this.id, OS.sel_caseSensitive) != 0;
+}
+
+public NSCharacterSet charactersToBeSkipped() {
+ int result = OS.objc_msgSend(this.id, OS.sel_charactersToBeSkipped);
+ return result != 0 ? new NSCharacterSet(result) : null;
+}
+
+public NSScanner initWithString(NSString string) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithString_1, string != null ? string.id : 0);
+ return result != 0 ? this : null;
+}
+
+public boolean isAtEnd() {
+ return OS.objc_msgSend(this.id, OS.sel_isAtEnd) != 0;
+}
+
+public id locale() {
+ int result = OS.objc_msgSend(this.id, OS.sel_locale);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id localizedScannerWithString(NSString string) {
+ int result = OS.objc_msgSend(OS.class_NSScanner, OS.sel_localizedScannerWithString_1, string != null ? string.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean scanCharactersFromSet(NSCharacterSet set, int value) {
+ return OS.objc_msgSend(this.id, OS.sel_scanCharactersFromSet_1intoString_1, set != null ? set.id : 0, value) != 0;
+}
+
+public boolean scanDecimal(int dcm) {
+ return OS.objc_msgSend(this.id, OS.sel_scanDecimal_1, dcm) != 0;
+}
+
+public boolean scanDouble(int value) {
+ return OS.objc_msgSend(this.id, OS.sel_scanDouble_1, value) != 0;
+}
+
+public boolean scanFloat(int value) {
+ return OS.objc_msgSend(this.id, OS.sel_scanFloat_1, value) != 0;
+}
+
+public boolean scanHexDouble(int result) {
+ return OS.objc_msgSend(this.id, OS.sel_scanHexDouble_1, result) != 0;
+}
+
+public boolean scanHexFloat(int result) {
+ return OS.objc_msgSend(this.id, OS.sel_scanHexFloat_1, result) != 0;
+}
+
+public boolean scanHexInt(int value) {
+ return OS.objc_msgSend(this.id, OS.sel_scanHexInt_1, value) != 0;
+}
+
+public boolean scanHexLongLong(int result) {
+ return OS.objc_msgSend(this.id, OS.sel_scanHexLongLong_1, result) != 0;
+}
+
+public boolean scanInt(int value) {
+ return OS.objc_msgSend(this.id, OS.sel_scanInt_1, value) != 0;
+}
+
+public boolean scanInteger(int value) {
+ return OS.objc_msgSend(this.id, OS.sel_scanInteger_1, value) != 0;
+}
+
+public int scanLocation() {
+ return OS.objc_msgSend(this.id, OS.sel_scanLocation);
+}
+
+public boolean scanLongLong(int value) {
+ return OS.objc_msgSend(this.id, OS.sel_scanLongLong_1, value) != 0;
+}
+
+public boolean scanString(NSString string, int value) {
+ return OS.objc_msgSend(this.id, OS.sel_scanString_1intoString_1, string != null ? string.id : 0, value) != 0;
+}
+
+public boolean scanUpToCharactersFromSet(NSCharacterSet set, int value) {
+ return OS.objc_msgSend(this.id, OS.sel_scanUpToCharactersFromSet_1intoString_1, set != null ? set.id : 0, value) != 0;
+}
+
+public boolean scanUpToString(NSString string, int value) {
+ return OS.objc_msgSend(this.id, OS.sel_scanUpToString_1intoString_1, string != null ? string.id : 0, value) != 0;
+}
+
+public static id scannerWithString(NSString string) {
+ int result = OS.objc_msgSend(OS.class_NSScanner, OS.sel_scannerWithString_1, string != null ? string.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void setCaseSensitive(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setCaseSensitive_1, flag);
+}
+
+public void setCharactersToBeSkipped(NSCharacterSet set) {
+ OS.objc_msgSend(this.id, OS.sel_setCharactersToBeSkipped_1, set != null ? set.id : 0);
+}
+
+public void setLocale(id locale) {
+ OS.objc_msgSend(this.id, OS.sel_setLocale_1, locale != null ? locale.id : 0);
+}
+
+public void setScanLocation(int pos) {
+ OS.objc_msgSend(this.id, OS.sel_setScanLocation_1, pos);
+}
+
+public NSString string() {
+ int result = OS.objc_msgSend(this.id, OS.sel_string);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScreen.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScreen.java
new file mode 100644
index 0000000000..fb98eabe19
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScreen.java
@@ -0,0 +1,57 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSScreen extends NSObject {
+
+public NSScreen() {
+ super();
+}
+
+public NSScreen(int id) {
+ super(id);
+}
+
+public static NSScreen deepestScreen() {
+ int result = OS.objc_msgSend(OS.class_NSScreen, OS.sel_deepestScreen);
+ return result != 0 ? new NSScreen(result) : null;
+}
+
+public int depth() {
+ return OS.objc_msgSend(this.id, OS.sel_depth);
+}
+
+public NSDictionary deviceDescription() {
+ int result = OS.objc_msgSend(this.id, OS.sel_deviceDescription);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSRect frame() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_frame);
+ return result;
+}
+
+public static NSScreen mainScreen() {
+ int result = OS.objc_msgSend(OS.class_NSScreen, OS.sel_mainScreen);
+ return result != 0 ? new NSScreen(result) : null;
+}
+
+public static NSArray screens() {
+ int result = OS.objc_msgSend(OS.class_NSScreen, OS.sel_screens);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public int supportedWindowDepths() {
+ return OS.objc_msgSend(this.id, OS.sel_supportedWindowDepths);
+}
+
+public float userSpaceScaleFactor() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_userSpaceScaleFactor);
+}
+
+public NSRect visibleFrame() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_visibleFrame);
+ return result;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptClassDescription.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptClassDescription.java
new file mode 100644
index 0000000000..4b4e67516e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptClassDescription.java
@@ -0,0 +1,107 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSScriptClassDescription extends NSClassDescription {
+
+public NSScriptClassDescription() {
+ super();
+}
+
+public NSScriptClassDescription(int id) {
+ super(id);
+}
+
+public int appleEventCode() {
+ return OS.objc_msgSend(this.id, OS.sel_appleEventCode);
+}
+
+public int appleEventCodeForKey(NSString key) {
+ return OS.objc_msgSend(this.id, OS.sel_appleEventCodeForKey_1, key != null ? key.id : 0);
+}
+
+//public static NSScriptClassDescription classDescriptionForClass(int aClass) {
+// int result = OS.objc_msgSend(OS.class_NSScriptClassDescription, OS.sel_classDescriptionForClass_1, aClass);
+// return result != 0 ? new NSScriptClassDescription(result) : null;
+//}
+
+public NSScriptClassDescription classDescriptionForKey(NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_classDescriptionForKey_1, key != null ? key.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSScriptClassDescription(result) : null);
+}
+
+public NSString className() {
+ int result = OS.objc_msgSend(this.id, OS.sel_className);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString defaultSubcontainerAttributeKey() {
+ int result = OS.objc_msgSend(this.id, OS.sel_defaultSubcontainerAttributeKey);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean hasOrderedToManyRelationshipForKey(NSString key) {
+ return OS.objc_msgSend(this.id, OS.sel_hasOrderedToManyRelationshipForKey_1, key != null ? key.id : 0) != 0;
+}
+
+public boolean hasPropertyForKey(NSString key) {
+ return OS.objc_msgSend(this.id, OS.sel_hasPropertyForKey_1, key != null ? key.id : 0) != 0;
+}
+
+public boolean hasReadablePropertyForKey(NSString key) {
+ return OS.objc_msgSend(this.id, OS.sel_hasReadablePropertyForKey_1, key != null ? key.id : 0) != 0;
+}
+
+public boolean hasWritablePropertyForKey(NSString key) {
+ return OS.objc_msgSend(this.id, OS.sel_hasWritablePropertyForKey_1, key != null ? key.id : 0) != 0;
+}
+
+public NSString implementationClassName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_implementationClassName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id initWithSuiteName(NSString suiteName, NSString className, NSDictionary classDeclaration) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithSuiteName_1className_1dictionary_1, suiteName != null ? suiteName.id : 0, className != null ? className.id : 0, classDeclaration != null ? classDeclaration.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isLocationRequiredToCreateForKey(NSString toManyRelationshipKey) {
+ return OS.objc_msgSend(this.id, OS.sel_isLocationRequiredToCreateForKey_1, toManyRelationshipKey != null ? toManyRelationshipKey.id : 0) != 0;
+}
+
+public boolean isReadOnlyKey(NSString key) {
+ return OS.objc_msgSend(this.id, OS.sel_isReadOnlyKey_1, key != null ? key.id : 0) != 0;
+}
+
+public NSString keyWithAppleEventCode(int appleEventCode) {
+ int result = OS.objc_msgSend(this.id, OS.sel_keyWithAppleEventCode_1, appleEventCode);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean matchesAppleEventCode(int appleEventCode) {
+ return OS.objc_msgSend(this.id, OS.sel_matchesAppleEventCode_1, appleEventCode) != 0;
+}
+
+public int selectorForCommand(NSScriptCommandDescription commandDescription) {
+ return OS.objc_msgSend(this.id, OS.sel_selectorForCommand_1, commandDescription != null ? commandDescription.id : 0);
+}
+
+public NSString suiteName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_suiteName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSScriptClassDescription superclassDescription() {
+ int result = OS.objc_msgSend(this.id, OS.sel_superclassDescription);
+ return result == this.id ? this : (result != 0 ? new NSScriptClassDescription(result) : null);
+}
+
+public boolean supportsCommand(NSScriptCommandDescription commandDescription) {
+ return OS.objc_msgSend(this.id, OS.sel_supportsCommand_1, commandDescription != null ? commandDescription.id : 0) != 0;
+}
+
+public NSString typeForKey(NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_typeForKey_1, key != null ? key.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptCoercionHandler.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptCoercionHandler.java
new file mode 100644
index 0000000000..00a942923a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptCoercionHandler.java
@@ -0,0 +1,27 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSScriptCoercionHandler extends NSObject {
+
+public NSScriptCoercionHandler() {
+ super();
+}
+
+public NSScriptCoercionHandler(int id) {
+ super(id);
+}
+
+public id coerceValue(id value, int toClass) {
+ int result = OS.objc_msgSend(this.id, OS.sel_coerceValue_1toClass_1, value != null ? value.id : 0, toClass);
+ return result != 0 ? new id(result) : null;
+}
+
+public void registerCoercer(id coercer, int selector, int fromClass, int toClass) {
+ OS.objc_msgSend(this.id, OS.sel_registerCoercer_1selector_1toConvertFromClass_1toClass_1, coercer != null ? coercer.id : 0, selector, fromClass, toClass);
+}
+
+public static NSScriptCoercionHandler sharedCoercionHandler() {
+ int result = OS.objc_msgSend(OS.class_NSScriptCoercionHandler, OS.sel_sharedCoercionHandler);
+ return result != 0 ? new NSScriptCoercionHandler(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptCommand.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptCommand.java
new file mode 100644
index 0000000000..6e08d44d08
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptCommand.java
@@ -0,0 +1,127 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSScriptCommand extends NSObject {
+
+public NSScriptCommand() {
+ super();
+}
+
+public NSScriptCommand(int id) {
+ super(id);
+}
+
+public NSAppleEventDescriptor appleEvent() {
+ int result = OS.objc_msgSend(this.id, OS.sel_appleEvent);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public NSDictionary arguments() {
+ int result = OS.objc_msgSend(this.id, OS.sel_arguments);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSScriptCommandDescription commandDescription() {
+ int result = OS.objc_msgSend(this.id, OS.sel_commandDescription);
+ return result != 0 ? new NSScriptCommandDescription(result) : null;
+}
+
+public static NSScriptCommand currentCommand() {
+ int result = OS.objc_msgSend(OS.class_NSScriptCommand, OS.sel_currentCommand);
+ return result != 0 ? new NSScriptCommand(result) : null;
+}
+
+public id directParameter() {
+ int result = OS.objc_msgSend(this.id, OS.sel_directParameter);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSDictionary evaluatedArguments() {
+ int result = OS.objc_msgSend(this.id, OS.sel_evaluatedArguments);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public id evaluatedReceivers() {
+ int result = OS.objc_msgSend(this.id, OS.sel_evaluatedReceivers);
+ return result != 0 ? new id(result) : null;
+}
+
+public id executeCommand() {
+ int result = OS.objc_msgSend(this.id, OS.sel_executeCommand);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithCommandDescription(NSScriptCommandDescription commandDef) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCommandDescription_1, commandDef != null ? commandDef.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isWellFormed() {
+ return OS.objc_msgSend(this.id, OS.sel_isWellFormed) != 0;
+}
+
+public id performDefaultImplementation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_performDefaultImplementation);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSScriptObjectSpecifier receiversSpecifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_receiversSpecifier);
+ return result != 0 ? new NSScriptObjectSpecifier(result) : null;
+}
+
+public void resumeExecutionWithResult(id result) {
+ OS.objc_msgSend(this.id, OS.sel_resumeExecutionWithResult_1, result != null ? result.id : 0);
+}
+
+public NSAppleEventDescriptor scriptErrorExpectedTypeDescriptor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_scriptErrorExpectedTypeDescriptor);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public int scriptErrorNumber() {
+ return OS.objc_msgSend(this.id, OS.sel_scriptErrorNumber);
+}
+
+public NSAppleEventDescriptor scriptErrorOffendingObjectDescriptor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_scriptErrorOffendingObjectDescriptor);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public NSString scriptErrorString() {
+ int result = OS.objc_msgSend(this.id, OS.sel_scriptErrorString);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void setArguments(NSDictionary args) {
+ OS.objc_msgSend(this.id, OS.sel_setArguments_1, args != null ? args.id : 0);
+}
+
+public void setDirectParameter(id directParameter) {
+ OS.objc_msgSend(this.id, OS.sel_setDirectParameter_1, directParameter != null ? directParameter.id : 0);
+}
+
+public void setReceiversSpecifier(NSScriptObjectSpecifier receiversRef) {
+ OS.objc_msgSend(this.id, OS.sel_setReceiversSpecifier_1, receiversRef != null ? receiversRef.id : 0);
+}
+
+public void setScriptErrorExpectedTypeDescriptor(NSAppleEventDescriptor errorExpectedTypeDescriptor) {
+ OS.objc_msgSend(this.id, OS.sel_setScriptErrorExpectedTypeDescriptor_1, errorExpectedTypeDescriptor != null ? errorExpectedTypeDescriptor.id : 0);
+}
+
+public void setScriptErrorNumber(int errorNumber) {
+ OS.objc_msgSend(this.id, OS.sel_setScriptErrorNumber_1, errorNumber);
+}
+
+public void setScriptErrorOffendingObjectDescriptor(NSAppleEventDescriptor errorOffendingObjectDescriptor) {
+ OS.objc_msgSend(this.id, OS.sel_setScriptErrorOffendingObjectDescriptor_1, errorOffendingObjectDescriptor != null ? errorOffendingObjectDescriptor.id : 0);
+}
+
+public void setScriptErrorString(NSString errorString) {
+ OS.objc_msgSend(this.id, OS.sel_setScriptErrorString_1, errorString != null ? errorString.id : 0);
+}
+
+public void suspendExecution() {
+ OS.objc_msgSend(this.id, OS.sel_suspendExecution);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptCommandDescription.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptCommandDescription.java
new file mode 100644
index 0000000000..7dff334afd
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptCommandDescription.java
@@ -0,0 +1,78 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSScriptCommandDescription extends NSObject {
+
+public NSScriptCommandDescription() {
+ super();
+}
+
+public NSScriptCommandDescription(int id) {
+ super(id);
+}
+
+public int appleEventClassCode() {
+ return OS.objc_msgSend(this.id, OS.sel_appleEventClassCode);
+}
+
+public int appleEventCode() {
+ return OS.objc_msgSend(this.id, OS.sel_appleEventCode);
+}
+
+public int appleEventCodeForArgumentWithName(NSString argumentName) {
+ return OS.objc_msgSend(this.id, OS.sel_appleEventCodeForArgumentWithName_1, argumentName != null ? argumentName.id : 0);
+}
+
+public int appleEventCodeForReturnType() {
+ return OS.objc_msgSend(this.id, OS.sel_appleEventCodeForReturnType);
+}
+
+public NSArray argumentNames() {
+ int result = OS.objc_msgSend(this.id, OS.sel_argumentNames);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString commandClassName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_commandClassName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString commandName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_commandName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSScriptCommand createCommandInstance() {
+ int result = OS.objc_msgSend(this.id, OS.sel_createCommandInstance);
+ return result != 0 ? new NSScriptCommand(result) : null;
+}
+
+public NSScriptCommand createCommandInstanceWithZone(int zone) {
+ int result = OS.objc_msgSend(this.id, OS.sel_createCommandInstanceWithZone_1, zone);
+ return result != 0 ? new NSScriptCommand(result) : null;
+}
+
+public id initWithSuiteName(NSString suiteName, NSString commandName, NSDictionary commandDeclaration) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithSuiteName_1commandName_1dictionary_1, suiteName != null ? suiteName.id : 0, commandName != null ? commandName.id : 0, commandDeclaration != null ? commandDeclaration.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isOptionalArgumentWithName(NSString argumentName) {
+ return OS.objc_msgSend(this.id, OS.sel_isOptionalArgumentWithName_1, argumentName != null ? argumentName.id : 0) != 0;
+}
+
+public NSString returnType() {
+ int result = OS.objc_msgSend(this.id, OS.sel_returnType);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString suiteName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_suiteName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString typeForArgumentWithName(NSString argumentName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_typeForArgumentWithName_1, argumentName != null ? argumentName.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptExecutionContext.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptExecutionContext.java
new file mode 100644
index 0000000000..1322a7e982
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptExecutionContext.java
@@ -0,0 +1,45 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSScriptExecutionContext extends NSObject {
+
+public NSScriptExecutionContext() {
+ super();
+}
+
+public NSScriptExecutionContext(int id) {
+ super(id);
+}
+
+public id objectBeingTested() {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectBeingTested);
+ return result != 0 ? new id(result) : null;
+}
+
+public id rangeContainerObject() {
+ int result = OS.objc_msgSend(this.id, OS.sel_rangeContainerObject);
+ return result != 0 ? new id(result) : null;
+}
+
+public void setObjectBeingTested(id obj) {
+ OS.objc_msgSend(this.id, OS.sel_setObjectBeingTested_1, obj != null ? obj.id : 0);
+}
+
+public void setRangeContainerObject(id obj) {
+ OS.objc_msgSend(this.id, OS.sel_setRangeContainerObject_1, obj != null ? obj.id : 0);
+}
+
+public void setTopLevelObject(id obj) {
+ OS.objc_msgSend(this.id, OS.sel_setTopLevelObject_1, obj != null ? obj.id : 0);
+}
+
+public static NSScriptExecutionContext sharedScriptExecutionContext() {
+ int result = OS.objc_msgSend(OS.class_NSScriptExecutionContext, OS.sel_sharedScriptExecutionContext);
+ return result != 0 ? new NSScriptExecutionContext(result) : null;
+}
+
+public id topLevelObject() {
+ int result = OS.objc_msgSend(this.id, OS.sel_topLevelObject);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptObjectSpecifier.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptObjectSpecifier.java
new file mode 100644
index 0000000000..154f66aec1
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptObjectSpecifier.java
@@ -0,0 +1,117 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSScriptObjectSpecifier extends NSObject {
+
+public NSScriptObjectSpecifier() {
+ super();
+}
+
+public NSScriptObjectSpecifier(int id) {
+ super(id);
+}
+
+public NSScriptObjectSpecifier childSpecifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_childSpecifier);
+ return result == this.id ? this : (result != 0 ? new NSScriptObjectSpecifier(result) : null);
+}
+
+public NSScriptClassDescription containerClassDescription() {
+ int result = OS.objc_msgSend(this.id, OS.sel_containerClassDescription);
+ return result != 0 ? new NSScriptClassDescription(result) : null;
+}
+
+public boolean containerIsObjectBeingTested() {
+ return OS.objc_msgSend(this.id, OS.sel_containerIsObjectBeingTested) != 0;
+}
+
+public boolean containerIsRangeContainerObject() {
+ return OS.objc_msgSend(this.id, OS.sel_containerIsRangeContainerObject) != 0;
+}
+
+public NSScriptObjectSpecifier containerSpecifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_containerSpecifier);
+ return result == this.id ? this : (result != 0 ? new NSScriptObjectSpecifier(result) : null);
+}
+
+public NSAppleEventDescriptor descriptor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_descriptor);
+ return result != 0 ? new NSAppleEventDescriptor(result) : null;
+}
+
+public int evaluationErrorNumber() {
+ return OS.objc_msgSend(this.id, OS.sel_evaluationErrorNumber);
+}
+
+public NSScriptObjectSpecifier evaluationErrorSpecifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_evaluationErrorSpecifier);
+ return result == this.id ? this : (result != 0 ? new NSScriptObjectSpecifier(result) : null);
+}
+
+public int indicesOfObjectsByEvaluatingWithContainer(id container, int count) {
+ return OS.objc_msgSend(this.id, OS.sel_indicesOfObjectsByEvaluatingWithContainer_1count_1, container != null ? container.id : 0, count);
+}
+
+public id initWithContainerClassDescription(NSScriptClassDescription classDesc, NSScriptObjectSpecifier container, NSString property) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContainerClassDescription_1containerSpecifier_1key_1, classDesc != null ? classDesc.id : 0, container != null ? container.id : 0, property != null ? property.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithContainerSpecifier(NSScriptObjectSpecifier container, NSString property) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContainerSpecifier_1key_1, container != null ? container.id : 0, property != null ? property.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString key() {
+ int result = OS.objc_msgSend(this.id, OS.sel_key);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSScriptClassDescription keyClassDescription() {
+ int result = OS.objc_msgSend(this.id, OS.sel_keyClassDescription);
+ return result != 0 ? new NSScriptClassDescription(result) : null;
+}
+
+public static NSScriptObjectSpecifier objectSpecifierWithDescriptor(NSAppleEventDescriptor descriptor) {
+ int result = OS.objc_msgSend(OS.class_NSScriptObjectSpecifier, OS.sel_objectSpecifierWithDescriptor_1, descriptor != null ? descriptor.id : 0);
+ return result != 0 ? new NSScriptObjectSpecifier(result) : null;
+}
+
+public id objectsByEvaluatingSpecifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectsByEvaluatingSpecifier);
+ return result != 0 ? new id(result) : null;
+}
+
+public id objectsByEvaluatingWithContainers(id containers) {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectsByEvaluatingWithContainers_1, containers != null ? containers.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void setChildSpecifier(NSScriptObjectSpecifier child) {
+ OS.objc_msgSend(this.id, OS.sel_setChildSpecifier_1, child != null ? child.id : 0);
+}
+
+public void setContainerClassDescription(NSScriptClassDescription classDesc) {
+ OS.objc_msgSend(this.id, OS.sel_setContainerClassDescription_1, classDesc != null ? classDesc.id : 0);
+}
+
+public void setContainerIsObjectBeingTested(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setContainerIsObjectBeingTested_1, flag);
+}
+
+public void setContainerIsRangeContainerObject(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setContainerIsRangeContainerObject_1, flag);
+}
+
+public void setContainerSpecifier(NSScriptObjectSpecifier subRef) {
+ OS.objc_msgSend(this.id, OS.sel_setContainerSpecifier_1, subRef != null ? subRef.id : 0);
+}
+
+public void setEvaluationErrorNumber(int error) {
+ OS.objc_msgSend(this.id, OS.sel_setEvaluationErrorNumber_1, error);
+}
+
+public void setKey(NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_setKey_1, key != null ? key.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptSuiteRegistry.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptSuiteRegistry.java
new file mode 100644
index 0000000000..939995d65e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptSuiteRegistry.java
@@ -0,0 +1,82 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSScriptSuiteRegistry extends NSObject {
+
+public NSScriptSuiteRegistry() {
+ super();
+}
+
+public NSScriptSuiteRegistry(int id) {
+ super(id);
+}
+
+public NSData aeteResource(NSString languageName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_aeteResource_1, languageName != null ? languageName.id : 0);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public int appleEventCodeForSuite(NSString suiteName) {
+ return OS.objc_msgSend(this.id, OS.sel_appleEventCodeForSuite_1, suiteName != null ? suiteName.id : 0);
+}
+
+public NSBundle bundleForSuite(NSString suiteName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_bundleForSuite_1, suiteName != null ? suiteName.id : 0);
+ return result != 0 ? new NSBundle(result) : null;
+}
+
+public NSScriptClassDescription classDescriptionWithAppleEventCode(int appleEventCode) {
+ int result = OS.objc_msgSend(this.id, OS.sel_classDescriptionWithAppleEventCode_1, appleEventCode);
+ return result != 0 ? new NSScriptClassDescription(result) : null;
+}
+
+public NSDictionary classDescriptionsInSuite(NSString suiteName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_classDescriptionsInSuite_1, suiteName != null ? suiteName.id : 0);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSScriptCommandDescription commandDescriptionWithAppleEventClass(int appleEventClassCode, int appleEventIDCode) {
+ int result = OS.objc_msgSend(this.id, OS.sel_commandDescriptionWithAppleEventClass_1andAppleEventCode_1, appleEventClassCode, appleEventIDCode);
+ return result != 0 ? new NSScriptCommandDescription(result) : null;
+}
+
+public NSDictionary commandDescriptionsInSuite(NSString suiteName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_commandDescriptionsInSuite_1, suiteName != null ? suiteName.id : 0);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public void loadSuiteWithDictionary(NSDictionary suiteDeclaration, NSBundle bundle) {
+ OS.objc_msgSend(this.id, OS.sel_loadSuiteWithDictionary_1fromBundle_1, suiteDeclaration != null ? suiteDeclaration.id : 0, bundle != null ? bundle.id : 0);
+}
+
+public void loadSuitesFromBundle(NSBundle bundle) {
+ OS.objc_msgSend(this.id, OS.sel_loadSuitesFromBundle_1, bundle != null ? bundle.id : 0);
+}
+
+public void registerClassDescription(NSScriptClassDescription classDescription) {
+ OS.objc_msgSend(this.id, OS.sel_registerClassDescription_1, classDescription != null ? classDescription.id : 0);
+}
+
+public void registerCommandDescription(NSScriptCommandDescription commandDescription) {
+ OS.objc_msgSend(this.id, OS.sel_registerCommandDescription_1, commandDescription != null ? commandDescription.id : 0);
+}
+
+public static void setSharedScriptSuiteRegistry(NSScriptSuiteRegistry registry) {
+ OS.objc_msgSend(OS.class_NSScriptSuiteRegistry, OS.sel_setSharedScriptSuiteRegistry_1, registry != null ? registry.id : 0);
+}
+
+public static NSScriptSuiteRegistry sharedScriptSuiteRegistry() {
+ int result = OS.objc_msgSend(OS.class_NSScriptSuiteRegistry, OS.sel_sharedScriptSuiteRegistry);
+ return result != 0 ? new NSScriptSuiteRegistry(result) : null;
+}
+
+public NSString suiteForAppleEventCode(int appleEventCode) {
+ int result = OS.objc_msgSend(this.id, OS.sel_suiteForAppleEventCode_1, appleEventCode);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSArray suiteNames() {
+ int result = OS.objc_msgSend(this.id, OS.sel_suiteNames);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptWhoseTest.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptWhoseTest.java
new file mode 100644
index 0000000000..d74c1e7af1
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScriptWhoseTest.java
@@ -0,0 +1,17 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSScriptWhoseTest extends NSObject {
+
+public NSScriptWhoseTest() {
+ super();
+}
+
+public NSScriptWhoseTest(int id) {
+ super(id);
+}
+
+public boolean isTrue() {
+ return OS.objc_msgSend(this.id, OS.sel_isTrue) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScrollView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScrollView.java
new file mode 100644
index 0000000000..33b6d8cb9c
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScrollView.java
@@ -0,0 +1,249 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSScrollView extends NSView {
+
+public NSScrollView() {
+ super();
+}
+
+public NSScrollView(int id) {
+ super(id);
+}
+
+public boolean autohidesScrollers() {
+ return OS.objc_msgSend(this.id, OS.sel_autohidesScrollers) != 0;
+}
+
+public NSColor backgroundColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public int borderType() {
+ return OS.objc_msgSend(this.id, OS.sel_borderType);
+}
+
+public NSSize contentSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_struct(result, this.id, OS.sel_contentSize);
+ return result;
+}
+
+public static NSSize contentSizeForFrameSize(NSSize fSize, boolean hFlag, boolean vFlag, int aType) {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, OS.class_NSScrollView, OS.sel_contentSizeForFrameSize_1hasHorizontalScroller_1hasVerticalScroller_1borderType_1, fSize, hFlag, vFlag, aType);
+ return result;
+}
+
+public NSClipView contentView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_contentView);
+ return result != 0 ? new NSClipView(result) : null;
+}
+
+public NSCursor documentCursor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_documentCursor);
+ return result != 0 ? new NSCursor(result) : null;
+}
+
+public id documentView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_documentView);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSRect documentVisibleRect() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_documentVisibleRect);
+ return result;
+}
+
+public boolean drawsBackground() {
+ return OS.objc_msgSend(this.id, OS.sel_drawsBackground) != 0;
+}
+
+public static NSSize frameSizeForContentSize(NSSize cSize, boolean hFlag, boolean vFlag, int aType) {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_struct(result, OS.class_NSScrollView, OS.sel_frameSizeForContentSize_1hasHorizontalScroller_1hasVerticalScroller_1borderType_1, cSize, hFlag, vFlag, aType);
+ return result;
+}
+
+public boolean hasHorizontalRuler() {
+ return OS.objc_msgSend(this.id, OS.sel_hasHorizontalRuler) != 0;
+}
+
+public boolean hasHorizontalScroller() {
+ return OS.objc_msgSend(this.id, OS.sel_hasHorizontalScroller) != 0;
+}
+
+public boolean hasVerticalRuler() {
+ return OS.objc_msgSend(this.id, OS.sel_hasVerticalRuler) != 0;
+}
+
+public boolean hasVerticalScroller() {
+ return OS.objc_msgSend(this.id, OS.sel_hasVerticalScroller) != 0;
+}
+
+public float horizontalLineScroll() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_horizontalLineScroll);
+}
+
+public float horizontalPageScroll() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_horizontalPageScroll);
+}
+
+public NSRulerView horizontalRulerView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_horizontalRulerView);
+ return result != 0 ? new NSRulerView(result) : null;
+}
+
+public NSScroller horizontalScroller() {
+ int result = OS.objc_msgSend(this.id, OS.sel_horizontalScroller);
+ return result != 0 ? new NSScroller(result) : null;
+}
+
+public float lineScroll() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_lineScroll);
+}
+
+public float pageScroll() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_pageScroll);
+}
+
+public void reflectScrolledClipView(NSClipView cView) {
+ OS.objc_msgSend(this.id, OS.sel_reflectScrolledClipView_1, cView != null ? cView.id : 0);
+}
+
+public static int rulerViewClass() {
+ return OS.objc_msgSend(OS.class_NSScrollView, OS.sel_rulerViewClass);
+}
+
+public boolean rulersVisible() {
+ return OS.objc_msgSend(this.id, OS.sel_rulersVisible) != 0;
+}
+
+public void scrollWheel(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_scrollWheel_1, theEvent != null ? theEvent.id : 0);
+}
+
+public boolean scrollsDynamically() {
+ return OS.objc_msgSend(this.id, OS.sel_scrollsDynamically) != 0;
+}
+
+public void setAutohidesScrollers(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAutohidesScrollers_1, flag);
+}
+
+public void setBackgroundColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color != null ? color.id : 0);
+}
+
+public void setBorderType(int aType) {
+ OS.objc_msgSend(this.id, OS.sel_setBorderType_1, aType);
+}
+
+public void setContentView(NSClipView contentView) {
+ OS.objc_msgSend(this.id, OS.sel_setContentView_1, contentView != null ? contentView.id : 0);
+}
+
+public void setDocumentCursor(NSCursor anObj) {
+ OS.objc_msgSend(this.id, OS.sel_setDocumentCursor_1, anObj != null ? anObj.id : 0);
+}
+
+public void setDocumentView(NSView aView) {
+ OS.objc_msgSend(this.id, OS.sel_setDocumentView_1, aView != null ? aView.id : 0);
+}
+
+public void setDrawsBackground(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setDrawsBackground_1, flag);
+}
+
+public void setHasHorizontalRuler(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setHasHorizontalRuler_1, flag);
+}
+
+public void setHasHorizontalScroller(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setHasHorizontalScroller_1, flag);
+}
+
+public void setHasVerticalRuler(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setHasVerticalRuler_1, flag);
+}
+
+public void setHasVerticalScroller(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setHasVerticalScroller_1, flag);
+}
+
+public void setHorizontalLineScroll(float value) {
+ OS.objc_msgSend(this.id, OS.sel_setHorizontalLineScroll_1, value);
+}
+
+public void setHorizontalPageScroll(float value) {
+ OS.objc_msgSend(this.id, OS.sel_setHorizontalPageScroll_1, value);
+}
+
+public void setHorizontalRulerView(NSRulerView ruler) {
+ OS.objc_msgSend(this.id, OS.sel_setHorizontalRulerView_1, ruler != null ? ruler.id : 0);
+}
+
+public void setHorizontalScroller(NSScroller anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setHorizontalScroller_1, anObject != null ? anObject.id : 0);
+}
+
+public void setLineScroll(float value) {
+ OS.objc_msgSend(this.id, OS.sel_setLineScroll_1, value);
+}
+
+public void setPageScroll(float value) {
+ OS.objc_msgSend(this.id, OS.sel_setPageScroll_1, value);
+}
+
+public static void setRulerViewClass(int rulerViewClass) {
+ OS.objc_msgSend(OS.class_NSScrollView, OS.sel_setRulerViewClass_1, rulerViewClass);
+}
+
+public void setRulersVisible(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setRulersVisible_1, flag);
+}
+
+public void setScrollsDynamically(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setScrollsDynamically_1, flag);
+}
+
+public void setVerticalLineScroll(float value) {
+ OS.objc_msgSend(this.id, OS.sel_setVerticalLineScroll_1, value);
+}
+
+public void setVerticalPageScroll(float value) {
+ OS.objc_msgSend(this.id, OS.sel_setVerticalPageScroll_1, value);
+}
+
+public void setVerticalRulerView(NSRulerView ruler) {
+ OS.objc_msgSend(this.id, OS.sel_setVerticalRulerView_1, ruler != null ? ruler.id : 0);
+}
+
+public void setVerticalScroller(NSScroller anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setVerticalScroller_1, anObject != null ? anObject.id : 0);
+}
+
+public void tile() {
+ OS.objc_msgSend(this.id, OS.sel_tile);
+}
+
+public float verticalLineScroll() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_verticalLineScroll);
+}
+
+public float verticalPageScroll() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_verticalPageScroll);
+}
+
+public NSRulerView verticalRulerView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_verticalRulerView);
+ return result != 0 ? new NSRulerView(result) : null;
+}
+
+public NSScroller verticalScroller() {
+ int result = OS.objc_msgSend(this.id, OS.sel_verticalScroller);
+ return result != 0 ? new NSScroller(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScroller.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScroller.java
new file mode 100644
index 0000000000..18725bdf83
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSScroller.java
@@ -0,0 +1,107 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSScroller extends NSControl {
+
+public NSScroller() {
+ super();
+}
+
+public NSScroller(int id) {
+ super(id);
+}
+
+public int arrowsPosition() {
+ return OS.objc_msgSend(this.id, OS.sel_arrowsPosition);
+}
+
+public void checkSpaceForParts() {
+ OS.objc_msgSend(this.id, OS.sel_checkSpaceForParts);
+}
+
+public int controlSize() {
+ return OS.objc_msgSend(this.id, OS.sel_controlSize);
+}
+
+public int controlTint() {
+ return OS.objc_msgSend(this.id, OS.sel_controlTint);
+}
+
+public void drawArrow(int whichArrow, boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_drawArrow_1highlight_1, whichArrow, flag);
+}
+
+public void drawKnob() {
+ OS.objc_msgSend(this.id, OS.sel_drawKnob);
+}
+
+public void drawKnobSlotInRect(NSRect slotRect, boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_drawKnobSlotInRect_1highlight_1, slotRect, flag);
+}
+
+public void drawParts() {
+ OS.objc_msgSend(this.id, OS.sel_drawParts);
+}
+
+public void highlight(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_highlight_1, flag);
+}
+
+public int hitPart() {
+ return OS.objc_msgSend(this.id, OS.sel_hitPart);
+}
+
+public float knobProportion() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_knobProportion);
+}
+
+public NSRect rectForPart(int partCode) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rectForPart_1, partCode);
+ return result;
+}
+
+public static float scrollerWidth() {
+ return (float)OS.objc_msgSend_fpret(OS.class_NSScroller, OS.sel_scrollerWidth);
+}
+
+public static float scrollerWidthForControlSize(int controlSize) {
+ return (float)OS.objc_msgSend_fpret(OS.class_NSScroller, OS.sel_scrollerWidthForControlSize_1, controlSize);
+}
+
+public void setArrowsPosition(int where) {
+ OS.objc_msgSend(this.id, OS.sel_setArrowsPosition_1, where);
+}
+
+public void setControlSize(int controlSize) {
+ OS.objc_msgSend(this.id, OS.sel_setControlSize_1, controlSize);
+}
+
+public void setControlTint(int controlTint) {
+ OS.objc_msgSend(this.id, OS.sel_setControlTint_1, controlTint);
+}
+
+public void setFloatValue(float aFloat, float proportion) {
+ OS.objc_msgSend(this.id, OS.sel_setFloatValue_1knobProportion_1, aFloat, proportion);
+}
+
+public void setKnobProportion(float proportion) {
+ OS.objc_msgSend(this.id, OS.sel_setKnobProportion_1, proportion);
+}
+
+public int testPart(NSPoint thePoint) {
+ return OS.objc_msgSend(this.id, OS.sel_testPart_1, thePoint);
+}
+
+public void trackKnob(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_trackKnob_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void trackScrollButtons(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_trackScrollButtons_1, theEvent != null ? theEvent.id : 0);
+}
+
+public int usableParts() {
+ return OS.objc_msgSend(this.id, OS.sel_usableParts);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSearchField.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSearchField.java
new file mode 100644
index 0000000000..ea285701ce
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSearchField.java
@@ -0,0 +1,31 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSearchField extends NSTextField {
+
+public NSSearchField() {
+ super();
+}
+
+public NSSearchField(int id) {
+ super(id);
+}
+
+public NSArray recentSearches() {
+ int result = OS.objc_msgSend(this.id, OS.sel_recentSearches);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString recentsAutosaveName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_recentsAutosaveName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void setRecentSearches(NSArray searches) {
+ OS.objc_msgSend(this.id, OS.sel_setRecentSearches_1, searches != null ? searches.id : 0);
+}
+
+public void setRecentsAutosaveName(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setRecentsAutosaveName_1, string != null ? string.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSearchFieldCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSearchFieldCell.java
new file mode 100644
index 0000000000..b877698e8e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSearchFieldCell.java
@@ -0,0 +1,108 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSearchFieldCell extends NSTextFieldCell {
+
+public NSSearchFieldCell() {
+ super();
+}
+
+public NSSearchFieldCell(int id) {
+ super(id);
+}
+
+public NSButtonCell cancelButtonCell() {
+ int result = OS.objc_msgSend(this.id, OS.sel_cancelButtonCell);
+ return result != 0 ? new NSButtonCell(result) : null;
+}
+
+public NSRect cancelButtonRectForBounds(NSRect rect) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_cancelButtonRectForBounds_1, rect);
+ return result;
+}
+
+public int maximumRecents() {
+ return OS.objc_msgSend(this.id, OS.sel_maximumRecents);
+}
+
+public NSArray recentSearches() {
+ int result = OS.objc_msgSend(this.id, OS.sel_recentSearches);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString recentsAutosaveName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_recentsAutosaveName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void resetCancelButtonCell() {
+ OS.objc_msgSend(this.id, OS.sel_resetCancelButtonCell);
+}
+
+public void resetSearchButtonCell() {
+ OS.objc_msgSend(this.id, OS.sel_resetSearchButtonCell);
+}
+
+public NSButtonCell searchButtonCell() {
+ int result = OS.objc_msgSend(this.id, OS.sel_searchButtonCell);
+ return result != 0 ? new NSButtonCell(result) : null;
+}
+
+public NSRect searchButtonRectForBounds(NSRect rect) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_searchButtonRectForBounds_1, rect);
+ return result;
+}
+
+public NSMenu searchMenuTemplate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_searchMenuTemplate);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+public NSRect searchTextRectForBounds(NSRect rect) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_searchTextRectForBounds_1, rect);
+ return result;
+}
+
+public boolean sendsSearchStringImmediately() {
+ return OS.objc_msgSend(this.id, OS.sel_sendsSearchStringImmediately) != 0;
+}
+
+public boolean sendsWholeSearchString() {
+ return OS.objc_msgSend(this.id, OS.sel_sendsWholeSearchString) != 0;
+}
+
+public void setCancelButtonCell(NSButtonCell cell) {
+ OS.objc_msgSend(this.id, OS.sel_setCancelButtonCell_1, cell != null ? cell.id : 0);
+}
+
+public void setMaximumRecents(int maxRecents) {
+ OS.objc_msgSend(this.id, OS.sel_setMaximumRecents_1, maxRecents);
+}
+
+public void setRecentSearches(NSArray searches) {
+ OS.objc_msgSend(this.id, OS.sel_setRecentSearches_1, searches != null ? searches.id : 0);
+}
+
+public void setRecentsAutosaveName(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setRecentsAutosaveName_1, string != null ? string.id : 0);
+}
+
+public void setSearchButtonCell(NSButtonCell cell) {
+ OS.objc_msgSend(this.id, OS.sel_setSearchButtonCell_1, cell != null ? cell.id : 0);
+}
+
+public void setSearchMenuTemplate(NSMenu menu) {
+ OS.objc_msgSend(this.id, OS.sel_setSearchMenuTemplate_1, menu != null ? menu.id : 0);
+}
+
+public void setSendsSearchStringImmediately(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setSendsSearchStringImmediately_1, flag);
+}
+
+public void setSendsWholeSearchString(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setSendsWholeSearchString_1, flag);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSecureTextField.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSecureTextField.java
new file mode 100644
index 0000000000..941a6b3138
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSecureTextField.java
@@ -0,0 +1,13 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSecureTextField extends NSTextField {
+
+public NSSecureTextField() {
+ super();
+}
+
+public NSSecureTextField(int id) {
+ super(id);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSecureTextFieldCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSecureTextFieldCell.java
new file mode 100644
index 0000000000..74fc0fcaa1
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSecureTextFieldCell.java
@@ -0,0 +1,21 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSecureTextFieldCell extends NSTextFieldCell {
+
+public NSSecureTextFieldCell() {
+ super();
+}
+
+public NSSecureTextFieldCell(int id) {
+ super(id);
+}
+
+public boolean echosBullets() {
+ return OS.objc_msgSend(this.id, OS.sel_echosBullets) != 0;
+}
+
+public void setEchosBullets(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setEchosBullets_1, flag);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSegmentedCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSegmentedCell.java
new file mode 100644
index 0000000000..299759c67e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSegmentedCell.java
@@ -0,0 +1,141 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSegmentedCell extends NSActionCell {
+
+public NSSegmentedCell() {
+ super();
+}
+
+public NSSegmentedCell(int id) {
+ super(id);
+}
+
+public void drawSegment(int segment, NSRect frame, NSView controlView) {
+ OS.objc_msgSend(this.id, OS.sel_drawSegment_1inFrame_1withView_1, segment, frame, controlView != null ? controlView.id : 0);
+}
+
+public NSImage imageForSegment(int segment) {
+ int result = OS.objc_msgSend(this.id, OS.sel_imageForSegment_1, segment);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public int imageScalingForSegment(int segment) {
+ return OS.objc_msgSend(this.id, OS.sel_imageScalingForSegment_1, segment);
+}
+
+public int interiorBackgroundStyleForSegment(int segment) {
+ return OS.objc_msgSend(this.id, OS.sel_interiorBackgroundStyleForSegment_1, segment);
+}
+
+public boolean isEnabledForSegment(int segment) {
+ return OS.objc_msgSend(this.id, OS.sel_isEnabledForSegment_1, segment) != 0;
+}
+
+public boolean isSelectedForSegment(int segment) {
+ return OS.objc_msgSend(this.id, OS.sel_isSelectedForSegment_1, segment) != 0;
+}
+
+public NSString labelForSegment(int segment) {
+ int result = OS.objc_msgSend(this.id, OS.sel_labelForSegment_1, segment);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void makeNextSegmentKey() {
+ OS.objc_msgSend(this.id, OS.sel_makeNextSegmentKey);
+}
+
+public void makePreviousSegmentKey() {
+ OS.objc_msgSend(this.id, OS.sel_makePreviousSegmentKey);
+}
+
+public NSMenu menuForSegment(int segment) {
+ int result = OS.objc_msgSend(this.id, OS.sel_menuForSegment_1, segment);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+public int segmentCount() {
+ return OS.objc_msgSend(this.id, OS.sel_segmentCount);
+}
+
+public int segmentStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_segmentStyle);
+}
+
+public boolean selectSegmentWithTag(int tag) {
+ return OS.objc_msgSend(this.id, OS.sel_selectSegmentWithTag_1, tag) != 0;
+}
+
+public int selectedSegment() {
+ return OS.objc_msgSend(this.id, OS.sel_selectedSegment);
+}
+
+public void setEnabled(boolean enabled, int segment) {
+ OS.objc_msgSend(this.id, OS.sel_setEnabled_1forSegment_1, enabled, segment);
+}
+
+public void setImage(NSImage image, int segment) {
+ OS.objc_msgSend(this.id, OS.sel_setImage_1forSegment_1, image != null ? image.id : 0, segment);
+}
+
+public void setImageScaling(int scaling, int segment) {
+ OS.objc_msgSend(this.id, OS.sel_setImageScaling_1forSegment_1, scaling, segment);
+}
+
+public void setLabel(NSString label, int segment) {
+ OS.objc_msgSend(this.id, OS.sel_setLabel_1forSegment_1, label != null ? label.id : 0, segment);
+}
+
+public void setMenu(NSMenu menu, int segment) {
+ OS.objc_msgSend(this.id, OS.sel_setMenu_1forSegment_1, menu != null ? menu.id : 0, segment);
+}
+
+public void setSegmentCount(int count) {
+ OS.objc_msgSend(this.id, OS.sel_setSegmentCount_1, count);
+}
+
+public void setSegmentStyle(int segmentStyle) {
+ OS.objc_msgSend(this.id, OS.sel_setSegmentStyle_1, segmentStyle);
+}
+
+public void setSelected(boolean selected, int segment) {
+ OS.objc_msgSend(this.id, OS.sel_setSelected_1forSegment_1, selected, segment);
+}
+
+public void setSelectedSegment(int selectedSegment) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectedSegment_1, selectedSegment);
+}
+
+public void setTag(int tag, int segment) {
+ OS.objc_msgSend(this.id, OS.sel_setTag_1forSegment_1, tag, segment);
+}
+
+public void setToolTip(NSString toolTip, int segment) {
+ OS.objc_msgSend(this.id, OS.sel_setToolTip_1forSegment_1, toolTip != null ? toolTip.id : 0, segment);
+}
+
+public void setTrackingMode(int trackingMode) {
+ OS.objc_msgSend(this.id, OS.sel_setTrackingMode_1, trackingMode);
+}
+
+public void setWidth(float width, int segment) {
+ OS.objc_msgSend(this.id, OS.sel_setWidth_1forSegment_1, width, segment);
+}
+
+public int tagForSegment(int segment) {
+ return OS.objc_msgSend(this.id, OS.sel_tagForSegment_1, segment);
+}
+
+public NSString toolTipForSegment(int segment) {
+ int result = OS.objc_msgSend(this.id, OS.sel_toolTipForSegment_1, segment);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int trackingMode() {
+ return OS.objc_msgSend(this.id, OS.sel_trackingMode);
+}
+
+public float widthForSegment(int segment) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_widthForSegment_1, segment);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSegmentedControl.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSegmentedControl.java
new file mode 100644
index 0000000000..ab57e7764f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSegmentedControl.java
@@ -0,0 +1,100 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSegmentedControl extends NSControl {
+
+public NSSegmentedControl() {
+ super();
+}
+
+public NSSegmentedControl(int id) {
+ super(id);
+}
+
+public NSImage imageForSegment(int segment) {
+ int result = OS.objc_msgSend(this.id, OS.sel_imageForSegment_1, segment);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public int imageScalingForSegment(int segment) {
+ return OS.objc_msgSend(this.id, OS.sel_imageScalingForSegment_1, segment);
+}
+
+public boolean isEnabledForSegment(int segment) {
+ return OS.objc_msgSend(this.id, OS.sel_isEnabledForSegment_1, segment) != 0;
+}
+
+public boolean isSelectedForSegment(int segment) {
+ return OS.objc_msgSend(this.id, OS.sel_isSelectedForSegment_1, segment) != 0;
+}
+
+public NSString labelForSegment(int segment) {
+ int result = OS.objc_msgSend(this.id, OS.sel_labelForSegment_1, segment);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSMenu menuForSegment(int segment) {
+ int result = OS.objc_msgSend(this.id, OS.sel_menuForSegment_1, segment);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+public int segmentCount() {
+ return OS.objc_msgSend(this.id, OS.sel_segmentCount);
+}
+
+public int segmentStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_segmentStyle);
+}
+
+public boolean selectSegmentWithTag(int tag) {
+ return OS.objc_msgSend(this.id, OS.sel_selectSegmentWithTag_1, tag) != 0;
+}
+
+public int selectedSegment() {
+ return OS.objc_msgSend(this.id, OS.sel_selectedSegment);
+}
+
+public void setEnabled(boolean enabled, int segment) {
+ OS.objc_msgSend(this.id, OS.sel_setEnabled_1forSegment_1, enabled, segment);
+}
+
+public void setImage(NSImage image, int segment) {
+ OS.objc_msgSend(this.id, OS.sel_setImage_1forSegment_1, image != null ? image.id : 0, segment);
+}
+
+public void setImageScaling(int scaling, int segment) {
+ OS.objc_msgSend(this.id, OS.sel_setImageScaling_1forSegment_1, scaling, segment);
+}
+
+public void setLabel(NSString label, int segment) {
+ OS.objc_msgSend(this.id, OS.sel_setLabel_1forSegment_1, label != null ? label.id : 0, segment);
+}
+
+public void setMenu(NSMenu menu, int segment) {
+ OS.objc_msgSend(this.id, OS.sel_setMenu_1forSegment_1, menu != null ? menu.id : 0, segment);
+}
+
+public void setSegmentCount(int count) {
+ OS.objc_msgSend(this.id, OS.sel_setSegmentCount_1, count);
+}
+
+public void setSegmentStyle(int segmentStyle) {
+ OS.objc_msgSend(this.id, OS.sel_setSegmentStyle_1, segmentStyle);
+}
+
+public void setSelected(boolean selected, int segment) {
+ OS.objc_msgSend(this.id, OS.sel_setSelected_1forSegment_1, selected, segment);
+}
+
+public void setSelectedSegment(int selectedSegment) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectedSegment_1, selectedSegment);
+}
+
+public void setWidth(float width, int segment) {
+ OS.objc_msgSend(this.id, OS.sel_setWidth_1forSegment_1, width, segment);
+}
+
+public float widthForSegment(int segment) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_widthForSegment_1, segment);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSet.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSet.java
new file mode 100644
index 0000000000..9b0ebcbc2e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSet.java
@@ -0,0 +1,163 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSet extends NSObject {
+
+public NSSet() {
+ super();
+}
+
+public NSSet(int id) {
+ super(id);
+}
+
+public void addObserver(NSObject observer, NSString keyPath, int options, int context) {
+ OS.objc_msgSend(this.id, OS.sel_addObserver_1forKeyPath_1options_1context_1, observer != null ? observer.id : 0, keyPath != null ? keyPath.id : 0, options, context);
+}
+
+public NSArray allObjects() {
+ int result = OS.objc_msgSend(this.id, OS.sel_allObjects);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public id anyObject() {
+ int result = OS.objc_msgSend(this.id, OS.sel_anyObject);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean containsObject(id anObject) {
+ return OS.objc_msgSend(this.id, OS.sel_containsObject_1, anObject != null ? anObject.id : 0) != 0;
+}
+
+public int count() {
+ return OS.objc_msgSend(this.id, OS.sel_count);
+}
+
+public NSString description() {
+ int result = OS.objc_msgSend(this.id, OS.sel_description);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString descriptionWithLocale(id locale) {
+ int result = OS.objc_msgSend(this.id, OS.sel_descriptionWithLocale_1, locale != null ? locale.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSSet filteredSetUsingPredicate(NSPredicate predicate) {
+ int result = OS.objc_msgSend(this.id, OS.sel_filteredSetUsingPredicate_1, predicate != null ? predicate.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSSet(result) : null);
+}
+
+public NSSet initWithArray(NSArray array) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithArray_1, array != null ? array.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSSet initWithObjects_(id initWithObjects) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithObjects_1, initWithObjects != null ? initWithObjects.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSSet initWithObjects_count_(int objects, int cnt) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithObjects_1count_1, objects, cnt);
+ return result != 0 ? this : null;
+}
+
+public NSSet initWithSet_(NSSet set) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithSet_1, set != null ? set.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSSet initWithSet_copyItems_(NSSet set, boolean flag) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithSet_1copyItems_1, set != null ? set.id : 0, flag);
+ return result != 0 ? this : null;
+}
+
+public boolean intersectsSet(NSSet otherSet) {
+ return OS.objc_msgSend(this.id, OS.sel_intersectsSet_1, otherSet != null ? otherSet.id : 0) != 0;
+}
+
+public boolean isEqualToSet(NSSet otherSet) {
+ return OS.objc_msgSend(this.id, OS.sel_isEqualToSet_1, otherSet != null ? otherSet.id : 0) != 0;
+}
+
+public boolean isSubsetOfSet(NSSet otherSet) {
+ return OS.objc_msgSend(this.id, OS.sel_isSubsetOfSet_1, otherSet != null ? otherSet.id : 0) != 0;
+}
+
+public void makeObjectsPerformSelector_(int aSelector) {
+ OS.objc_msgSend(this.id, OS.sel_makeObjectsPerformSelector_1, aSelector);
+}
+
+public void makeObjectsPerformSelector_withObject_(int aSelector, id argument) {
+ OS.objc_msgSend(this.id, OS.sel_makeObjectsPerformSelector_1withObject_1, aSelector, argument != null ? argument.id : 0);
+}
+
+public id member(id object) {
+ int result = OS.objc_msgSend(this.id, OS.sel_member_1, object != null ? object.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSEnumerator objectEnumerator() {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectEnumerator);
+ return result != 0 ? new NSEnumerator(result) : null;
+}
+
+public void removeObserver(NSObject observer, NSString keyPath) {
+ OS.objc_msgSend(this.id, OS.sel_removeObserver_1forKeyPath_1, observer != null ? observer.id : 0, keyPath != null ? keyPath.id : 0);
+}
+
+public static id set() {
+ int result = OS.objc_msgSend(OS.class_NSSet, OS.sel_set);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSSet setByAddingObject(id anObject) {
+ int result = OS.objc_msgSend(this.id, OS.sel_setByAddingObject_1, anObject != null ? anObject.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSSet(result) : null);
+}
+
+public NSSet setByAddingObjectsFromArray(NSArray other) {
+ int result = OS.objc_msgSend(this.id, OS.sel_setByAddingObjectsFromArray_1, other != null ? other.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSSet(result) : null);
+}
+
+public NSSet setByAddingObjectsFromSet(NSSet other) {
+ int result = OS.objc_msgSend(this.id, OS.sel_setByAddingObjectsFromSet_1, other != null ? other.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSSet(result) : null);
+}
+
+public void setValue(id value, NSString key) {
+ OS.objc_msgSend(this.id, OS.sel_setValue_1forKey_1, value != null ? value.id : 0, key != null ? key.id : 0);
+}
+
+public static id setWithArray(NSArray array) {
+ int result = OS.objc_msgSend(OS.class_NSSet, OS.sel_setWithArray_1, array != null ? array.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id setWithObject(id object) {
+ int result = OS.objc_msgSend(OS.class_NSSet, OS.sel_setWithObject_1, object != null ? object.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_setWithObjects_(id setWithObjects) {
+ int result = OS.objc_msgSend(OS.class_NSSet, OS.sel_setWithObjects_1, setWithObjects != null ? setWithObjects.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_setWithObjects_count_(int objects, int cnt) {
+ int result = OS.objc_msgSend(OS.class_NSSet, OS.sel_setWithObjects_1count_1, objects, cnt);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id setWithSet(NSSet set) {
+ int result = OS.objc_msgSend(OS.class_NSSet, OS.sel_setWithSet_1, set != null ? set.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id valueForKey(NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_valueForKey_1, key != null ? key.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSetCommand.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSetCommand.java
new file mode 100644
index 0000000000..3daec788ce
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSetCommand.java
@@ -0,0 +1,22 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSetCommand extends NSScriptCommand {
+
+public NSSetCommand() {
+ super();
+}
+
+public NSSetCommand(int id) {
+ super(id);
+}
+
+public NSScriptObjectSpecifier keySpecifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_keySpecifier);
+ return result != 0 ? new NSScriptObjectSpecifier(result) : null;
+}
+
+public void setReceiversSpecifier(NSScriptObjectSpecifier receiversRef) {
+ OS.objc_msgSend(this.id, OS.sel_setReceiversSpecifier_1, receiversRef != null ? receiversRef.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSShadow.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSShadow.java
new file mode 100644
index 0000000000..c207dbe0f6
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSShadow.java
@@ -0,0 +1,44 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSShadow extends NSObject {
+
+public NSShadow() {
+ super();
+}
+
+public NSShadow(int id) {
+ super(id);
+}
+
+public void set() {
+ OS.objc_msgSend(this.id, OS.sel_set);
+}
+
+public void setShadowBlurRadius(float val) {
+ OS.objc_msgSend(this.id, OS.sel_setShadowBlurRadius_1, val);
+}
+
+public void setShadowColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setShadowColor_1, color != null ? color.id : 0);
+}
+
+public void setShadowOffset(NSSize offset) {
+ OS.objc_msgSend(this.id, OS.sel_setShadowOffset_1, offset);
+}
+
+public float shadowBlurRadius() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_shadowBlurRadius);
+}
+
+public NSColor shadowColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_shadowColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public NSSize shadowOffset() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_shadowOffset);
+ return result;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSize.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSize.java
new file mode 100755
index 0000000000..a9b2d3150b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSize.java
@@ -0,0 +1,19 @@
+/**********************************************************************
+ * Copyright (c) 2003-2006 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ **********************************************************************/
+package org.eclipse.swt.internal.cocoa;
+
+
+public class NSSize {
+ public float width;
+ public float height;
+ public static final int sizeof = 8;
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSlider.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSlider.java
new file mode 100644
index 0000000000..309edb0c25
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSlider.java
@@ -0,0 +1,140 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSlider extends NSControl {
+
+public NSSlider() {
+ super();
+}
+
+public NSSlider(int id) {
+ super(id);
+}
+
+public boolean acceptsFirstMouse(NSEvent theEvent) {
+ return OS.objc_msgSend(this.id, OS.sel_acceptsFirstMouse_1, theEvent != null ? theEvent.id : 0) != 0;
+}
+
+public boolean allowsTickMarkValuesOnly() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsTickMarkValuesOnly) != 0;
+}
+
+public double altIncrementValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_altIncrementValue);
+}
+
+public double closestTickMarkValueToValue(double value) {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_closestTickMarkValueToValue_1, value);
+}
+
+public NSImage image() {
+ int result = OS.objc_msgSend(this.id, OS.sel_image);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public int indexOfTickMarkAtPoint(NSPoint point) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfTickMarkAtPoint_1, point);
+}
+
+public int isVertical() {
+ return OS.objc_msgSend(this.id, OS.sel_isVertical);
+}
+
+public float knobThickness() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_knobThickness);
+}
+
+public double maxValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_maxValue);
+}
+
+public double minValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_minValue);
+}
+
+public int numberOfTickMarks() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfTickMarks);
+}
+
+public NSRect rectOfTickMarkAtIndex(int index) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rectOfTickMarkAtIndex_1, index);
+ return result;
+}
+
+public void setAllowsTickMarkValuesOnly(boolean yorn) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsTickMarkValuesOnly_1, yorn);
+}
+
+public void setAltIncrementValue(double incValue) {
+ OS.objc_msgSend(this.id, OS.sel_setAltIncrementValue_1, incValue);
+}
+
+public void setImage(NSImage backgroundImage) {
+ OS.objc_msgSend(this.id, OS.sel_setImage_1, backgroundImage != null ? backgroundImage.id : 0);
+}
+
+public void setKnobThickness(float aFloat) {
+ OS.objc_msgSend(this.id, OS.sel_setKnobThickness_1, aFloat);
+}
+
+public void setMaxValue(double aDouble) {
+ OS.objc_msgSend(this.id, OS.sel_setMaxValue_1, aDouble);
+}
+
+public void setMinValue(double aDouble) {
+ OS.objc_msgSend(this.id, OS.sel_setMinValue_1, aDouble);
+}
+
+public void setNumberOfTickMarks(int count) {
+ OS.objc_msgSend(this.id, OS.sel_setNumberOfTickMarks_1, count);
+}
+
+public void setTickMarkPosition(int position) {
+ OS.objc_msgSend(this.id, OS.sel_setTickMarkPosition_1, position);
+}
+
+public void setTitle(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString != null ? aString.id : 0);
+}
+
+public void setTitleCell(NSCell aCell) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleCell_1, aCell != null ? aCell.id : 0);
+}
+
+public void setTitleColor(NSColor newColor) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleColor_1, newColor != null ? newColor.id : 0);
+}
+
+public void setTitleFont(NSFont fontObj) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleFont_1, fontObj != null ? fontObj.id : 0);
+}
+
+public int tickMarkPosition() {
+ return OS.objc_msgSend(this.id, OS.sel_tickMarkPosition);
+}
+
+public double tickMarkValueAtIndex(int index) {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_tickMarkValueAtIndex_1, index);
+}
+
+public NSString title() {
+ int result = OS.objc_msgSend(this.id, OS.sel_title);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id titleCell() {
+ int result = OS.objc_msgSend(this.id, OS.sel_titleCell);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSColor titleColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_titleColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public NSFont titleFont() {
+ int result = OS.objc_msgSend(this.id, OS.sel_titleFont);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSliderCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSliderCell.java
new file mode 100644
index 0000000000..6197229add
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSliderCell.java
@@ -0,0 +1,163 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSliderCell extends NSActionCell {
+
+public NSSliderCell() {
+ super();
+}
+
+public NSSliderCell(int id) {
+ super(id);
+}
+
+public boolean allowsTickMarkValuesOnly() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsTickMarkValuesOnly) != 0;
+}
+
+public double altIncrementValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_altIncrementValue);
+}
+
+public double closestTickMarkValueToValue(double value) {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_closestTickMarkValueToValue_1, value);
+}
+
+public void drawBarInside(NSRect aRect, boolean flipped) {
+ OS.objc_msgSend(this.id, OS.sel_drawBarInside_1flipped_1, aRect, flipped);
+}
+
+public void drawKnob() {
+ OS.objc_msgSend(this.id, OS.sel_drawKnob);
+}
+
+public void drawKnob_(NSRect knobRect) {
+ OS.objc_msgSend(this.id, OS.sel_drawKnob_1, knobRect);
+}
+
+public int indexOfTickMarkAtPoint(NSPoint point) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfTickMarkAtPoint_1, point);
+}
+
+public int isVertical() {
+ return OS.objc_msgSend(this.id, OS.sel_isVertical);
+}
+
+public NSRect knobRectFlipped(boolean flipped) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_knobRectFlipped_1, flipped);
+ return result;
+}
+
+public float knobThickness() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_knobThickness);
+}
+
+public double maxValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_maxValue);
+}
+
+public double minValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_minValue);
+}
+
+public int numberOfTickMarks() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfTickMarks);
+}
+
+public static boolean prefersTrackingUntilMouseUp() {
+ return OS.objc_msgSend(OS.class_NSSliderCell, OS.sel_prefersTrackingUntilMouseUp) != 0;
+}
+
+public NSRect rectOfTickMarkAtIndex(int index) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rectOfTickMarkAtIndex_1, index);
+ return result;
+}
+
+public void setAllowsTickMarkValuesOnly(boolean yorn) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsTickMarkValuesOnly_1, yorn);
+}
+
+public void setAltIncrementValue(double incValue) {
+ OS.objc_msgSend(this.id, OS.sel_setAltIncrementValue_1, incValue);
+}
+
+public void setKnobThickness(float aFloat) {
+ OS.objc_msgSend(this.id, OS.sel_setKnobThickness_1, aFloat);
+}
+
+public void setMaxValue(double aDouble) {
+ OS.objc_msgSend(this.id, OS.sel_setMaxValue_1, aDouble);
+}
+
+public void setMinValue(double aDouble) {
+ OS.objc_msgSend(this.id, OS.sel_setMinValue_1, aDouble);
+}
+
+public void setNumberOfTickMarks(int count) {
+ OS.objc_msgSend(this.id, OS.sel_setNumberOfTickMarks_1, count);
+}
+
+public void setSliderType(int sliderType) {
+ OS.objc_msgSend(this.id, OS.sel_setSliderType_1, sliderType);
+}
+
+public void setTickMarkPosition(int position) {
+ OS.objc_msgSend(this.id, OS.sel_setTickMarkPosition_1, position);
+}
+
+public void setTitle(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString != null ? aString.id : 0);
+}
+
+public void setTitleCell(NSCell aCell) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleCell_1, aCell != null ? aCell.id : 0);
+}
+
+public void setTitleColor(NSColor newColor) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleColor_1, newColor != null ? newColor.id : 0);
+}
+
+public void setTitleFont(NSFont fontObj) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleFont_1, fontObj != null ? fontObj.id : 0);
+}
+
+public int sliderType() {
+ return OS.objc_msgSend(this.id, OS.sel_sliderType);
+}
+
+public int tickMarkPosition() {
+ return OS.objc_msgSend(this.id, OS.sel_tickMarkPosition);
+}
+
+public double tickMarkValueAtIndex(int index) {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_tickMarkValueAtIndex_1, index);
+}
+
+public NSString title() {
+ int result = OS.objc_msgSend(this.id, OS.sel_title);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id titleCell() {
+ int result = OS.objc_msgSend(this.id, OS.sel_titleCell);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSColor titleColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_titleColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public NSFont titleFont() {
+ int result = OS.objc_msgSend(this.id, OS.sel_titleFont);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public NSRect trackRect() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_trackRect);
+ return result;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSocketPort.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSocketPort.java
new file mode 100644
index 0000000000..29b069c277
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSocketPort.java
@@ -0,0 +1,59 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSocketPort extends NSPort {
+
+public NSSocketPort() {
+ super();
+}
+
+public NSSocketPort(int id) {
+ super(id);
+}
+
+public NSData address() {
+ int result = OS.objc_msgSend(this.id, OS.sel_address);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public id initRemoteWithProtocolFamily(int family, int type, int protocol, NSData address) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initRemoteWithProtocolFamily_1socketType_1protocol_1address_1, family, type, protocol, address != null ? address.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initRemoteWithTCPPort(short port, NSString hostName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initRemoteWithTCPPort_1host_1, port, hostName != null ? hostName.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithProtocolFamily_socketType_protocol_address_(int family, int type, int protocol, NSData address) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithProtocolFamily_1socketType_1protocol_1address_1, family, type, protocol, address != null ? address.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithProtocolFamily_socketType_protocol_socket_(int family, int type, int protocol, int sock) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithProtocolFamily_1socketType_1protocol_1socket_1, family, type, protocol, sock);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithTCPPort(short port) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithTCPPort_1, port);
+ return result != 0 ? new id(result) : null;
+}
+
+public int protocol() {
+ return OS.objc_msgSend(this.id, OS.sel_protocol);
+}
+
+public int protocolFamily() {
+ return OS.objc_msgSend(this.id, OS.sel_protocolFamily);
+}
+
+public int socket() {
+ return OS.objc_msgSend(this.id, OS.sel_socket);
+}
+
+public int socketType() {
+ return OS.objc_msgSend(this.id, OS.sel_socketType);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSocketPortNameServer.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSocketPortNameServer.java
new file mode 100644
index 0000000000..a42f129cf7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSocketPortNameServer.java
@@ -0,0 +1,53 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSocketPortNameServer extends NSPortNameServer {
+
+public NSSocketPortNameServer() {
+ super();
+}
+
+public NSSocketPortNameServer(int id) {
+ super(id);
+}
+
+public short defaultNameServerPortNumber() {
+ return (short)OS.objc_msgSend(this.id, OS.sel_defaultNameServerPortNumber);
+}
+
+public NSPort portForName_(NSString name) {
+ int result = OS.objc_msgSend(this.id, OS.sel_portForName_1, name != null ? name.id : 0);
+ return result != 0 ? new NSPort(result) : null;
+}
+
+public NSPort portForName_host_(NSString name, NSString host) {
+ int result = OS.objc_msgSend(this.id, OS.sel_portForName_1host_1, name != null ? name.id : 0, host != null ? host.id : 0);
+ return result != 0 ? new NSPort(result) : null;
+}
+
+public NSPort portForName_host_nameServerPortNumber_(NSString name, NSString host, short portNumber) {
+ int result = OS.objc_msgSend(this.id, OS.sel_portForName_1host_1nameServerPortNumber_1, name != null ? name.id : 0, host != null ? host.id : 0, portNumber);
+ return result != 0 ? new NSPort(result) : null;
+}
+
+public boolean registerPort_name_(NSPort port, NSString name) {
+ return OS.objc_msgSend(this.id, OS.sel_registerPort_1name_1, port != null ? port.id : 0, name != null ? name.id : 0) != 0;
+}
+
+public boolean registerPort_name_nameServerPortNumber_(NSPort port, NSString name, short portNumber) {
+ return OS.objc_msgSend(this.id, OS.sel_registerPort_1name_1nameServerPortNumber_1, port != null ? port.id : 0, name != null ? name.id : 0, portNumber) != 0;
+}
+
+public boolean removePortForName(NSString name) {
+ return OS.objc_msgSend(this.id, OS.sel_removePortForName_1, name != null ? name.id : 0) != 0;
+}
+
+public void setDefaultNameServerPortNumber(short portNumber) {
+ OS.objc_msgSend(this.id, OS.sel_setDefaultNameServerPortNumber_1, portNumber);
+}
+
+public static id sharedInstance() {
+ int result = OS.objc_msgSend(OS.class_NSSocketPortNameServer, OS.sel_sharedInstance);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSortDescriptor.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSortDescriptor.java
new file mode 100644
index 0000000000..dc76712de4
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSortDescriptor.java
@@ -0,0 +1,45 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSortDescriptor extends NSObject {
+
+public NSSortDescriptor() {
+ super();
+}
+
+public NSSortDescriptor(int id) {
+ super(id);
+}
+
+public boolean ascending() {
+ return OS.objc_msgSend(this.id, OS.sel_ascending) != 0;
+}
+
+public int compareObject(id object1, id object2) {
+ return OS.objc_msgSend(this.id, OS.sel_compareObject_1toObject_1, object1 != null ? object1.id : 0, object2 != null ? object2.id : 0);
+}
+
+public id initWithKey_ascending_(NSString key, boolean ascending) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithKey_1ascending_1, key != null ? key.id : 0, ascending);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithKey_ascending_selector_(NSString key, boolean ascending, int selector) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithKey_1ascending_1selector_1, key != null ? key.id : 0, ascending, selector);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString key() {
+ int result = OS.objc_msgSend(this.id, OS.sel_key);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id reversedSortDescriptor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_reversedSortDescriptor);
+ return result != 0 ? new id(result) : null;
+}
+
+public int selector() {
+ return OS.objc_msgSend(this.id, OS.sel_selector);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSound.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSound.java
new file mode 100644
index 0000000000..0a9a293718
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSound.java
@@ -0,0 +1,145 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSound extends NSObject {
+
+public NSSound() {
+ super();
+}
+
+public NSSound(int id) {
+ super(id);
+}
+
+public static boolean canInitWithPasteboard(NSPasteboard pasteboard) {
+ return OS.objc_msgSend(OS.class_NSSound, OS.sel_canInitWithPasteboard_1, pasteboard != null ? pasteboard.id : 0) != 0;
+}
+
+public NSArray channelMapping() {
+ int result = OS.objc_msgSend(this.id, OS.sel_channelMapping);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public double currentTime() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_currentTime);
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public double duration() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_duration);
+}
+
+public id initWithContentsOfFile(NSString path, boolean byRef) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfFile_1byReference_1, path != null ? path.id : 0, byRef);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithContentsOfURL(NSURL url, boolean byRef) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1byReference_1, url != null ? url.id : 0, byRef);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithData(NSData data) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithData_1, data != null ? data.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithPasteboard(NSPasteboard pasteboard) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithPasteboard_1, pasteboard != null ? pasteboard.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isPlaying() {
+ return OS.objc_msgSend(this.id, OS.sel_isPlaying) != 0;
+}
+
+public boolean loops() {
+ return OS.objc_msgSend(this.id, OS.sel_loops) != 0;
+}
+
+public NSString name() {
+ int result = OS.objc_msgSend(this.id, OS.sel_name);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean pause() {
+ return OS.objc_msgSend(this.id, OS.sel_pause) != 0;
+}
+
+public boolean play() {
+ return OS.objc_msgSend(this.id, OS.sel_play) != 0;
+}
+
+public NSString playbackDeviceIdentifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_playbackDeviceIdentifier);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean resume() {
+ return OS.objc_msgSend(this.id, OS.sel_resume) != 0;
+}
+
+public void setChannelMapping(NSArray channelMapping) {
+ OS.objc_msgSend(this.id, OS.sel_setChannelMapping_1, channelMapping != null ? channelMapping.id : 0);
+}
+
+public void setCurrentTime(double seconds) {
+ OS.objc_msgSend(this.id, OS.sel_setCurrentTime_1, seconds);
+}
+
+public void setDelegate(id aDelegate) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, aDelegate != null ? aDelegate.id : 0);
+}
+
+public void setLoops(boolean val) {
+ OS.objc_msgSend(this.id, OS.sel_setLoops_1, val);
+}
+
+public boolean setName(NSString string) {
+ return OS.objc_msgSend(this.id, OS.sel_setName_1, string != null ? string.id : 0) != 0;
+}
+
+public void setPlaybackDeviceIdentifier(NSString deviceUID) {
+ OS.objc_msgSend(this.id, OS.sel_setPlaybackDeviceIdentifier_1, deviceUID != null ? deviceUID.id : 0);
+}
+
+public void setVolume(float volume) {
+ OS.objc_msgSend(this.id, OS.sel_setVolume_1, volume);
+}
+
+public static id soundNamed(NSString name) {
+ int result = OS.objc_msgSend(OS.class_NSSound, OS.sel_soundNamed_1, name != null ? name.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static NSArray soundUnfilteredFileTypes() {
+ int result = OS.objc_msgSend(OS.class_NSSound, OS.sel_soundUnfilteredFileTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray soundUnfilteredPasteboardTypes() {
+ int result = OS.objc_msgSend(OS.class_NSSound, OS.sel_soundUnfilteredPasteboardTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSArray soundUnfilteredTypes() {
+ int result = OS.objc_msgSend(OS.class_NSSound, OS.sel_soundUnfilteredTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean stop() {
+ return OS.objc_msgSend(this.id, OS.sel_stop) != 0;
+}
+
+public float volume() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_volume);
+}
+
+public void writeToPasteboard(NSPasteboard pasteboard) {
+ OS.objc_msgSend(this.id, OS.sel_writeToPasteboard_1, pasteboard != null ? pasteboard.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpecifierTest.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpecifierTest.java
new file mode 100644
index 0000000000..2c8a3af81a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpecifierTest.java
@@ -0,0 +1,18 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSpecifierTest extends NSScriptWhoseTest {
+
+public NSSpecifierTest() {
+ super();
+}
+
+public NSSpecifierTest(int id) {
+ super(id);
+}
+
+public id initWithObjectSpecifier(NSScriptObjectSpecifier obj1, int compOp, id obj2) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithObjectSpecifier_1comparisonOperator_1testObject_1, obj1 != null ? obj1.id : 0, compOp, obj2 != null ? obj2.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpeechRecognizer.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpeechRecognizer.java
new file mode 100644
index 0000000000..673d19e9e8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpeechRecognizer.java
@@ -0,0 +1,64 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSpeechRecognizer extends NSObject {
+
+public NSSpeechRecognizer() {
+ super();
+}
+
+public NSSpeechRecognizer(int id) {
+ super(id);
+}
+
+public boolean blocksOtherRecognizers() {
+ return OS.objc_msgSend(this.id, OS.sel_blocksOtherRecognizers) != 0;
+}
+
+public NSArray commands() {
+ int result = OS.objc_msgSend(this.id, OS.sel_commands);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString displayedCommandsTitle() {
+ int result = OS.objc_msgSend(this.id, OS.sel_displayedCommandsTitle);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean listensInForegroundOnly() {
+ return OS.objc_msgSend(this.id, OS.sel_listensInForegroundOnly) != 0;
+}
+
+public void setBlocksOtherRecognizers(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setBlocksOtherRecognizers_1, flag);
+}
+
+public void setCommands(NSArray commands) {
+ OS.objc_msgSend(this.id, OS.sel_setCommands_1, commands != null ? commands.id : 0);
+}
+
+public void setDelegate(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
+}
+
+public void setDisplayedCommandsTitle(NSString title) {
+ OS.objc_msgSend(this.id, OS.sel_setDisplayedCommandsTitle_1, title != null ? title.id : 0);
+}
+
+public void setListensInForegroundOnly(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setListensInForegroundOnly_1, flag);
+}
+
+public void startListening() {
+ OS.objc_msgSend(this.id, OS.sel_startListening);
+}
+
+public void stopListening() {
+ OS.objc_msgSend(this.id, OS.sel_stopListening);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpeechSynthesizer.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpeechSynthesizer.java
new file mode 100644
index 0000000000..17d3372ace
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpeechSynthesizer.java
@@ -0,0 +1,125 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSpeechSynthesizer extends NSObject {
+
+public NSSpeechSynthesizer() {
+ super();
+}
+
+public NSSpeechSynthesizer(int id) {
+ super(id);
+}
+
+public void addSpeechDictionary(NSDictionary speechDictionary) {
+ OS.objc_msgSend(this.id, OS.sel_addSpeechDictionary_1, speechDictionary != null ? speechDictionary.id : 0);
+}
+
+public static NSDictionary attributesForVoice(NSString voice) {
+ int result = OS.objc_msgSend(OS.class_NSSpeechSynthesizer, OS.sel_attributesForVoice_1, voice != null ? voice.id : 0);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public static NSArray availableVoices() {
+ int result = OS.objc_msgSend(OS.class_NSSpeechSynthesizer, OS.sel_availableVoices);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void continueSpeaking() {
+ OS.objc_msgSend(this.id, OS.sel_continueSpeaking);
+}
+
+public static NSString defaultVoice() {
+ int result = OS.objc_msgSend(OS.class_NSSpeechSynthesizer, OS.sel_defaultVoice);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithVoice(NSString voice) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithVoice_1, voice != null ? voice.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static boolean isAnyApplicationSpeaking() {
+ return OS.objc_msgSend(OS.class_NSSpeechSynthesizer, OS.sel_isAnyApplicationSpeaking) != 0;
+}
+
+public boolean isSpeaking() {
+ return OS.objc_msgSend(this.id, OS.sel_isSpeaking) != 0;
+}
+
+public id objectForProperty(NSString property, int outError) {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectForProperty_1error_1, property != null ? property.id : 0, outError);
+ return result != 0 ? new id(result) : null;
+}
+
+public void pauseSpeakingAtBoundary(int boundary) {
+ OS.objc_msgSend(this.id, OS.sel_pauseSpeakingAtBoundary_1, boundary);
+}
+
+public NSString phonemesFromText(NSString text) {
+ int result = OS.objc_msgSend(this.id, OS.sel_phonemesFromText_1, text != null ? text.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public float rate() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_rate);
+}
+
+public void setDelegate(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
+}
+
+public boolean setObject(id object, NSString property, int outError) {
+ return OS.objc_msgSend(this.id, OS.sel_setObject_1forProperty_1error_1, object != null ? object.id : 0, property != null ? property.id : 0, outError) != 0;
+}
+
+public void setRate(float rate) {
+ OS.objc_msgSend(this.id, OS.sel_setRate_1, rate);
+}
+
+public void setUsesFeedbackWindow(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setUsesFeedbackWindow_1, flag);
+}
+
+public boolean setVoice(NSString voice) {
+ return OS.objc_msgSend(this.id, OS.sel_setVoice_1, voice != null ? voice.id : 0) != 0;
+}
+
+public void setVolume(float volume) {
+ OS.objc_msgSend(this.id, OS.sel_setVolume_1, volume);
+}
+
+public boolean startSpeakingString_(NSString string) {
+ return OS.objc_msgSend(this.id, OS.sel_startSpeakingString_1, string != null ? string.id : 0) != 0;
+}
+
+public boolean startSpeakingString_toURL_(NSString string, NSURL url) {
+ return OS.objc_msgSend(this.id, OS.sel_startSpeakingString_1toURL_1, string != null ? string.id : 0, url != null ? url.id : 0) != 0;
+}
+
+public void stopSpeaking() {
+ OS.objc_msgSend(this.id, OS.sel_stopSpeaking);
+}
+
+public void stopSpeakingAtBoundary(int boundary) {
+ OS.objc_msgSend(this.id, OS.sel_stopSpeakingAtBoundary_1, boundary);
+}
+
+public boolean usesFeedbackWindow() {
+ return OS.objc_msgSend(this.id, OS.sel_usesFeedbackWindow) != 0;
+}
+
+public NSString voice() {
+ int result = OS.objc_msgSend(this.id, OS.sel_voice);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public float volume() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_volume);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpellChecker.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpellChecker.java
new file mode 100644
index 0000000000..085be0f4c0
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpellChecker.java
@@ -0,0 +1,131 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSpellChecker extends NSObject {
+
+public NSSpellChecker() {
+ super();
+}
+
+public NSSpellChecker(int id) {
+ super(id);
+}
+
+public NSView accessoryView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_accessoryView);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public NSArray availableLanguages() {
+ int result = OS.objc_msgSend(this.id, OS.sel_availableLanguages);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSRange checkGrammarOfString(NSString stringToCheck, int startingOffset, NSString language, boolean wrapFlag, int tag, int details) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_checkGrammarOfString_1startingAt_1language_1wrap_1inSpellDocumentWithTag_1details_1, stringToCheck != null ? stringToCheck.id : 0, startingOffset, language != null ? language.id : 0, wrapFlag, tag, details);
+ return result;
+}
+
+public NSRange checkSpellingOfString_startingAt_(NSString stringToCheck, int startingOffset) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_checkSpellingOfString_1startingAt_1, stringToCheck != null ? stringToCheck.id : 0, startingOffset);
+ return result;
+}
+
+public NSRange checkSpellingOfString_startingAt_language_wrap_inSpellDocumentWithTag_wordCount_(NSString stringToCheck, int startingOffset, NSString language, boolean wrapFlag, int tag, int wordCount) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_checkSpellingOfString_1startingAt_1language_1wrap_1inSpellDocumentWithTag_1wordCount_1, stringToCheck != null ? stringToCheck.id : 0, startingOffset, language != null ? language.id : 0, wrapFlag, tag, wordCount);
+ return result;
+}
+
+public void closeSpellDocumentWithTag(int tag) {
+ OS.objc_msgSend(this.id, OS.sel_closeSpellDocumentWithTag_1, tag);
+}
+
+public NSArray completionsForPartialWordRange(NSRange range, NSString string, NSString language, int tag) {
+ int result = OS.objc_msgSend(this.id, OS.sel_completionsForPartialWordRange_1inString_1language_1inSpellDocumentWithTag_1, range, string != null ? string.id : 0, language != null ? language.id : 0, tag);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public int countWordsInString(NSString stringToCount, NSString language) {
+ return OS.objc_msgSend(this.id, OS.sel_countWordsInString_1language_1, stringToCount != null ? stringToCount.id : 0, language != null ? language.id : 0);
+}
+
+public void forgetWord(NSString word) {
+ OS.objc_msgSend(this.id, OS.sel_forgetWord_1, word != null ? word.id : 0);
+}
+
+public NSArray guessesForWord(NSString word) {
+ int result = OS.objc_msgSend(this.id, OS.sel_guessesForWord_1, word != null ? word.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean hasLearnedWord(NSString word) {
+ return OS.objc_msgSend(this.id, OS.sel_hasLearnedWord_1, word != null ? word.id : 0) != 0;
+}
+
+public void ignoreWord(NSString wordToIgnore, int tag) {
+ OS.objc_msgSend(this.id, OS.sel_ignoreWord_1inSpellDocumentWithTag_1, wordToIgnore != null ? wordToIgnore.id : 0, tag);
+}
+
+public NSArray ignoredWordsInSpellDocumentWithTag(int tag) {
+ int result = OS.objc_msgSend(this.id, OS.sel_ignoredWordsInSpellDocumentWithTag_1, tag);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString language() {
+ int result = OS.objc_msgSend(this.id, OS.sel_language);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void learnWord(NSString word) {
+ OS.objc_msgSend(this.id, OS.sel_learnWord_1, word != null ? word.id : 0);
+}
+
+public void setAccessoryView(NSView aView) {
+ OS.objc_msgSend(this.id, OS.sel_setAccessoryView_1, aView != null ? aView.id : 0);
+}
+
+public void setIgnoredWords(NSArray words, int tag) {
+ OS.objc_msgSend(this.id, OS.sel_setIgnoredWords_1inSpellDocumentWithTag_1, words != null ? words.id : 0, tag);
+}
+
+public boolean setLanguage(NSString language) {
+ return OS.objc_msgSend(this.id, OS.sel_setLanguage_1, language != null ? language.id : 0) != 0;
+}
+
+public void setWordFieldStringValue(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setWordFieldStringValue_1, aString != null ? aString.id : 0);
+}
+
+public static NSSpellChecker sharedSpellChecker() {
+ int result = OS.objc_msgSend(OS.class_NSSpellChecker, OS.sel_sharedSpellChecker);
+ return result != 0 ? new NSSpellChecker(result) : null;
+}
+
+public static boolean sharedSpellCheckerExists() {
+ return OS.objc_msgSend(OS.class_NSSpellChecker, OS.sel_sharedSpellCheckerExists) != 0;
+}
+
+public NSPanel spellingPanel() {
+ int result = OS.objc_msgSend(this.id, OS.sel_spellingPanel);
+ return result != 0 ? new NSPanel(result) : null;
+}
+
+public static int uniqueSpellDocumentTag() {
+ return OS.objc_msgSend(OS.class_NSSpellChecker, OS.sel_uniqueSpellDocumentTag);
+}
+
+public void unlearnWord(NSString word) {
+ OS.objc_msgSend(this.id, OS.sel_unlearnWord_1, word != null ? word.id : 0);
+}
+
+public void updateSpellingPanelWithGrammarString(NSString string, NSDictionary detail) {
+ OS.objc_msgSend(this.id, OS.sel_updateSpellingPanelWithGrammarString_1detail_1, string != null ? string.id : 0, detail != null ? detail.id : 0);
+}
+
+public void updateSpellingPanelWithMisspelledWord(NSString word) {
+ OS.objc_msgSend(this.id, OS.sel_updateSpellingPanelWithMisspelledWord_1, word != null ? word.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpellServer.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpellServer.java
new file mode 100644
index 0000000000..c163d2b5de
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSpellServer.java
@@ -0,0 +1,34 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSpellServer extends NSObject {
+
+public NSSpellServer() {
+ super();
+}
+
+public NSSpellServer(int id) {
+ super(id);
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isWordInUserDictionaries(NSString word, boolean flag) {
+ return OS.objc_msgSend(this.id, OS.sel_isWordInUserDictionaries_1caseSensitive_1, word != null ? word.id : 0, flag) != 0;
+}
+
+public boolean registerLanguage(NSString language, NSString vendor) {
+ return OS.objc_msgSend(this.id, OS.sel_registerLanguage_1byVendor_1, language != null ? language.id : 0, vendor != null ? vendor.id : 0) != 0;
+}
+
+public void run() {
+ OS.objc_msgSend(this.id, OS.sel_run);
+}
+
+public void setDelegate(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSplitView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSplitView.java
new file mode 100644
index 0000000000..5ae8e72dfd
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSplitView.java
@@ -0,0 +1,88 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSplitView extends NSView {
+
+public NSSplitView() {
+ super();
+}
+
+public NSSplitView(int id) {
+ super(id);
+}
+
+public void adjustSubviews() {
+ OS.objc_msgSend(this.id, OS.sel_adjustSubviews);
+}
+
+public NSString autosaveName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_autosaveName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSColor dividerColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_dividerColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public int dividerStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_dividerStyle);
+}
+
+public float dividerThickness() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_dividerThickness);
+}
+
+public void drawDividerInRect(NSRect rect) {
+ OS.objc_msgSend(this.id, OS.sel_drawDividerInRect_1, rect);
+}
+
+public boolean isPaneSplitter() {
+ return OS.objc_msgSend(this.id, OS.sel_isPaneSplitter) != 0;
+}
+
+public boolean isSubviewCollapsed(NSView subview) {
+ return OS.objc_msgSend(this.id, OS.sel_isSubviewCollapsed_1, subview != null ? subview.id : 0) != 0;
+}
+
+public boolean isVertical() {
+ return OS.objc_msgSend(this.id, OS.sel_isVertical) != 0;
+}
+
+public float maxPossiblePositionOfDividerAtIndex(int dividerIndex) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_maxPossiblePositionOfDividerAtIndex_1, dividerIndex);
+}
+
+public float minPossiblePositionOfDividerAtIndex(int dividerIndex) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_minPossiblePositionOfDividerAtIndex_1, dividerIndex);
+}
+
+public void setAutosaveName(NSString autosaveName) {
+ OS.objc_msgSend(this.id, OS.sel_setAutosaveName_1, autosaveName != null ? autosaveName.id : 0);
+}
+
+public void setDelegate(id delegate) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegate != null ? delegate.id : 0);
+}
+
+public void setDividerStyle(int dividerStyle) {
+ OS.objc_msgSend(this.id, OS.sel_setDividerStyle_1, dividerStyle);
+}
+
+public void setIsPaneSplitter(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setIsPaneSplitter_1, flag);
+}
+
+public void setPosition(float position, int dividerIndex) {
+ OS.objc_msgSend(this.id, OS.sel_setPosition_1ofDividerAtIndex_1, position, dividerIndex);
+}
+
+public void setVertical(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setVertical_1, flag);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStatusBar.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStatusBar.java
new file mode 100644
index 0000000000..9a0b1feb5b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStatusBar.java
@@ -0,0 +1,35 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSStatusBar extends NSObject {
+
+public NSStatusBar() {
+ super();
+}
+
+public NSStatusBar(int id) {
+ super(id);
+}
+
+public boolean isVertical() {
+ return OS.objc_msgSend(this.id, OS.sel_isVertical) != 0;
+}
+
+public void removeStatusItem(NSStatusItem item) {
+ OS.objc_msgSend(this.id, OS.sel_removeStatusItem_1, item != null ? item.id : 0);
+}
+
+public NSStatusItem statusItemWithLength(float length) {
+ int result = OS.objc_msgSend(this.id, OS.sel_statusItemWithLength_1, length);
+ return result != 0 ? new NSStatusItem(result) : null;
+}
+
+public static NSStatusBar systemStatusBar() {
+ int result = OS.objc_msgSend(OS.class_NSStatusBar, OS.sel_systemStatusBar);
+ return result != 0 ? new NSStatusBar(result) : null;
+}
+
+public float thickness() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_thickness);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStatusItem.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStatusItem.java
new file mode 100644
index 0000000000..3b3bc4f999
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStatusItem.java
@@ -0,0 +1,142 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSStatusItem extends NSObject {
+
+public NSStatusItem() {
+ super();
+}
+
+public NSStatusItem(int id) {
+ super(id);
+}
+
+public int action() {
+ return OS.objc_msgSend(this.id, OS.sel_action);
+}
+
+public NSImage alternateImage() {
+ int result = OS.objc_msgSend(this.id, OS.sel_alternateImage);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public NSAttributedString attributedTitle() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributedTitle);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public int doubleAction() {
+ return OS.objc_msgSend(this.id, OS.sel_doubleAction);
+}
+
+public void drawStatusBarBackgroundInRect(NSRect rect, boolean highlight) {
+ OS.objc_msgSend(this.id, OS.sel_drawStatusBarBackgroundInRect_1withHighlight_1, rect, highlight);
+}
+
+public boolean highlightMode() {
+ return OS.objc_msgSend(this.id, OS.sel_highlightMode) != 0;
+}
+
+public NSImage image() {
+ int result = OS.objc_msgSend(this.id, OS.sel_image);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public boolean isEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_isEnabled) != 0;
+}
+
+public float length() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_length);
+}
+
+public NSMenu menu() {
+ int result = OS.objc_msgSend(this.id, OS.sel_menu);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+public void popUpStatusItemMenu(NSMenu menu) {
+ OS.objc_msgSend(this.id, OS.sel_popUpStatusItemMenu_1, menu != null ? menu.id : 0);
+}
+
+public int sendActionOn(int mask) {
+ return OS.objc_msgSend(this.id, OS.sel_sendActionOn_1, mask);
+}
+
+public void setAction(int action) {
+ OS.objc_msgSend(this.id, OS.sel_setAction_1, action);
+}
+
+public void setAlternateImage(NSImage image) {
+ OS.objc_msgSend(this.id, OS.sel_setAlternateImage_1, image != null ? image.id : 0);
+}
+
+public void setAttributedTitle(NSAttributedString title) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributedTitle_1, title != null ? title.id : 0);
+}
+
+public void setDoubleAction(int action) {
+ OS.objc_msgSend(this.id, OS.sel_setDoubleAction_1, action);
+}
+
+public void setEnabled(boolean enabled) {
+ OS.objc_msgSend(this.id, OS.sel_setEnabled_1, enabled);
+}
+
+public void setHighlightMode(boolean highlightMode) {
+ OS.objc_msgSend(this.id, OS.sel_setHighlightMode_1, highlightMode);
+}
+
+public void setImage(NSImage image) {
+ OS.objc_msgSend(this.id, OS.sel_setImage_1, image != null ? image.id : 0);
+}
+
+public void setLength(float length) {
+ OS.objc_msgSend(this.id, OS.sel_setLength_1, length);
+}
+
+public void setMenu(NSMenu menu) {
+ OS.objc_msgSend(this.id, OS.sel_setMenu_1, menu != null ? menu.id : 0);
+}
+
+public void setTarget(id target) {
+ OS.objc_msgSend(this.id, OS.sel_setTarget_1, target != null ? target.id : 0);
+}
+
+public void setTitle(NSString title) {
+ OS.objc_msgSend(this.id, OS.sel_setTitle_1, title != null ? title.id : 0);
+}
+
+public void setToolTip(NSString toolTip) {
+ OS.objc_msgSend(this.id, OS.sel_setToolTip_1, toolTip != null ? toolTip.id : 0);
+}
+
+public void setView(NSView view) {
+ OS.objc_msgSend(this.id, OS.sel_setView_1, view != null ? view.id : 0);
+}
+
+public NSStatusBar statusBar() {
+ int result = OS.objc_msgSend(this.id, OS.sel_statusBar);
+ return result != 0 ? new NSStatusBar(result) : null;
+}
+
+public id target() {
+ int result = OS.objc_msgSend(this.id, OS.sel_target);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString title() {
+ int result = OS.objc_msgSend(this.id, OS.sel_title);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString toolTip() {
+ int result = OS.objc_msgSend(this.id, OS.sel_toolTip);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSView view() {
+ int result = OS.objc_msgSend(this.id, OS.sel_view);
+ return result != 0 ? new NSView(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStepper.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStepper.java
new file mode 100644
index 0000000000..25b0231919
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStepper.java
@@ -0,0 +1,53 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSStepper extends NSControl {
+
+public NSStepper() {
+ super();
+}
+
+public NSStepper(int id) {
+ super(id);
+}
+
+public boolean autorepeat() {
+ return OS.objc_msgSend(this.id, OS.sel_autorepeat) != 0;
+}
+
+public double increment() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_increment);
+}
+
+public double maxValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_maxValue);
+}
+
+public double minValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_minValue);
+}
+
+public void setAutorepeat(boolean autorepeat) {
+ OS.objc_msgSend(this.id, OS.sel_setAutorepeat_1, autorepeat);
+}
+
+public void setIncrement(double increment) {
+ OS.objc_msgSend(this.id, OS.sel_setIncrement_1, increment);
+}
+
+public void setMaxValue(double maxValue) {
+ OS.objc_msgSend(this.id, OS.sel_setMaxValue_1, maxValue);
+}
+
+public void setMinValue(double minValue) {
+ OS.objc_msgSend(this.id, OS.sel_setMinValue_1, minValue);
+}
+
+public void setValueWraps(boolean valueWraps) {
+ OS.objc_msgSend(this.id, OS.sel_setValueWraps_1, valueWraps);
+}
+
+public boolean valueWraps() {
+ return OS.objc_msgSend(this.id, OS.sel_valueWraps) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStepperCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStepperCell.java
new file mode 100644
index 0000000000..1807823c91
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStepperCell.java
@@ -0,0 +1,53 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSStepperCell extends NSActionCell {
+
+public NSStepperCell() {
+ super();
+}
+
+public NSStepperCell(int id) {
+ super(id);
+}
+
+public boolean autorepeat() {
+ return OS.objc_msgSend(this.id, OS.sel_autorepeat) != 0;
+}
+
+public double increment() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_increment);
+}
+
+public double maxValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_maxValue);
+}
+
+public double minValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_minValue);
+}
+
+public void setAutorepeat(boolean autorepeat) {
+ OS.objc_msgSend(this.id, OS.sel_setAutorepeat_1, autorepeat);
+}
+
+public void setIncrement(double increment) {
+ OS.objc_msgSend(this.id, OS.sel_setIncrement_1, increment);
+}
+
+public void setMaxValue(double maxValue) {
+ OS.objc_msgSend(this.id, OS.sel_setMaxValue_1, maxValue);
+}
+
+public void setMinValue(double minValue) {
+ OS.objc_msgSend(this.id, OS.sel_setMinValue_1, minValue);
+}
+
+public void setValueWraps(boolean valueWraps) {
+ OS.objc_msgSend(this.id, OS.sel_setValueWraps_1, valueWraps);
+}
+
+public boolean valueWraps() {
+ return OS.objc_msgSend(this.id, OS.sel_valueWraps) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStream.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStream.java
new file mode 100644
index 0000000000..14fe1eecb2
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSStream.java
@@ -0,0 +1,60 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSStream extends NSObject {
+
+public NSStream() {
+ super();
+}
+
+public NSStream(int id) {
+ super(id);
+}
+
+public void close() {
+ OS.objc_msgSend(this.id, OS.sel_close);
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public static void getStreamsToHost(NSHost host, int port, int inputStream, int outputStream) {
+ OS.objc_msgSend(OS.class_NSStream, OS.sel_getStreamsToHost_1port_1inputStream_1outputStream_1, host != null ? host.id : 0, port, inputStream, outputStream);
+}
+
+public void open() {
+ OS.objc_msgSend(this.id, OS.sel_open);
+}
+
+public id propertyForKey(NSString key) {
+ int result = OS.objc_msgSend(this.id, OS.sel_propertyForKey_1, key != null ? key.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void removeFromRunLoop(NSRunLoop aRunLoop, NSString mode) {
+ OS.objc_msgSend(this.id, OS.sel_removeFromRunLoop_1forMode_1, aRunLoop != null ? aRunLoop.id : 0, mode != null ? mode.id : 0);
+}
+
+public void scheduleInRunLoop(NSRunLoop aRunLoop, NSString mode) {
+ OS.objc_msgSend(this.id, OS.sel_scheduleInRunLoop_1forMode_1, aRunLoop != null ? aRunLoop.id : 0, mode != null ? mode.id : 0);
+}
+
+public void setDelegate(id delegate) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegate != null ? delegate.id : 0);
+}
+
+public boolean setProperty(id property, NSString key) {
+ return OS.objc_msgSend(this.id, OS.sel_setProperty_1forKey_1, property != null ? property.id : 0, key != null ? key.id : 0) != 0;
+}
+
+public NSError streamError() {
+ int result = OS.objc_msgSend(this.id, OS.sel_streamError);
+ return result != 0 ? new NSError(result) : null;
+}
+
+public int streamStatus() {
+ return OS.objc_msgSend(this.id, OS.sel_streamStatus);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSString.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSString.java
new file mode 100644
index 0000000000..fd4a4f3137
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSString.java
@@ -0,0 +1,668 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSString extends NSObject {
+
+public NSString() {
+ super();
+}
+
+public NSString(int id) {
+ super(id);
+}
+
+public int UTF8String() {
+ return OS.objc_msgSend(this.id, OS.sel_UTF8String);
+}
+
+public static int availableStringEncodings() {
+ return OS.objc_msgSend(OS.class_NSString, OS.sel_availableStringEncodings);
+}
+
+public boolean boolValue() {
+ return OS.objc_msgSend(this.id, OS.sel_boolValue) != 0;
+}
+
+public int cString() {
+ return OS.objc_msgSend(this.id, OS.sel_cString);
+}
+
+public int cStringLength() {
+ return OS.objc_msgSend(this.id, OS.sel_cStringLength);
+}
+
+public int cStringUsingEncoding(int encoding) {
+ return OS.objc_msgSend(this.id, OS.sel_cStringUsingEncoding_1, encoding);
+}
+
+public boolean canBeConvertedToEncoding(int encoding) {
+ return OS.objc_msgSend(this.id, OS.sel_canBeConvertedToEncoding_1, encoding) != 0;
+}
+
+public NSString capitalizedString() {
+ int result = OS.objc_msgSend(this.id, OS.sel_capitalizedString);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public int caseInsensitiveCompare(NSString string) {
+ return OS.objc_msgSend(this.id, OS.sel_caseInsensitiveCompare_1, string != null ? string.id : 0);
+}
+
+public short characterAtIndex(int index) {
+ return (short)OS.objc_msgSend(this.id, OS.sel_characterAtIndex_1, index);
+}
+
+public NSString commonPrefixWithString(NSString aString, int mask) {
+ int result = OS.objc_msgSend(this.id, OS.sel_commonPrefixWithString_1options_1, aString != null ? aString.id : 0, mask);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public int compare_(NSString string) {
+ return OS.objc_msgSend(this.id, OS.sel_compare_1, string != null ? string.id : 0);
+}
+
+public int compare_options_(NSString string, int mask) {
+ return OS.objc_msgSend(this.id, OS.sel_compare_1options_1, string != null ? string.id : 0, mask);
+}
+
+public int compare_options_range_(NSString string, int mask, NSRange compareRange) {
+ return OS.objc_msgSend(this.id, OS.sel_compare_1options_1range_1, string != null ? string.id : 0, mask, compareRange);
+}
+
+public int compare_options_range_locale_(NSString string, int mask, NSRange compareRange, id locale) {
+ return OS.objc_msgSend(this.id, OS.sel_compare_1options_1range_1locale_1, string != null ? string.id : 0, mask, compareRange, locale != null ? locale.id : 0);
+}
+
+public int completePathIntoString(int outputName, boolean flag, int outputArray, NSArray filterTypes) {
+ return OS.objc_msgSend(this.id, OS.sel_completePathIntoString_1caseSensitive_1matchesIntoArray_1filterTypes_1, outputName, flag, outputArray, filterTypes != null ? filterTypes.id : 0);
+}
+
+public NSArray componentsSeparatedByCharactersInSet(NSCharacterSet separator) {
+ int result = OS.objc_msgSend(this.id, OS.sel_componentsSeparatedByCharactersInSet_1, separator != null ? separator.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray componentsSeparatedByString(NSString separator) {
+ int result = OS.objc_msgSend(this.id, OS.sel_componentsSeparatedByString_1, separator != null ? separator.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSData dataUsingEncoding_(int encoding) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dataUsingEncoding_1, encoding);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSData dataUsingEncoding_allowLossyConversion_(int encoding, boolean lossy) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dataUsingEncoding_1allowLossyConversion_1, encoding, lossy);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSString decomposedStringWithCanonicalMapping() {
+ int result = OS.objc_msgSend(this.id, OS.sel_decomposedStringWithCanonicalMapping);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString decomposedStringWithCompatibilityMapping() {
+ int result = OS.objc_msgSend(this.id, OS.sel_decomposedStringWithCompatibilityMapping);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public static int defaultCStringEncoding() {
+ return OS.objc_msgSend(OS.class_NSString, OS.sel_defaultCStringEncoding);
+}
+
+public NSString description() {
+ int result = OS.objc_msgSend(this.id, OS.sel_description);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public double doubleValue() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_doubleValue);
+}
+
+public int fastestEncoding() {
+ return OS.objc_msgSend(this.id, OS.sel_fastestEncoding);
+}
+
+public int fileSystemRepresentation() {
+ return OS.objc_msgSend(this.id, OS.sel_fileSystemRepresentation);
+}
+
+public float floatValue() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_floatValue);
+}
+
+public boolean getBytes(int buffer, int maxBufferCount, int usedBufferCount, int encoding, int options, NSRange range, int leftover) {
+ return OS.objc_msgSend(this.id, OS.sel_getBytes_1maxLength_1usedLength_1encoding_1options_1range_1remainingRange_1, buffer, maxBufferCount, usedBufferCount, encoding, options, range, leftover) != 0;
+}
+
+public void getCString_(int bytes) {
+ OS.objc_msgSend(this.id, OS.sel_getCString_1, bytes);
+}
+
+public void getCString_maxLength_(int bytes, int maxLength) {
+ OS.objc_msgSend(this.id, OS.sel_getCString_1maxLength_1, bytes, maxLength);
+}
+
+public boolean getCString_maxLength_encoding_(int buffer, int maxBufferCount, int encoding) {
+ return OS.objc_msgSend(this.id, OS.sel_getCString_1maxLength_1encoding_1, buffer, maxBufferCount, encoding) != 0;
+}
+
+public void getCString_maxLength_range_remainingRange_(int bytes, int maxLength, NSRange aRange, int leftoverRange) {
+ OS.objc_msgSend(this.id, OS.sel_getCString_1maxLength_1range_1remainingRange_1, bytes, maxLength, aRange, leftoverRange);
+}
+
+public void getCharacters_(char[] buffer) {
+ OS.objc_msgSend(this.id, OS.sel_getCharacters_1, buffer);
+}
+
+public void getCharacters_range_(char[] buffer, NSRange aRange) {
+ OS.objc_msgSend(this.id, OS.sel_getCharacters_1range_1, buffer, aRange);
+}
+
+public boolean getFileSystemRepresentation(int cname, int max) {
+ return OS.objc_msgSend(this.id, OS.sel_getFileSystemRepresentation_1maxLength_1, cname, max) != 0;
+}
+
+public void getLineStart(int startPtr, int lineEndPtr, int contentsEndPtr, NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_getLineStart_1end_1contentsEnd_1forRange_1, startPtr, lineEndPtr, contentsEndPtr, range);
+}
+
+public void getParagraphStart(int startPtr, int parEndPtr, int contentsEndPtr, NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_getParagraphStart_1end_1contentsEnd_1forRange_1, startPtr, parEndPtr, contentsEndPtr, range);
+}
+
+public boolean hasPrefix(NSString aString) {
+ return OS.objc_msgSend(this.id, OS.sel_hasPrefix_1, aString != null ? aString.id : 0) != 0;
+}
+
+public boolean hasSuffix(NSString aString) {
+ return OS.objc_msgSend(this.id, OS.sel_hasSuffix_1, aString != null ? aString.id : 0) != 0;
+}
+
+public int hash() {
+ return OS.objc_msgSend(this.id, OS.sel_hash);
+}
+
+public NSString initWithBytes(int bytes, int len, int encoding) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithBytes_1length_1encoding_1, bytes, len, encoding);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithBytesNoCopy(int bytes, int len, int encoding, boolean freeBuffer) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithBytesNoCopy_1length_1encoding_1freeWhenDone_1, bytes, len, encoding, freeBuffer);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithCString_(int bytes) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCString_1, bytes);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithCString_encoding_(int nullTerminatedCString, int encoding) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCString_1encoding_1, nullTerminatedCString, encoding);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithCString_length_(int bytes, int length) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCString_1length_1, bytes, length);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithCStringNoCopy(int bytes, int length, boolean freeBuffer) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCStringNoCopy_1length_1freeWhenDone_1, bytes, length, freeBuffer);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithCharacters(int characters, int length) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCharacters_1length_1, characters, length);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithCharactersNoCopy(int characters, int length, boolean freeBuffer) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithCharactersNoCopy_1length_1freeWhenDone_1, characters, length, freeBuffer);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithContentsOfFile_(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfFile_1, path != null ? path.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithContentsOfFile_encoding_error_(NSString path, int enc, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfFile_1encoding_1error_1, path != null ? path.id : 0, enc, error);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithContentsOfFile_usedEncoding_error_(NSString path, int enc, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfFile_1usedEncoding_1error_1, path != null ? path.id : 0, enc, error);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithContentsOfURL_(NSURL url) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1, url != null ? url.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithContentsOfURL_encoding_error_(NSURL url, int enc, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1encoding_1error_1, url != null ? url.id : 0, enc, error);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithContentsOfURL_usedEncoding_error_(NSURL url, int enc, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1usedEncoding_1error_1, url != null ? url.id : 0, enc, error);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithData(NSData data, int encoding) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithData_1encoding_1, data != null ? data.id : 0, encoding);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithFormat_(NSString initWithFormat) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFormat_1, initWithFormat != null ? initWithFormat.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithFormat_arguments_(NSString format, int argList) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFormat_1arguments_1, format != null ? format.id : 0, argList);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithFormat_locale_(NSString format, id locale) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFormat_1locale_1, format != null ? format.id : 0, locale != null ? locale.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithFormat_locale_arguments_(NSString format, id locale, int argList) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFormat_1locale_1arguments_1, format != null ? format.id : 0, locale != null ? locale.id : 0, argList);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithString(NSString aString) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithString_1, aString != null ? aString.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSString initWithUTF8String(int nullTerminatedCString) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithUTF8String_1, nullTerminatedCString);
+ return result != 0 ? this : null;
+}
+
+public int intValue() {
+ return OS.objc_msgSend(this.id, OS.sel_intValue);
+}
+
+public int integerValue() {
+ return OS.objc_msgSend(this.id, OS.sel_integerValue);
+}
+
+public boolean isAbsolutePath() {
+ return OS.objc_msgSend(this.id, OS.sel_isAbsolutePath) != 0;
+}
+
+public boolean isEqualToString(NSString aString) {
+ return OS.objc_msgSend(this.id, OS.sel_isEqualToString_1, aString != null ? aString.id : 0) != 0;
+}
+
+public NSString lastPathComponent() {
+ int result = OS.objc_msgSend(this.id, OS.sel_lastPathComponent);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public int length() {
+ return OS.objc_msgSend(this.id, OS.sel_length);
+}
+
+public int lengthOfBytesUsingEncoding(int enc) {
+ return OS.objc_msgSend(this.id, OS.sel_lengthOfBytesUsingEncoding_1, enc);
+}
+
+public NSRange lineRangeForRange(NSRange range) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_struct(result, this.id, OS.sel_lineRangeForRange_1, range);
+ return result;
+}
+
+public int localizedCaseInsensitiveCompare(NSString string) {
+ return OS.objc_msgSend(this.id, OS.sel_localizedCaseInsensitiveCompare_1, string != null ? string.id : 0);
+}
+
+public int localizedCompare(NSString string) {
+ return OS.objc_msgSend(this.id, OS.sel_localizedCompare_1, string != null ? string.id : 0);
+}
+
+public static NSString localizedNameOfStringEncoding(int encoding) {
+ int result = OS.objc_msgSend(OS.class_NSString, OS.sel_localizedNameOfStringEncoding_1, encoding);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static id localizedStringWithFormat(NSString localizedStringWithFormat) {
+ int result = OS.objc_msgSend(OS.class_NSString, OS.sel_localizedStringWithFormat_1, localizedStringWithFormat != null ? localizedStringWithFormat.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public long longLongValue() {
+ return (long)OS.objc_msgSend(this.id, OS.sel_longLongValue);
+}
+
+public int lossyCString() {
+ return OS.objc_msgSend(this.id, OS.sel_lossyCString);
+}
+
+public NSString lowercaseString() {
+ int result = OS.objc_msgSend(this.id, OS.sel_lowercaseString);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public int maximumLengthOfBytesUsingEncoding(int enc) {
+ return OS.objc_msgSend(this.id, OS.sel_maximumLengthOfBytesUsingEncoding_1, enc);
+}
+
+public NSRange paragraphRangeForRange(NSRange range) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_paragraphRangeForRange_1, range);
+ return result;
+}
+
+public NSArray pathComponents() {
+ int result = OS.objc_msgSend(this.id, OS.sel_pathComponents);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString pathExtension() {
+ int result = OS.objc_msgSend(this.id, OS.sel_pathExtension);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public static NSString pathWithComponents(NSArray components) {
+ int result = OS.objc_msgSend(OS.class_NSString, OS.sel_pathWithComponents_1, components != null ? components.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString precomposedStringWithCanonicalMapping() {
+ int result = OS.objc_msgSend(this.id, OS.sel_precomposedStringWithCanonicalMapping);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString precomposedStringWithCompatibilityMapping() {
+ int result = OS.objc_msgSend(this.id, OS.sel_precomposedStringWithCompatibilityMapping);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public id propertyList() {
+ int result = OS.objc_msgSend(this.id, OS.sel_propertyList);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSDictionary propertyListFromStringsFileFormat() {
+ int result = OS.objc_msgSend(this.id, OS.sel_propertyListFromStringsFileFormat);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSRange rangeOfCharacterFromSet_(NSCharacterSet aSet) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfCharacterFromSet_1, aSet != null ? aSet.id : 0);
+ return result;
+}
+
+public NSRange rangeOfCharacterFromSet_options_(NSCharacterSet aSet, int mask) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfCharacterFromSet_1options_1, aSet != null ? aSet.id : 0, mask);
+ return result;
+}
+
+public NSRange rangeOfCharacterFromSet_options_range_(NSCharacterSet aSet, int mask, NSRange searchRange) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfCharacterFromSet_1options_1range_1, aSet != null ? aSet.id : 0, mask, searchRange);
+ return result;
+}
+
+public NSRange rangeOfComposedCharacterSequenceAtIndex(int index) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfComposedCharacterSequenceAtIndex_1, index);
+ return result;
+}
+
+public NSRange rangeOfComposedCharacterSequencesForRange(NSRange range) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfComposedCharacterSequencesForRange_1, range);
+ return result;
+}
+
+public NSRange rangeOfString_(NSString aString) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfString_1, aString != null ? aString.id : 0);
+ return result;
+}
+
+public NSRange rangeOfString_options_(NSString aString, int mask) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfString_1options_1, aString != null ? aString.id : 0, mask);
+ return result;
+}
+
+public NSRange rangeOfString_options_range_(NSString aString, int mask, NSRange searchRange) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfString_1options_1range_1, aString != null ? aString.id : 0, mask, searchRange);
+ return result;
+}
+
+public NSRange rangeOfString_options_range_locale_(NSString aString, int mask, NSRange searchRange, NSLocale locale) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rangeOfString_1options_1range_1locale_1, aString != null ? aString.id : 0, mask, searchRange, locale != null ? locale.id : 0);
+ return result;
+}
+
+public int smallestEncoding() {
+ return OS.objc_msgSend(this.id, OS.sel_smallestEncoding);
+}
+
+public static NSString string() {
+ int result = OS.objc_msgSend(OS.class_NSString, OS.sel_string);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString stringByAbbreviatingWithTildeInPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringByAbbreviatingWithTildeInPath);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString stringByAddingPercentEscapesUsingEncoding(int enc) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringByAddingPercentEscapesUsingEncoding_1, enc);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString stringByAppendingFormat(NSString stringByAppendingFormat) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringByAppendingFormat_1, stringByAppendingFormat != null ? stringByAppendingFormat.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString stringByAppendingPathComponent(NSString str) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringByAppendingPathComponent_1, str != null ? str.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString stringByAppendingPathExtension(NSString str) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringByAppendingPathExtension_1, str != null ? str.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString stringByAppendingString(NSString aString) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringByAppendingString_1, aString != null ? aString.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString stringByDeletingLastPathComponent() {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringByDeletingLastPathComponent);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString stringByDeletingPathExtension() {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringByDeletingPathExtension);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString stringByExpandingTildeInPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringByExpandingTildeInPath);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString stringByFoldingWithOptions(int options, NSLocale locale) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringByFoldingWithOptions_1locale_1, options, locale != null ? locale.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString stringByPaddingToLength(int newLength, NSString padString, int padIndex) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringByPaddingToLength_1withString_1startingAtIndex_1, newLength, padString != null ? padString.id : 0, padIndex);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString stringByReplacingCharactersInRange(NSRange range, NSString replacement) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringByReplacingCharactersInRange_1withString_1, range, replacement != null ? replacement.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString stringByReplacingOccurrencesOfString_withString_(NSString target, NSString replacement) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringByReplacingOccurrencesOfString_1withString_1, target != null ? target.id : 0, replacement != null ? replacement.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString stringByReplacingOccurrencesOfString_withString_options_range_(NSString target, NSString replacement, int options, NSRange searchRange) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringByReplacingOccurrencesOfString_1withString_1options_1range_1, target != null ? target.id : 0, replacement != null ? replacement.id : 0, options, searchRange);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString stringByReplacingPercentEscapesUsingEncoding(int enc) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringByReplacingPercentEscapesUsingEncoding_1, enc);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString stringByResolvingSymlinksInPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringByResolvingSymlinksInPath);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString stringByStandardizingPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringByStandardizingPath);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString stringByTrimmingCharactersInSet(NSCharacterSet set) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringByTrimmingCharactersInSet_1, set != null ? set.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public static id static_stringWithCString_(int bytes) {
+ int result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithCString_1, bytes);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static id static_stringWithCString_encoding_(int cString, int enc) {
+ int result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithCString_1encoding_1, cString, enc);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSString static_stringWithCString_length_(int bytes, int length) {
+ int result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithCString_1length_1, bytes, length);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSString stringWithCharacters(char[] characters, int length) {
+ int result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithCharacters_1length_1, characters, length);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSString stringWith(String str) {
+ char[] chars = new char[str.length()];
+ str.getChars(0, chars.length, chars, 0);
+ int result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithCharacters_1length_1, chars, chars.length);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static id static_stringWithContentsOfFile_(NSString path) {
+ int result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithContentsOfFile_1, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_stringWithContentsOfFile_encoding_error_(NSString path, int enc, int error) {
+ int result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithContentsOfFile_1encoding_1error_1, path != null ? path.id : 0, enc, error);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_stringWithContentsOfFile_usedEncoding_error_(NSString path, int enc, int error) {
+ int result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithContentsOfFile_1usedEncoding_1error_1, path != null ? path.id : 0, enc, error);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_stringWithContentsOfURL_(NSURL url) {
+ int result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithContentsOfURL_1, url != null ? url.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_stringWithContentsOfURL_encoding_error_(NSURL url, int enc, int error) {
+ int result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithContentsOfURL_1encoding_1error_1, url != null ? url.id : 0, enc, error);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_stringWithContentsOfURL_usedEncoding_error_(NSURL url, int enc, int error) {
+ int result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithContentsOfURL_1usedEncoding_1error_1, url != null ? url.id : 0, enc, error);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id stringWithFormat(NSString stringWithFormat) {
+ int result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithFormat_1, stringWithFormat != null ? stringWithFormat.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id stringWithString(NSString string) {
+ int result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithString_1, string != null ? string.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id stringWithUTF8String(int nullTerminatedCString) {
+ int result = OS.objc_msgSend(OS.class_NSString, OS.sel_stringWithUTF8String_1, nullTerminatedCString);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSArray stringsByAppendingPaths(NSArray paths) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringsByAppendingPaths_1, paths != null ? paths.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString substringFromIndex(int from) {
+ int result = OS.objc_msgSend(this.id, OS.sel_substringFromIndex_1, from);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString substringToIndex(int to) {
+ int result = OS.objc_msgSend(this.id, OS.sel_substringToIndex_1, to);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString substringWithRange(NSRange range) {
+ int result = OS.objc_msgSend(this.id, OS.sel_substringWithRange_1, range);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public NSString uppercaseString() {
+ int result = OS.objc_msgSend(this.id, OS.sel_uppercaseString);
+ return result == this.id ? this : (result != 0 ? new NSString(result) : null);
+}
+
+public boolean writeToFile_atomically_(NSString path, boolean useAuxiliaryFile) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToFile_1atomically_1, path != null ? path.id : 0, useAuxiliaryFile) != 0;
+}
+
+public boolean writeToFile_atomically_encoding_error_(NSString path, boolean useAuxiliaryFile, int enc, int error) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToFile_1atomically_1encoding_1error_1, path != null ? path.id : 0, useAuxiliaryFile, enc, error) != 0;
+}
+
+public boolean writeToURL_atomically_(NSURL url, boolean atomically) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToURL_1atomically_1, url != null ? url.id : 0, atomically) != 0;
+}
+
+public boolean writeToURL_atomically_encoding_error_(NSURL url, boolean useAuxiliaryFile, int enc, int error) {
+ return OS.objc_msgSend(this.id, OS.sel_writeToURL_1atomically_1encoding_1error_1, url != null ? url.id : 0, useAuxiliaryFile, enc, error) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSwappedDouble.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSwappedDouble.java
new file mode 100644
index 0000000000..24eaf5518a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSwappedDouble.java
@@ -0,0 +1,5 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSwappedDouble {
+public long v;
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSwappedFloat.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSwappedFloat.java
new file mode 100644
index 0000000000..23df9172ca
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSSwappedFloat.java
@@ -0,0 +1,5 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSSwappedFloat {
+public int v;
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTabView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTabView.java
new file mode 100644
index 0000000000..492e166df7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTabView.java
@@ -0,0 +1,159 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTabView extends NSView {
+
+public NSTabView() {
+ super();
+}
+
+public NSTabView(int id) {
+ super(id);
+}
+
+public void addTabViewItem(NSTabViewItem tabViewItem) {
+ OS.objc_msgSend(this.id, OS.sel_addTabViewItem_1, tabViewItem != null ? tabViewItem.id : 0);
+}
+
+public boolean allowsTruncatedLabels() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsTruncatedLabels) != 0;
+}
+
+public NSRect contentRect() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_contentRect);
+ return result;
+}
+
+public int controlSize() {
+ return OS.objc_msgSend(this.id, OS.sel_controlSize);
+}
+
+public int controlTint() {
+ return OS.objc_msgSend(this.id, OS.sel_controlTint);
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean drawsBackground() {
+ return OS.objc_msgSend(this.id, OS.sel_drawsBackground) != 0;
+}
+
+public NSFont font() {
+ int result = OS.objc_msgSend(this.id, OS.sel_font);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public int indexOfTabViewItem(NSTabViewItem tabViewItem) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfTabViewItem_1, tabViewItem != null ? tabViewItem.id : 0);
+}
+
+public int indexOfTabViewItemWithIdentifier(id identifier) {
+ return OS.objc_msgSend(this.id, OS.sel_indexOfTabViewItemWithIdentifier_1, identifier != null ? identifier.id : 0);
+}
+
+public void insertTabViewItem(NSTabViewItem tabViewItem, int index) {
+ OS.objc_msgSend(this.id, OS.sel_insertTabViewItem_1atIndex_1, tabViewItem != null ? tabViewItem.id : 0, index);
+}
+
+public NSSize minimumSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_struct(result, this.id, OS.sel_minimumSize);
+ return result;
+}
+
+public int numberOfTabViewItems() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfTabViewItems);
+}
+
+public void removeTabViewItem(NSTabViewItem tabViewItem) {
+ OS.objc_msgSend(this.id, OS.sel_removeTabViewItem_1, tabViewItem != null ? tabViewItem.id : 0);
+}
+
+public void selectFirstTabViewItem(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectFirstTabViewItem_1, sender != null ? sender.id : 0);
+}
+
+public void selectLastTabViewItem(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectLastTabViewItem_1, sender != null ? sender.id : 0);
+}
+
+public void selectNextTabViewItem(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectNextTabViewItem_1, sender != null ? sender.id : 0);
+}
+
+public void selectPreviousTabViewItem(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectPreviousTabViewItem_1, sender != null ? sender.id : 0);
+}
+
+public void selectTabViewItem(NSTabViewItem tabViewItem) {
+ OS.objc_msgSend(this.id, OS.sel_selectTabViewItem_1, tabViewItem != null ? tabViewItem.id : 0);
+}
+
+public void selectTabViewItemAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_selectTabViewItemAtIndex_1, index);
+}
+
+public void selectTabViewItemWithIdentifier(id identifier) {
+ OS.objc_msgSend(this.id, OS.sel_selectTabViewItemWithIdentifier_1, identifier != null ? identifier.id : 0);
+}
+
+public NSTabViewItem selectedTabViewItem() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedTabViewItem);
+ return result != 0 ? new NSTabViewItem(result) : null;
+}
+
+public void setAllowsTruncatedLabels(boolean allowTruncatedLabels) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsTruncatedLabels_1, allowTruncatedLabels);
+}
+
+public void setControlSize(int controlSize) {
+ OS.objc_msgSend(this.id, OS.sel_setControlSize_1, controlSize);
+}
+
+public void setControlTint(int controlTint) {
+ OS.objc_msgSend(this.id, OS.sel_setControlTint_1, controlTint);
+}
+
+public void setDelegate(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
+}
+
+public void setDrawsBackground(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setDrawsBackground_1, flag);
+}
+
+public void setFont(NSFont font) {
+ OS.objc_msgSend(this.id, OS.sel_setFont_1, font != null ? font.id : 0);
+}
+
+public void setTabViewType(int tabViewType) {
+ OS.objc_msgSend(this.id, OS.sel_setTabViewType_1, tabViewType);
+}
+
+public NSTabViewItem tabViewItemAtIndex(int index) {
+ int result = OS.objc_msgSend(this.id, OS.sel_tabViewItemAtIndex_1, index);
+ return result != 0 ? new NSTabViewItem(result) : null;
+}
+
+public NSTabViewItem tabViewItemAtPoint(NSPoint point) {
+ int result = OS.objc_msgSend(this.id, OS.sel_tabViewItemAtPoint_1, point);
+ return result != 0 ? new NSTabViewItem(result) : null;
+}
+
+public NSArray tabViewItems() {
+ int result = OS.objc_msgSend(this.id, OS.sel_tabViewItems);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public int tabViewType() {
+ return OS.objc_msgSend(this.id, OS.sel_tabViewType);
+}
+
+public void takeSelectedTabViewItemFromSender(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_takeSelectedTabViewItemFromSender_1, sender != null ? sender.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTabViewItem.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTabViewItem.java
new file mode 100644
index 0000000000..635e8fc687
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTabViewItem.java
@@ -0,0 +1,82 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTabViewItem extends NSObject {
+
+public NSTabViewItem() {
+ super();
+}
+
+public NSTabViewItem(int id) {
+ super(id);
+}
+
+public NSColor color() {
+ int result = OS.objc_msgSend(this.id, OS.sel_color);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public void drawLabel(boolean shouldTruncateLabel, NSRect labelRect) {
+ OS.objc_msgSend(this.id, OS.sel_drawLabel_1inRect_1, shouldTruncateLabel, labelRect);
+}
+
+public id identifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_identifier);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSTabViewItem initWithIdentifier(id identifier) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithIdentifier_1, identifier != null ? identifier.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSTabViewItem initialFirstResponder() {
+ int result = OS.objc_msgSend(this.id, OS.sel_initialFirstResponder);
+ return result != 0 ? this : null;
+}
+
+public NSString label() {
+ int result = OS.objc_msgSend(this.id, OS.sel_label);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void setColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setColor_1, color != null ? color.id : 0);
+}
+
+public void setIdentifier(id identifier) {
+ OS.objc_msgSend(this.id, OS.sel_setIdentifier_1, identifier != null ? identifier.id : 0);
+}
+
+public void setInitialFirstResponder(NSView view) {
+ OS.objc_msgSend(this.id, OS.sel_setInitialFirstResponder_1, view != null ? view.id : 0);
+}
+
+public void setLabel(NSString label) {
+ OS.objc_msgSend(this.id, OS.sel_setLabel_1, label != null ? label.id : 0);
+}
+
+public void setView(NSView view) {
+ OS.objc_msgSend(this.id, OS.sel_setView_1, view != null ? view.id : 0);
+}
+
+public NSSize sizeOfLabel(boolean computeMin) {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_sizeOfLabel_1, computeMin);
+ return result;
+}
+
+public int tabState() {
+ return OS.objc_msgSend(this.id, OS.sel_tabState);
+}
+
+public NSTabView tabView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_tabView);
+ return result != 0 ? new NSTabView(result) : null;
+}
+
+public id view() {
+ int result = OS.objc_msgSend(this.id, OS.sel_view);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableColumn.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableColumn.java
new file mode 100644
index 0000000000..0783c76b5a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableColumn.java
@@ -0,0 +1,137 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTableColumn extends NSObject {
+
+public NSTableColumn() {
+ super();
+}
+
+public NSTableColumn(int id) {
+ super(id);
+}
+
+public id dataCell() {
+ int result = OS.objc_msgSend(this.id, OS.sel_dataCell);
+ return result != 0 ? new id(result) : null;
+}
+
+public id dataCellForRow(int row) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dataCellForRow_1, row);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSTableHeaderCell headerCell() {
+ int result = OS.objc_msgSend(this.id, OS.sel_headerCell);
+ return result != 0 ? new NSTableHeaderCell(result) : null;
+}
+
+public NSString headerToolTip() {
+ int result = OS.objc_msgSend(this.id, OS.sel_headerToolTip);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id identifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_identifier);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSTableColumn initWithIdentifier(id identifier) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithIdentifier_1, identifier != null ? identifier.id : 0);
+ return result != 0 ? this : null;
+}
+
+public boolean isEditable() {
+ return OS.objc_msgSend(this.id, OS.sel_isEditable) != 0;
+}
+
+public boolean isHidden() {
+ return OS.objc_msgSend(this.id, OS.sel_isHidden) != 0;
+}
+
+public boolean isResizable() {
+ return OS.objc_msgSend(this.id, OS.sel_isResizable) != 0;
+}
+
+public float maxWidth() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_maxWidth);
+}
+
+public float minWidth() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_minWidth);
+}
+
+public int resizingMask() {
+ return OS.objc_msgSend(this.id, OS.sel_resizingMask);
+}
+
+public void setDataCell(NSCell cell) {
+ OS.objc_msgSend(this.id, OS.sel_setDataCell_1, cell != null ? cell.id : 0);
+}
+
+public void setEditable(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setEditable_1, flag);
+}
+
+public void setHeaderCell(NSCell cell) {
+ OS.objc_msgSend(this.id, OS.sel_setHeaderCell_1, cell != null ? cell.id : 0);
+}
+
+public void setHeaderToolTip(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setHeaderToolTip_1, string != null ? string.id : 0);
+}
+
+public void setHidden(boolean hidden) {
+ OS.objc_msgSend(this.id, OS.sel_setHidden_1, hidden);
+}
+
+public void setIdentifier(id identifier) {
+ OS.objc_msgSend(this.id, OS.sel_setIdentifier_1, identifier != null ? identifier.id : 0);
+}
+
+public void setMaxWidth(float maxWidth) {
+ OS.objc_msgSend(this.id, OS.sel_setMaxWidth_1, maxWidth);
+}
+
+public void setMinWidth(float minWidth) {
+ OS.objc_msgSend(this.id, OS.sel_setMinWidth_1, minWidth);
+}
+
+public void setResizable(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setResizable_1, flag);
+}
+
+public void setResizingMask(int resizingMask) {
+ OS.objc_msgSend(this.id, OS.sel_setResizingMask_1, resizingMask);
+}
+
+public void setSortDescriptorPrototype(NSSortDescriptor sortDescriptor) {
+ OS.objc_msgSend(this.id, OS.sel_setSortDescriptorPrototype_1, sortDescriptor != null ? sortDescriptor.id : 0);
+}
+
+public void setTableView(NSTableView tableView) {
+ OS.objc_msgSend(this.id, OS.sel_setTableView_1, tableView != null ? tableView.id : 0);
+}
+
+public void setWidth(float width) {
+ OS.objc_msgSend(this.id, OS.sel_setWidth_1, width);
+}
+
+public void sizeToFit() {
+ OS.objc_msgSend(this.id, OS.sel_sizeToFit);
+}
+
+public NSSortDescriptor sortDescriptorPrototype() {
+ int result = OS.objc_msgSend(this.id, OS.sel_sortDescriptorPrototype);
+ return result != 0 ? new NSSortDescriptor(result) : null;
+}
+
+public NSTableView tableView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_tableView);
+ return result != 0 ? new NSTableView(result) : null;
+}
+
+public float width() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_width);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableHeaderCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableHeaderCell.java
new file mode 100644
index 0000000000..4cc59aee31
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableHeaderCell.java
@@ -0,0 +1,23 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTableHeaderCell extends NSTextFieldCell {
+
+public NSTableHeaderCell() {
+ super();
+}
+
+public NSTableHeaderCell(int id) {
+ super(id);
+}
+
+public void drawSortIndicatorWithFrame(NSRect cellFrame, NSView controlView, boolean ascending, int priority) {
+ OS.objc_msgSend(this.id, OS.sel_drawSortIndicatorWithFrame_1inView_1ascending_1priority_1, cellFrame, controlView != null ? controlView.id : 0, ascending, priority);
+}
+
+public NSRect sortIndicatorRectForBounds(NSRect theRect) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_sortIndicatorRectForBounds_1, theRect);
+ return result;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableHeaderView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableHeaderView.java
new file mode 100644
index 0000000000..bf3508cceb
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableHeaderView.java
@@ -0,0 +1,44 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTableHeaderView extends NSView {
+
+public NSTableHeaderView() {
+ super();
+}
+
+public NSTableHeaderView(int id) {
+ super(id);
+}
+
+public int columnAtPoint(NSPoint point) {
+ return OS.objc_msgSend(this.id, OS.sel_columnAtPoint_1, point);
+}
+
+public int draggedColumn() {
+ return OS.objc_msgSend(this.id, OS.sel_draggedColumn);
+}
+
+public float draggedDistance() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_draggedDistance);
+}
+
+public NSRect headerRectOfColumn(int column) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_headerRectOfColumn_1, column);
+ return result;
+}
+
+public int resizedColumn() {
+ return OS.objc_msgSend(this.id, OS.sel_resizedColumn);
+}
+
+public void setTableView(NSTableView tableView) {
+ OS.objc_msgSend(this.id, OS.sel_setTableView_1, tableView != null ? tableView.id : 0);
+}
+
+public NSTableView tableView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_tableView);
+ return result != 0 ? new NSTableView(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableView.java
new file mode 100644
index 0000000000..941862bf41
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTableView.java
@@ -0,0 +1,509 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTableView extends NSControl {
+
+public NSTableView() {
+ super();
+}
+
+public NSTableView(int id) {
+ super(id);
+}
+
+public void addTableColumn(NSTableColumn column) {
+ OS.objc_msgSend(this.id, OS.sel_addTableColumn_1, column != null ? column.id : 0);
+}
+
+public boolean allowsColumnReordering() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsColumnReordering) != 0;
+}
+
+public boolean allowsColumnResizing() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsColumnResizing) != 0;
+}
+
+public boolean allowsColumnSelection() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsColumnSelection) != 0;
+}
+
+public boolean allowsEmptySelection() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsEmptySelection) != 0;
+}
+
+public boolean allowsMultipleSelection() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsMultipleSelection) != 0;
+}
+
+public boolean allowsTypeSelect() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsTypeSelect) != 0;
+}
+
+public boolean autoresizesAllColumnsToFit() {
+ return OS.objc_msgSend(this.id, OS.sel_autoresizesAllColumnsToFit) != 0;
+}
+
+public NSString autosaveName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_autosaveName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean autosaveTableColumns() {
+ return OS.objc_msgSend(this.id, OS.sel_autosaveTableColumns) != 0;
+}
+
+public NSColor backgroundColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public boolean canDragRowsWithIndexes(NSIndexSet rowIndexes, NSPoint mouseDownPoint) {
+ return OS.objc_msgSend(this.id, OS.sel_canDragRowsWithIndexes_1atPoint_1, rowIndexes != null ? rowIndexes.id : 0, mouseDownPoint) != 0;
+}
+
+public int clickedColumn() {
+ return OS.objc_msgSend(this.id, OS.sel_clickedColumn);
+}
+
+public int clickedRow() {
+ return OS.objc_msgSend(this.id, OS.sel_clickedRow);
+}
+
+public int columnAtPoint(NSPoint point) {
+ return OS.objc_msgSend(this.id, OS.sel_columnAtPoint_1, point);
+}
+
+public int columnAutoresizingStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_columnAutoresizingStyle);
+}
+
+public NSIndexSet columnIndexesInRect(NSRect rect) {
+ int result = OS.objc_msgSend(this.id, OS.sel_columnIndexesInRect_1, rect);
+ return result != 0 ? new NSIndexSet(result) : null;
+}
+
+public int columnWithIdentifier(id identifier) {
+ return OS.objc_msgSend(this.id, OS.sel_columnWithIdentifier_1, identifier != null ? identifier.id : 0);
+}
+
+public NSRange columnsInRect(NSRect rect) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_columnsInRect_1, rect);
+ return result;
+}
+
+public NSView cornerView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_cornerView);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public id dataSource() {
+ int result = OS.objc_msgSend(this.id, OS.sel_dataSource);
+ return result != 0 ? new id(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public void deselectAll(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_deselectAll_1, sender != null ? sender.id : 0);
+}
+
+public void deselectColumn(int column) {
+ OS.objc_msgSend(this.id, OS.sel_deselectColumn_1, column);
+}
+
+public void deselectRow(int row) {
+ OS.objc_msgSend(this.id, OS.sel_deselectRow_1, row);
+}
+
+public int doubleAction() {
+ return OS.objc_msgSend(this.id, OS.sel_doubleAction);
+}
+
+public NSImage dragImageForRows(NSArray dragRows, NSEvent dragEvent, int dragImageOffset) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dragImageForRows_1event_1dragImageOffset_1, dragRows != null ? dragRows.id : 0, dragEvent != null ? dragEvent.id : 0, dragImageOffset);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public NSImage dragImageForRowsWithIndexes(NSIndexSet dragRows, NSArray tableColumns, NSEvent dragEvent, int dragImageOffset) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dragImageForRowsWithIndexes_1tableColumns_1event_1offset_1, dragRows != null ? dragRows.id : 0, tableColumns != null ? tableColumns.id : 0, dragEvent != null ? dragEvent.id : 0, dragImageOffset);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public void drawBackgroundInClipRect(NSRect clipRect) {
+ OS.objc_msgSend(this.id, OS.sel_drawBackgroundInClipRect_1, clipRect);
+}
+
+public void drawGridInClipRect(NSRect clipRect) {
+ OS.objc_msgSend(this.id, OS.sel_drawGridInClipRect_1, clipRect);
+}
+
+public void drawRow(int row, NSRect clipRect) {
+ OS.objc_msgSend(this.id, OS.sel_drawRow_1clipRect_1, row, clipRect);
+}
+
+public boolean drawsGrid() {
+ return OS.objc_msgSend(this.id, OS.sel_drawsGrid) != 0;
+}
+
+public void editColumn(int column, int row, NSEvent theEvent, boolean select) {
+ OS.objc_msgSend(this.id, OS.sel_editColumn_1row_1withEvent_1select_1, column, row, theEvent != null ? theEvent.id : 0, select);
+}
+
+public int editedColumn() {
+ return OS.objc_msgSend(this.id, OS.sel_editedColumn);
+}
+
+public int editedRow() {
+ return OS.objc_msgSend(this.id, OS.sel_editedRow);
+}
+
+public NSRect frameOfCellAtColumn(int column, int row) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_frameOfCellAtColumn_1row_1, column, row);
+ return result;
+}
+
+public NSColor gridColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_gridColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public int gridStyleMask() {
+ return OS.objc_msgSend(this.id, OS.sel_gridStyleMask);
+}
+
+public NSTableHeaderView headerView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_headerView);
+ return result != 0 ? new NSTableHeaderView(result) : null;
+}
+
+public void highlightSelectionInClipRect(NSRect clipRect) {
+ OS.objc_msgSend(this.id, OS.sel_highlightSelectionInClipRect_1, clipRect);
+}
+
+public NSTableColumn highlightedTableColumn() {
+ int result = OS.objc_msgSend(this.id, OS.sel_highlightedTableColumn);
+ return result != 0 ? new NSTableColumn(result) : null;
+}
+
+public NSImage indicatorImageInTableColumn(NSTableColumn tc) {
+ int result = OS.objc_msgSend(this.id, OS.sel_indicatorImageInTableColumn_1, tc != null ? tc.id : 0);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public NSSize intercellSpacing() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_intercellSpacing);
+ return result;
+}
+
+public boolean isColumnSelected(int column) {
+ return OS.objc_msgSend(this.id, OS.sel_isColumnSelected_1, column) != 0;
+}
+
+public boolean isRowSelected(int row) {
+ return OS.objc_msgSend(this.id, OS.sel_isRowSelected_1, row) != 0;
+}
+
+public void moveColumn(int column, int newIndex) {
+ OS.objc_msgSend(this.id, OS.sel_moveColumn_1toColumn_1, column, newIndex);
+}
+
+public void noteHeightOfRowsWithIndexesChanged(NSIndexSet indexSet) {
+ OS.objc_msgSend(this.id, OS.sel_noteHeightOfRowsWithIndexesChanged_1, indexSet != null ? indexSet.id : 0);
+}
+
+public void noteNumberOfRowsChanged() {
+ OS.objc_msgSend(this.id, OS.sel_noteNumberOfRowsChanged);
+}
+
+public int numberOfColumns() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfColumns);
+}
+
+public int numberOfRows() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfRows);
+}
+
+public int numberOfSelectedColumns() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfSelectedColumns);
+}
+
+public int numberOfSelectedRows() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfSelectedRows);
+}
+
+public NSCell preparedCellAtColumn(int column, int row) {
+ int result = OS.objc_msgSend(this.id, OS.sel_preparedCellAtColumn_1row_1, column, row);
+ return result != 0 ? new NSCell(result) : null;
+}
+
+public NSRect rectOfColumn(int column) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rectOfColumn_1, column);
+ return result;
+}
+
+public NSRect rectOfRow(int row) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rectOfRow_1, row);
+ return result;
+}
+
+public void reloadData() {
+ OS.objc_msgSend(this.id, OS.sel_reloadData);
+}
+
+public void removeTableColumn(NSTableColumn column) {
+ OS.objc_msgSend(this.id, OS.sel_removeTableColumn_1, column != null ? column.id : 0);
+}
+
+public int rowAtPoint(NSPoint point) {
+ return OS.objc_msgSend(this.id, OS.sel_rowAtPoint_1, point);
+}
+
+public float rowHeight() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_rowHeight);
+}
+
+public NSRange rowsInRect(NSRect rect) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rowsInRect_1, rect);
+ return result;
+}
+
+public void scrollColumnToVisible(int column) {
+ OS.objc_msgSend(this.id, OS.sel_scrollColumnToVisible_1, column);
+}
+
+public void scrollRowToVisible(int row) {
+ OS.objc_msgSend(this.id, OS.sel_scrollRowToVisible_1, row);
+}
+
+public void selectAll(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectAll_1, sender != null ? sender.id : 0);
+}
+
+public void selectColumn(int column, boolean extend) {
+ OS.objc_msgSend(this.id, OS.sel_selectColumn_1byExtendingSelection_1, column, extend);
+}
+
+public void selectColumnIndexes(NSIndexSet indexes, boolean extend) {
+ OS.objc_msgSend(this.id, OS.sel_selectColumnIndexes_1byExtendingSelection_1, indexes != null ? indexes.id : 0, extend);
+}
+
+public void selectRow(int row, boolean extend) {
+ OS.objc_msgSend(this.id, OS.sel_selectRow_1byExtendingSelection_1, row, extend);
+}
+
+public void selectRowIndexes(NSIndexSet indexes, boolean extend) {
+ OS.objc_msgSend(this.id, OS.sel_selectRowIndexes_1byExtendingSelection_1, indexes != null ? indexes.id : 0, extend);
+}
+
+public int selectedColumn() {
+ return OS.objc_msgSend(this.id, OS.sel_selectedColumn);
+}
+
+public NSEnumerator selectedColumnEnumerator() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedColumnEnumerator);
+ return result != 0 ? new NSEnumerator(result) : null;
+}
+
+public NSIndexSet selectedColumnIndexes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedColumnIndexes);
+ return result != 0 ? new NSIndexSet(result) : null;
+}
+
+public int selectedRow() {
+ return OS.objc_msgSend(this.id, OS.sel_selectedRow);
+}
+
+public NSEnumerator selectedRowEnumerator() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedRowEnumerator);
+ return result != 0 ? new NSEnumerator(result) : null;
+}
+
+public NSIndexSet selectedRowIndexes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedRowIndexes);
+ return result != 0 ? new NSIndexSet(result) : null;
+}
+
+public int selectionHighlightStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_selectionHighlightStyle);
+}
+
+public void setAllowsColumnReordering(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsColumnReordering_1, flag);
+}
+
+public void setAllowsColumnResizing(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsColumnResizing_1, flag);
+}
+
+public void setAllowsColumnSelection(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsColumnSelection_1, flag);
+}
+
+public void setAllowsEmptySelection(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsEmptySelection_1, flag);
+}
+
+public void setAllowsMultipleSelection(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsMultipleSelection_1, flag);
+}
+
+public void setAllowsTypeSelect(boolean value) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsTypeSelect_1, value);
+}
+
+public void setAutoresizesAllColumnsToFit(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAutoresizesAllColumnsToFit_1, flag);
+}
+
+public void setAutosaveName(NSString name) {
+ OS.objc_msgSend(this.id, OS.sel_setAutosaveName_1, name != null ? name.id : 0);
+}
+
+public void setAutosaveTableColumns(boolean save) {
+ OS.objc_msgSend(this.id, OS.sel_setAutosaveTableColumns_1, save);
+}
+
+public void setBackgroundColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color != null ? color.id : 0);
+}
+
+public void setColumnAutoresizingStyle(int style) {
+ OS.objc_msgSend(this.id, OS.sel_setColumnAutoresizingStyle_1, style);
+}
+
+public void setCornerView(NSView cornerView) {
+ OS.objc_msgSend(this.id, OS.sel_setCornerView_1, cornerView != null ? cornerView.id : 0);
+}
+
+public void setDataSource(id aSource) {
+ OS.objc_msgSend(this.id, OS.sel_setDataSource_1, aSource != null ? aSource.id : 0);
+}
+
+public void setDelegate(id delegate) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegate != null ? delegate.id : 0);
+}
+
+public void setDoubleAction(int aSelector) {
+ OS.objc_msgSend(this.id, OS.sel_setDoubleAction_1, aSelector);
+}
+
+public void setDraggingSourceOperationMask(int mask, boolean isLocal) {
+ OS.objc_msgSend(this.id, OS.sel_setDraggingSourceOperationMask_1forLocal_1, mask, isLocal);
+}
+
+public void setDrawsGrid(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setDrawsGrid_1, flag);
+}
+
+public void setDropRow(int row, int op) {
+ OS.objc_msgSend(this.id, OS.sel_setDropRow_1dropOperation_1, row, op);
+}
+
+public void setGridColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setGridColor_1, color != null ? color.id : 0);
+}
+
+public void setGridStyleMask(int gridType) {
+ OS.objc_msgSend(this.id, OS.sel_setGridStyleMask_1, gridType);
+}
+
+public void setHeaderView(NSTableHeaderView headerView) {
+ OS.objc_msgSend(this.id, OS.sel_setHeaderView_1, headerView != null ? headerView.id : 0);
+}
+
+public void setHighlightedTableColumn(NSTableColumn tc) {
+ OS.objc_msgSend(this.id, OS.sel_setHighlightedTableColumn_1, tc != null ? tc.id : 0);
+}
+
+public void setIndicatorImage(NSImage anImage, NSTableColumn tc) {
+ OS.objc_msgSend(this.id, OS.sel_setIndicatorImage_1inTableColumn_1, anImage != null ? anImage.id : 0, tc != null ? tc.id : 0);
+}
+
+public void setIntercellSpacing(NSSize aSize) {
+ OS.objc_msgSend(this.id, OS.sel_setIntercellSpacing_1, aSize);
+}
+
+public void setRowHeight(float rowHeight) {
+ OS.objc_msgSend(this.id, OS.sel_setRowHeight_1, rowHeight);
+}
+
+public void setSelectionHighlightStyle(int selectionHighlightStyle) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectionHighlightStyle_1, selectionHighlightStyle);
+}
+
+public void setSortDescriptors(NSArray array) {
+ OS.objc_msgSend(this.id, OS.sel_setSortDescriptors_1, array != null ? array.id : 0);
+}
+
+public void setUsesAlternatingRowBackgroundColors(boolean useAlternatingRowColors) {
+ OS.objc_msgSend(this.id, OS.sel_setUsesAlternatingRowBackgroundColors_1, useAlternatingRowColors);
+}
+
+public void setVerticalMotionCanBeginDrag(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setVerticalMotionCanBeginDrag_1, flag);
+}
+
+public void sizeLastColumnToFit() {
+ OS.objc_msgSend(this.id, OS.sel_sizeLastColumnToFit);
+}
+
+public void sizeToFit() {
+ OS.objc_msgSend(this.id, OS.sel_sizeToFit);
+}
+
+public NSArray sortDescriptors() {
+ int result = OS.objc_msgSend(this.id, OS.sel_sortDescriptors);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSTableColumn tableColumnWithIdentifier(id identifier) {
+ int result = OS.objc_msgSend(this.id, OS.sel_tableColumnWithIdentifier_1, identifier != null ? identifier.id : 0);
+ return result != 0 ? new NSTableColumn(result) : null;
+}
+
+public NSArray tableColumns() {
+ int result = OS.objc_msgSend(this.id, OS.sel_tableColumns);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void textDidBeginEditing(NSNotification notification) {
+ OS.objc_msgSend(this.id, OS.sel_textDidBeginEditing_1, notification != null ? notification.id : 0);
+}
+
+public void textDidChange(NSNotification notification) {
+ OS.objc_msgSend(this.id, OS.sel_textDidChange_1, notification != null ? notification.id : 0);
+}
+
+public void textDidEndEditing(NSNotification notification) {
+ OS.objc_msgSend(this.id, OS.sel_textDidEndEditing_1, notification != null ? notification.id : 0);
+}
+
+public boolean textShouldBeginEditing(NSText textObject) {
+ return OS.objc_msgSend(this.id, OS.sel_textShouldBeginEditing_1, textObject != null ? textObject.id : 0) != 0;
+}
+
+public boolean textShouldEndEditing(NSText textObject) {
+ return OS.objc_msgSend(this.id, OS.sel_textShouldEndEditing_1, textObject != null ? textObject.id : 0) != 0;
+}
+
+public void tile() {
+ OS.objc_msgSend(this.id, OS.sel_tile);
+}
+
+public boolean usesAlternatingRowBackgroundColors() {
+ return OS.objc_msgSend(this.id, OS.sel_usesAlternatingRowBackgroundColors) != 0;
+}
+
+public boolean verticalMotionCanBeginDrag() {
+ return OS.objc_msgSend(this.id, OS.sel_verticalMotionCanBeginDrag) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTask.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTask.java
new file mode 100644
index 0000000000..b499abc685
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTask.java
@@ -0,0 +1,117 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTask extends NSObject {
+
+public NSTask() {
+ super();
+}
+
+public NSTask(int id) {
+ super(id);
+}
+
+public NSArray arguments() {
+ int result = OS.objc_msgSend(this.id, OS.sel_arguments);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString currentDirectoryPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_currentDirectoryPath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSDictionary environment() {
+ int result = OS.objc_msgSend(this.id, OS.sel_environment);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public void interrupt() {
+ OS.objc_msgSend(this.id, OS.sel_interrupt);
+}
+
+public boolean isRunning() {
+ return OS.objc_msgSend(this.id, OS.sel_isRunning) != 0;
+}
+
+public void launch() {
+ OS.objc_msgSend(this.id, OS.sel_launch);
+}
+
+public NSString launchPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_launchPath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSTask launchedTaskWithLaunchPath(NSString path, NSArray arguments) {
+ int result = OS.objc_msgSend(OS.class_NSTask, OS.sel_launchedTaskWithLaunchPath_1arguments_1, path != null ? path.id : 0, arguments != null ? arguments.id : 0);
+ return result != 0 ? new NSTask(result) : null;
+}
+
+public int processIdentifier() {
+ return OS.objc_msgSend(this.id, OS.sel_processIdentifier);
+}
+
+public boolean resume() {
+ return OS.objc_msgSend(this.id, OS.sel_resume) != 0;
+}
+
+public void setArguments(NSArray arguments) {
+ OS.objc_msgSend(this.id, OS.sel_setArguments_1, arguments != null ? arguments.id : 0);
+}
+
+public void setCurrentDirectoryPath(NSString path) {
+ OS.objc_msgSend(this.id, OS.sel_setCurrentDirectoryPath_1, path != null ? path.id : 0);
+}
+
+public void setEnvironment(NSDictionary dict) {
+ OS.objc_msgSend(this.id, OS.sel_setEnvironment_1, dict != null ? dict.id : 0);
+}
+
+public void setLaunchPath(NSString path) {
+ OS.objc_msgSend(this.id, OS.sel_setLaunchPath_1, path != null ? path.id : 0);
+}
+
+public void setStandardError(id error) {
+ OS.objc_msgSend(this.id, OS.sel_setStandardError_1, error != null ? error.id : 0);
+}
+
+public void setStandardInput(id input) {
+ OS.objc_msgSend(this.id, OS.sel_setStandardInput_1, input != null ? input.id : 0);
+}
+
+public void setStandardOutput(id output) {
+ OS.objc_msgSend(this.id, OS.sel_setStandardOutput_1, output != null ? output.id : 0);
+}
+
+public id standardError() {
+ int result = OS.objc_msgSend(this.id, OS.sel_standardError);
+ return result != 0 ? new id(result) : null;
+}
+
+public id standardInput() {
+ int result = OS.objc_msgSend(this.id, OS.sel_standardInput);
+ return result != 0 ? new id(result) : null;
+}
+
+public id standardOutput() {
+ int result = OS.objc_msgSend(this.id, OS.sel_standardOutput);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean suspend() {
+ return OS.objc_msgSend(this.id, OS.sel_suspend) != 0;
+}
+
+public void terminate() {
+ OS.objc_msgSend(this.id, OS.sel_terminate);
+}
+
+public int terminationStatus() {
+ return OS.objc_msgSend(this.id, OS.sel_terminationStatus);
+}
+
+public void waitUntilExit() {
+ OS.objc_msgSend(this.id, OS.sel_waitUntilExit);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSText.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSText.java
new file mode 100644
index 0000000000..8c9a2e82db
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSText.java
@@ -0,0 +1,306 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSText extends NSView {
+
+public NSText() {
+ super();
+}
+
+public NSText(int id) {
+ super(id);
+}
+
+public NSData RTFDFromRange(NSRange range) {
+ int result = OS.objc_msgSend(this.id, OS.sel_RTFDFromRange_1, range);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSData RTFFromRange(NSRange range) {
+ int result = OS.objc_msgSend(this.id, OS.sel_RTFFromRange_1, range);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public void alignCenter(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_alignCenter_1, sender != null ? sender.id : 0);
+}
+
+public void alignLeft(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_alignLeft_1, sender != null ? sender.id : 0);
+}
+
+public void alignRight(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_alignRight_1, sender != null ? sender.id : 0);
+}
+
+public int alignment() {
+ return OS.objc_msgSend(this.id, OS.sel_alignment);
+}
+
+public NSColor backgroundColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public int baseWritingDirection() {
+ return OS.objc_msgSend(this.id, OS.sel_baseWritingDirection);
+}
+
+public void changeFont(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_changeFont_1, sender != null ? sender.id : 0);
+}
+
+public void checkSpelling(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_checkSpelling_1, sender != null ? sender.id : 0);
+}
+
+public void copy(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_copy_1, sender != null ? sender.id : 0);
+}
+
+public void copyFont(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_copyFont_1, sender != null ? sender.id : 0);
+}
+
+public void copyRuler(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_copyRuler_1, sender != null ? sender.id : 0);
+}
+
+public void cut(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_cut_1, sender != null ? sender.id : 0);
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public void delete(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_delete_1, sender != null ? sender.id : 0);
+}
+
+public boolean drawsBackground() {
+ return OS.objc_msgSend(this.id, OS.sel_drawsBackground) != 0;
+}
+
+public NSFont font() {
+ int result = OS.objc_msgSend(this.id, OS.sel_font);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public boolean importsGraphics() {
+ return OS.objc_msgSend(this.id, OS.sel_importsGraphics) != 0;
+}
+
+public boolean isEditable() {
+ return OS.objc_msgSend(this.id, OS.sel_isEditable) != 0;
+}
+
+public boolean isFieldEditor() {
+ return OS.objc_msgSend(this.id, OS.sel_isFieldEditor) != 0;
+}
+
+public boolean isHorizontallyResizable() {
+ return OS.objc_msgSend(this.id, OS.sel_isHorizontallyResizable) != 0;
+}
+
+public boolean isRichText() {
+ return OS.objc_msgSend(this.id, OS.sel_isRichText) != 0;
+}
+
+public boolean isRulerVisible() {
+ return OS.objc_msgSend(this.id, OS.sel_isRulerVisible) != 0;
+}
+
+public boolean isSelectable() {
+ return OS.objc_msgSend(this.id, OS.sel_isSelectable) != 0;
+}
+
+public boolean isVerticallyResizable() {
+ return OS.objc_msgSend(this.id, OS.sel_isVerticallyResizable) != 0;
+}
+
+public NSSize maxSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_maxSize);
+ return result;
+}
+
+public NSSize minSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_minSize);
+ return result;
+}
+
+public void paste(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_paste_1, sender != null ? sender.id : 0);
+}
+
+public void pasteFont(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_pasteFont_1, sender != null ? sender.id : 0);
+}
+
+public void pasteRuler(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_pasteRuler_1, sender != null ? sender.id : 0);
+}
+
+public boolean readRTFDFromFile(NSString path) {
+ return OS.objc_msgSend(this.id, OS.sel_readRTFDFromFile_1, path != null ? path.id : 0) != 0;
+}
+
+public void replaceCharactersInRange_withRTF_(NSRange range, NSData rtfData) {
+ OS.objc_msgSend(this.id, OS.sel_replaceCharactersInRange_1withRTF_1, range, rtfData != null ? rtfData.id : 0);
+}
+
+public void replaceCharactersInRange_withRTFD_(NSRange range, NSData rtfdData) {
+ OS.objc_msgSend(this.id, OS.sel_replaceCharactersInRange_1withRTFD_1, range, rtfdData != null ? rtfdData.id : 0);
+}
+
+public void replaceCharactersInRange_withString_(NSRange range, NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_replaceCharactersInRange_1withString_1, range, aString != null ? aString.id : 0);
+}
+
+public void scrollRangeToVisible(NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_scrollRangeToVisible_1, range);
+}
+
+public void selectAll(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectAll_1, sender != null ? sender.id : 0);
+}
+
+public NSRange selectedRange() {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_struct(result, this.id, OS.sel_selectedRange);
+ return result;
+}
+
+public void setAlignment(int mode) {
+ OS.objc_msgSend(this.id, OS.sel_setAlignment_1, mode);
+}
+
+public void setBackgroundColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color != null ? color.id : 0);
+}
+
+public void setBaseWritingDirection(int writingDirection) {
+ OS.objc_msgSend(this.id, OS.sel_setBaseWritingDirection_1, writingDirection);
+}
+
+public void setDelegate(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
+}
+
+public void setDrawsBackground(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setDrawsBackground_1, flag);
+}
+
+public void setEditable(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setEditable_1, flag);
+}
+
+public void setFieldEditor(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setFieldEditor_1, flag);
+}
+
+public void setFont_(NSFont obj) {
+ OS.objc_msgSend(this.id, OS.sel_setFont_1, obj != null ? obj.id : 0);
+}
+
+public void setFont_range_(NSFont font, NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_setFont_1range_1, font != null ? font.id : 0, range);
+}
+
+public void setHorizontallyResizable(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setHorizontallyResizable_1, flag);
+}
+
+public void setImportsGraphics(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setImportsGraphics_1, flag);
+}
+
+public void setMaxSize(NSSize newMaxSize) {
+ OS.objc_msgSend(this.id, OS.sel_setMaxSize_1, newMaxSize);
+}
+
+public void setMinSize(NSSize newMinSize) {
+ OS.objc_msgSend(this.id, OS.sel_setMinSize_1, newMinSize);
+}
+
+public void setRichText(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setRichText_1, flag);
+}
+
+public void setSelectable(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectable_1, flag);
+}
+
+public void setSelectedRange(NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectedRange_1, range);
+}
+
+public void setString(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setString_1, string != null ? string.id : 0);
+}
+
+public void setTextColor_(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setTextColor_1, color != null ? color.id : 0);
+}
+
+public void setTextColor_range_(NSColor color, NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_setTextColor_1range_1, color != null ? color.id : 0, range);
+}
+
+public void setUsesFontPanel(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setUsesFontPanel_1, flag);
+}
+
+public void setVerticallyResizable(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setVerticallyResizable_1, flag);
+}
+
+public void showGuessPanel(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_showGuessPanel_1, sender != null ? sender.id : 0);
+}
+
+public void sizeToFit() {
+ OS.objc_msgSend(this.id, OS.sel_sizeToFit);
+}
+
+public NSString string() {
+ int result = OS.objc_msgSend(this.id, OS.sel_string);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void subscript(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_subscript_1, sender != null ? sender.id : 0);
+}
+
+public void superscript(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_superscript_1, sender != null ? sender.id : 0);
+}
+
+public NSColor textColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public void toggleRuler(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_toggleRuler_1, sender != null ? sender.id : 0);
+}
+
+public void underline(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_underline_1, sender != null ? sender.id : 0);
+}
+
+public void unscript(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_unscript_1, sender != null ? sender.id : 0);
+}
+
+public boolean usesFontPanel() {
+ return OS.objc_msgSend(this.id, OS.sel_usesFontPanel) != 0;
+}
+
+public boolean writeRTFDToFile(NSString path, boolean flag) {
+ return OS.objc_msgSend(this.id, OS.sel_writeRTFDToFile_1atomically_1, path != null ? path.id : 0, flag) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextAttachment.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextAttachment.java
new file mode 100644
index 0000000000..71c2054718
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextAttachment.java
@@ -0,0 +1,36 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTextAttachment extends NSObject {
+
+public NSTextAttachment() {
+ super();
+}
+
+public NSTextAttachment(int id) {
+ super(id);
+}
+
+public id attachmentCell() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attachmentCell);
+ return result != 0 ? new id (result) : null;
+}
+
+public NSFileWrapper fileWrapper() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fileWrapper);
+ return result != 0 ? new NSFileWrapper(result) : null;
+}
+
+public id initWithFileWrapper(NSFileWrapper fileWrapper) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFileWrapper_1, fileWrapper != null ? fileWrapper.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void setAttachmentCell(id cell) {
+ OS.objc_msgSend(this.id, OS.sel_setAttachmentCell_1, cell != null ? cell.id : 0);
+}
+
+public void setFileWrapper(NSFileWrapper fileWrapper) {
+ OS.objc_msgSend(this.id, OS.sel_setFileWrapper_1, fileWrapper != null ? fileWrapper.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextBlock.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextBlock.java
new file mode 100644
index 0000000000..7ae6a218aa
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextBlock.java
@@ -0,0 +1,99 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTextBlock extends NSObject {
+
+public NSTextBlock() {
+ super();
+}
+
+public NSTextBlock(int id) {
+ super(id);
+}
+
+public NSColor backgroundColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public NSColor borderColorForEdge(int edge) {
+ int result = OS.objc_msgSend(this.id, OS.sel_borderColorForEdge_1, edge);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public NSRect boundsRectForContentRect(NSRect contentRect, NSRect rect, NSTextContainer textContainer, NSRange charRange) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_boundsRectForContentRect_1inRect_1textContainer_1characterRange_1, contentRect, rect, textContainer != null ? textContainer.id : 0, charRange);
+ return result;
+}
+
+public float contentWidth() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_contentWidth);
+}
+
+public int contentWidthValueType() {
+ return OS.objc_msgSend(this.id, OS.sel_contentWidthValueType);
+}
+
+public void drawBackgroundWithFrame(NSRect frameRect, NSView controlView, NSRange charRange, NSLayoutManager layoutManager) {
+ OS.objc_msgSend(this.id, OS.sel_drawBackgroundWithFrame_1inView_1characterRange_1layoutManager_1, frameRect, controlView != null ? controlView.id : 0, charRange, layoutManager != null ? layoutManager.id : 0);
+}
+
+public NSRect rectForLayoutAtPoint(NSPoint startingPoint, NSRect rect, NSTextContainer textContainer, NSRange charRange) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rectForLayoutAtPoint_1inRect_1textContainer_1characterRange_1, startingPoint, rect, textContainer != null ? textContainer.id : 0, charRange);
+ return result;
+}
+
+public void setBackgroundColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color != null ? color.id : 0);
+}
+
+public void setBorderColor_(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setBorderColor_1, color != null ? color.id : 0);
+}
+
+public void setBorderColor_forEdge_(NSColor color, int edge) {
+ OS.objc_msgSend(this.id, OS.sel_setBorderColor_1forEdge_1, color != null ? color.id : 0, edge);
+}
+
+public void setContentWidth(float val, int type) {
+ OS.objc_msgSend(this.id, OS.sel_setContentWidth_1type_1, val, type);
+}
+
+public void setValue(float val, int type, int dimension) {
+ OS.objc_msgSend(this.id, OS.sel_setValue_1type_1forDimension_1, val, type, dimension);
+}
+
+public void setVerticalAlignment(int alignment) {
+ OS.objc_msgSend(this.id, OS.sel_setVerticalAlignment_1, alignment);
+}
+
+public void setWidth_type_forLayer_(float val, int type, int layer) {
+ OS.objc_msgSend(this.id, OS.sel_setWidth_1type_1forLayer_1, val, type, layer);
+}
+
+public void setWidth_type_forLayer_edge_(float val, int type, int layer, int edge) {
+ OS.objc_msgSend(this.id, OS.sel_setWidth_1type_1forLayer_1edge_1, val, type, layer, edge);
+}
+
+public float valueForDimension(int dimension) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_valueForDimension_1, dimension);
+}
+
+public int valueTypeForDimension(int dimension) {
+ return OS.objc_msgSend(this.id, OS.sel_valueTypeForDimension_1, dimension);
+}
+
+public int verticalAlignment() {
+ return OS.objc_msgSend(this.id, OS.sel_verticalAlignment);
+}
+
+public float widthForLayer(int layer, int edge) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_widthForLayer_1edge_1, layer, edge);
+}
+
+public int widthValueTypeForLayer(int layer, int edge) {
+ return OS.objc_msgSend(this.id, OS.sel_widthValueTypeForLayer_1edge_1, layer, edge);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextContainer.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextContainer.java
new file mode 100644
index 0000000000..56e6cb573f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextContainer.java
@@ -0,0 +1,88 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTextContainer extends NSObject {
+
+public NSTextContainer() {
+ super();
+}
+
+public NSTextContainer(int id) {
+ super(id);
+}
+
+public NSSize containerSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_containerSize);
+ return result;
+}
+
+public boolean containsPoint(NSPoint point) {
+ return OS.objc_msgSend(this.id, OS.sel_containsPoint_1, point) != 0;
+}
+
+public boolean heightTracksTextView() {
+ return OS.objc_msgSend(this.id, OS.sel_heightTracksTextView) != 0;
+}
+
+public id initWithContainerSize(NSSize size) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContainerSize_1, size);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isSimpleRectangularTextContainer() {
+ return OS.objc_msgSend(this.id, OS.sel_isSimpleRectangularTextContainer) != 0;
+}
+
+public NSLayoutManager layoutManager() {
+ int result = OS.objc_msgSend(this.id, OS.sel_layoutManager);
+ return result != 0 ? new NSLayoutManager(result) : null;
+}
+
+public float lineFragmentPadding() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_lineFragmentPadding);
+}
+
+public NSRect lineFragmentRectForProposedRect(NSRect proposedRect, int sweepDirection, int movementDirection, int remainingRect) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_lineFragmentRectForProposedRect_1sweepDirection_1movementDirection_1remainingRect_1, proposedRect, sweepDirection, movementDirection, remainingRect);
+ return result;
+}
+
+public void replaceLayoutManager(NSLayoutManager newLayoutManager) {
+ OS.objc_msgSend(this.id, OS.sel_replaceLayoutManager_1, newLayoutManager != null ? newLayoutManager.id : 0);
+}
+
+public void setContainerSize(NSSize size) {
+ OS.objc_msgSend(this.id, OS.sel_setContainerSize_1, size);
+}
+
+public void setHeightTracksTextView(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setHeightTracksTextView_1, flag);
+}
+
+public void setLayoutManager(NSLayoutManager layoutManager) {
+ OS.objc_msgSend(this.id, OS.sel_setLayoutManager_1, layoutManager != null ? layoutManager.id : 0);
+}
+
+public void setLineFragmentPadding(float pad) {
+ OS.objc_msgSend(this.id, OS.sel_setLineFragmentPadding_1, pad);
+}
+
+public void setTextView(NSTextView textView) {
+ OS.objc_msgSend(this.id, OS.sel_setTextView_1, textView != null ? textView.id : 0);
+}
+
+public void setWidthTracksTextView(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setWidthTracksTextView_1, flag);
+}
+
+public NSTextView textView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textView);
+ return result != 0 ? new NSTextView(result) : null;
+}
+
+public boolean widthTracksTextView() {
+ return OS.objc_msgSend(this.id, OS.sel_widthTracksTextView) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextField.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextField.java
new file mode 100644
index 0000000000..f8a4d1b454
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextField.java
@@ -0,0 +1,136 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTextField extends NSControl {
+
+public NSTextField() {
+ super();
+}
+
+public NSTextField(int id) {
+ super(id);
+}
+
+public boolean acceptsFirstResponder() {
+ return OS.objc_msgSend(this.id, OS.sel_acceptsFirstResponder) != 0;
+}
+
+public boolean allowsEditingTextAttributes() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsEditingTextAttributes) != 0;
+}
+
+public NSColor backgroundColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public int bezelStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_bezelStyle);
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean drawsBackground() {
+ return OS.objc_msgSend(this.id, OS.sel_drawsBackground) != 0;
+}
+
+public boolean importsGraphics() {
+ return OS.objc_msgSend(this.id, OS.sel_importsGraphics) != 0;
+}
+
+public boolean isBezeled() {
+ return OS.objc_msgSend(this.id, OS.sel_isBezeled) != 0;
+}
+
+public boolean isBordered() {
+ return OS.objc_msgSend(this.id, OS.sel_isBordered) != 0;
+}
+
+public boolean isEditable() {
+ return OS.objc_msgSend(this.id, OS.sel_isEditable) != 0;
+}
+
+public boolean isSelectable() {
+ return OS.objc_msgSend(this.id, OS.sel_isSelectable) != 0;
+}
+
+public void selectText(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectText_1, sender != null ? sender.id : 0);
+}
+
+public void setAllowsEditingTextAttributes(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsEditingTextAttributes_1, flag);
+}
+
+public void setBackgroundColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color != null ? color.id : 0);
+}
+
+public void setBezelStyle(int style) {
+ OS.objc_msgSend(this.id, OS.sel_setBezelStyle_1, style);
+}
+
+public void setBezeled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setBezeled_1, flag);
+}
+
+public void setBordered(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setBordered_1, flag);
+}
+
+public void setDelegate(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
+}
+
+public void setDrawsBackground(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setDrawsBackground_1, flag);
+}
+
+public void setEditable(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setEditable_1, flag);
+}
+
+public void setImportsGraphics(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setImportsGraphics_1, flag);
+}
+
+public void setSelectable(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectable_1, flag);
+}
+
+public void setTextColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setTextColor_1, color != null ? color.id : 0);
+}
+
+public void setTitleWithMnemonic(NSString stringWithAmpersand) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleWithMnemonic_1, stringWithAmpersand != null ? stringWithAmpersand.id : 0);
+}
+
+public NSColor textColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public void textDidBeginEditing(NSNotification notification) {
+ OS.objc_msgSend(this.id, OS.sel_textDidBeginEditing_1, notification != null ? notification.id : 0);
+}
+
+public void textDidChange(NSNotification notification) {
+ OS.objc_msgSend(this.id, OS.sel_textDidChange_1, notification != null ? notification.id : 0);
+}
+
+public void textDidEndEditing(NSNotification notification) {
+ OS.objc_msgSend(this.id, OS.sel_textDidEndEditing_1, notification != null ? notification.id : 0);
+}
+
+public boolean textShouldBeginEditing(NSText textObject) {
+ return OS.objc_msgSend(this.id, OS.sel_textShouldBeginEditing_1, textObject != null ? textObject.id : 0) != 0;
+}
+
+public boolean textShouldEndEditing(NSText textObject) {
+ return OS.objc_msgSend(this.id, OS.sel_textShouldEndEditing_1, textObject != null ? textObject.id : 0) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextFieldCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextFieldCell.java
new file mode 100644
index 0000000000..244d6fa3d0
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextFieldCell.java
@@ -0,0 +1,83 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTextFieldCell extends NSActionCell {
+
+public NSTextFieldCell() {
+ super();
+}
+
+public NSTextFieldCell(int id) {
+ super(id);
+}
+
+public NSArray allowedInputSourceLocales() {
+ int result = OS.objc_msgSend(this.id, OS.sel_allowedInputSourceLocales);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSColor backgroundColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public int bezelStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_bezelStyle);
+}
+
+public boolean drawsBackground() {
+ return OS.objc_msgSend(this.id, OS.sel_drawsBackground) != 0;
+}
+
+public NSAttributedString placeholderAttributedString() {
+ int result = OS.objc_msgSend(this.id, OS.sel_placeholderAttributedString);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public NSString placeholderString() {
+ int result = OS.objc_msgSend(this.id, OS.sel_placeholderString);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void setAllowedInputSourceLocales(NSArray localeIdentifiers) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowedInputSourceLocales_1, localeIdentifiers != null ? localeIdentifiers.id : 0);
+}
+
+public void setBackgroundColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color != null ? color.id : 0);
+}
+
+public void setBezelStyle(int style) {
+ OS.objc_msgSend(this.id, OS.sel_setBezelStyle_1, style);
+}
+
+public void setDrawsBackground(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setDrawsBackground_1, flag);
+}
+
+public void setPlaceholderAttributedString(NSAttributedString string) {
+ OS.objc_msgSend(this.id, OS.sel_setPlaceholderAttributedString_1, string != null ? string.id : 0);
+}
+
+public void setPlaceholderString(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setPlaceholderString_1, string != null ? string.id : 0);
+}
+
+public void setTextColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setTextColor_1, color != null ? color.id : 0);
+}
+
+public NSText setUpFieldEditorAttributes(NSText textObj) {
+ int result = OS.objc_msgSend(this.id, OS.sel_setUpFieldEditorAttributes_1, textObj != null ? textObj.id : 0);
+ return result != 0 ? new NSText(result) : null;
+}
+
+public void setWantsNotificationForMarkedText(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setWantsNotificationForMarkedText_1, flag);
+}
+
+public NSColor textColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextList.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextList.java
new file mode 100644
index 0000000000..4634e94fc4
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextList.java
@@ -0,0 +1,32 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTextList extends NSObject {
+
+public NSTextList() {
+ super();
+}
+
+public NSTextList(int id) {
+ super(id);
+}
+
+public NSTextList initWithMarkerFormat(NSString format, int mask) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithMarkerFormat_1options_1, format != null ? format.id : 0, mask);
+ return result != 0 ? this : null;
+}
+
+public int listOptions() {
+ return OS.objc_msgSend(this.id, OS.sel_listOptions);
+}
+
+public NSString markerForItemNumber(int itemNum) {
+ int result = OS.objc_msgSend(this.id, OS.sel_markerForItemNumber_1, itemNum);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString markerFormat() {
+ int result = OS.objc_msgSend(this.id, OS.sel_markerFormat);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextStorage.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextStorage.java
new file mode 100644
index 0000000000..8b5136a290
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextStorage.java
@@ -0,0 +1,123 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTextStorage extends NSMutableAttributedString {
+
+public NSTextStorage() {
+ super();
+}
+
+public NSTextStorage(int id) {
+ super(id);
+}
+
+public void addLayoutManager(NSLayoutManager obj) {
+ OS.objc_msgSend(this.id, OS.sel_addLayoutManager_1, obj != null ? obj.id : 0);
+}
+
+public NSArray attributeRuns() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributeRuns);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public int changeInLength() {
+ return OS.objc_msgSend(this.id, OS.sel_changeInLength);
+}
+
+public NSArray characters() {
+ int result = OS.objc_msgSend(this.id, OS.sel_characters);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public void edited(int editedMask, NSRange range, int delta) {
+ OS.objc_msgSend(this.id, OS.sel_edited_1range_1changeInLength_1, editedMask, range, delta);
+}
+
+public int editedMask() {
+ return OS.objc_msgSend(this.id, OS.sel_editedMask);
+}
+
+public NSRange editedRange() {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_editedRange);
+ return result;
+}
+
+public void ensureAttributesAreFixedInRange(NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_ensureAttributesAreFixedInRange_1, range);
+}
+
+public boolean fixesAttributesLazily() {
+ return OS.objc_msgSend(this.id, OS.sel_fixesAttributesLazily) != 0;
+}
+
+public NSFont font() {
+ int result = OS.objc_msgSend(this.id, OS.sel_font);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public NSColor foregroundColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_foregroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public void invalidateAttributesInRange(NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_invalidateAttributesInRange_1, range);
+}
+
+public NSArray layoutManagers() {
+ int result = OS.objc_msgSend(this.id, OS.sel_layoutManagers);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray paragraphs() {
+ int result = OS.objc_msgSend(this.id, OS.sel_paragraphs);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void processEditing() {
+ OS.objc_msgSend(this.id, OS.sel_processEditing);
+}
+
+public void removeLayoutManager(NSLayoutManager obj) {
+ OS.objc_msgSend(this.id, OS.sel_removeLayoutManager_1, obj != null ? obj.id : 0);
+}
+
+public void setAttributeRuns(NSArray attributeRuns) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributeRuns_1, attributeRuns != null ? attributeRuns.id : 0);
+}
+
+public void setCharacters(NSArray characters) {
+ OS.objc_msgSend(this.id, OS.sel_setCharacters_1, characters != null ? characters.id : 0);
+}
+
+public void setDelegate(id delegate) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegate != null ? delegate.id : 0);
+}
+
+public void setFont(NSFont font) {
+ OS.objc_msgSend(this.id, OS.sel_setFont_1, font != null ? font.id : 0);
+}
+
+public void setForegroundColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setForegroundColor_1, color != null ? color.id : 0);
+}
+
+public void setParagraphs(NSArray paragraphs) {
+ OS.objc_msgSend(this.id, OS.sel_setParagraphs_1, paragraphs != null ? paragraphs.id : 0);
+}
+
+public void setWords(NSArray words) {
+ OS.objc_msgSend(this.id, OS.sel_setWords_1, words != null ? words.id : 0);
+}
+
+public NSArray words() {
+ int result = OS.objc_msgSend(this.id, OS.sel_words);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextTab.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextTab.java
new file mode 100644
index 0000000000..60dfc42ce0
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextTab.java
@@ -0,0 +1,40 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTextTab extends NSObject {
+
+public NSTextTab() {
+ super();
+}
+
+public NSTextTab(int id) {
+ super(id);
+}
+
+public int alignment() {
+ return OS.objc_msgSend(this.id, OS.sel_alignment);
+}
+
+public NSTextTab initWithTextAlignment(int alignment, float loc, NSDictionary options) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithTextAlignment_1location_1options_1, alignment, loc, options != null ? options.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSTextTab initWithType(int type, float loc) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithType_1location_1, type, loc);
+ return result != 0 ? this : null;
+}
+
+public float location() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_location);
+}
+
+public NSDictionary options() {
+ int result = OS.objc_msgSend(this.id, OS.sel_options);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public int tabStopType() {
+ return OS.objc_msgSend(this.id, OS.sel_tabStopType);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextTable.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextTable.java
new file mode 100644
index 0000000000..9ed765a11b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextTable.java
@@ -0,0 +1,61 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTextTable extends NSTextBlock {
+
+public NSTextTable() {
+ super();
+}
+
+public NSTextTable(int id) {
+ super(id);
+}
+
+public NSRect boundsRectForBlock(NSTextTableBlock block, NSRect contentRect, NSRect rect, NSTextContainer textContainer, NSRange charRange) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_boundsRectForBlock_1contentRect_1inRect_1textContainer_1characterRange_1, block != null ? block.id : 0, contentRect, rect, textContainer != null ? textContainer.id : 0, charRange);
+ return result;
+}
+
+public boolean collapsesBorders() {
+ return OS.objc_msgSend(this.id, OS.sel_collapsesBorders) != 0;
+}
+
+public void drawBackgroundForBlock(NSTextTableBlock block, NSRect frameRect, NSView controlView, NSRange charRange, NSLayoutManager layoutManager) {
+ OS.objc_msgSend(this.id, OS.sel_drawBackgroundForBlock_1withFrame_1inView_1characterRange_1layoutManager_1, block != null ? block.id : 0, frameRect, controlView != null ? controlView.id : 0, charRange, layoutManager != null ? layoutManager.id : 0);
+}
+
+public boolean hidesEmptyCells() {
+ return OS.objc_msgSend(this.id, OS.sel_hidesEmptyCells) != 0;
+}
+
+public int layoutAlgorithm() {
+ return OS.objc_msgSend(this.id, OS.sel_layoutAlgorithm);
+}
+
+public int numberOfColumns() {
+ return OS.objc_msgSend(this.id, OS.sel_numberOfColumns);
+}
+
+public NSRect rectForBlock(NSTextTableBlock block, NSPoint startingPoint, NSRect rect, NSTextContainer textContainer, NSRange charRange) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rectForBlock_1layoutAtPoint_1inRect_1textContainer_1characterRange_1, block != null ? block.id : 0, startingPoint, rect, textContainer != null ? textContainer.id : 0, charRange);
+ return result;
+}
+
+public void setCollapsesBorders(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setCollapsesBorders_1, flag);
+}
+
+public void setHidesEmptyCells(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setHidesEmptyCells_1, flag);
+}
+
+public void setLayoutAlgorithm(int algorithm) {
+ OS.objc_msgSend(this.id, OS.sel_setLayoutAlgorithm_1, algorithm);
+}
+
+public void setNumberOfColumns(int numCols) {
+ OS.objc_msgSend(this.id, OS.sel_setNumberOfColumns_1, numCols);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextTableBlock.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextTableBlock.java
new file mode 100644
index 0000000000..0177d03d38
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextTableBlock.java
@@ -0,0 +1,39 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTextTableBlock extends NSTextBlock {
+
+public NSTextTableBlock() {
+ super();
+}
+
+public NSTextTableBlock(int id) {
+ super(id);
+}
+
+public int columnSpan() {
+ return OS.objc_msgSend(this.id, OS.sel_columnSpan);
+}
+
+public id initWithTable(NSTextTable table, int row, int rowSpan, int col, int colSpan) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithTable_1startingRow_1rowSpan_1startingColumn_1columnSpan_1, table != null ? table.id : 0, row, rowSpan, col, colSpan);
+ return result != 0 ? new id(result) : null;
+}
+
+public int rowSpan() {
+ return OS.objc_msgSend(this.id, OS.sel_rowSpan);
+}
+
+public int startingColumn() {
+ return OS.objc_msgSend(this.id, OS.sel_startingColumn);
+}
+
+public int startingRow() {
+ return OS.objc_msgSend(this.id, OS.sel_startingRow);
+}
+
+public NSTextTable table() {
+ int result = OS.objc_msgSend(this.id, OS.sel_table);
+ return result != 0 ? new NSTextTable(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextView.java
new file mode 100644
index 0000000000..af53dab2dd
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTextView.java
@@ -0,0 +1,726 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTextView extends NSText {
+
+public NSTextView() {
+ super();
+}
+
+public NSTextView(int id) {
+ super(id);
+}
+
+public NSArray acceptableDragTypes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_acceptableDragTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean acceptsGlyphInfo() {
+ return OS.objc_msgSend(this.id, OS.sel_acceptsGlyphInfo) != 0;
+}
+
+public void alignJustified(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_alignJustified_1, sender != null ? sender.id : 0);
+}
+
+public NSArray allowedInputSourceLocales() {
+ int result = OS.objc_msgSend(this.id, OS.sel_allowedInputSourceLocales);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean allowsDocumentBackgroundColorChange() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsDocumentBackgroundColorChange) != 0;
+}
+
+public boolean allowsImageEditing() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsImageEditing) != 0;
+}
+
+public boolean allowsUndo() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsUndo) != 0;
+}
+
+public NSColor backgroundColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public void breakUndoCoalescing() {
+ OS.objc_msgSend(this.id, OS.sel_breakUndoCoalescing);
+}
+
+public void changeAttributes(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_changeAttributes_1, sender != null ? sender.id : 0);
+}
+
+public void changeColor(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_changeColor_1, sender != null ? sender.id : 0);
+}
+
+public void changeDocumentBackgroundColor(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_changeDocumentBackgroundColor_1, sender != null ? sender.id : 0);
+}
+
+public int characterIndexForInsertionAtPoint(NSPoint point) {
+ return OS.objc_msgSend(this.id, OS.sel_characterIndexForInsertionAtPoint_1, point);
+}
+
+public void cleanUpAfterDragOperation() {
+ OS.objc_msgSend(this.id, OS.sel_cleanUpAfterDragOperation);
+}
+
+public void clickedOnLink(id link, int charIndex) {
+ OS.objc_msgSend(this.id, OS.sel_clickedOnLink_1atIndex_1, link != null ? link.id : 0, charIndex);
+}
+
+public void complete(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_complete_1, sender != null ? sender.id : 0);
+}
+
+public NSArray completionsForPartialWordRange(NSRange charRange, int index) {
+ int result = OS.objc_msgSend(this.id, OS.sel_completionsForPartialWordRange_1indexOfSelectedItem_1, charRange, index);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSParagraphStyle defaultParagraphStyle() {
+ int result = OS.objc_msgSend(this.id, OS.sel_defaultParagraphStyle);
+ return result != 0 ? new NSParagraphStyle(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public void didChangeText() {
+ OS.objc_msgSend(this.id, OS.sel_didChangeText);
+}
+
+public boolean displaysLinkToolTips() {
+ return OS.objc_msgSend(this.id, OS.sel_displaysLinkToolTips) != 0;
+}
+
+public NSImage dragImageForSelectionWithEvent(NSEvent event, int origin) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dragImageForSelectionWithEvent_1origin_1, event != null ? event.id : 0, origin);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public int dragOperationForDraggingInfo(id dragInfo, NSString type) {
+ return OS.objc_msgSend(this.id, OS.sel_dragOperationForDraggingInfo_1type_1, dragInfo != null ? dragInfo.id : 0, type != null ? type.id : 0);
+}
+
+public boolean dragSelectionWithEvent(NSEvent event, NSSize mouseOffset, boolean slideBack) {
+ return OS.objc_msgSend(this.id, OS.sel_dragSelectionWithEvent_1offset_1slideBack_1, event != null ? event.id : 0, mouseOffset, slideBack) != 0;
+}
+
+public void drawInsertionPointInRect(NSRect rect, NSColor color, boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_drawInsertionPointInRect_1color_1turnedOn_1, rect, color != null ? color.id : 0, flag);
+}
+
+public void drawViewBackgroundInRect(NSRect rect) {
+ OS.objc_msgSend(this.id, OS.sel_drawViewBackgroundInRect_1, rect);
+}
+
+public boolean drawsBackground() {
+ return OS.objc_msgSend(this.id, OS.sel_drawsBackground) != 0;
+}
+
+public NSRect firstRectForCharacterRange(NSRange range) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, id, OS.sel_firstRectForCharacterRange_1, range);
+ return result;
+}
+
+public boolean importsGraphics() {
+ return OS.objc_msgSend(this.id, OS.sel_importsGraphics) != 0;
+}
+
+public id initWithFrame_(NSRect frameRect) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFrame_1, frameRect);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithFrame_textContainer_(NSRect frameRect, NSTextContainer container) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFrame_1textContainer_1, frameRect, container != null ? container.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void insertCompletion(NSString word, NSRange charRange, int movement, boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_insertCompletion_1forPartialWordRange_1movement_1isFinal_1, word != null ? word.id : 0, charRange, movement, flag);
+}
+
+public void insertText(id insertString) {
+ OS.objc_msgSend(this.id, OS.sel_insertText_1, insertString != null ? insertString.id : 0);
+}
+
+public NSColor insertionPointColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_insertionPointColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public void invalidateTextContainerOrigin() {
+ OS.objc_msgSend(this.id, OS.sel_invalidateTextContainerOrigin);
+}
+
+public boolean isAutomaticLinkDetectionEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_isAutomaticLinkDetectionEnabled) != 0;
+}
+
+public boolean isAutomaticQuoteSubstitutionEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_isAutomaticQuoteSubstitutionEnabled) != 0;
+}
+
+public boolean isContinuousSpellCheckingEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_isContinuousSpellCheckingEnabled) != 0;
+}
+
+public boolean isEditable() {
+ return OS.objc_msgSend(this.id, OS.sel_isEditable) != 0;
+}
+
+public boolean isFieldEditor() {
+ return OS.objc_msgSend(this.id, OS.sel_isFieldEditor) != 0;
+}
+
+public boolean isGrammarCheckingEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_isGrammarCheckingEnabled) != 0;
+}
+
+public boolean isRichText() {
+ return OS.objc_msgSend(this.id, OS.sel_isRichText) != 0;
+}
+
+public boolean isRulerVisible() {
+ return OS.objc_msgSend(this.id, OS.sel_isRulerVisible) != 0;
+}
+
+public boolean isSelectable() {
+ return OS.objc_msgSend(this.id, OS.sel_isSelectable) != 0;
+}
+
+public NSLayoutManager layoutManager() {
+ int result = OS.objc_msgSend(this.id, OS.sel_layoutManager);
+ return result != 0 ? new NSLayoutManager(result) : null;
+}
+
+public NSDictionary linkTextAttributes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_linkTextAttributes);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public void loosenKerning(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_loosenKerning_1, sender != null ? sender.id : 0);
+}
+
+public void lowerBaseline(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_lowerBaseline_1, sender != null ? sender.id : 0);
+}
+
+public NSDictionary markedTextAttributes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_markedTextAttributes);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public void orderFrontLinkPanel(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_orderFrontLinkPanel_1, sender != null ? sender.id : 0);
+}
+
+public void orderFrontListPanel(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_orderFrontListPanel_1, sender != null ? sender.id : 0);
+}
+
+public void orderFrontSpacingPanel(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_orderFrontSpacingPanel_1, sender != null ? sender.id : 0);
+}
+
+public void orderFrontTablePanel(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_orderFrontTablePanel_1, sender != null ? sender.id : 0);
+}
+
+public void outline(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_outline_1, sender != null ? sender.id : 0);
+}
+
+public void pasteAsPlainText(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_pasteAsPlainText_1, sender != null ? sender.id : 0);
+}
+
+public void pasteAsRichText(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_pasteAsRichText_1, sender != null ? sender.id : 0);
+}
+
+public void performFindPanelAction(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_performFindPanelAction_1, sender != null ? sender.id : 0);
+}
+
+public NSString preferredPasteboardTypeFromArray(NSArray availableTypes, NSArray allowedTypes) {
+ int result = OS.objc_msgSend(this.id, OS.sel_preferredPasteboardTypeFromArray_1restrictedToTypesFromArray_1, availableTypes != null ? availableTypes.id : 0, allowedTypes != null ? allowedTypes.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void raiseBaseline(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_raiseBaseline_1, sender != null ? sender.id : 0);
+}
+
+public NSRange rangeForUserCharacterAttributeChange() {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rangeForUserCharacterAttributeChange);
+ return result;
+}
+
+public NSRange rangeForUserCompletion() {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rangeForUserCompletion);
+ return result;
+}
+
+public NSRange rangeForUserParagraphAttributeChange() {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rangeForUserParagraphAttributeChange);
+ return result;
+}
+
+public NSRange rangeForUserTextChange() {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rangeForUserTextChange);
+ return result;
+}
+
+public NSArray rangesForUserCharacterAttributeChange() {
+ int result = OS.objc_msgSend(this.id, OS.sel_rangesForUserCharacterAttributeChange);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray rangesForUserParagraphAttributeChange() {
+ int result = OS.objc_msgSend(this.id, OS.sel_rangesForUserParagraphAttributeChange);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray rangesForUserTextChange() {
+ int result = OS.objc_msgSend(this.id, OS.sel_rangesForUserTextChange);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean readSelectionFromPasteboard_(NSPasteboard pboard) {
+ return OS.objc_msgSend(this.id, OS.sel_readSelectionFromPasteboard_1, pboard != null ? pboard.id : 0) != 0;
+}
+
+public boolean readSelectionFromPasteboard_type_(NSPasteboard pboard, NSString type) {
+ return OS.objc_msgSend(this.id, OS.sel_readSelectionFromPasteboard_1type_1, pboard != null ? pboard.id : 0, type != null ? type.id : 0) != 0;
+}
+
+public NSArray readablePasteboardTypes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_readablePasteboardTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static void registerForServices() {
+ OS.objc_msgSend(OS.class_NSTextView, OS.sel_registerForServices);
+}
+
+public void replaceTextContainer(NSTextContainer newContainer) {
+ OS.objc_msgSend(this.id, OS.sel_replaceTextContainer_1, newContainer != null ? newContainer.id : 0);
+}
+
+public void rulerView_didAddMarker_(NSRulerView ruler, NSRulerMarker marker) {
+ OS.objc_msgSend(this.id, OS.sel_rulerView_1didAddMarker_1, ruler != null ? ruler.id : 0, marker != null ? marker.id : 0);
+}
+
+public void rulerView_didMoveMarker_(NSRulerView ruler, NSRulerMarker marker) {
+ OS.objc_msgSend(this.id, OS.sel_rulerView_1didMoveMarker_1, ruler != null ? ruler.id : 0, marker != null ? marker.id : 0);
+}
+
+public void rulerView_didRemoveMarker_(NSRulerView ruler, NSRulerMarker marker) {
+ OS.objc_msgSend(this.id, OS.sel_rulerView_1didRemoveMarker_1, ruler != null ? ruler.id : 0, marker != null ? marker.id : 0);
+}
+
+public void rulerView_handleMouseDown_(NSRulerView ruler, NSEvent event) {
+ OS.objc_msgSend(this.id, OS.sel_rulerView_1handleMouseDown_1, ruler != null ? ruler.id : 0, event != null ? event.id : 0);
+}
+
+public boolean rulerView_shouldAddMarker_(NSRulerView ruler, NSRulerMarker marker) {
+ return OS.objc_msgSend(this.id, OS.sel_rulerView_1shouldAddMarker_1, ruler != null ? ruler.id : 0, marker != null ? marker.id : 0) != 0;
+}
+
+public boolean rulerView_shouldMoveMarker_(NSRulerView ruler, NSRulerMarker marker) {
+ return OS.objc_msgSend(this.id, OS.sel_rulerView_1shouldMoveMarker_1, ruler != null ? ruler.id : 0, marker != null ? marker.id : 0) != 0;
+}
+
+public boolean rulerView_shouldRemoveMarker_(NSRulerView ruler, NSRulerMarker marker) {
+ return OS.objc_msgSend(this.id, OS.sel_rulerView_1shouldRemoveMarker_1, ruler != null ? ruler.id : 0, marker != null ? marker.id : 0) != 0;
+}
+
+public float rulerView_willAddMarker_atLocation_(NSRulerView ruler, NSRulerMarker marker, float location) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_rulerView_1willAddMarker_1atLocation_1, ruler != null ? ruler.id : 0, marker != null ? marker.id : 0, location);
+}
+
+public float rulerView_willMoveMarker_toLocation_(NSRulerView ruler, NSRulerMarker marker, float location) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_rulerView_1willMoveMarker_1toLocation_1, ruler != null ? ruler.id : 0, marker != null ? marker.id : 0, location);
+}
+
+public NSArray selectedRanges() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedRanges);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSDictionary selectedTextAttributes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedTextAttributes);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public int selectionAffinity() {
+ return OS.objc_msgSend(this.id, OS.sel_selectionAffinity);
+}
+
+public int selectionGranularity() {
+ return OS.objc_msgSend(this.id, OS.sel_selectionGranularity);
+}
+
+public NSRange selectionRangeForProposedRange(NSRange proposedCharRange, int granularity) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_selectionRangeForProposedRange_1granularity_1, proposedCharRange, granularity);
+ return result;
+}
+
+public void setAcceptsGlyphInfo(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAcceptsGlyphInfo_1, flag);
+}
+
+public void setAlignment(int alignment, NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_setAlignment_1range_1, alignment, range);
+}
+
+public void setAllowedInputSourceLocales(NSArray localeIdentifiers) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowedInputSourceLocales_1, localeIdentifiers != null ? localeIdentifiers.id : 0);
+}
+
+public void setAllowsDocumentBackgroundColorChange(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsDocumentBackgroundColorChange_1, flag);
+}
+
+public void setAllowsImageEditing(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsImageEditing_1, flag);
+}
+
+public void setAllowsUndo(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsUndo_1, flag);
+}
+
+public void setAutomaticLinkDetectionEnabled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAutomaticLinkDetectionEnabled_1, flag);
+}
+
+public void setAutomaticQuoteSubstitutionEnabled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAutomaticQuoteSubstitutionEnabled_1, flag);
+}
+
+public void setBackgroundColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color != null ? color.id : 0);
+}
+
+public void setBaseWritingDirection(int writingDirection, NSRange range) {
+ OS.objc_msgSend(this.id, OS.sel_setBaseWritingDirection_1range_1, writingDirection, range);
+}
+
+public void setConstrainedFrameSize(NSSize desiredSize) {
+ OS.objc_msgSend(this.id, OS.sel_setConstrainedFrameSize_1, desiredSize);
+}
+
+public void setContinuousSpellCheckingEnabled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setContinuousSpellCheckingEnabled_1, flag);
+}
+
+public void setDefaultParagraphStyle(NSParagraphStyle paragraphStyle) {
+ OS.objc_msgSend(this.id, OS.sel_setDefaultParagraphStyle_1, paragraphStyle != null ? paragraphStyle.id : 0);
+}
+
+public void setDelegate(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
+}
+
+public void setDisplaysLinkToolTips(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setDisplaysLinkToolTips_1, flag);
+}
+
+public void setDrawsBackground(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setDrawsBackground_1, flag);
+}
+
+public void setEditable(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setEditable_1, flag);
+}
+
+public void setFieldEditor(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setFieldEditor_1, flag);
+}
+
+public void setGrammarCheckingEnabled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setGrammarCheckingEnabled_1, flag);
+}
+
+public void setImportsGraphics(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setImportsGraphics_1, flag);
+}
+
+public void setInsertionPointColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setInsertionPointColor_1, color != null ? color.id : 0);
+}
+
+public void setLinkTextAttributes(NSDictionary attributeDictionary) {
+ OS.objc_msgSend(this.id, OS.sel_setLinkTextAttributes_1, attributeDictionary != null ? attributeDictionary.id : 0);
+}
+
+public void setMarkedTextAttributes(NSDictionary attributeDictionary) {
+ OS.objc_msgSend(this.id, OS.sel_setMarkedTextAttributes_1, attributeDictionary != null ? attributeDictionary.id : 0);
+}
+
+public void setNeedsDisplayInRect(NSRect rect, boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setNeedsDisplayInRect_1avoidAdditionalLayout_1, rect, flag);
+}
+
+public void setRichText(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setRichText_1, flag);
+}
+
+public void setRulerVisible(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setRulerVisible_1, flag);
+}
+
+public void setSelectable(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectable_1, flag);
+}
+
+public void setSelectedRange_(NSRange charRange) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectedRange_1, charRange);
+}
+
+public void setSelectedRange_affinity_stillSelecting_(NSRange charRange, int affinity, boolean stillSelectingFlag) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectedRange_1affinity_1stillSelecting_1, charRange, affinity, stillSelectingFlag);
+}
+
+public void setSelectedRanges_(NSArray ranges) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectedRanges_1, ranges != null ? ranges.id : 0);
+}
+
+public void setSelectedRanges_affinity_stillSelecting_(NSArray ranges, int affinity, boolean stillSelectingFlag) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectedRanges_1affinity_1stillSelecting_1, ranges != null ? ranges.id : 0, affinity, stillSelectingFlag);
+}
+
+public void setSelectedTextAttributes(NSDictionary attributeDictionary) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectedTextAttributes_1, attributeDictionary != null ? attributeDictionary.id : 0);
+}
+
+public void setSelectionGranularity(int granularity) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectionGranularity_1, granularity);
+}
+
+public void setSmartInsertDeleteEnabled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setSmartInsertDeleteEnabled_1, flag);
+}
+
+public void setSpellingState(int value, NSRange charRange) {
+ OS.objc_msgSend(this.id, OS.sel_setSpellingState_1range_1, value, charRange);
+}
+
+public void setTextContainer(NSTextContainer container) {
+ OS.objc_msgSend(this.id, OS.sel_setTextContainer_1, container != null ? container.id : 0);
+}
+
+public void setTextContainerInset(NSSize inset) {
+ OS.objc_msgSend(this.id, OS.sel_setTextContainerInset_1, inset);
+}
+
+public void setTypingAttributes(NSDictionary attrs) {
+ OS.objc_msgSend(this.id, OS.sel_setTypingAttributes_1, attrs != null ? attrs.id : 0);
+}
+
+public void setUsesFindPanel(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setUsesFindPanel_1, flag);
+}
+
+public void setUsesFontPanel(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setUsesFontPanel_1, flag);
+}
+
+public void setUsesRuler(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setUsesRuler_1, flag);
+}
+
+public boolean shouldChangeTextInRange(NSRange affectedCharRange, NSString replacementString) {
+ return OS.objc_msgSend(this.id, OS.sel_shouldChangeTextInRange_1replacementString_1, affectedCharRange, replacementString != null ? replacementString.id : 0) != 0;
+}
+
+public boolean shouldChangeTextInRanges(NSArray affectedRanges, NSArray replacementStrings) {
+ return OS.objc_msgSend(this.id, OS.sel_shouldChangeTextInRanges_1replacementStrings_1, affectedRanges != null ? affectedRanges.id : 0, replacementStrings != null ? replacementStrings.id : 0) != 0;
+}
+
+public boolean shouldDrawInsertionPoint() {
+ return OS.objc_msgSend(this.id, OS.sel_shouldDrawInsertionPoint) != 0;
+}
+
+public void showFindIndicatorForRange(NSRange charRange) {
+ OS.objc_msgSend(this.id, OS.sel_showFindIndicatorForRange_1, charRange);
+}
+
+public NSRange smartDeleteRangeForProposedRange(NSRange proposedCharRange) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_smartDeleteRangeForProposedRange_1, proposedCharRange);
+ return result;
+}
+
+public NSString smartInsertAfterStringForString(NSString pasteString, NSRange charRangeToReplace) {
+ int result = OS.objc_msgSend(this.id, OS.sel_smartInsertAfterStringForString_1replacingRange_1, pasteString != null ? pasteString.id : 0, charRangeToReplace);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString smartInsertBeforeStringForString(NSString pasteString, NSRange charRangeToReplace) {
+ int result = OS.objc_msgSend(this.id, OS.sel_smartInsertBeforeStringForString_1replacingRange_1, pasteString != null ? pasteString.id : 0, charRangeToReplace);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean smartInsertDeleteEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_smartInsertDeleteEnabled) != 0;
+}
+
+public void smartInsertForString(NSString pasteString, NSRange charRangeToReplace, int beforeString, int afterString) {
+ OS.objc_msgSend(this.id, OS.sel_smartInsertForString_1replacingRange_1beforeString_1afterString_1, pasteString != null ? pasteString.id : 0, charRangeToReplace, beforeString, afterString);
+}
+
+public int spellCheckerDocumentTag() {
+ return OS.objc_msgSend(this.id, OS.sel_spellCheckerDocumentTag);
+}
+
+public void startSpeaking(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_startSpeaking_1, sender != null ? sender.id : 0);
+}
+
+public void stopSpeaking(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_stopSpeaking_1, sender != null ? sender.id : 0);
+}
+
+public NSTextContainer textContainer() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textContainer);
+ return result != 0 ? new NSTextContainer(result) : null;
+}
+
+public NSSize textContainerInset() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_textContainerInset);
+ return result;
+}
+
+public NSPoint textContainerOrigin() {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_textContainerOrigin);
+ return result;
+}
+
+public NSTextStorage textStorage() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textStorage);
+ return result != 0 ? new NSTextStorage(result) : null;
+}
+
+public void tightenKerning(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_tightenKerning_1, sender != null ? sender.id : 0);
+}
+
+public void toggleAutomaticLinkDetection(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_toggleAutomaticLinkDetection_1, sender != null ? sender.id : 0);
+}
+
+public void toggleAutomaticQuoteSubstitution(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_toggleAutomaticQuoteSubstitution_1, sender != null ? sender.id : 0);
+}
+
+public void toggleBaseWritingDirection(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_toggleBaseWritingDirection_1, sender != null ? sender.id : 0);
+}
+
+public void toggleContinuousSpellChecking(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_toggleContinuousSpellChecking_1, sender != null ? sender.id : 0);
+}
+
+public void toggleGrammarChecking(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_toggleGrammarChecking_1, sender != null ? sender.id : 0);
+}
+
+public void toggleSmartInsertDelete(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_toggleSmartInsertDelete_1, sender != null ? sender.id : 0);
+}
+
+public void toggleTraditionalCharacterShape(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_toggleTraditionalCharacterShape_1, sender != null ? sender.id : 0);
+}
+
+public void turnOffKerning(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_turnOffKerning_1, sender != null ? sender.id : 0);
+}
+
+public void turnOffLigatures(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_turnOffLigatures_1, sender != null ? sender.id : 0);
+}
+
+public NSDictionary typingAttributes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_typingAttributes);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public void updateDragTypeRegistration() {
+ OS.objc_msgSend(this.id, OS.sel_updateDragTypeRegistration);
+}
+
+public void updateFontPanel() {
+ OS.objc_msgSend(this.id, OS.sel_updateFontPanel);
+}
+
+public void updateInsertionPointStateAndRestartTimer(boolean restartFlag) {
+ OS.objc_msgSend(this.id, OS.sel_updateInsertionPointStateAndRestartTimer_1, restartFlag);
+}
+
+public void updateRuler() {
+ OS.objc_msgSend(this.id, OS.sel_updateRuler);
+}
+
+public void useAllLigatures(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_useAllLigatures_1, sender != null ? sender.id : 0);
+}
+
+public void useStandardKerning(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_useStandardKerning_1, sender != null ? sender.id : 0);
+}
+
+public void useStandardLigatures(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_useStandardLigatures_1, sender != null ? sender.id : 0);
+}
+
+public boolean usesFindPanel() {
+ return OS.objc_msgSend(this.id, OS.sel_usesFindPanel) != 0;
+}
+
+public boolean usesFontPanel() {
+ return OS.objc_msgSend(this.id, OS.sel_usesFontPanel) != 0;
+}
+
+public boolean usesRuler() {
+ return OS.objc_msgSend(this.id, OS.sel_usesRuler) != 0;
+}
+
+public id validRequestorForSendType(NSString sendType, NSString returnType) {
+ int result = OS.objc_msgSend(this.id, OS.sel_validRequestorForSendType_1returnType_1, sendType != null ? sendType.id : 0, returnType != null ? returnType.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSArray writablePasteboardTypes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_writablePasteboardTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean writeSelectionToPasteboard_type_(NSPasteboard pboard, NSString type) {
+ return OS.objc_msgSend(this.id, OS.sel_writeSelectionToPasteboard_1type_1, pboard != null ? pboard.id : 0, type != null ? type.id : 0) != 0;
+}
+
+public boolean writeSelectionToPasteboard_types_(NSPasteboard pboard, NSArray types) {
+ return OS.objc_msgSend(this.id, OS.sel_writeSelectionToPasteboard_1types_1, pboard != null ? pboard.id : 0, types != null ? types.id : 0) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSThread.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSThread.java
new file mode 100644
index 0000000000..a2f8fee72c
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSThread.java
@@ -0,0 +1,115 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSThread extends NSObject {
+
+public NSThread() {
+ super();
+}
+
+public NSThread(int id) {
+ super(id);
+}
+
+public static NSArray callStackReturnAddresses() {
+ int result = OS.objc_msgSend(OS.class_NSThread, OS.sel_callStackReturnAddresses);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void cancel() {
+ OS.objc_msgSend(this.id, OS.sel_cancel);
+}
+
+public static NSThread currentThread() {
+ int result = OS.objc_msgSend(OS.class_NSThread, OS.sel_currentThread);
+ return result != 0 ? new NSThread(result) : null;
+}
+
+public static void detachNewThreadSelector(int selector, id target, id argument) {
+ OS.objc_msgSend(OS.class_NSThread, OS.sel_detachNewThreadSelector_1toTarget_1withObject_1, selector, target != null ? target.id : 0, argument != null ? argument.id : 0);
+}
+
+public static void exit() {
+ OS.objc_msgSend(OS.class_NSThread, OS.sel_exit);
+}
+
+public id initWithTarget(id target, int selector, id argument) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithTarget_1selector_1object_1, target != null ? target.id : 0, selector, argument != null ? argument.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isCancelled() {
+ return OS.objc_msgSend(this.id, OS.sel_isCancelled) != 0;
+}
+
+public boolean isExecuting() {
+ return OS.objc_msgSend(this.id, OS.sel_isExecuting) != 0;
+}
+
+public boolean isFinished() {
+ return OS.objc_msgSend(this.id, OS.sel_isFinished) != 0;
+}
+
+public static boolean static_isMainThread() {
+ return OS.objc_msgSend(OS.class_NSThread, OS.sel_isMainThread) != 0;
+}
+
+public boolean isMainThread() {
+ return OS.objc_msgSend(this.id, OS.sel_isMainThread) != 0;
+}
+
+public static boolean isMultiThreaded() {
+ return OS.objc_msgSend(OS.class_NSThread, OS.sel_isMultiThreaded) != 0;
+}
+
+public void main() {
+ OS.objc_msgSend(this.id, OS.sel_main);
+}
+
+public static NSThread mainThread() {
+ int result = OS.objc_msgSend(OS.class_NSThread, OS.sel_mainThread);
+ return result != 0 ? new NSThread(result) : null;
+}
+
+public NSString name() {
+ int result = OS.objc_msgSend(this.id, OS.sel_name);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void setName(NSString n) {
+ OS.objc_msgSend(this.id, OS.sel_setName_1, n != null ? n.id : 0);
+}
+
+public void setStackSize(int s) {
+ OS.objc_msgSend(this.id, OS.sel_setStackSize_1, s);
+}
+
+public static boolean setThreadPriority(double p) {
+ return OS.objc_msgSend(OS.class_NSThread, OS.sel_setThreadPriority_1, p) != 0;
+}
+
+public static void sleepForTimeInterval(double ti) {
+ OS.objc_msgSend(OS.class_NSThread, OS.sel_sleepForTimeInterval_1, ti);
+}
+
+public static void sleepUntilDate(NSDate date) {
+ OS.objc_msgSend(OS.class_NSThread, OS.sel_sleepUntilDate_1, date != null ? date.id : 0);
+}
+
+public int stackSize() {
+ return OS.objc_msgSend(this.id, OS.sel_stackSize);
+}
+
+public void start() {
+ OS.objc_msgSend(this.id, OS.sel_start);
+}
+
+public NSMutableDictionary threadDictionary() {
+ int result = OS.objc_msgSend(this.id, OS.sel_threadDictionary);
+ return result != 0 ? new NSMutableDictionary(result) : null;
+}
+
+public static double threadPriority() {
+ return OS.objc_msgSend_fpret(OS.class_NSThread, OS.sel_threadPriority);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTimeZone.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTimeZone.java
new file mode 100644
index 0000000000..e11d47a944
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTimeZone.java
@@ -0,0 +1,144 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTimeZone extends NSObject {
+
+public NSTimeZone() {
+ super();
+}
+
+public NSTimeZone(int id) {
+ super(id);
+}
+
+public NSString abbreviation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_abbreviation);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSDictionary abbreviationDictionary() {
+ int result = OS.objc_msgSend(OS.class_NSTimeZone, OS.sel_abbreviationDictionary);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSString abbreviationForDate(NSDate aDate) {
+ int result = OS.objc_msgSend(this.id, OS.sel_abbreviationForDate_1, aDate != null ? aDate.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSData data() {
+ int result = OS.objc_msgSend(this.id, OS.sel_data);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public double daylightSavingTimeOffset() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_daylightSavingTimeOffset);
+}
+
+public double daylightSavingTimeOffsetForDate(NSDate aDate) {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_daylightSavingTimeOffsetForDate_1, aDate != null ? aDate.id : 0);
+}
+
+public static NSTimeZone defaultTimeZone() {
+ int result = OS.objc_msgSend(OS.class_NSTimeZone, OS.sel_defaultTimeZone);
+ return result != 0 ? new NSTimeZone(result) : null;
+}
+
+public NSString description() {
+ int result = OS.objc_msgSend(this.id, OS.sel_description);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id initWithName_(NSString tzName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithName_1, tzName != null ? tzName.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithName_data_(NSString tzName, NSData aData) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithName_1data_1, tzName != null ? tzName.id : 0, aData != null ? aData.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isDaylightSavingTime() {
+ return OS.objc_msgSend(this.id, OS.sel_isDaylightSavingTime) != 0;
+}
+
+public boolean isDaylightSavingTimeForDate(NSDate aDate) {
+ return OS.objc_msgSend(this.id, OS.sel_isDaylightSavingTimeForDate_1, aDate != null ? aDate.id : 0) != 0;
+}
+
+public boolean isEqualToTimeZone(NSTimeZone aTimeZone) {
+ return OS.objc_msgSend(this.id, OS.sel_isEqualToTimeZone_1, aTimeZone != null ? aTimeZone.id : 0) != 0;
+}
+
+public static NSArray knownTimeZoneNames() {
+ int result = OS.objc_msgSend(OS.class_NSTimeZone, OS.sel_knownTimeZoneNames);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static NSTimeZone localTimeZone() {
+ int result = OS.objc_msgSend(OS.class_NSTimeZone, OS.sel_localTimeZone);
+ return result != 0 ? new NSTimeZone(result) : null;
+}
+
+public NSString localizedName(int style, NSLocale locale) {
+ int result = OS.objc_msgSend(this.id, OS.sel_localizedName_1locale_1, style, locale != null ? locale.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString name() {
+ int result = OS.objc_msgSend(this.id, OS.sel_name);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSDate nextDaylightSavingTimeTransition() {
+ int result = OS.objc_msgSend(this.id, OS.sel_nextDaylightSavingTimeTransition);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public NSDate nextDaylightSavingTimeTransitionAfterDate(NSDate aDate) {
+ int result = OS.objc_msgSend(this.id, OS.sel_nextDaylightSavingTimeTransitionAfterDate_1, aDate != null ? aDate.id : 0);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public static void resetSystemTimeZone() {
+ OS.objc_msgSend(OS.class_NSTimeZone, OS.sel_resetSystemTimeZone);
+}
+
+public int secondsFromGMT() {
+ return OS.objc_msgSend(this.id, OS.sel_secondsFromGMT);
+}
+
+public int secondsFromGMTForDate(NSDate aDate) {
+ return OS.objc_msgSend(this.id, OS.sel_secondsFromGMTForDate_1, aDate != null ? aDate.id : 0);
+}
+
+public static void setDefaultTimeZone(NSTimeZone aTimeZone) {
+ OS.objc_msgSend(OS.class_NSTimeZone, OS.sel_setDefaultTimeZone_1, aTimeZone != null ? aTimeZone.id : 0);
+}
+
+public static NSTimeZone systemTimeZone() {
+ int result = OS.objc_msgSend(OS.class_NSTimeZone, OS.sel_systemTimeZone);
+ return result != 0 ? new NSTimeZone(result) : null;
+}
+
+public static id timeZoneForSecondsFromGMT(int seconds) {
+ int result = OS.objc_msgSend(OS.class_NSTimeZone, OS.sel_timeZoneForSecondsFromGMT_1, seconds);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id timeZoneWithAbbreviation(NSString abbreviation) {
+ int result = OS.objc_msgSend(OS.class_NSTimeZone, OS.sel_timeZoneWithAbbreviation_1, abbreviation != null ? abbreviation.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_timeZoneWithName_(NSString tzName) {
+ int result = OS.objc_msgSend(OS.class_NSTimeZone, OS.sel_timeZoneWithName_1, tzName != null ? tzName.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_timeZoneWithName_data_(NSString tzName, NSData aData) {
+ int result = OS.objc_msgSend(OS.class_NSTimeZone, OS.sel_timeZoneWithName_1data_1, tzName != null ? tzName.id : 0, aData != null ? aData.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTimer.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTimer.java
new file mode 100644
index 0000000000..37085db20e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTimer.java
@@ -0,0 +1,67 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTimer extends NSObject {
+
+public NSTimer() {
+ super();
+}
+
+public NSTimer(int id) {
+ super(id);
+}
+
+public void fire() {
+ OS.objc_msgSend(this.id, OS.sel_fire);
+}
+
+public NSDate fireDate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fireDate);
+ return result != 0 ? new NSDate(result) : null;
+}
+
+public id initWithFireDate(NSDate date, double ti, id t, int s, id ui, boolean rep) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFireDate_1interval_1target_1selector_1userInfo_1repeats_1, date != null ? date.id : 0, ti, t != null ? t.id : 0, s, ui != null ? ui.id : 0, rep);
+ return result != 0 ? new id(result) : null;
+}
+
+public void invalidate() {
+ OS.objc_msgSend(this.id, OS.sel_invalidate);
+}
+
+public boolean isValid() {
+ return OS.objc_msgSend(this.id, OS.sel_isValid) != 0;
+}
+
+public static NSTimer static_scheduledTimerWithTimeInterval_invocation_repeats_(double ti, NSInvocation invocation, boolean yesOrNo) {
+ int result = OS.objc_msgSend(OS.class_NSTimer, OS.sel_scheduledTimerWithTimeInterval_1invocation_1repeats_1, ti, invocation != null ? invocation.id : 0, yesOrNo);
+ return result != 0 ? new NSTimer(result) : null;
+}
+
+public static NSTimer static_scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_(double ti, id aTarget, int aSelector, int userInfo, boolean yesOrNo) {
+ int result = OS.objc_msgSend(OS.class_NSTimer, OS.sel_scheduledTimerWithTimeInterval_1target_1selector_1userInfo_1repeats_1, ti, aTarget != null ? aTarget.id : 0, aSelector, userInfo, yesOrNo);
+ return result != 0 ? new NSTimer(result) : null;
+}
+
+public void setFireDate(NSDate date) {
+ OS.objc_msgSend(this.id, OS.sel_setFireDate_1, date != null ? date.id : 0);
+}
+
+public double timeInterval() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_timeInterval);
+}
+
+public static NSTimer static_timerWithTimeInterval_invocation_repeats_(double ti, NSInvocation invocation, boolean yesOrNo) {
+ int result = OS.objc_msgSend(OS.class_NSTimer, OS.sel_timerWithTimeInterval_1invocation_1repeats_1, ti, invocation != null ? invocation.id : 0, yesOrNo);
+ return result != 0 ? new NSTimer(result) : null;
+}
+
+public static NSTimer static_timerWithTimeInterval_target_selector_userInfo_repeats_(double ti, id aTarget, int aSelector, id userInfo, boolean yesOrNo) {
+ int result = OS.objc_msgSend(OS.class_NSTimer, OS.sel_timerWithTimeInterval_1target_1selector_1userInfo_1repeats_1, ti, aTarget != null ? aTarget.id : 0, aSelector, userInfo != null ? userInfo.id : 0, yesOrNo);
+ return result != 0 ? new NSTimer(result) : null;
+}
+
+public int userInfo() {
+ return OS.objc_msgSend(this.id, OS.sel_userInfo);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTokenField.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTokenField.java
new file mode 100644
index 0000000000..1dc287839b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTokenField.java
@@ -0,0 +1,47 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTokenField extends NSTextField {
+
+public NSTokenField() {
+ super();
+}
+
+public NSTokenField(int id) {
+ super(id);
+}
+
+public double completionDelay() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_completionDelay);
+}
+
+public static double defaultCompletionDelay() {
+ return OS.objc_msgSend_fpret(OS.class_NSTokenField, OS.sel_defaultCompletionDelay);
+}
+
+public static NSCharacterSet defaultTokenizingCharacterSet() {
+ int result = OS.objc_msgSend(OS.class_NSTokenField, OS.sel_defaultTokenizingCharacterSet);
+ return result != 0 ? new NSCharacterSet(result) : null;
+}
+
+public void setCompletionDelay(double delay) {
+ OS.objc_msgSend(this.id, OS.sel_setCompletionDelay_1, delay);
+}
+
+public void setTokenStyle(int style) {
+ OS.objc_msgSend(this.id, OS.sel_setTokenStyle_1, style);
+}
+
+public void setTokenizingCharacterSet(NSCharacterSet characterSet) {
+ OS.objc_msgSend(this.id, OS.sel_setTokenizingCharacterSet_1, characterSet != null ? characterSet.id : 0);
+}
+
+public int tokenStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_tokenStyle);
+}
+
+public NSCharacterSet tokenizingCharacterSet() {
+ int result = OS.objc_msgSend(this.id, OS.sel_tokenizingCharacterSet);
+ return result != 0 ? new NSCharacterSet(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTokenFieldCell.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTokenFieldCell.java
new file mode 100644
index 0000000000..ed2fa1dcdd
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTokenFieldCell.java
@@ -0,0 +1,56 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTokenFieldCell extends NSTextFieldCell {
+
+public NSTokenFieldCell() {
+ super();
+}
+
+public NSTokenFieldCell(int id) {
+ super(id);
+}
+
+public double completionDelay() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_completionDelay);
+}
+
+public static double defaultCompletionDelay() {
+ return OS.objc_msgSend_fpret(OS.class_NSTokenFieldCell, OS.sel_defaultCompletionDelay);
+}
+
+public static NSCharacterSet defaultTokenizingCharacterSet() {
+ int result = OS.objc_msgSend(OS.class_NSTokenFieldCell, OS.sel_defaultTokenizingCharacterSet);
+ return result != 0 ? new NSCharacterSet(result) : null;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public void setCompletionDelay(double delay) {
+ OS.objc_msgSend(this.id, OS.sel_setCompletionDelay_1, delay);
+}
+
+public void setDelegate(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
+}
+
+public void setTokenStyle(int style) {
+ OS.objc_msgSend(this.id, OS.sel_setTokenStyle_1, style);
+}
+
+public void setTokenizingCharacterSet(NSCharacterSet characterSet) {
+ OS.objc_msgSend(this.id, OS.sel_setTokenizingCharacterSet_1, characterSet != null ? characterSet.id : 0);
+}
+
+public int tokenStyle() {
+ return OS.objc_msgSend(this.id, OS.sel_tokenStyle);
+}
+
+public NSCharacterSet tokenizingCharacterSet() {
+ int result = OS.objc_msgSend(this.id, OS.sel_tokenizingCharacterSet);
+ return result != 0 ? new NSCharacterSet(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbar.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbar.java
new file mode 100644
index 0000000000..a74c9ec4c5
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbar.java
@@ -0,0 +1,128 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSToolbar extends NSObject {
+
+public NSToolbar() {
+ super();
+}
+
+public NSToolbar(int id) {
+ super(id);
+}
+
+public boolean allowsUserCustomization() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsUserCustomization) != 0;
+}
+
+public boolean autosavesConfiguration() {
+ return OS.objc_msgSend(this.id, OS.sel_autosavesConfiguration) != 0;
+}
+
+public NSDictionary configurationDictionary() {
+ int result = OS.objc_msgSend(this.id, OS.sel_configurationDictionary);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public boolean customizationPaletteIsRunning() {
+ return OS.objc_msgSend(this.id, OS.sel_customizationPaletteIsRunning) != 0;
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public int displayMode() {
+ return OS.objc_msgSend(this.id, OS.sel_displayMode);
+}
+
+public NSString identifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_identifier);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id initWithIdentifier(NSString identifier) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithIdentifier_1, identifier != null ? identifier.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void insertItemWithItemIdentifier(NSString itemIdentifier, int index) {
+ OS.objc_msgSend(this.id, OS.sel_insertItemWithItemIdentifier_1atIndex_1, itemIdentifier != null ? itemIdentifier.id : 0, index);
+}
+
+public boolean isVisible() {
+ return OS.objc_msgSend(this.id, OS.sel_isVisible) != 0;
+}
+
+public NSArray items() {
+ int result = OS.objc_msgSend(this.id, OS.sel_items);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void removeItemAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_removeItemAtIndex_1, index);
+}
+
+public void runCustomizationPalette(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_runCustomizationPalette_1, sender != null ? sender.id : 0);
+}
+
+public NSString selectedItemIdentifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedItemIdentifier);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void setAllowsUserCustomization(boolean allowCustomization) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsUserCustomization_1, allowCustomization);
+}
+
+public void setAutosavesConfiguration(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAutosavesConfiguration_1, flag);
+}
+
+public void setConfigurationFromDictionary(NSDictionary configDict) {
+ OS.objc_msgSend(this.id, OS.sel_setConfigurationFromDictionary_1, configDict != null ? configDict.id : 0);
+}
+
+public void setDelegate(id delegate) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegate != null ? delegate.id : 0);
+}
+
+public void setDisplayMode(int displayMode) {
+ OS.objc_msgSend(this.id, OS.sel_setDisplayMode_1, displayMode);
+}
+
+public void setSelectedItemIdentifier(NSString itemIdentifier) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectedItemIdentifier_1, itemIdentifier != null ? itemIdentifier.id : 0);
+}
+
+public void setShowsBaselineSeparator(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setShowsBaselineSeparator_1, flag);
+}
+
+public void setSizeMode(int sizeMode) {
+ OS.objc_msgSend(this.id, OS.sel_setSizeMode_1, sizeMode);
+}
+
+public void setVisible(boolean shown) {
+ OS.objc_msgSend(this.id, OS.sel_setVisible_1, shown);
+}
+
+public boolean showsBaselineSeparator() {
+ return OS.objc_msgSend(this.id, OS.sel_showsBaselineSeparator) != 0;
+}
+
+public int sizeMode() {
+ return OS.objc_msgSend(this.id, OS.sel_sizeMode);
+}
+
+public void validateVisibleItems() {
+ OS.objc_msgSend(this.id, OS.sel_validateVisibleItems);
+}
+
+public NSArray visibleItems() {
+ int result = OS.objc_msgSend(this.id, OS.sel_visibleItems);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbarItem.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbarItem.java
new file mode 100644
index 0000000000..086dc04e2e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbarItem.java
@@ -0,0 +1,159 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSToolbarItem extends NSObject {
+
+public NSToolbarItem() {
+ super();
+}
+
+public NSToolbarItem(int id) {
+ super(id);
+}
+
+public int action() {
+ return OS.objc_msgSend(this.id, OS.sel_action);
+}
+
+public boolean allowsDuplicatesInToolbar() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsDuplicatesInToolbar) != 0;
+}
+
+public boolean autovalidates() {
+ return OS.objc_msgSend(this.id, OS.sel_autovalidates) != 0;
+}
+
+public NSImage image() {
+ int result = OS.objc_msgSend(this.id, OS.sel_image);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public id initWithItemIdentifier(NSString itemIdentifier) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithItemIdentifier_1, itemIdentifier != null ? itemIdentifier.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_isEnabled) != 0;
+}
+
+public NSString itemIdentifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_itemIdentifier);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString label() {
+ int result = OS.objc_msgSend(this.id, OS.sel_label);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSSize maxSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_maxSize);
+ return result;
+}
+
+public NSMenuItem menuFormRepresentation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_menuFormRepresentation);
+ return result != 0 ? new NSMenuItem(result) : null;
+}
+
+public NSSize minSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_minSize);
+ return result;
+}
+
+public NSString paletteLabel() {
+ int result = OS.objc_msgSend(this.id, OS.sel_paletteLabel);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void setAction(int action) {
+ OS.objc_msgSend(this.id, OS.sel_setAction_1, action);
+}
+
+public void setAutovalidates(boolean resistance) {
+ OS.objc_msgSend(this.id, OS.sel_setAutovalidates_1, resistance);
+}
+
+public void setEnabled(boolean enabled) {
+ OS.objc_msgSend(this.id, OS.sel_setEnabled_1, enabled);
+}
+
+public void setImage(NSImage image) {
+ OS.objc_msgSend(this.id, OS.sel_setImage_1, image != null ? image.id : 0);
+}
+
+public void setLabel(NSString label) {
+ OS.objc_msgSend(this.id, OS.sel_setLabel_1, label != null ? label.id : 0);
+}
+
+public void setMaxSize(NSSize size) {
+ OS.objc_msgSend(this.id, OS.sel_setMaxSize_1, size);
+}
+
+public void setMenuFormRepresentation(NSMenuItem menuItem) {
+ OS.objc_msgSend(this.id, OS.sel_setMenuFormRepresentation_1, menuItem != null ? menuItem.id : 0);
+}
+
+public void setMinSize(NSSize size) {
+ OS.objc_msgSend(this.id, OS.sel_setMinSize_1, size);
+}
+
+public void setPaletteLabel(NSString paletteLabel) {
+ OS.objc_msgSend(this.id, OS.sel_setPaletteLabel_1, paletteLabel != null ? paletteLabel.id : 0);
+}
+
+public void setTag(int tag) {
+ OS.objc_msgSend(this.id, OS.sel_setTag_1, tag);
+}
+
+public void setTarget(id target) {
+ OS.objc_msgSend(this.id, OS.sel_setTarget_1, target != null ? target.id : 0);
+}
+
+public void setToolTip(NSString toolTip) {
+ OS.objc_msgSend(this.id, OS.sel_setToolTip_1, toolTip != null ? toolTip.id : 0);
+}
+
+public void setView(NSView view) {
+ OS.objc_msgSend(this.id, OS.sel_setView_1, view != null ? view.id : 0);
+}
+
+public void setVisibilityPriority(int visibilityPriority) {
+ OS.objc_msgSend(this.id, OS.sel_setVisibilityPriority_1, visibilityPriority);
+}
+
+public int tag() {
+ return OS.objc_msgSend(this.id, OS.sel_tag);
+}
+
+public id target() {
+ int result = OS.objc_msgSend(this.id, OS.sel_target);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString toolTip() {
+ int result = OS.objc_msgSend(this.id, OS.sel_toolTip);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSToolbar toolbar() {
+ int result = OS.objc_msgSend(this.id, OS.sel_toolbar);
+ return result != 0 ? new NSToolbar(result) : null;
+}
+
+public void validate() {
+ OS.objc_msgSend(this.id, OS.sel_validate);
+}
+
+public NSView view() {
+ int result = OS.objc_msgSend(this.id, OS.sel_view);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public int visibilityPriority() {
+ return OS.objc_msgSend(this.id, OS.sel_visibilityPriority);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbarItemGroup.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbarItemGroup.java
new file mode 100644
index 0000000000..904ec77079
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSToolbarItemGroup.java
@@ -0,0 +1,22 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSToolbarItemGroup extends NSToolbarItem {
+
+public NSToolbarItemGroup() {
+ super();
+}
+
+public NSToolbarItemGroup(int id) {
+ super(id);
+}
+
+public void setSubitems(NSArray subitems) {
+ OS.objc_msgSend(this.id, OS.sel_setSubitems_1, subitems != null ? subitems.id : 0);
+}
+
+public NSArray subitems() {
+ int result = OS.objc_msgSend(this.id, OS.sel_subitems);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTrackingArea.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTrackingArea.java
new file mode 100644
index 0000000000..169d9599de
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTrackingArea.java
@@ -0,0 +1,38 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTrackingArea extends NSObject {
+
+public NSTrackingArea() {
+ super();
+}
+
+public NSTrackingArea(int id) {
+ super(id);
+}
+
+public NSTrackingArea initWithRect(NSRect rect, int options, id owner, NSDictionary userInfo) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithRect_1options_1owner_1userInfo_1, rect, options, owner != null ? owner.id : 0, userInfo != null ? userInfo.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSTrackingArea(result) : null);
+}
+
+public int options() {
+ return OS.objc_msgSend(this.id, OS.sel_options);
+}
+
+public id owner() {
+ int result = OS.objc_msgSend(this.id, OS.sel_owner);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSRect rect() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rect);
+ return result;
+}
+
+public NSDictionary userInfo() {
+ int result = OS.objc_msgSend(this.id, OS.sel_userInfo);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTreeController.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTreeController.java
new file mode 100644
index 0000000000..fffcdcb424
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTreeController.java
@@ -0,0 +1,206 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTreeController extends NSObjectController {
+
+public NSTreeController() {
+ super();
+}
+
+public NSTreeController(int id) {
+ super(id);
+}
+
+public void add(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_add_1, sender != null ? sender.id : 0);
+}
+
+public void addChild(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_addChild_1, sender != null ? sender.id : 0);
+}
+
+public boolean addSelectionIndexPaths(NSArray indexPaths) {
+ return OS.objc_msgSend(this.id, OS.sel_addSelectionIndexPaths_1, indexPaths != null ? indexPaths.id : 0) != 0;
+}
+
+public boolean alwaysUsesMultipleValuesMarker() {
+ return OS.objc_msgSend(this.id, OS.sel_alwaysUsesMultipleValuesMarker) != 0;
+}
+
+public id arrangedObjects() {
+ int result = OS.objc_msgSend(this.id, OS.sel_arrangedObjects);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean avoidsEmptySelection() {
+ return OS.objc_msgSend(this.id, OS.sel_avoidsEmptySelection) != 0;
+}
+
+public boolean canAddChild() {
+ return OS.objc_msgSend(this.id, OS.sel_canAddChild) != 0;
+}
+
+public boolean canInsert() {
+ return OS.objc_msgSend(this.id, OS.sel_canInsert) != 0;
+}
+
+public boolean canInsertChild() {
+ return OS.objc_msgSend(this.id, OS.sel_canInsertChild) != 0;
+}
+
+public NSString childrenKeyPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_childrenKeyPath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString childrenKeyPathForNode(NSTreeNode node) {
+ int result = OS.objc_msgSend(this.id, OS.sel_childrenKeyPathForNode_1, node != null ? node.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id content() {
+ int result = OS.objc_msgSend(this.id, OS.sel_content);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString countKeyPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_countKeyPath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString countKeyPathForNode(NSTreeNode node) {
+ int result = OS.objc_msgSend(this.id, OS.sel_countKeyPathForNode_1, node != null ? node.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void insert(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_insert_1, sender != null ? sender.id : 0);
+}
+
+public void insertChild(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_insertChild_1, sender != null ? sender.id : 0);
+}
+
+public void insertObject(id object, NSIndexPath indexPath) {
+ OS.objc_msgSend(this.id, OS.sel_insertObject_1atArrangedObjectIndexPath_1, object != null ? object.id : 0, indexPath != null ? indexPath.id : 0);
+}
+
+public void insertObjects(NSArray objects, NSArray indexPaths) {
+ OS.objc_msgSend(this.id, OS.sel_insertObjects_1atArrangedObjectIndexPaths_1, objects != null ? objects.id : 0, indexPaths != null ? indexPaths.id : 0);
+}
+
+public NSString leafKeyPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_leafKeyPath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString leafKeyPathForNode(NSTreeNode node) {
+ int result = OS.objc_msgSend(this.id, OS.sel_leafKeyPathForNode_1, node != null ? node.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void moveNode(NSTreeNode node, NSIndexPath indexPath) {
+ OS.objc_msgSend(this.id, OS.sel_moveNode_1toIndexPath_1, node != null ? node.id : 0, indexPath != null ? indexPath.id : 0);
+}
+
+public void moveNodes(NSArray nodes, NSIndexPath startingIndexPath) {
+ OS.objc_msgSend(this.id, OS.sel_moveNodes_1toIndexPath_1, nodes != null ? nodes.id : 0, startingIndexPath != null ? startingIndexPath.id : 0);
+}
+
+public boolean preservesSelection() {
+ return OS.objc_msgSend(this.id, OS.sel_preservesSelection) != 0;
+}
+
+public void rearrangeObjects() {
+ OS.objc_msgSend(this.id, OS.sel_rearrangeObjects);
+}
+
+public void remove(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_remove_1, sender != null ? sender.id : 0);
+}
+
+public void removeObjectAtArrangedObjectIndexPath(NSIndexPath indexPath) {
+ OS.objc_msgSend(this.id, OS.sel_removeObjectAtArrangedObjectIndexPath_1, indexPath != null ? indexPath.id : 0);
+}
+
+public void removeObjectsAtArrangedObjectIndexPaths(NSArray indexPaths) {
+ OS.objc_msgSend(this.id, OS.sel_removeObjectsAtArrangedObjectIndexPaths_1, indexPaths != null ? indexPaths.id : 0);
+}
+
+public boolean removeSelectionIndexPaths(NSArray indexPaths) {
+ return OS.objc_msgSend(this.id, OS.sel_removeSelectionIndexPaths_1, indexPaths != null ? indexPaths.id : 0) != 0;
+}
+
+public NSArray selectedNodes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedNodes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray selectedObjects() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectedObjects);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSIndexPath selectionIndexPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectionIndexPath);
+ return result != 0 ? new NSIndexPath(result) : null;
+}
+
+public NSArray selectionIndexPaths() {
+ int result = OS.objc_msgSend(this.id, OS.sel_selectionIndexPaths);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean selectsInsertedObjects() {
+ return OS.objc_msgSend(this.id, OS.sel_selectsInsertedObjects) != 0;
+}
+
+public void setAlwaysUsesMultipleValuesMarker(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAlwaysUsesMultipleValuesMarker_1, flag);
+}
+
+public void setAvoidsEmptySelection(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAvoidsEmptySelection_1, flag);
+}
+
+public void setChildrenKeyPath(NSString keyPath) {
+ OS.objc_msgSend(this.id, OS.sel_setChildrenKeyPath_1, keyPath != null ? keyPath.id : 0);
+}
+
+public void setContent(id content) {
+ OS.objc_msgSend(this.id, OS.sel_setContent_1, content != null ? content.id : 0);
+}
+
+public void setCountKeyPath(NSString keyPath) {
+ OS.objc_msgSend(this.id, OS.sel_setCountKeyPath_1, keyPath != null ? keyPath.id : 0);
+}
+
+public void setLeafKeyPath(NSString keyPath) {
+ OS.objc_msgSend(this.id, OS.sel_setLeafKeyPath_1, keyPath != null ? keyPath.id : 0);
+}
+
+public void setPreservesSelection(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setPreservesSelection_1, flag);
+}
+
+public boolean setSelectionIndexPath(NSIndexPath indexPath) {
+ return OS.objc_msgSend(this.id, OS.sel_setSelectionIndexPath_1, indexPath != null ? indexPath.id : 0) != 0;
+}
+
+public boolean setSelectionIndexPaths(NSArray indexPaths) {
+ return OS.objc_msgSend(this.id, OS.sel_setSelectionIndexPaths_1, indexPaths != null ? indexPaths.id : 0) != 0;
+}
+
+public void setSelectsInsertedObjects(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setSelectsInsertedObjects_1, flag);
+}
+
+public void setSortDescriptors(NSArray sortDescriptors) {
+ OS.objc_msgSend(this.id, OS.sel_setSortDescriptors_1, sortDescriptors != null ? sortDescriptors.id : 0);
+}
+
+public NSArray sortDescriptors() {
+ int result = OS.objc_msgSend(this.id, OS.sel_sortDescriptors);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTreeNode.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTreeNode.java
new file mode 100644
index 0000000000..1a119fd845
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTreeNode.java
@@ -0,0 +1,61 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTreeNode extends NSObject {
+
+public NSTreeNode() {
+ super();
+}
+
+public NSTreeNode(int id) {
+ super(id);
+}
+
+public NSArray childNodes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_childNodes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSTreeNode descendantNodeAtIndexPath(NSIndexPath indexPath) {
+ int result = OS.objc_msgSend(this.id, OS.sel_descendantNodeAtIndexPath_1, indexPath != null ? indexPath.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSTreeNode(result) : null);
+}
+
+public NSIndexPath indexPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_indexPath);
+ return result != 0 ? new NSIndexPath(result) : null;
+}
+
+public id initWithRepresentedObject(id modelObject) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithRepresentedObject_1, modelObject != null ? modelObject.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isLeaf() {
+ return OS.objc_msgSend(this.id, OS.sel_isLeaf) != 0;
+}
+
+public NSMutableArray mutableChildNodes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_mutableChildNodes);
+ return result != 0 ? new NSMutableArray(result) : null;
+}
+
+public NSTreeNode parentNode() {
+ int result = OS.objc_msgSend(this.id, OS.sel_parentNode);
+ return result == this.id ? this : (result != 0 ? new NSTreeNode(result) : null);
+}
+
+public id representedObject() {
+ int result = OS.objc_msgSend(this.id, OS.sel_representedObject);
+ return result != 0 ? new id(result) : null;
+}
+
+public void sortWithSortDescriptors(NSArray sortDescriptors, boolean recursively) {
+ OS.objc_msgSend(this.id, OS.sel_sortWithSortDescriptors_1recursively_1, sortDescriptors != null ? sortDescriptors.id : 0, recursively);
+}
+
+public static id treeNodeWithRepresentedObject(id modelObject) {
+ int result = OS.objc_msgSend(OS.class_NSTreeNode, OS.sel_treeNodeWithRepresentedObject_1, modelObject != null ? modelObject.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTypesetter.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTypesetter.java
new file mode 100644
index 0000000000..66d99125e6
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSTypesetter.java
@@ -0,0 +1,285 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSTypesetter extends NSObject {
+
+public NSTypesetter() {
+ super();
+}
+
+public NSTypesetter(int id) {
+ super(id);
+}
+
+public int actionForControlCharacterAtIndex(int charIndex) {
+ return OS.objc_msgSend(this.id, OS.sel_actionForControlCharacterAtIndex_1, charIndex);
+}
+
+public NSAttributedString attributedString() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributedString);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public NSDictionary attributesForExtraLineFragment() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributesForExtraLineFragment);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public float baselineOffsetInLayoutManager(NSLayoutManager layoutMgr, int glyphIndex) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_baselineOffsetInLayoutManager_1glyphIndex_1, layoutMgr != null ? layoutMgr.id : 0, glyphIndex);
+}
+
+public void beginLineWithGlyphAtIndex(int glyphIndex) {
+ OS.objc_msgSend(this.id, OS.sel_beginLineWithGlyphAtIndex_1, glyphIndex);
+}
+
+public void beginParagraph() {
+ OS.objc_msgSend(this.id, OS.sel_beginParagraph);
+}
+
+public boolean bidiProcessingEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_bidiProcessingEnabled) != 0;
+}
+
+public NSRect boundingBoxForControlGlyphAtIndex(int glyphIndex, NSTextContainer textContainer, NSRect proposedRect, NSPoint glyphPosition, int charIndex) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_boundingBoxForControlGlyphAtIndex_1forTextContainer_1proposedLineFragment_1glyphPosition_1characterIndex_1, glyphIndex, textContainer != null ? textContainer.id : 0, proposedRect, glyphPosition, charIndex);
+ return result;
+}
+
+public NSRange characterRangeForGlyphRange(NSRange glyphRange, int actualGlyphRange) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_characterRangeForGlyphRange_1actualGlyphRange_1, glyphRange, actualGlyphRange);
+ return result;
+}
+
+public NSParagraphStyle currentParagraphStyle() {
+ int result = OS.objc_msgSend(this.id, OS.sel_currentParagraphStyle);
+ return result != 0 ? new NSParagraphStyle(result) : null;
+}
+
+public NSTextContainer currentTextContainer() {
+ int result = OS.objc_msgSend(this.id, OS.sel_currentTextContainer);
+ return result != 0 ? new NSTextContainer(result) : null;
+}
+
+public static int defaultTypesetterBehavior() {
+ return OS.objc_msgSend(OS.class_NSTypesetter, OS.sel_defaultTypesetterBehavior);
+}
+
+public void deleteGlyphsInRange(NSRange glyphRange) {
+ OS.objc_msgSend(this.id, OS.sel_deleteGlyphsInRange_1, glyphRange);
+}
+
+public void endLineWithGlyphRange(NSRange lineGlyphRange) {
+ OS.objc_msgSend(this.id, OS.sel_endLineWithGlyphRange_1, lineGlyphRange);
+}
+
+public void endParagraph() {
+ OS.objc_msgSend(this.id, OS.sel_endParagraph);
+}
+
+public int getGlyphsInRange(NSRange glyphsRange, int glyphBuffer, int charIndexBuffer, int inscribeBuffer, int elasticBuffer, int bidiLevelBuffer) {
+ return OS.objc_msgSend(this.id, OS.sel_getGlyphsInRange_1glyphs_1characterIndexes_1glyphInscriptions_1elasticBits_1bidiLevels_1, glyphsRange, glyphBuffer, charIndexBuffer, inscribeBuffer, elasticBuffer, bidiLevelBuffer);
+}
+
+public void getLineFragmentRect_usedRect_forParagraphSeparatorGlyphRange_atProposedOrigin_(int lineFragmentRect, int lineFragmentUsedRect, NSRange paragraphSeparatorGlyphRange, NSPoint lineOrigin) {
+ OS.objc_msgSend(this.id, OS.sel_getLineFragmentRect_1usedRect_1forParagraphSeparatorGlyphRange_1atProposedOrigin_1, lineFragmentRect, lineFragmentUsedRect, paragraphSeparatorGlyphRange, lineOrigin);
+}
+
+public void getLineFragmentRect_usedRect_remainingRect_forStartingGlyphAtIndex_proposedRect_lineSpacing_paragraphSpacingBefore_paragraphSpacingAfter_(int lineFragmentRect, int lineFragmentUsedRect, int remainingRect, int startingGlyphIndex, NSRect proposedRect, float lineSpacing, float paragraphSpacingBefore, float paragraphSpacingAfter) {
+ OS.objc_msgSend(this.id, OS.sel_getLineFragmentRect_1usedRect_1remainingRect_1forStartingGlyphAtIndex_1proposedRect_1lineSpacing_1paragraphSpacingBefore_1paragraphSpacingAfter_1, lineFragmentRect, lineFragmentUsedRect, remainingRect, startingGlyphIndex, proposedRect, lineSpacing, paragraphSpacingBefore, paragraphSpacingAfter);
+}
+
+public NSRange glyphRangeForCharacterRange(NSRange charRange, int actualCharRange) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_glyphRangeForCharacterRange_1actualCharacterRange_1, charRange, actualCharRange);
+ return result;
+}
+
+public int hyphenCharacterForGlyphAtIndex(int glyphIndex) {
+ return OS.objc_msgSend(this.id, OS.sel_hyphenCharacterForGlyphAtIndex_1, glyphIndex);
+}
+
+public float hyphenationFactor() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_hyphenationFactor);
+}
+
+public float hyphenationFactorForGlyphAtIndex(int glyphIndex) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_hyphenationFactorForGlyphAtIndex_1, glyphIndex);
+}
+
+public void insertGlyph(int glyph, int glyphIndex, int characterIndex) {
+ OS.objc_msgSend(this.id, OS.sel_insertGlyph_1atGlyphIndex_1characterIndex_1, glyph, glyphIndex, characterIndex);
+}
+
+public NSRange layoutCharactersInRange(NSRange characterRange, NSLayoutManager layoutManager, int maxNumLines) {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_layoutCharactersInRange_1forLayoutManager_1maximumNumberOfLineFragments_1, characterRange, layoutManager != null ? layoutManager.id : 0, maxNumLines);
+ return result;
+}
+
+public void layoutGlyphsInLayoutManager(NSLayoutManager layoutManager, int startGlyphIndex, int maxNumLines, int nextGlyph) {
+ OS.objc_msgSend(this.id, OS.sel_layoutGlyphsInLayoutManager_1startingAtGlyphIndex_1maxNumberOfLineFragments_1nextGlyphIndex_1, layoutManager != null ? layoutManager.id : 0, startGlyphIndex, maxNumLines, nextGlyph);
+}
+
+public NSLayoutManager layoutManager() {
+ int result = OS.objc_msgSend(this.id, OS.sel_layoutManager);
+ return result != 0 ? new NSLayoutManager(result) : null;
+}
+
+public int layoutParagraphAtPoint(int lineFragmentOrigin) {
+ return OS.objc_msgSend(this.id, OS.sel_layoutParagraphAtPoint_1, lineFragmentOrigin);
+}
+
+public float lineFragmentPadding() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_lineFragmentPadding);
+}
+
+public float lineSpacingAfterGlyphAtIndex(int glyphIndex, NSRect rect) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_lineSpacingAfterGlyphAtIndex_1withProposedLineFragmentRect_1, glyphIndex, rect);
+}
+
+public NSRange paragraphCharacterRange() {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_paragraphCharacterRange);
+ return result;
+}
+
+public NSRange paragraphGlyphRange() {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_paragraphGlyphRange);
+ return result;
+}
+
+public NSRange paragraphSeparatorCharacterRange() {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_paragraphSeparatorCharacterRange);
+ return result;
+}
+
+public NSRange paragraphSeparatorGlyphRange() {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_paragraphSeparatorGlyphRange);
+ return result;
+}
+
+public float paragraphSpacingAfterGlyphAtIndex(int glyphIndex, NSRect rect) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_paragraphSpacingAfterGlyphAtIndex_1withProposedLineFragmentRect_1, glyphIndex, rect);
+}
+
+public float paragraphSpacingBeforeGlyphAtIndex(int glyphIndex, NSRect rect) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_paragraphSpacingBeforeGlyphAtIndex_1withProposedLineFragmentRect_1, glyphIndex, rect);
+}
+
+public static NSSize printingAdjustmentInLayoutManager(NSLayoutManager layoutMgr, NSRange nominallySpacedGlyphsRange, int packedGlyphs, int packedGlyphsCount) {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, OS.class_NSTypesetter, OS.sel_printingAdjustmentInLayoutManager_1forNominallySpacedGlyphRange_1packedGlyphs_1count_1, layoutMgr != null ? layoutMgr.id : 0, nominallySpacedGlyphsRange, packedGlyphs, packedGlyphsCount);
+ return result;
+}
+
+public void setAttachmentSize(NSSize attachmentSize, NSRange glyphRange) {
+ OS.objc_msgSend(this.id, OS.sel_setAttachmentSize_1forGlyphRange_1, attachmentSize, glyphRange);
+}
+
+public void setAttributedString(NSAttributedString attrString) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributedString_1, attrString != null ? attrString.id : 0);
+}
+
+public void setBidiLevels(int levels, NSRange glyphRange) {
+ OS.objc_msgSend(this.id, OS.sel_setBidiLevels_1forGlyphRange_1, levels, glyphRange);
+}
+
+public void setBidiProcessingEnabled(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setBidiProcessingEnabled_1, flag);
+}
+
+public void setDrawsOutsideLineFragment(boolean flag, NSRange glyphRange) {
+ OS.objc_msgSend(this.id, OS.sel_setDrawsOutsideLineFragment_1forGlyphRange_1, flag, glyphRange);
+}
+
+public void setHardInvalidation(boolean flag, NSRange glyphRange) {
+ OS.objc_msgSend(this.id, OS.sel_setHardInvalidation_1forGlyphRange_1, flag, glyphRange);
+}
+
+public void setHyphenationFactor(float factor) {
+ OS.objc_msgSend(this.id, OS.sel_setHyphenationFactor_1, factor);
+}
+
+public void setLineFragmentPadding(float padding) {
+ OS.objc_msgSend(this.id, OS.sel_setLineFragmentPadding_1, padding);
+}
+
+public void setLineFragmentRect(NSRect fragmentRect, NSRange glyphRange, NSRect usedRect, float baselineOffset) {
+ OS.objc_msgSend(this.id, OS.sel_setLineFragmentRect_1forGlyphRange_1usedRect_1baselineOffset_1, fragmentRect, glyphRange, usedRect, baselineOffset);
+}
+
+public void setLocation(NSPoint location, int advancements, NSRange glyphRange) {
+ OS.objc_msgSend(this.id, OS.sel_setLocation_1withAdvancements_1forStartOfGlyphRange_1, location, advancements, glyphRange);
+}
+
+public void setNotShownAttribute(boolean flag, NSRange glyphRange) {
+ OS.objc_msgSend(this.id, OS.sel_setNotShownAttribute_1forGlyphRange_1, flag, glyphRange);
+}
+
+public void setParagraphGlyphRange(NSRange paragraphRange, NSRange paragraphSeparatorRange) {
+ OS.objc_msgSend(this.id, OS.sel_setParagraphGlyphRange_1separatorGlyphRange_1, paragraphRange, paragraphSeparatorRange);
+}
+
+public void setTypesetterBehavior(int behavior) {
+ OS.objc_msgSend(this.id, OS.sel_setTypesetterBehavior_1, behavior);
+}
+
+public void setUsesFontLeading(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setUsesFontLeading_1, flag);
+}
+
+public static id sharedSystemTypesetter() {
+ int result = OS.objc_msgSend(OS.class_NSTypesetter, OS.sel_sharedSystemTypesetter);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id sharedSystemTypesetterForBehavior(int theBehavior) {
+ int result = OS.objc_msgSend(OS.class_NSTypesetter, OS.sel_sharedSystemTypesetterForBehavior_1, theBehavior);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean shouldBreakLineByHyphenatingBeforeCharacterAtIndex(int charIndex) {
+ return OS.objc_msgSend(this.id, OS.sel_shouldBreakLineByHyphenatingBeforeCharacterAtIndex_1, charIndex) != 0;
+}
+
+public boolean shouldBreakLineByWordBeforeCharacterAtIndex(int charIndex) {
+ return OS.objc_msgSend(this.id, OS.sel_shouldBreakLineByWordBeforeCharacterAtIndex_1, charIndex) != 0;
+}
+
+public NSFont substituteFontForFont(NSFont originalFont) {
+ int result = OS.objc_msgSend(this.id, OS.sel_substituteFontForFont_1, originalFont != null ? originalFont.id : 0);
+ return result != 0 ? new NSFont(result) : null;
+}
+
+public void substituteGlyphsInRange(NSRange glyphRange, int glyphs) {
+ OS.objc_msgSend(this.id, OS.sel_substituteGlyphsInRange_1withGlyphs_1, glyphRange, glyphs);
+}
+
+public NSArray textContainers() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textContainers);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSTextTab textTabForGlyphLocation(float glyphLocation, int direction, float maxLocation) {
+ int result = OS.objc_msgSend(this.id, OS.sel_textTabForGlyphLocation_1writingDirection_1maxLocation_1, glyphLocation, direction, maxLocation);
+ return result != 0 ? new NSTextTab(result) : null;
+}
+
+public int typesetterBehavior() {
+ return OS.objc_msgSend(this.id, OS.sel_typesetterBehavior);
+}
+
+public boolean usesFontLeading() {
+ return OS.objc_msgSend(this.id, OS.sel_usesFontLeading) != 0;
+}
+
+public void willSetLineFragmentRect(int lineRect, NSRange glyphRange, int usedRect, int baselineOffset) {
+ OS.objc_msgSend(this.id, OS.sel_willSetLineFragmentRect_1forGlyphRange_1usedRect_1baselineOffset_1, lineRect, glyphRange, usedRect, baselineOffset);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURL.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURL.java
new file mode 100644
index 0000000000..91a67a6093
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURL.java
@@ -0,0 +1,169 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSURL extends NSObject {
+
+public NSURL() {
+ super();
+}
+
+public NSURL(int id) {
+ super(id);
+}
+
+public NSURLHandle URLHandleUsingCache(boolean shouldUseCache) {
+ int result = OS.objc_msgSend(this.id, OS.sel_URLHandleUsingCache_1, shouldUseCache);
+ return result != 0 ? new NSURLHandle(result) : null;
+}
+
+public static NSURL static_URLWithString_(NSString URLString) {
+ int result = OS.objc_msgSend(OS.class_NSURL, OS.sel_URLWithString_1, URLString != null ? URLString.id : 0);
+ return result != 0 ? new NSURL(result) : null;
+}
+
+public static id static_URLWithString_relativeToURL_(NSString URLString, NSURL baseURL) {
+ int result = OS.objc_msgSend(OS.class_NSURL, OS.sel_URLWithString_1relativeToURL_1, URLString != null ? URLString.id : 0, baseURL != null ? baseURL.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString absoluteString() {
+ int result = OS.objc_msgSend(this.id, OS.sel_absoluteString);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSURL absoluteURL() {
+ int result = OS.objc_msgSend(this.id, OS.sel_absoluteURL);
+ return result == this.id ? this : (result != 0 ? new NSURL(result) : null);
+}
+
+public NSURL baseURL() {
+ int result = OS.objc_msgSend(this.id, OS.sel_baseURL);
+ return result == this.id ? this : (result != 0 ? new NSURL(result) : null);
+}
+
+public static id static_fileURLWithPath_(NSString path) {
+ int result = OS.objc_msgSend(OS.class_NSURL, OS.sel_fileURLWithPath_1, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_fileURLWithPath_isDirectory_(NSString path, boolean isDir) {
+ int result = OS.objc_msgSend(OS.class_NSURL, OS.sel_fileURLWithPath_1isDirectory_1, path != null ? path.id : 0, isDir);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString fragment() {
+ int result = OS.objc_msgSend(this.id, OS.sel_fragment);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString host() {
+ int result = OS.objc_msgSend(this.id, OS.sel_host);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id initFileURLWithPath_(NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initFileURLWithPath_1, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initFileURLWithPath_isDirectory_(NSString path, boolean isDir) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initFileURLWithPath_1isDirectory_1, path != null ? path.id : 0, isDir);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithScheme(NSString scheme, NSString host, NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithScheme_1host_1path_1, scheme != null ? scheme.id : 0, host != null ? host.id : 0, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithString_(NSString URLString) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithString_1, URLString != null ? URLString.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithString_relativeToURL_(NSString URLString, NSURL baseURL) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithString_1relativeToURL_1, URLString != null ? URLString.id : 0, baseURL != null ? baseURL.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isFileURL() {
+ return OS.objc_msgSend(this.id, OS.sel_isFileURL) != 0;
+}
+
+public void loadResourceDataNotifyingClient(id client, boolean shouldUseCache) {
+ OS.objc_msgSend(this.id, OS.sel_loadResourceDataNotifyingClient_1usingCache_1, client != null ? client.id : 0, shouldUseCache);
+}
+
+public NSString parameterString() {
+ int result = OS.objc_msgSend(this.id, OS.sel_parameterString);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString password() {
+ int result = OS.objc_msgSend(this.id, OS.sel_password);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString path() {
+ int result = OS.objc_msgSend(this.id, OS.sel_path);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSNumber port() {
+ int result = OS.objc_msgSend(this.id, OS.sel_port);
+ return result != 0 ? new NSNumber(result) : null;
+}
+
+public id propertyForKey(NSString propertyKey) {
+ int result = OS.objc_msgSend(this.id, OS.sel_propertyForKey_1, propertyKey != null ? propertyKey.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString query() {
+ int result = OS.objc_msgSend(this.id, OS.sel_query);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString relativePath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_relativePath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString relativeString() {
+ int result = OS.objc_msgSend(this.id, OS.sel_relativeString);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSData resourceDataUsingCache(boolean shouldUseCache) {
+ int result = OS.objc_msgSend(this.id, OS.sel_resourceDataUsingCache_1, shouldUseCache);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSString resourceSpecifier() {
+ int result = OS.objc_msgSend(this.id, OS.sel_resourceSpecifier);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString scheme() {
+ int result = OS.objc_msgSend(this.id, OS.sel_scheme);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean setProperty(id property, NSString propertyKey) {
+ return OS.objc_msgSend(this.id, OS.sel_setProperty_1forKey_1, property != null ? property.id : 0, propertyKey != null ? propertyKey.id : 0) != 0;
+}
+
+public boolean setResourceData(NSData data) {
+ return OS.objc_msgSend(this.id, OS.sel_setResourceData_1, data != null ? data.id : 0) != 0;
+}
+
+public NSURL standardizedURL() {
+ int result = OS.objc_msgSend(this.id, OS.sel_standardizedURL);
+ return result == this.id ? this : (result != 0 ? new NSURL(result) : null);
+}
+
+public NSString user() {
+ int result = OS.objc_msgSend(this.id, OS.sel_user);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLAuthenticationChallenge.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLAuthenticationChallenge.java
new file mode 100644
index 0000000000..5ec722b20b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLAuthenticationChallenge.java
@@ -0,0 +1,52 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSURLAuthenticationChallenge extends NSObject {
+
+public NSURLAuthenticationChallenge() {
+ super();
+}
+
+public NSURLAuthenticationChallenge(int id) {
+ super(id);
+}
+
+public NSError error() {
+ int result = OS.objc_msgSend(this.id, OS.sel_error);
+ return result != 0 ? new NSError(result) : null;
+}
+
+public NSURLResponse failureResponse() {
+ int result = OS.objc_msgSend(this.id, OS.sel_failureResponse);
+ return result != 0 ? new NSURLResponse(result) : null;
+}
+
+public id initWithAuthenticationChallenge(NSURLAuthenticationChallenge challenge, id sender) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithAuthenticationChallenge_1sender_1, challenge != null ? challenge.id : 0, sender != null ? sender.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithProtectionSpace(NSURLProtectionSpace space, NSURLCredential credential, int previousFailureCount, NSURLResponse response, NSError error, id sender) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithProtectionSpace_1proposedCredential_1previousFailureCount_1failureResponse_1error_1sender_1, space != null ? space.id : 0, credential != null ? credential.id : 0, previousFailureCount, response != null ? response.id : 0, error != null ? error.id : 0, sender != null ? sender.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public int previousFailureCount() {
+ return OS.objc_msgSend(this.id, OS.sel_previousFailureCount);
+}
+
+public NSURLCredential proposedCredential() {
+ int result = OS.objc_msgSend(this.id, OS.sel_proposedCredential);
+ return result != 0 ? new NSURLCredential(result) : null;
+}
+
+public NSURLProtectionSpace protectionSpace() {
+ int result = OS.objc_msgSend(this.id, OS.sel_protectionSpace);
+ return result != 0 ? new NSURLProtectionSpace(result) : null;
+}
+
+public id sender() {
+ int result = OS.objc_msgSend(this.id, OS.sel_sender);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLCache.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLCache.java
new file mode 100644
index 0000000000..e3d433f4ba
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLCache.java
@@ -0,0 +1,68 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSURLCache extends NSObject {
+
+public NSURLCache() {
+ super();
+}
+
+public NSURLCache(int id) {
+ super(id);
+}
+
+public NSCachedURLResponse cachedResponseForRequest(NSURLRequest request) {
+ int result = OS.objc_msgSend(this.id, OS.sel_cachedResponseForRequest_1, request != null ? request.id : 0);
+ return result != 0 ? new NSCachedURLResponse(result) : null;
+}
+
+public int currentDiskUsage() {
+ return OS.objc_msgSend(this.id, OS.sel_currentDiskUsage);
+}
+
+public int currentMemoryUsage() {
+ return OS.objc_msgSend(this.id, OS.sel_currentMemoryUsage);
+}
+
+public int diskCapacity() {
+ return OS.objc_msgSend(this.id, OS.sel_diskCapacity);
+}
+
+public id initWithMemoryCapacity(int memoryCapacity, int diskCapacity, NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithMemoryCapacity_1diskCapacity_1diskPath_1, memoryCapacity, diskCapacity, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public int memoryCapacity() {
+ return OS.objc_msgSend(this.id, OS.sel_memoryCapacity);
+}
+
+public void removeAllCachedResponses() {
+ OS.objc_msgSend(this.id, OS.sel_removeAllCachedResponses);
+}
+
+public void removeCachedResponseForRequest(NSURLRequest request) {
+ OS.objc_msgSend(this.id, OS.sel_removeCachedResponseForRequest_1, request != null ? request.id : 0);
+}
+
+public void setDiskCapacity(int diskCapacity) {
+ OS.objc_msgSend(this.id, OS.sel_setDiskCapacity_1, diskCapacity);
+}
+
+public void setMemoryCapacity(int memoryCapacity) {
+ OS.objc_msgSend(this.id, OS.sel_setMemoryCapacity_1, memoryCapacity);
+}
+
+public static void setSharedURLCache(NSURLCache cache) {
+ OS.objc_msgSend(OS.class_NSURLCache, OS.sel_setSharedURLCache_1, cache != null ? cache.id : 0);
+}
+
+public static NSURLCache sharedURLCache() {
+ int result = OS.objc_msgSend(OS.class_NSURLCache, OS.sel_sharedURLCache);
+ return result != 0 ? new NSURLCache(result) : null;
+}
+
+public void storeCachedResponse(NSCachedURLResponse cachedResponse, NSURLRequest request) {
+ OS.objc_msgSend(this.id, OS.sel_storeCachedResponse_1forRequest_1, cachedResponse != null ? cachedResponse.id : 0, request != null ? request.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLConnection.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLConnection.java
new file mode 100644
index 0000000000..fc38ac9a4c
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLConnection.java
@@ -0,0 +1,53 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSURLConnection extends NSObject {
+
+public NSURLConnection() {
+ super();
+}
+
+public NSURLConnection(int id) {
+ super(id);
+}
+
+public static boolean canHandleRequest(NSURLRequest request) {
+ return OS.objc_msgSend(OS.class_NSURLConnection, OS.sel_canHandleRequest_1, request != null ? request.id : 0) != 0;
+}
+
+public void cancel() {
+ OS.objc_msgSend(this.id, OS.sel_cancel);
+}
+
+public static NSURLConnection connectionWithRequest(NSURLRequest request, id delegate) {
+ int result = OS.objc_msgSend(OS.class_NSURLConnection, OS.sel_connectionWithRequest_1delegate_1, request != null ? request.id : 0, delegate != null ? delegate.id : 0);
+ return result != 0 ? new NSURLConnection(result) : null;
+}
+
+public id initWithRequest_delegate_(NSURLRequest request, id delegate) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithRequest_1delegate_1, request != null ? request.id : 0, delegate != null ? delegate.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithRequest_delegate_startImmediately_(NSURLRequest request, id delegate, boolean startImmediately) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithRequest_1delegate_1startImmediately_1, request != null ? request.id : 0, delegate != null ? delegate.id : 0, startImmediately);
+ return result != 0 ? new id(result) : null;
+}
+
+public void scheduleInRunLoop(NSRunLoop aRunLoop, NSString mode) {
+ OS.objc_msgSend(this.id, OS.sel_scheduleInRunLoop_1forMode_1, aRunLoop != null ? aRunLoop.id : 0, mode != null ? mode.id : 0);
+}
+
+public static NSData sendSynchronousRequest(NSURLRequest request, int response, int error) {
+ int result = OS.objc_msgSend(OS.class_NSURLConnection, OS.sel_sendSynchronousRequest_1returningResponse_1error_1, request != null ? request.id : 0, response, error);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public void start() {
+ OS.objc_msgSend(this.id, OS.sel_start);
+}
+
+public void unscheduleFromRunLoop(NSRunLoop aRunLoop, NSString mode) {
+ OS.objc_msgSend(this.id, OS.sel_unscheduleFromRunLoop_1forMode_1, aRunLoop != null ? aRunLoop.id : 0, mode != null ? mode.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLCredential.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLCredential.java
new file mode 100644
index 0000000000..c2b81d1208
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLCredential.java
@@ -0,0 +1,41 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSURLCredential extends NSObject {
+
+public NSURLCredential() {
+ super();
+}
+
+public NSURLCredential(int id) {
+ super(id);
+}
+
+public static NSURLCredential credentialWithUser(NSString user, NSString password, int persistence) {
+ int result = OS.objc_msgSend(OS.class_NSURLCredential, OS.sel_credentialWithUser_1password_1persistence_1, user != null ? user.id : 0, password != null ? password.id : 0, persistence);
+ return result != 0 ? new NSURLCredential(result) : null;
+}
+
+public boolean hasPassword() {
+ return OS.objc_msgSend(this.id, OS.sel_hasPassword) != 0;
+}
+
+public id initWithUser(NSString user, NSString password, int persistence) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithUser_1password_1persistence_1, user != null ? user.id : 0, password != null ? password.id : 0, persistence);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString password() {
+ int result = OS.objc_msgSend(this.id, OS.sel_password);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int persistence() {
+ return OS.objc_msgSend(this.id, OS.sel_persistence);
+}
+
+public NSString user() {
+ int result = OS.objc_msgSend(this.id, OS.sel_user);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLCredentialStorage.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLCredentialStorage.java
new file mode 100644
index 0000000000..8b9171c700
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLCredentialStorage.java
@@ -0,0 +1,45 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSURLCredentialStorage extends NSObject {
+
+public NSURLCredentialStorage() {
+ super();
+}
+
+public NSURLCredentialStorage(int id) {
+ super(id);
+}
+
+public NSDictionary allCredentials() {
+ int result = OS.objc_msgSend(this.id, OS.sel_allCredentials);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSDictionary credentialsForProtectionSpace(NSURLProtectionSpace space) {
+ int result = OS.objc_msgSend(this.id, OS.sel_credentialsForProtectionSpace_1, space != null ? space.id : 0);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSURLCredential defaultCredentialForProtectionSpace(NSURLProtectionSpace space) {
+ int result = OS.objc_msgSend(this.id, OS.sel_defaultCredentialForProtectionSpace_1, space != null ? space.id : 0);
+ return result != 0 ? new NSURLCredential(result) : null;
+}
+
+public void removeCredential(NSURLCredential credential, NSURLProtectionSpace space) {
+ OS.objc_msgSend(this.id, OS.sel_removeCredential_1forProtectionSpace_1, credential != null ? credential.id : 0, space != null ? space.id : 0);
+}
+
+public void setCredential(NSURLCredential credential, NSURLProtectionSpace space) {
+ OS.objc_msgSend(this.id, OS.sel_setCredential_1forProtectionSpace_1, credential != null ? credential.id : 0, space != null ? space.id : 0);
+}
+
+public void setDefaultCredential(NSURLCredential credential, NSURLProtectionSpace space) {
+ OS.objc_msgSend(this.id, OS.sel_setDefaultCredential_1forProtectionSpace_1, credential != null ? credential.id : 0, space != null ? space.id : 0);
+}
+
+public static NSURLCredentialStorage sharedCredentialStorage() {
+ int result = OS.objc_msgSend(OS.class_NSURLCredentialStorage, OS.sel_sharedCredentialStorage);
+ return result != 0 ? new NSURLCredentialStorage(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLDownload.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLDownload.java
new file mode 100644
index 0000000000..10876cb37f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLDownload.java
@@ -0,0 +1,53 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSURLDownload extends NSObject {
+
+public NSURLDownload() {
+ super();
+}
+
+public NSURLDownload(int id) {
+ super(id);
+}
+
+public static boolean canResumeDownloadDecodedWithEncodingMIMEType(NSString MIMEType) {
+ return OS.objc_msgSend(OS.class_NSURLDownload, OS.sel_canResumeDownloadDecodedWithEncodingMIMEType_1, MIMEType != null ? MIMEType.id : 0) != 0;
+}
+
+public void cancel() {
+ OS.objc_msgSend(this.id, OS.sel_cancel);
+}
+
+public boolean deletesFileUponFailure() {
+ return OS.objc_msgSend(this.id, OS.sel_deletesFileUponFailure) != 0;
+}
+
+public id initWithRequest(NSURLRequest request, id delegate) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithRequest_1delegate_1, request != null ? request.id : 0, delegate != null ? delegate.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithResumeData(NSData resumeData, id delegate, NSString path) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithResumeData_1delegate_1path_1, resumeData != null ? resumeData.id : 0, delegate != null ? delegate.id : 0, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSURLRequest request() {
+ int result = OS.objc_msgSend(this.id, OS.sel_request);
+ return result != 0 ? new NSURLRequest(result) : null;
+}
+
+public NSData resumeData() {
+ int result = OS.objc_msgSend(this.id, OS.sel_resumeData);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public void setDeletesFileUponFailure(boolean deletesFileUponFailure) {
+ OS.objc_msgSend(this.id, OS.sel_setDeletesFileUponFailure_1, deletesFileUponFailure);
+}
+
+public void setDestination(NSString path, boolean allowOverwrite) {
+ OS.objc_msgSend(this.id, OS.sel_setDestination_1allowOverwrite_1, path != null ? path.id : 0, allowOverwrite);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLHandle.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLHandle.java
new file mode 100644
index 0000000000..93aa2a1635
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLHandle.java
@@ -0,0 +1,117 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSURLHandle extends NSObject {
+
+public NSURLHandle() {
+ super();
+}
+
+public NSURLHandle(int id) {
+ super(id);
+}
+
+public static int URLHandleClassForURL(NSURL anURL) {
+ return OS.objc_msgSend(OS.class_NSURLHandle, OS.sel_URLHandleClassForURL_1, anURL != null ? anURL.id : 0);
+}
+
+public void addClient(id client) {
+ OS.objc_msgSend(this.id, OS.sel_addClient_1, client != null ? client.id : 0);
+}
+
+public NSData availableResourceData() {
+ int result = OS.objc_msgSend(this.id, OS.sel_availableResourceData);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public void backgroundLoadDidFailWithReason(NSString reason) {
+ OS.objc_msgSend(this.id, OS.sel_backgroundLoadDidFailWithReason_1, reason != null ? reason.id : 0);
+}
+
+public void beginLoadInBackground() {
+ OS.objc_msgSend(this.id, OS.sel_beginLoadInBackground);
+}
+
+public static NSURLHandle cachedHandleForURL(NSURL anURL) {
+ int result = OS.objc_msgSend(OS.class_NSURLHandle, OS.sel_cachedHandleForURL_1, anURL != null ? anURL.id : 0);
+ return result != 0 ? new NSURLHandle(result) : null;
+}
+
+public static boolean canInitWithURL(NSURL anURL) {
+ return OS.objc_msgSend(OS.class_NSURLHandle, OS.sel_canInitWithURL_1, anURL != null ? anURL.id : 0) != 0;
+}
+
+public void cancelLoadInBackground() {
+ OS.objc_msgSend(this.id, OS.sel_cancelLoadInBackground);
+}
+
+public void didLoadBytes(NSData newBytes, boolean yorn) {
+ OS.objc_msgSend(this.id, OS.sel_didLoadBytes_1loadComplete_1, newBytes != null ? newBytes.id : 0, yorn);
+}
+
+public void endLoadInBackground() {
+ OS.objc_msgSend(this.id, OS.sel_endLoadInBackground);
+}
+
+public long expectedResourceDataSize() {
+ return (long)OS.objc_msgSend(this.id, OS.sel_expectedResourceDataSize);
+}
+
+public NSString failureReason() {
+ int result = OS.objc_msgSend(this.id, OS.sel_failureReason);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void flushCachedData() {
+ OS.objc_msgSend(this.id, OS.sel_flushCachedData);
+}
+
+public id initWithURL(NSURL anURL, boolean willCache) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithURL_1cached_1, anURL != null ? anURL.id : 0, willCache);
+ return result != 0 ? new id(result) : null;
+}
+
+public void loadInBackground() {
+ OS.objc_msgSend(this.id, OS.sel_loadInBackground);
+}
+
+public NSData loadInForeground() {
+ int result = OS.objc_msgSend(this.id, OS.sel_loadInForeground);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public id propertyForKey(NSString propertyKey) {
+ int result = OS.objc_msgSend(this.id, OS.sel_propertyForKey_1, propertyKey != null ? propertyKey.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id propertyForKeyIfAvailable(NSString propertyKey) {
+ int result = OS.objc_msgSend(this.id, OS.sel_propertyForKeyIfAvailable_1, propertyKey != null ? propertyKey.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static void registerURLHandleClass(int anURLHandleSubclass) {
+ OS.objc_msgSend(OS.class_NSURLHandle, OS.sel_registerURLHandleClass_1, anURLHandleSubclass);
+}
+
+public void removeClient(id client) {
+ OS.objc_msgSend(this.id, OS.sel_removeClient_1, client != null ? client.id : 0);
+}
+
+public NSData resourceData() {
+ int result = OS.objc_msgSend(this.id, OS.sel_resourceData);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public int status() {
+ return OS.objc_msgSend(this.id, OS.sel_status);
+}
+
+public boolean writeData(NSData data) {
+ return OS.objc_msgSend(this.id, OS.sel_writeData_1, data != null ? data.id : 0) != 0;
+}
+
+public boolean writeProperty(id propertyValue, NSString propertyKey) {
+ return OS.objc_msgSend(this.id, OS.sel_writeProperty_1forKey_1, propertyValue != null ? propertyValue.id : 0, propertyKey != null ? propertyKey.id : 0) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLProtectionSpace.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLProtectionSpace.java
new file mode 100644
index 0000000000..c0af4f6e69
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLProtectionSpace.java
@@ -0,0 +1,60 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSURLProtectionSpace extends NSObject {
+
+public NSURLProtectionSpace() {
+ super();
+}
+
+public NSURLProtectionSpace(int id) {
+ super(id);
+}
+
+public NSString authenticationMethod() {
+ int result = OS.objc_msgSend(this.id, OS.sel_authenticationMethod);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString host() {
+ int result = OS.objc_msgSend(this.id, OS.sel_host);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id initWithHost(NSString host, int port, NSString protocol, NSString realm, NSString authenticationMethod) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithHost_1port_1protocol_1realm_1authenticationMethod_1, host != null ? host.id : 0, port, protocol != null ? protocol.id : 0, realm != null ? realm.id : 0, authenticationMethod != null ? authenticationMethod.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithProxyHost(NSString host, int port, NSString type, NSString realm, NSString authenticationMethod) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithProxyHost_1port_1type_1realm_1authenticationMethod_1, host != null ? host.id : 0, port, type != null ? type.id : 0, realm != null ? realm.id : 0, authenticationMethod != null ? authenticationMethod.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isProxy() {
+ return OS.objc_msgSend(this.id, OS.sel_isProxy) != 0;
+}
+
+public int port() {
+ return OS.objc_msgSend(this.id, OS.sel_port);
+}
+
+public NSString protocol() {
+ int result = OS.objc_msgSend(this.id, OS.sel_protocol);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString proxyType() {
+ int result = OS.objc_msgSend(this.id, OS.sel_proxyType);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString realm() {
+ int result = OS.objc_msgSend(this.id, OS.sel_realm);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean receivesCredentialSecurely() {
+ return OS.objc_msgSend(this.id, OS.sel_receivesCredentialSecurely) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLProtocol.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLProtocol.java
new file mode 100644
index 0000000000..197ed712a1
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLProtocol.java
@@ -0,0 +1,75 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSURLProtocol extends NSObject {
+
+public NSURLProtocol() {
+ super();
+}
+
+public NSURLProtocol(int id) {
+ super(id);
+}
+
+public NSCachedURLResponse cachedResponse() {
+ int result = OS.objc_msgSend(this.id, OS.sel_cachedResponse);
+ return result != 0 ? new NSCachedURLResponse(result) : null;
+}
+
+public static boolean canInitWithRequest(NSURLRequest request) {
+ return OS.objc_msgSend(OS.class_NSURLProtocol, OS.sel_canInitWithRequest_1, request != null ? request.id : 0) != 0;
+}
+
+public static NSURLRequest canonicalRequestForRequest(NSURLRequest request) {
+ int result = OS.objc_msgSend(OS.class_NSURLProtocol, OS.sel_canonicalRequestForRequest_1, request != null ? request.id : 0);
+ return result != 0 ? new NSURLRequest(result) : null;
+}
+
+public id client() {
+ int result = OS.objc_msgSend(this.id, OS.sel_client);
+ return result != 0 ? new id (result) : null;
+}
+
+public id initWithRequest(NSURLRequest request, NSCachedURLResponse cachedResponse, id client) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithRequest_1cachedResponse_1client_1, request != null ? request.id : 0, cachedResponse != null ? cachedResponse.id : 0, client != null ? client.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id propertyForKey(NSString key, NSURLRequest request) {
+ int result = OS.objc_msgSend(OS.class_NSURLProtocol, OS.sel_propertyForKey_1inRequest_1, key != null ? key.id : 0, request != null ? request.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static boolean registerClass(int protocolClass) {
+ return OS.objc_msgSend(OS.class_NSURLProtocol, OS.sel_registerClass_1, protocolClass) != 0;
+}
+
+public static void removePropertyForKey(NSString key, NSMutableURLRequest request) {
+ OS.objc_msgSend(OS.class_NSURLProtocol, OS.sel_removePropertyForKey_1inRequest_1, key != null ? key.id : 0, request != null ? request.id : 0);
+}
+
+public NSURLRequest request() {
+ int result = OS.objc_msgSend(this.id, OS.sel_request);
+ return result != 0 ? new NSURLRequest(result) : null;
+}
+
+public static boolean requestIsCacheEquivalent(NSURLRequest a, NSURLRequest b) {
+ return OS.objc_msgSend(OS.class_NSURLProtocol, OS.sel_requestIsCacheEquivalent_1toRequest_1, a != null ? a.id : 0, b != null ? b.id : 0) != 0;
+}
+
+public static void setProperty(id value, NSString key, NSMutableURLRequest request) {
+ OS.objc_msgSend(OS.class_NSURLProtocol, OS.sel_setProperty_1forKey_1inRequest_1, value != null ? value.id : 0, key != null ? key.id : 0, request != null ? request.id : 0);
+}
+
+public void startLoading() {
+ OS.objc_msgSend(this.id, OS.sel_startLoading);
+}
+
+public void stopLoading() {
+ OS.objc_msgSend(this.id, OS.sel_stopLoading);
+}
+
+public static void unregisterClass(int protocolClass) {
+ OS.objc_msgSend(OS.class_NSURLProtocol, OS.sel_unregisterClass_1, protocolClass);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLRequest.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLRequest.java
new file mode 100644
index 0000000000..ef6c63e98b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLRequest.java
@@ -0,0 +1,80 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSURLRequest extends NSObject {
+
+public NSURLRequest() {
+ super();
+}
+
+public NSURLRequest(int id) {
+ super(id);
+}
+
+public NSData HTTPBody() {
+ int result = OS.objc_msgSend(this.id, OS.sel_HTTPBody);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSInputStream HTTPBodyStream() {
+ int result = OS.objc_msgSend(this.id, OS.sel_HTTPBodyStream);
+ return result != 0 ? new NSInputStream(result) : null;
+}
+
+public NSString HTTPMethod() {
+ int result = OS.objc_msgSend(this.id, OS.sel_HTTPMethod);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean HTTPShouldHandleCookies() {
+ return OS.objc_msgSend(this.id, OS.sel_HTTPShouldHandleCookies) != 0;
+}
+
+public NSURL URL() {
+ int result = OS.objc_msgSend(this.id, OS.sel_URL);
+ return result != 0 ? new NSURL(result) : null;
+}
+
+public NSDictionary allHTTPHeaderFields() {
+ int result = OS.objc_msgSend(this.id, OS.sel_allHTTPHeaderFields);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public int cachePolicy() {
+ return OS.objc_msgSend(this.id, OS.sel_cachePolicy);
+}
+
+public id initWithURL_(NSURL URL) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithURL_1, URL != null ? URL.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithURL_cachePolicy_timeoutInterval_(NSURL URL, int cachePolicy, double timeoutInterval) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithURL_1cachePolicy_1timeoutInterval_1, URL != null ? URL.id : 0, cachePolicy, timeoutInterval);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSURL mainDocumentURL() {
+ int result = OS.objc_msgSend(this.id, OS.sel_mainDocumentURL);
+ return result != 0 ? new NSURL(result) : null;
+}
+
+public static id static_requestWithURL_(NSURL URL) {
+ int result = OS.objc_msgSend(OS.class_NSURLRequest, OS.sel_requestWithURL_1, URL != null ? URL.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_requestWithURL_cachePolicy_timeoutInterval_(NSURL URL, int cachePolicy, double timeoutInterval) {
+ int result = OS.objc_msgSend(OS.class_NSURLRequest, OS.sel_requestWithURL_1cachePolicy_1timeoutInterval_1, URL != null ? URL.id : 0, cachePolicy, timeoutInterval);
+ return result != 0 ? new id(result) : null;
+}
+
+public double timeoutInterval() {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_timeoutInterval);
+}
+
+public NSString valueForHTTPHeaderField(NSString field) {
+ int result = OS.objc_msgSend(this.id, OS.sel_valueForHTTPHeaderField_1, field != null ? field.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLResponse.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLResponse.java
new file mode 100644
index 0000000000..b6a6b4c82a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSURLResponse.java
@@ -0,0 +1,42 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSURLResponse extends NSObject {
+
+public NSURLResponse() {
+ super();
+}
+
+public NSURLResponse(int id) {
+ super(id);
+}
+
+public NSString MIMEType() {
+ int result = OS.objc_msgSend(this.id, OS.sel_MIMEType);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSURL URL() {
+ int result = OS.objc_msgSend(this.id, OS.sel_URL);
+ return result != 0 ? new NSURL(result) : null;
+}
+
+public long expectedContentLength() {
+ return (long)OS.objc_msgSend(this.id, OS.sel_expectedContentLength);
+}
+
+public id initWithURL(NSURL URL, NSString MIMEType, int length, NSString name) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithURL_1MIMEType_1expectedContentLength_1textEncodingName_1, URL != null ? URL.id : 0, MIMEType != null ? MIMEType.id : 0, length, name != null ? name.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString suggestedFilename() {
+ int result = OS.objc_msgSend(this.id, OS.sel_suggestedFilename);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString textEncodingName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_textEncodingName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUnarchiver.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUnarchiver.java
new file mode 100644
index 0000000000..dd39d059e2
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUnarchiver.java
@@ -0,0 +1,66 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSUnarchiver extends NSCoder {
+
+public NSUnarchiver() {
+ super();
+}
+
+public NSUnarchiver(int id) {
+ super(id);
+}
+
+public static NSString static_classNameDecodedForArchiveClassName_(NSString inArchiveName) {
+ int result = OS.objc_msgSend(OS.class_NSUnarchiver, OS.sel_classNameDecodedForArchiveClassName_1, inArchiveName != null ? inArchiveName.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString classNameDecodedForArchiveClassName_(NSString inArchiveName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_classNameDecodedForArchiveClassName_1, inArchiveName != null ? inArchiveName.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void decodeClassName_asClassName_(NSString inArchiveName, NSString trueName) {
+ OS.objc_msgSend(this.id, OS.sel_decodeClassName_1asClassName_1, inArchiveName != null ? inArchiveName.id : 0, trueName != null ? trueName.id : 0);
+}
+
+public static void static_decodeClassName_asClassName_(NSString inArchiveName, NSString trueName) {
+ OS.objc_msgSend(OS.class_NSUnarchiver, OS.sel_decodeClassName_1asClassName_1, inArchiveName != null ? inArchiveName.id : 0, trueName != null ? trueName.id : 0);
+}
+
+public id initForReadingWithData(NSData data) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initForReadingWithData_1, data != null ? data.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isAtEnd() {
+ return OS.objc_msgSend(this.id, OS.sel_isAtEnd) != 0;
+}
+
+public int objectZone() {
+ return OS.objc_msgSend(this.id, OS.sel_objectZone);
+}
+
+public void replaceObject(id object, id newObject) {
+ OS.objc_msgSend(this.id, OS.sel_replaceObject_1withObject_1, object != null ? object.id : 0, newObject != null ? newObject.id : 0);
+}
+
+public void setObjectZone(int zone) {
+ OS.objc_msgSend(this.id, OS.sel_setObjectZone_1, zone);
+}
+
+public int systemVersion() {
+ return OS.objc_msgSend(this.id, OS.sel_systemVersion);
+}
+
+public static id unarchiveObjectWithData(NSData data) {
+ int result = OS.objc_msgSend(OS.class_NSUnarchiver, OS.sel_unarchiveObjectWithData_1, data != null ? data.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id unarchiveObjectWithFile(NSString path) {
+ int result = OS.objc_msgSend(OS.class_NSUnarchiver, OS.sel_unarchiveObjectWithFile_1, path != null ? path.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUndoManager.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUndoManager.java
new file mode 100644
index 0000000000..0b41ee5a6d
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUndoManager.java
@@ -0,0 +1,141 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSUndoManager extends NSObject {
+
+public NSUndoManager() {
+ super();
+}
+
+public NSUndoManager(int id) {
+ super(id);
+}
+
+public void beginUndoGrouping() {
+ OS.objc_msgSend(this.id, OS.sel_beginUndoGrouping);
+}
+
+public boolean canRedo() {
+ return OS.objc_msgSend(this.id, OS.sel_canRedo) != 0;
+}
+
+public boolean canUndo() {
+ return OS.objc_msgSend(this.id, OS.sel_canUndo) != 0;
+}
+
+public void disableUndoRegistration() {
+ OS.objc_msgSend(this.id, OS.sel_disableUndoRegistration);
+}
+
+public void enableUndoRegistration() {
+ OS.objc_msgSend(this.id, OS.sel_enableUndoRegistration);
+}
+
+public void endUndoGrouping() {
+ OS.objc_msgSend(this.id, OS.sel_endUndoGrouping);
+}
+
+public int groupingLevel() {
+ return OS.objc_msgSend(this.id, OS.sel_groupingLevel);
+}
+
+public boolean groupsByEvent() {
+ return OS.objc_msgSend(this.id, OS.sel_groupsByEvent) != 0;
+}
+
+public boolean isRedoing() {
+ return OS.objc_msgSend(this.id, OS.sel_isRedoing) != 0;
+}
+
+public boolean isUndoRegistrationEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_isUndoRegistrationEnabled) != 0;
+}
+
+public boolean isUndoing() {
+ return OS.objc_msgSend(this.id, OS.sel_isUndoing) != 0;
+}
+
+public int levelsOfUndo() {
+ return OS.objc_msgSend(this.id, OS.sel_levelsOfUndo);
+}
+
+public id prepareWithInvocationTarget(id target) {
+ int result = OS.objc_msgSend(this.id, OS.sel_prepareWithInvocationTarget_1, target != null ? target.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void redo() {
+ OS.objc_msgSend(this.id, OS.sel_redo);
+}
+
+public NSString redoActionName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_redoActionName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString redoMenuItemTitle() {
+ int result = OS.objc_msgSend(this.id, OS.sel_redoMenuItemTitle);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString redoMenuTitleForUndoActionName(NSString actionName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_redoMenuTitleForUndoActionName_1, actionName != null ? actionName.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void registerUndoWithTarget(id target, int selector, id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_registerUndoWithTarget_1selector_1object_1, target != null ? target.id : 0, selector, anObject != null ? anObject.id : 0);
+}
+
+public void removeAllActions() {
+ OS.objc_msgSend(this.id, OS.sel_removeAllActions);
+}
+
+public void removeAllActionsWithTarget(id target) {
+ OS.objc_msgSend(this.id, OS.sel_removeAllActionsWithTarget_1, target != null ? target.id : 0);
+}
+
+public NSArray runLoopModes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_runLoopModes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void setActionName(NSString actionName) {
+ OS.objc_msgSend(this.id, OS.sel_setActionName_1, actionName != null ? actionName.id : 0);
+}
+
+public void setGroupsByEvent(boolean groupsByEvent) {
+ OS.objc_msgSend(this.id, OS.sel_setGroupsByEvent_1, groupsByEvent);
+}
+
+public void setLevelsOfUndo(int levels) {
+ OS.objc_msgSend(this.id, OS.sel_setLevelsOfUndo_1, levels);
+}
+
+public void setRunLoopModes(NSArray runLoopModes) {
+ OS.objc_msgSend(this.id, OS.sel_setRunLoopModes_1, runLoopModes != null ? runLoopModes.id : 0);
+}
+
+public void undo() {
+ OS.objc_msgSend(this.id, OS.sel_undo);
+}
+
+public NSString undoActionName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_undoActionName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString undoMenuItemTitle() {
+ int result = OS.objc_msgSend(this.id, OS.sel_undoMenuItemTitle);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString undoMenuTitleForUndoActionName(NSString actionName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_undoMenuTitleForUndoActionName_1, actionName != null ? actionName.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void undoNestedGroup() {
+ OS.objc_msgSend(this.id, OS.sel_undoNestedGroup);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUniqueIDSpecifier.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUniqueIDSpecifier.java
new file mode 100644
index 0000000000..45ea315778
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUniqueIDSpecifier.java
@@ -0,0 +1,27 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSUniqueIDSpecifier extends NSScriptObjectSpecifier {
+
+public NSUniqueIDSpecifier() {
+ super();
+}
+
+public NSUniqueIDSpecifier(int id) {
+ super(id);
+}
+
+public id initWithContainerClassDescription(NSScriptClassDescription classDesc, NSScriptObjectSpecifier container, NSString property, id uniqueID) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContainerClassDescription_1containerSpecifier_1key_1uniqueID_1, classDesc != null ? classDesc.id : 0, container != null ? container.id : 0, property != null ? property.id : 0, uniqueID != null ? uniqueID.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void setUniqueID(id uniqueID) {
+ OS.objc_msgSend(this.id, OS.sel_setUniqueID_1, uniqueID != null ? uniqueID.id : 0);
+}
+
+public id uniqueID() {
+ int result = OS.objc_msgSend(this.id, OS.sel_uniqueID);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUserDefaults.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUserDefaults.java
new file mode 100644
index 0000000000..66139ed00f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUserDefaults.java
@@ -0,0 +1,162 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSUserDefaults extends NSObject {
+
+public NSUserDefaults() {
+ super();
+}
+
+public NSUserDefaults(int id) {
+ super(id);
+}
+
+public void addSuiteNamed(NSString suiteName) {
+ OS.objc_msgSend(this.id, OS.sel_addSuiteNamed_1, suiteName != null ? suiteName.id : 0);
+}
+
+public NSArray arrayForKey(NSString defaultName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_arrayForKey_1, defaultName != null ? defaultName.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public boolean boolForKey(NSString defaultName) {
+ return OS.objc_msgSend(this.id, OS.sel_boolForKey_1, defaultName != null ? defaultName.id : 0) != 0;
+}
+
+public NSData dataForKey(NSString defaultName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dataForKey_1, defaultName != null ? defaultName.id : 0);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSDictionary dictionaryForKey(NSString defaultName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dictionaryForKey_1, defaultName != null ? defaultName.id : 0);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSDictionary dictionaryRepresentation() {
+ int result = OS.objc_msgSend(this.id, OS.sel_dictionaryRepresentation);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public double doubleForKey(NSString defaultName) {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_doubleForKey_1, defaultName != null ? defaultName.id : 0);
+}
+
+public float floatForKey(NSString defaultName) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_floatForKey_1, defaultName != null ? defaultName.id : 0);
+}
+
+public id initWithUser(NSString username) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithUser_1, username != null ? username.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public int integerForKey(NSString defaultName) {
+ return OS.objc_msgSend(this.id, OS.sel_integerForKey_1, defaultName != null ? defaultName.id : 0);
+}
+
+public id objectForKey(NSString defaultName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectForKey_1, defaultName != null ? defaultName.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean objectIsForcedForKey_(NSString key) {
+ return OS.objc_msgSend(this.id, OS.sel_objectIsForcedForKey_1, key != null ? key.id : 0) != 0;
+}
+
+public boolean objectIsForcedForKey_inDomain_(NSString key, NSString domain) {
+ return OS.objc_msgSend(this.id, OS.sel_objectIsForcedForKey_1inDomain_1, key != null ? key.id : 0, domain != null ? domain.id : 0) != 0;
+}
+
+public NSDictionary persistentDomainForName(NSString domainName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_persistentDomainForName_1, domainName != null ? domainName.id : 0);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSArray persistentDomainNames() {
+ int result = OS.objc_msgSend(this.id, OS.sel_persistentDomainNames);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void registerDefaults(NSDictionary registrationDictionary) {
+ OS.objc_msgSend(this.id, OS.sel_registerDefaults_1, registrationDictionary != null ? registrationDictionary.id : 0);
+}
+
+public void removeObjectForKey(NSString defaultName) {
+ OS.objc_msgSend(this.id, OS.sel_removeObjectForKey_1, defaultName != null ? defaultName.id : 0);
+}
+
+public void removePersistentDomainForName(NSString domainName) {
+ OS.objc_msgSend(this.id, OS.sel_removePersistentDomainForName_1, domainName != null ? domainName.id : 0);
+}
+
+public void removeSuiteNamed(NSString suiteName) {
+ OS.objc_msgSend(this.id, OS.sel_removeSuiteNamed_1, suiteName != null ? suiteName.id : 0);
+}
+
+public void removeVolatileDomainForName(NSString domainName) {
+ OS.objc_msgSend(this.id, OS.sel_removeVolatileDomainForName_1, domainName != null ? domainName.id : 0);
+}
+
+public static void resetStandardUserDefaults() {
+ OS.objc_msgSend(OS.class_NSUserDefaults, OS.sel_resetStandardUserDefaults);
+}
+
+public void setBool(boolean value, NSString defaultName) {
+ OS.objc_msgSend(this.id, OS.sel_setBool_1forKey_1, value, defaultName != null ? defaultName.id : 0);
+}
+
+public void setDouble(double value, NSString defaultName) {
+ OS.objc_msgSend(this.id, OS.sel_setDouble_1forKey_1, value, defaultName != null ? defaultName.id : 0);
+}
+
+public void setFloat(float value, NSString defaultName) {
+ OS.objc_msgSend(this.id, OS.sel_setFloat_1forKey_1, value, defaultName != null ? defaultName.id : 0);
+}
+
+public void setInteger(int value, NSString defaultName) {
+ OS.objc_msgSend(this.id, OS.sel_setInteger_1forKey_1, value, defaultName != null ? defaultName.id : 0);
+}
+
+public void setObject(id value, NSString defaultName) {
+ OS.objc_msgSend(this.id, OS.sel_setObject_1forKey_1, value != null ? value.id : 0, defaultName != null ? defaultName.id : 0);
+}
+
+public void setPersistentDomain(NSDictionary domain, NSString domainName) {
+ OS.objc_msgSend(this.id, OS.sel_setPersistentDomain_1forName_1, domain != null ? domain.id : 0, domainName != null ? domainName.id : 0);
+}
+
+public void setVolatileDomain(NSDictionary domain, NSString domainName) {
+ OS.objc_msgSend(this.id, OS.sel_setVolatileDomain_1forName_1, domain != null ? domain.id : 0, domainName != null ? domainName.id : 0);
+}
+
+public static NSUserDefaults standardUserDefaults() {
+ int result = OS.objc_msgSend(OS.class_NSUserDefaults, OS.sel_standardUserDefaults);
+ return result != 0 ? new NSUserDefaults(result) : null;
+}
+
+public NSArray stringArrayForKey(NSString defaultName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringArrayForKey_1, defaultName != null ? defaultName.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString stringForKey(NSString defaultName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringForKey_1, defaultName != null ? defaultName.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean synchronize() {
+ return OS.objc_msgSend(this.id, OS.sel_synchronize) != 0;
+}
+
+public NSDictionary volatileDomainForName(NSString domainName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_volatileDomainForName_1, domainName != null ? domainName.id : 0);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public NSArray volatileDomainNames() {
+ int result = OS.objc_msgSend(this.id, OS.sel_volatileDomainNames);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUserDefaultsController.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUserDefaultsController.java
new file mode 100644
index 0000000000..288847da69
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSUserDefaultsController.java
@@ -0,0 +1,66 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSUserDefaultsController extends NSController {
+
+public NSUserDefaultsController() {
+ super();
+}
+
+public NSUserDefaultsController(int id) {
+ super(id);
+}
+
+public boolean appliesImmediately() {
+ return OS.objc_msgSend(this.id, OS.sel_appliesImmediately) != 0;
+}
+
+public NSUserDefaults defaults() {
+ int result = OS.objc_msgSend(this.id, OS.sel_defaults);
+ return result != 0 ? new NSUserDefaults(result) : null;
+}
+
+public boolean hasUnappliedChanges() {
+ return OS.objc_msgSend(this.id, OS.sel_hasUnappliedChanges) != 0;
+}
+
+public id initWithDefaults(NSUserDefaults defaults, NSDictionary initialValues) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithDefaults_1initialValues_1, defaults != null ? defaults.id : 0, initialValues != null ? initialValues.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSDictionary initialValues() {
+ int result = OS.objc_msgSend(this.id, OS.sel_initialValues);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public void revert(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_revert_1, sender != null ? sender.id : 0);
+}
+
+public void revertToInitialValues(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_revertToInitialValues_1, sender != null ? sender.id : 0);
+}
+
+public void save(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_save_1, sender != null ? sender.id : 0);
+}
+
+public void setAppliesImmediately(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAppliesImmediately_1, flag);
+}
+
+public void setInitialValues(NSDictionary initialValues) {
+ OS.objc_msgSend(this.id, OS.sel_setInitialValues_1, initialValues != null ? initialValues.id : 0);
+}
+
+public static id sharedUserDefaultsController() {
+ int result = OS.objc_msgSend(OS.class_NSUserDefaultsController, OS.sel_sharedUserDefaultsController);
+ return result != 0 ? new id(result) : null;
+}
+
+public id values() {
+ int result = OS.objc_msgSend(this.id, OS.sel_values);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSValue.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSValue.java
new file mode 100644
index 0000000000..7481ae56c2
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSValue.java
@@ -0,0 +1,103 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSValue extends NSObject {
+
+public NSValue() {
+ super();
+}
+
+public NSValue(int id) {
+ super(id);
+}
+
+public void getValue(int value) {
+ OS.objc_msgSend(this.id, OS.sel_getValue_1, value);
+}
+
+public id initWithBytes(int value, int type) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithBytes_1objCType_1, value, type);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isEqualToValue(NSValue value) {
+ return OS.objc_msgSend(this.id, OS.sel_isEqualToValue_1, value != null ? value.id : 0) != 0;
+}
+
+public id nonretainedObjectValue() {
+ int result = OS.objc_msgSend(this.id, OS.sel_nonretainedObjectValue);
+ return result != 0 ? new id(result) : null;
+}
+
+public int objCType() {
+ return OS.objc_msgSend(this.id, OS.sel_objCType);
+}
+
+public NSPoint pointValue() {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_pointValue);
+ return result;
+}
+
+public int pointerValue() {
+ return OS.objc_msgSend(this.id, OS.sel_pointerValue);
+}
+
+public NSRange rangeValue() {
+ NSRange result = new NSRange();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rangeValue);
+ return result;
+}
+
+public NSRect rectValue() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rectValue);
+ return result;
+}
+
+public NSSize sizeValue() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_sizeValue);
+ return result;
+}
+
+public static NSValue value(int value, int type) {
+ int result = OS.objc_msgSend(OS.class_NSValue, OS.sel_value_1withObjCType_1, value, type);
+ return result != 0 ? new NSValue(result) : null;
+}
+
+public static NSValue valueWithBytes(int value, int type) {
+ int result = OS.objc_msgSend(OS.class_NSValue, OS.sel_valueWithBytes_1objCType_1, value, type);
+ return result != 0 ? new NSValue(result) : null;
+}
+
+public static NSValue valueWithNonretainedObject(id anObject) {
+ int result = OS.objc_msgSend(OS.class_NSValue, OS.sel_valueWithNonretainedObject_1, anObject != null ? anObject.id : 0);
+ return result != 0 ? new NSValue(result) : null;
+}
+
+public static NSValue valueWithPoint(NSPoint point) {
+ int result = OS.objc_msgSend(OS.class_NSValue, OS.sel_valueWithPoint_1, point);
+ return result != 0 ? new NSValue(result) : null;
+}
+
+public static NSValue valueWithPointer(int pointer) {
+ int result = OS.objc_msgSend(OS.class_NSValue, OS.sel_valueWithPointer_1, pointer);
+ return result != 0 ? new NSValue(result) : null;
+}
+
+public static NSValue valueWithRange(NSRange range) {
+ int result = OS.objc_msgSend(OS.class_NSValue, OS.sel_valueWithRange_1, range);
+ return result != 0 ? new NSValue(result) : null;
+}
+
+public static NSValue valueWithRect(NSRect rect) {
+ int result = OS.objc_msgSend(OS.class_NSValue, OS.sel_valueWithRect_1, rect);
+ return result != 0 ? new NSValue(result) : null;
+}
+
+public static NSValue valueWithSize(NSSize size) {
+ int result = OS.objc_msgSend(OS.class_NSValue, OS.sel_valueWithSize_1, size);
+ return result != 0 ? new NSValue(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSValueTransformer.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSValueTransformer.java
new file mode 100644
index 0000000000..c46d9aad9e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSValueTransformer.java
@@ -0,0 +1,45 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSValueTransformer extends NSObject {
+
+public NSValueTransformer() {
+ super();
+}
+
+public NSValueTransformer(int id) {
+ super(id);
+}
+
+public static boolean allowsReverseTransformation() {
+ return OS.objc_msgSend(OS.class_NSValueTransformer, OS.sel_allowsReverseTransformation) != 0;
+}
+
+public id reverseTransformedValue(id value) {
+ int result = OS.objc_msgSend(this.id, OS.sel_reverseTransformedValue_1, value != null ? value.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static void setValueTransformer(NSValueTransformer transformer, NSString name) {
+ OS.objc_msgSend(OS.class_NSValueTransformer, OS.sel_setValueTransformer_1forName_1, transformer != null ? transformer.id : 0, name != null ? name.id : 0);
+}
+
+public id transformedValue(id value) {
+ int result = OS.objc_msgSend(this.id, OS.sel_transformedValue_1, value != null ? value.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static int transformedValueClass() {
+ return OS.objc_msgSend(OS.class_NSValueTransformer, OS.sel_transformedValueClass);
+}
+
+public static NSValueTransformer valueTransformerForName(NSString name) {
+ int result = OS.objc_msgSend(OS.class_NSValueTransformer, OS.sel_valueTransformerForName_1, name != null ? name.id : 0);
+ return result != 0 ? new NSValueTransformer(result) : null;
+}
+
+public static NSArray valueTransformerNames() {
+ int result = OS.objc_msgSend(OS.class_NSValueTransformer, OS.sel_valueTransformerNames);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSView.java
new file mode 100644
index 0000000000..fade8698e7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSView.java
@@ -0,0 +1,912 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSView extends NSResponder {
+
+public NSView() {
+ super();
+}
+
+public NSView(int id) {
+ super(id);
+}
+
+public boolean acceptsFirstMouse(NSEvent theEvent) {
+ return OS.objc_msgSend(this.id, OS.sel_acceptsFirstMouse_1, theEvent != null ? theEvent.id : 0) != 0;
+}
+
+public void addCursorRect(NSRect aRect, NSCursor anObj) {
+ OS.objc_msgSend(this.id, OS.sel_addCursorRect_1cursor_1, aRect, anObj != null ? anObj.id : 0);
+}
+
+public void addSubview_(NSView aView) {
+ OS.objc_msgSend(this.id, OS.sel_addSubview_1, aView != null ? aView.id : 0);
+}
+
+public void addSubview_positioned_relativeTo_(NSView aView, int place, NSView otherView) {
+ OS.objc_msgSend(this.id, OS.sel_addSubview_1positioned_1relativeTo_1, aView != null ? aView.id : 0, place, otherView != null ? otherView.id : 0);
+}
+
+public int addToolTipRect(NSRect aRect, id anObject, int data) {
+ return OS.objc_msgSend(this.id, OS.sel_addToolTipRect_1owner_1userData_1, aRect, anObject != null ? anObject.id : 0, data);
+}
+
+public void addTrackingArea(NSTrackingArea trackingArea) {
+ OS.objc_msgSend(this.id, OS.sel_addTrackingArea_1, trackingArea != null ? trackingArea.id : 0);
+}
+
+public int addTrackingRect(NSRect aRect, id anObject, int data, boolean flag) {
+ return OS.objc_msgSend(this.id, OS.sel_addTrackingRect_1owner_1userData_1assumeInside_1, aRect, anObject != null ? anObject.id : 0, data, flag);
+}
+
+public void adjustPageHeightNew(int newBottom, float oldTop, float oldBottom, float bottomLimit) {
+ OS.objc_msgSend(this.id, OS.sel_adjustPageHeightNew_1top_1bottom_1limit_1, newBottom, oldTop, oldBottom, bottomLimit);
+}
+
+public void adjustPageWidthNew(int newRight, float oldLeft, float oldRight, float rightLimit) {
+ OS.objc_msgSend(this.id, OS.sel_adjustPageWidthNew_1left_1right_1limit_1, newRight, oldLeft, oldRight, rightLimit);
+}
+
+public NSRect adjustScroll(NSRect newVisible) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_adjustScroll_1, newVisible);
+ return result;
+}
+
+public void allocateGState() {
+ OS.objc_msgSend(this.id, OS.sel_allocateGState);
+}
+
+public float alphaValue() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_alphaValue);
+}
+
+public NSView ancestorSharedWithView(NSView aView) {
+ int result = OS.objc_msgSend(this.id, OS.sel_ancestorSharedWithView_1, aView != null ? aView.id : 0);
+ return result == this.id ? this : (result != 0 ? new NSView(result) : null);
+}
+
+public boolean autoresizesSubviews() {
+ return OS.objc_msgSend(this.id, OS.sel_autoresizesSubviews) != 0;
+}
+
+public int autoresizingMask() {
+ return OS.objc_msgSend(this.id, OS.sel_autoresizingMask);
+}
+
+public boolean autoscroll(NSEvent theEvent) {
+ return OS.objc_msgSend(this.id, OS.sel_autoscroll_1, theEvent != null ? theEvent.id : 0) != 0;
+}
+
+public NSArray backgroundFilters() {
+ int result = OS.objc_msgSend(this.id, OS.sel_backgroundFilters);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void beginDocument() {
+ OS.objc_msgSend(this.id, OS.sel_beginDocument);
+}
+
+public void beginPageInRect(NSRect aRect, NSPoint location) {
+ OS.objc_msgSend(this.id, OS.sel_beginPageInRect_1atPlacement_1, aRect, location);
+}
+
+public NSBitmapImageRep bitmapImageRepForCachingDisplayInRect(NSRect rect) {
+ int result = OS.objc_msgSend(this.id, OS.sel_bitmapImageRepForCachingDisplayInRect_1, rect);
+ return result != 0 ? new NSBitmapImageRep(result) : null;
+}
+
+public NSRect bounds() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_bounds);
+ return result;
+}
+
+public float boundsRotation() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_boundsRotation);
+}
+
+public void cacheDisplayInRect(NSRect rect, NSBitmapImageRep bitmapImageRep) {
+ OS.objc_msgSend(this.id, OS.sel_cacheDisplayInRect_1toBitmapImageRep_1, rect, bitmapImageRep != null ? bitmapImageRep.id : 0);
+}
+
+public boolean canBecomeKeyView() {
+ return OS.objc_msgSend(this.id, OS.sel_canBecomeKeyView) != 0;
+}
+
+public boolean canDraw() {
+ return OS.objc_msgSend(this.id, OS.sel_canDraw) != 0;
+}
+
+public NSRect centerScanRect(NSRect aRect) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_centerScanRect_1, aRect);
+ return result;
+}
+
+//public CIFilter compositingFilter() {
+// int result = OS.objc_msgSend(this.id, OS.sel_compositingFilter);
+// return result != 0 ? new CIFilter(result) : null;
+//}
+
+public NSArray contentFilters() {
+ int result = OS.objc_msgSend(this.id, OS.sel_contentFilters);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSPoint convertPoint_fromView_(NSPoint aPoint, NSView aView) {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_struct(result, this.id, OS.sel_convertPoint_1fromView_1, aPoint, aView != null ? aView.id : 0);
+ return result;
+}
+
+public NSPoint convertPoint_toView_(NSPoint aPoint, NSView aView) {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_convertPoint_1toView_1, aPoint, aView != null ? aView.id : 0);
+ return result;
+}
+
+public NSPoint convertPointFromBase(NSPoint aPoint) {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_convertPointFromBase_1, aPoint);
+ return result;
+}
+
+public NSPoint convertPointToBase(NSPoint aPoint) {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_convertPointToBase_1, aPoint);
+ return result;
+}
+
+public NSRect convertRect_fromView_(NSRect aRect, NSView aView) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_convertRect_1fromView_1, aRect, aView != null ? aView.id : 0);
+ return result;
+}
+
+public NSRect convertRect_toView_(NSRect aRect, NSView aView) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_convertRect_1toView_1, aRect, aView != null ? aView.id : 0);
+ return result;
+}
+
+public NSRect convertRectFromBase(NSRect aRect) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_convertRectFromBase_1, aRect);
+ return result;
+}
+
+public NSRect convertRectToBase(NSRect aRect) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_convertRectToBase_1, aRect);
+ return result;
+}
+
+public NSSize convertSize_fromView_(NSSize aSize, NSView aView) {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_convertSize_1fromView_1, aSize, aView != null ? aView.id : 0);
+ return result;
+}
+
+public NSSize convertSize_toView_(NSSize aSize, NSView aView) {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_convertSize_1toView_1, aSize, aView != null ? aView.id : 0);
+ return result;
+}
+
+public NSSize convertSizeFromBase(NSSize aSize) {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_convertSizeFromBase_1, aSize);
+ return result;
+}
+
+public NSSize convertSizeToBase(NSSize aSize) {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_convertSizeToBase_1, aSize);
+ return result;
+}
+
+public NSData dataWithEPSInsideRect(NSRect rect) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dataWithEPSInsideRect_1, rect);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSData dataWithPDFInsideRect(NSRect rect) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dataWithPDFInsideRect_1, rect);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public static int defaultFocusRingType() {
+ return OS.objc_msgSend(OS.class_NSView, OS.sel_defaultFocusRingType);
+}
+
+public static NSMenu defaultMenu() {
+ int result = OS.objc_msgSend(OS.class_NSView, OS.sel_defaultMenu);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+public void didAddSubview(NSView subview) {
+ OS.objc_msgSend(this.id, OS.sel_didAddSubview_1, subview != null ? subview.id : 0);
+}
+
+public void discardCursorRects() {
+ OS.objc_msgSend(this.id, OS.sel_discardCursorRects);
+}
+
+public void display() {
+ OS.objc_msgSend(this.id, OS.sel_display);
+}
+
+public void displayIfNeeded() {
+ OS.objc_msgSend(this.id, OS.sel_displayIfNeeded);
+}
+
+public void displayIfNeededIgnoringOpacity() {
+ OS.objc_msgSend(this.id, OS.sel_displayIfNeededIgnoringOpacity);
+}
+
+public void displayIfNeededInRect(NSRect rect) {
+ OS.objc_msgSend(this.id, OS.sel_displayIfNeededInRect_1, rect);
+}
+
+public void displayIfNeededInRectIgnoringOpacity(NSRect rect) {
+ OS.objc_msgSend(this.id, OS.sel_displayIfNeededInRectIgnoringOpacity_1, rect);
+}
+
+public void displayRect(NSRect rect) {
+ OS.objc_msgSend(this.id, OS.sel_displayRect_1, rect);
+}
+
+public void displayRectIgnoringOpacity_(NSRect rect) {
+ OS.objc_msgSend(this.id, OS.sel_displayRectIgnoringOpacity_1, rect);
+}
+
+public void displayRectIgnoringOpacity_inContext_(NSRect aRect, NSGraphicsContext context) {
+ OS.objc_msgSend(this.id, OS.sel_displayRectIgnoringOpacity_1inContext_1, aRect, context != null ? context.id : 0);
+}
+
+public boolean dragFile(NSString filename, NSRect rect, boolean aFlag, NSEvent event) {
+ return OS.objc_msgSend(this.id, OS.sel_dragFile_1fromRect_1slideBack_1event_1, filename != null ? filename.id : 0, rect, aFlag, event != null ? event.id : 0) != 0;
+}
+
+public void dragImage(NSImage anImage, NSPoint viewLocation, NSSize initialOffset, NSEvent event, NSPasteboard pboard, id sourceObj, boolean slideFlag) {
+ OS.objc_msgSend(this.id, OS.sel_dragImage_1at_1offset_1event_1pasteboard_1source_1slideBack_1, anImage != null ? anImage.id : 0, viewLocation, initialOffset, event != null ? event.id : 0, pboard != null ? pboard.id : 0, sourceObj != null ? sourceObj.id : 0, slideFlag);
+}
+
+public boolean dragPromisedFilesOfTypes(NSArray typeArray, NSRect rect, id sourceObject, boolean aFlag, NSEvent event) {
+ return OS.objc_msgSend(this.id, OS.sel_dragPromisedFilesOfTypes_1fromRect_1source_1slideBack_1event_1, typeArray != null ? typeArray.id : 0, rect, sourceObject != null ? sourceObject.id : 0, aFlag, event != null ? event.id : 0) != 0;
+}
+
+public void drawPageBorderWithSize(NSSize borderSize) {
+ OS.objc_msgSend(this.id, OS.sel_drawPageBorderWithSize_1, borderSize);
+}
+
+public void drawRect(NSRect rect) {
+ OS.objc_msgSend(this.id, OS.sel_drawRect_1, rect);
+}
+
+public void drawSheetBorderWithSize(NSSize borderSize) {
+ OS.objc_msgSend(this.id, OS.sel_drawSheetBorderWithSize_1, borderSize);
+}
+
+public NSMenuItem enclosingMenuItem() {
+ int result = OS.objc_msgSend(this.id, OS.sel_enclosingMenuItem);
+ return result != 0 ? new NSMenuItem(result) : null;
+}
+
+public NSScrollView enclosingScrollView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_enclosingScrollView);
+ return result != 0 ? new NSScrollView(result) : null;
+}
+
+public void endDocument() {
+ OS.objc_msgSend(this.id, OS.sel_endDocument);
+}
+
+public void endPage() {
+ OS.objc_msgSend(this.id, OS.sel_endPage);
+}
+
+public boolean enterFullScreenMode(NSScreen screen, NSDictionary options) {
+ return OS.objc_msgSend(this.id, OS.sel_enterFullScreenMode_1withOptions_1, screen != null ? screen.id : 0, options != null ? options.id : 0) != 0;
+}
+
+public void exitFullScreenModeWithOptions(NSDictionary options) {
+ OS.objc_msgSend(this.id, OS.sel_exitFullScreenModeWithOptions_1, options != null ? options.id : 0);
+}
+
+public int focusRingType() {
+ return OS.objc_msgSend(this.id, OS.sel_focusRingType);
+}
+
+public static NSView focusView() {
+ int result = OS.objc_msgSend(OS.class_NSView, OS.sel_focusView);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public NSRect frame() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_frame);
+ return result;
+}
+
+public float frameCenterRotation() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_frameCenterRotation);
+}
+
+public float frameRotation() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_frameRotation);
+}
+
+public int gState() {
+ return OS.objc_msgSend(this.id, OS.sel_gState);
+}
+
+public void getRectsBeingDrawn(int rects, int count) {
+ OS.objc_msgSend(this.id, OS.sel_getRectsBeingDrawn_1count_1, rects, count);
+}
+
+public void getRectsExposedDuringLiveResize(int exposedRects, int count) {
+ OS.objc_msgSend(this.id, OS.sel_getRectsExposedDuringLiveResize_1count_1, exposedRects, count);
+}
+
+public float heightAdjustLimit() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_heightAdjustLimit);
+}
+
+public NSView hitTest(NSPoint aPoint) {
+ int result = OS.objc_msgSend(this.id, OS.sel_hitTest_1, aPoint);
+ return result == this.id ? this : (result != 0 ? new NSView(result) : null);
+}
+
+public boolean inLiveResize() {
+ return OS.objc_msgSend(this.id, OS.sel_inLiveResize) != 0;
+}
+
+public NSView initWithFrame(NSRect frameRect) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithFrame_1, frameRect);
+ return result != 0 ? this : null;
+}
+
+public boolean isDescendantOf(NSView aView) {
+ return OS.objc_msgSend(this.id, OS.sel_isDescendantOf_1, aView != null ? aView.id : 0) != 0;
+}
+
+public boolean isFlipped() {
+ return OS.objc_msgSend(this.id, OS.sel_isFlipped) != 0;
+}
+
+public boolean isHidden() {
+ return OS.objc_msgSend(this.id, OS.sel_isHidden) != 0;
+}
+
+public boolean isHiddenOrHasHiddenAncestor() {
+ return OS.objc_msgSend(this.id, OS.sel_isHiddenOrHasHiddenAncestor) != 0;
+}
+
+public boolean isInFullScreenMode() {
+ return OS.objc_msgSend(this.id, OS.sel_isInFullScreenMode) != 0;
+}
+
+public boolean isOpaque() {
+ return OS.objc_msgSend(this.id, OS.sel_isOpaque) != 0;
+}
+
+public boolean isRotatedFromBase() {
+ return OS.objc_msgSend(this.id, OS.sel_isRotatedFromBase) != 0;
+}
+
+public boolean isRotatedOrScaledFromBase() {
+ return OS.objc_msgSend(this.id, OS.sel_isRotatedOrScaledFromBase) != 0;
+}
+
+public boolean knowsPageRange(int range) {
+ return OS.objc_msgSend(this.id, OS.sel_knowsPageRange_1, range) != 0;
+}
+
+//public CALayer layer() {
+// int result = OS.objc_msgSend(this.id, OS.sel_layer);
+// return result != 0 ? new CALayer(result) : null;
+//}
+
+public NSPoint locationOfPrintRect(NSRect aRect) {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_locationOfPrintRect_1, aRect);
+ return result;
+}
+
+public void lockFocus() {
+ OS.objc_msgSend(this.id, OS.sel_lockFocus);
+}
+
+public boolean lockFocusIfCanDraw() {
+ return OS.objc_msgSend(this.id, OS.sel_lockFocusIfCanDraw) != 0;
+}
+
+public boolean lockFocusIfCanDrawInContext(NSGraphicsContext context) {
+ return OS.objc_msgSend(this.id, OS.sel_lockFocusIfCanDrawInContext_1, context != null ? context.id : 0) != 0;
+}
+
+public NSMenu menuForEvent(NSEvent event) {
+ int result = OS.objc_msgSend(this.id, OS.sel_menuForEvent_1, event != null ? event.id : 0);
+ return result != 0 ? new NSMenu(result) : null;
+}
+
+public boolean mouse(NSPoint aPoint, NSRect aRect) {
+ return OS.objc_msgSend(this.id, OS.sel_mouse_1inRect_1, aPoint, aRect) != 0;
+}
+
+public boolean mouseDownCanMoveWindow() {
+ return OS.objc_msgSend(this.id, OS.sel_mouseDownCanMoveWindow) != 0;
+}
+
+public boolean needsDisplay() {
+ return OS.objc_msgSend(this.id, OS.sel_needsDisplay) != 0;
+}
+
+public boolean needsPanelToBecomeKey() {
+ return OS.objc_msgSend(this.id, OS.sel_needsPanelToBecomeKey) != 0;
+}
+
+public boolean needsToDrawRect(NSRect aRect) {
+ return OS.objc_msgSend(this.id, OS.sel_needsToDrawRect_1, aRect) != 0;
+}
+
+public NSView nextKeyView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_nextKeyView);
+ return result == this.id ? this : (result != 0 ? new NSView(result) : null);
+}
+
+public NSView nextValidKeyView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_nextValidKeyView);
+ return result == this.id ? this : (result != 0 ? new NSView(result) : null);
+}
+
+public NSView opaqueAncestor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_opaqueAncestor);
+ return result == this.id ? this : (result != 0 ? new NSView(result) : null);
+}
+
+public NSAttributedString pageFooter() {
+ int result = OS.objc_msgSend(this.id, OS.sel_pageFooter);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public NSAttributedString pageHeader() {
+ int result = OS.objc_msgSend(this.id, OS.sel_pageHeader);
+ return result != 0 ? new NSAttributedString(result) : null;
+}
+
+public boolean performKeyEquivalent(NSEvent theEvent) {
+ return OS.objc_msgSend(this.id, OS.sel_performKeyEquivalent_1, theEvent != null ? theEvent.id : 0) != 0;
+}
+
+public boolean performMnemonic(NSString theString) {
+ return OS.objc_msgSend(this.id, OS.sel_performMnemonic_1, theString != null ? theString.id : 0) != 0;
+}
+
+public boolean postsBoundsChangedNotifications() {
+ return OS.objc_msgSend(this.id, OS.sel_postsBoundsChangedNotifications) != 0;
+}
+
+public boolean postsFrameChangedNotifications() {
+ return OS.objc_msgSend(this.id, OS.sel_postsFrameChangedNotifications) != 0;
+}
+
+public boolean preservesContentDuringLiveResize() {
+ return OS.objc_msgSend(this.id, OS.sel_preservesContentDuringLiveResize) != 0;
+}
+
+public NSView previousKeyView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_previousKeyView);
+ return result == this.id ? this : (result != 0 ? new NSView(result) : null);
+}
+
+public NSView previousValidKeyView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_previousValidKeyView);
+ return result == this.id ? this : (result != 0 ? new NSView(result) : null);
+}
+
+public void print(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_print_1, sender != null ? sender.id : 0);
+}
+
+public NSString printJobTitle() {
+ int result = OS.objc_msgSend(this.id, OS.sel_printJobTitle);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSRect rectForPage(int page) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rectForPage_1, page);
+ return result;
+}
+
+public NSRect rectPreservedDuringLiveResize() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_rectPreservedDuringLiveResize);
+ return result;
+}
+
+public void reflectScrolledClipView(NSClipView aClipView) {
+ OS.objc_msgSend(this.id, OS.sel_reflectScrolledClipView_1, aClipView != null ? aClipView.id : 0);
+}
+
+public void registerForDraggedTypes(NSArray newTypes) {
+ OS.objc_msgSend(this.id, OS.sel_registerForDraggedTypes_1, newTypes != null ? newTypes.id : 0);
+}
+
+public NSArray registeredDraggedTypes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_registeredDraggedTypes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void releaseGState() {
+ OS.objc_msgSend(this.id, OS.sel_releaseGState);
+}
+
+public void removeAllToolTips() {
+ OS.objc_msgSend(this.id, OS.sel_removeAllToolTips);
+}
+
+public void removeCursorRect(NSRect aRect, NSCursor anObj) {
+ OS.objc_msgSend(this.id, OS.sel_removeCursorRect_1cursor_1, aRect, anObj != null ? anObj.id : 0);
+}
+
+public void removeFromSuperview() {
+ OS.objc_msgSend(this.id, OS.sel_removeFromSuperview);
+}
+
+public void removeFromSuperviewWithoutNeedingDisplay() {
+ OS.objc_msgSend(this.id, OS.sel_removeFromSuperviewWithoutNeedingDisplay);
+}
+
+public void removeToolTip(int tag) {
+ OS.objc_msgSend(this.id, OS.sel_removeToolTip_1, tag);
+}
+
+public void removeTrackingArea(NSTrackingArea trackingArea) {
+ OS.objc_msgSend(this.id, OS.sel_removeTrackingArea_1, trackingArea != null ? trackingArea.id : 0);
+}
+
+public void removeTrackingRect(int tag) {
+ OS.objc_msgSend(this.id, OS.sel_removeTrackingRect_1, tag);
+}
+
+public void renewGState() {
+ OS.objc_msgSend(this.id, OS.sel_renewGState);
+}
+
+public void replaceSubview(NSView oldView, NSView newView) {
+ OS.objc_msgSend(this.id, OS.sel_replaceSubview_1with_1, oldView != null ? oldView.id : 0, newView != null ? newView.id : 0);
+}
+
+public void resetCursorRects() {
+ OS.objc_msgSend(this.id, OS.sel_resetCursorRects);
+}
+
+public void resizeSubviewsWithOldSize(NSSize oldSize) {
+ OS.objc_msgSend(this.id, OS.sel_resizeSubviewsWithOldSize_1, oldSize);
+}
+
+public void resizeWithOldSuperviewSize(NSSize oldSize) {
+ OS.objc_msgSend(this.id, OS.sel_resizeWithOldSuperviewSize_1, oldSize);
+}
+
+public void rotateByAngle(float angle) {
+ OS.objc_msgSend(this.id, OS.sel_rotateByAngle_1, angle);
+}
+
+public void rulerView_didAddMarker_(NSRulerView ruler, NSRulerMarker marker) {
+ OS.objc_msgSend(this.id, OS.sel_rulerView_1didAddMarker_1, ruler != null ? ruler.id : 0, marker != null ? marker.id : 0);
+}
+
+public void rulerView_didMoveMarker_(NSRulerView ruler, NSRulerMarker marker) {
+ OS.objc_msgSend(this.id, OS.sel_rulerView_1didMoveMarker_1, ruler != null ? ruler.id : 0, marker != null ? marker.id : 0);
+}
+
+public void rulerView_didRemoveMarker_(NSRulerView ruler, NSRulerMarker marker) {
+ OS.objc_msgSend(this.id, OS.sel_rulerView_1didRemoveMarker_1, ruler != null ? ruler.id : 0, marker != null ? marker.id : 0);
+}
+
+public void rulerView_handleMouseDown_(NSRulerView ruler, NSEvent event) {
+ OS.objc_msgSend(this.id, OS.sel_rulerView_1handleMouseDown_1, ruler != null ? ruler.id : 0, event != null ? event.id : 0);
+}
+
+public boolean rulerView_shouldAddMarker_(NSRulerView ruler, NSRulerMarker marker) {
+ return OS.objc_msgSend(this.id, OS.sel_rulerView_1shouldAddMarker_1, ruler != null ? ruler.id : 0, marker != null ? marker.id : 0) != 0;
+}
+
+public boolean rulerView_shouldMoveMarker_(NSRulerView ruler, NSRulerMarker marker) {
+ return OS.objc_msgSend(this.id, OS.sel_rulerView_1shouldMoveMarker_1, ruler != null ? ruler.id : 0, marker != null ? marker.id : 0) != 0;
+}
+
+public boolean rulerView_shouldRemoveMarker_(NSRulerView ruler, NSRulerMarker marker) {
+ return OS.objc_msgSend(this.id, OS.sel_rulerView_1shouldRemoveMarker_1, ruler != null ? ruler.id : 0, marker != null ? marker.id : 0) != 0;
+}
+
+public float rulerView_willAddMarker_atLocation_(NSRulerView ruler, NSRulerMarker marker, float location) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_rulerView_1willAddMarker_1atLocation_1, ruler != null ? ruler.id : 0, marker != null ? marker.id : 0, location);
+}
+
+public float rulerView_willMoveMarker_toLocation_(NSRulerView ruler, NSRulerMarker marker, float location) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_rulerView_1willMoveMarker_1toLocation_1, ruler != null ? ruler.id : 0, marker != null ? marker.id : 0, location);
+}
+
+public void rulerView_willSetClientView_(NSRulerView ruler, NSView newClient) {
+ OS.objc_msgSend(this.id, OS.sel_rulerView_1willSetClientView_1, ruler != null ? ruler.id : 0, newClient != null ? newClient.id : 0);
+}
+
+public void scaleUnitSquareToSize(NSSize newUnitSize) {
+ OS.objc_msgSend(this.id, OS.sel_scaleUnitSquareToSize_1, newUnitSize);
+}
+
+public void scrollClipView(NSClipView aClipView, NSPoint aPoint) {
+ OS.objc_msgSend(this.id, OS.sel_scrollClipView_1toPoint_1, aClipView != null ? aClipView.id : 0, aPoint);
+}
+
+public void scrollPoint(NSPoint aPoint) {
+ OS.objc_msgSend(this.id, OS.sel_scrollPoint_1, aPoint);
+}
+
+public void scrollRect(NSRect aRect, NSSize delta) {
+ OS.objc_msgSend(this.id, OS.sel_scrollRect_1by_1, aRect, delta);
+}
+
+public boolean scrollRectToVisible(NSRect aRect) {
+ return OS.objc_msgSend(this.id, OS.sel_scrollRectToVisible_1, aRect) != 0;
+}
+
+public void setAlphaValue(float viewAlpha) {
+ OS.objc_msgSend(this.id, OS.sel_setAlphaValue_1, viewAlpha);
+}
+
+public void setAutoresizesSubviews(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAutoresizesSubviews_1, flag);
+}
+
+public void setAutoresizingMask(int mask) {
+ OS.objc_msgSend(this.id, OS.sel_setAutoresizingMask_1, mask);
+}
+
+public void setBackgroundFilters(NSArray filters) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundFilters_1, filters != null ? filters.id : 0);
+}
+
+public void setBounds(NSRect aRect) {
+ OS.objc_msgSend(this.id, OS.sel_setBounds_1, aRect);
+}
+
+public void setBoundsOrigin(NSPoint newOrigin) {
+ OS.objc_msgSend(this.id, OS.sel_setBoundsOrigin_1, newOrigin);
+}
+
+public void setBoundsRotation(float angle) {
+ OS.objc_msgSend(this.id, OS.sel_setBoundsRotation_1, angle);
+}
+
+public void setBoundsSize(NSSize newSize) {
+ OS.objc_msgSend(this.id, OS.sel_setBoundsSize_1, newSize);
+}
+
+//public void setCompositingFilter(CIFilter filter) {
+// OS.objc_msgSend(this.id, OS.sel_setCompositingFilter_1, filter != null ? filter.id : 0);
+//}
+
+public void setContentFilters(NSArray filters) {
+ OS.objc_msgSend(this.id, OS.sel_setContentFilters_1, filters != null ? filters.id : 0);
+}
+
+public void setFocusRingType(int focusRingType) {
+ OS.objc_msgSend(this.id, OS.sel_setFocusRingType_1, focusRingType);
+}
+
+public void setFrame(NSRect frameRect) {
+ OS.objc_msgSend(this.id, OS.sel_setFrame_1, frameRect);
+}
+
+public void setFrameCenterRotation(float angle) {
+ OS.objc_msgSend(this.id, OS.sel_setFrameCenterRotation_1, angle);
+}
+
+public void setFrameOrigin(NSPoint newOrigin) {
+ OS.objc_msgSend(this.id, OS.sel_setFrameOrigin_1, newOrigin);
+}
+
+public void setFrameRotation(float angle) {
+ OS.objc_msgSend(this.id, OS.sel_setFrameRotation_1, angle);
+}
+
+public void setFrameSize(NSSize newSize) {
+ OS.objc_msgSend(this.id, OS.sel_setFrameSize_1, newSize);
+}
+
+public void setHidden(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setHidden_1, flag);
+}
+
+public void setKeyboardFocusRingNeedsDisplayInRect(NSRect rect) {
+ OS.objc_msgSend(this.id, OS.sel_setKeyboardFocusRingNeedsDisplayInRect_1, rect);
+}
+
+//public void setLayer(CALayer newLayer) {
+// OS.objc_msgSend(this.id, OS.sel_setLayer_1, newLayer != null ? newLayer.id : 0);
+//}
+
+public void setNeedsDisplay(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setNeedsDisplay_1, flag);
+}
+
+public void setNeedsDisplayInRect(NSRect invalidRect) {
+ OS.objc_msgSend(this.id, OS.sel_setNeedsDisplayInRect_1, invalidRect);
+}
+
+public void setNextKeyView(NSView next) {
+ OS.objc_msgSend(this.id, OS.sel_setNextKeyView_1, next != null ? next.id : 0);
+}
+
+public void setPostsBoundsChangedNotifications(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setPostsBoundsChangedNotifications_1, flag);
+}
+
+public void setPostsFrameChangedNotifications(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setPostsFrameChangedNotifications_1, flag);
+}
+
+public void setShadow(NSShadow shadow) {
+ OS.objc_msgSend(this.id, OS.sel_setShadow_1, shadow != null ? shadow.id : 0);
+}
+
+public void setSubviews(NSArray newSubviews) {
+ OS.objc_msgSend(this.id, OS.sel_setSubviews_1, newSubviews != null ? newSubviews.id : 0);
+}
+
+public void setToolTip(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setToolTip_1, string != null ? string.id : 0);
+}
+
+public void setUpGState() {
+ OS.objc_msgSend(this.id, OS.sel_setUpGState);
+}
+
+public void setWantsLayer(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setWantsLayer_1, flag);
+}
+
+public NSShadow shadow() {
+ int result = OS.objc_msgSend(this.id, OS.sel_shadow);
+ return result != 0 ? new NSShadow(result) : null;
+}
+
+public boolean shouldDelayWindowOrderingForEvent(NSEvent theEvent) {
+ return OS.objc_msgSend(this.id, OS.sel_shouldDelayWindowOrderingForEvent_1, theEvent != null ? theEvent.id : 0) != 0;
+}
+
+public boolean shouldDrawColor() {
+ return OS.objc_msgSend(this.id, OS.sel_shouldDrawColor) != 0;
+}
+
+public void sortSubviewsUsingFunction(int compare, int context) {
+ OS.objc_msgSend(this.id, OS.sel_sortSubviewsUsingFunction_1context_1, compare, context);
+}
+
+public NSArray subviews() {
+ int result = OS.objc_msgSend(this.id, OS.sel_subviews);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSView superview() {
+ int result = OS.objc_msgSend(this.id, OS.sel_superview);
+ return result == this.id ? this : (result != 0 ? new NSView(result) : null);
+}
+
+public int tag() {
+ return OS.objc_msgSend(this.id, OS.sel_tag);
+}
+
+public NSString toolTip() {
+ int result = OS.objc_msgSend(this.id, OS.sel_toolTip);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSArray trackingAreas() {
+ int result = OS.objc_msgSend(this.id, OS.sel_trackingAreas);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void translateOriginToPoint(NSPoint translation) {
+ OS.objc_msgSend(this.id, OS.sel_translateOriginToPoint_1, translation);
+}
+
+public void translateRectsNeedingDisplayInRect(NSRect clipRect, NSSize delta) {
+ OS.objc_msgSend(this.id, OS.sel_translateRectsNeedingDisplayInRect_1by_1, clipRect, delta);
+}
+
+public void unlockFocus() {
+ OS.objc_msgSend(this.id, OS.sel_unlockFocus);
+}
+
+public void unregisterDraggedTypes() {
+ OS.objc_msgSend(this.id, OS.sel_unregisterDraggedTypes);
+}
+
+public void updateTrackingAreas() {
+ OS.objc_msgSend(this.id, OS.sel_updateTrackingAreas);
+}
+
+public void viewDidEndLiveResize() {
+ OS.objc_msgSend(this.id, OS.sel_viewDidEndLiveResize);
+}
+
+public void viewDidHide() {
+ OS.objc_msgSend(this.id, OS.sel_viewDidHide);
+}
+
+public void viewDidMoveToSuperview() {
+ OS.objc_msgSend(this.id, OS.sel_viewDidMoveToSuperview);
+}
+
+public void viewDidMoveToWindow() {
+ OS.objc_msgSend(this.id, OS.sel_viewDidMoveToWindow);
+}
+
+public void viewDidUnhide() {
+ OS.objc_msgSend(this.id, OS.sel_viewDidUnhide);
+}
+
+public void viewWillDraw() {
+ OS.objc_msgSend(this.id, OS.sel_viewWillDraw);
+}
+
+public void viewWillMoveToSuperview(NSView newSuperview) {
+ OS.objc_msgSend(this.id, OS.sel_viewWillMoveToSuperview_1, newSuperview != null ? newSuperview.id : 0);
+}
+
+public void viewWillMoveToWindow(NSWindow newWindow) {
+ OS.objc_msgSend(this.id, OS.sel_viewWillMoveToWindow_1, newWindow != null ? newWindow.id : 0);
+}
+
+public void viewWillStartLiveResize() {
+ OS.objc_msgSend(this.id, OS.sel_viewWillStartLiveResize);
+}
+
+public id viewWithTag(int aTag) {
+ int result = OS.objc_msgSend(this.id, OS.sel_viewWithTag_1, aTag);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSRect visibleRect() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_visibleRect);
+ return result;
+}
+
+public boolean wantsDefaultClipping() {
+ return OS.objc_msgSend(this.id, OS.sel_wantsDefaultClipping) != 0;
+}
+
+public boolean wantsLayer() {
+ return OS.objc_msgSend(this.id, OS.sel_wantsLayer) != 0;
+}
+
+public float widthAdjustLimit() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_widthAdjustLimit);
+}
+
+public void willRemoveSubview(NSView subview) {
+ OS.objc_msgSend(this.id, OS.sel_willRemoveSubview_1, subview != null ? subview.id : 0);
+}
+
+public NSWindow window() {
+ int result = OS.objc_msgSend(this.id, OS.sel_window);
+ return result != 0 ? new NSWindow(result) : null;
+}
+
+public void writeEPSInsideRect(NSRect rect, NSPasteboard pasteboard) {
+ OS.objc_msgSend(this.id, OS.sel_writeEPSInsideRect_1toPasteboard_1, rect, pasteboard != null ? pasteboard.id : 0);
+}
+
+public void writePDFInsideRect(NSRect rect, NSPasteboard pasteboard) {
+ OS.objc_msgSend(this.id, OS.sel_writePDFInsideRect_1toPasteboard_1, rect, pasteboard != null ? pasteboard.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSViewAnimation.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSViewAnimation.java
new file mode 100644
index 0000000000..a9214ecf06
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSViewAnimation.java
@@ -0,0 +1,27 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSViewAnimation extends NSAnimation {
+
+public NSViewAnimation() {
+ super();
+}
+
+public NSViewAnimation(int id) {
+ super(id);
+}
+
+public id initWithViewAnimations(NSArray viewAnimations) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithViewAnimations_1, viewAnimations != null ? viewAnimations.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void setViewAnimations(NSArray viewAnimations) {
+ OS.objc_msgSend(this.id, OS.sel_setViewAnimations_1, viewAnimations != null ? viewAnimations.id : 0);
+}
+
+public NSArray viewAnimations() {
+ int result = OS.objc_msgSend(this.id, OS.sel_viewAnimations);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSViewController.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSViewController.java
new file mode 100644
index 0000000000..72b9c8872f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSViewController.java
@@ -0,0 +1,71 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSViewController extends NSResponder {
+
+public NSViewController() {
+ super();
+}
+
+public NSViewController(int id) {
+ super(id);
+}
+
+public boolean commitEditing() {
+ return OS.objc_msgSend(this.id, OS.sel_commitEditing) != 0;
+}
+
+public void commitEditingWithDelegate(id delegate, int didCommitSelector, int contextInfo) {
+ OS.objc_msgSend(this.id, OS.sel_commitEditingWithDelegate_1didCommitSelector_1contextInfo_1, delegate != null ? delegate.id : 0, didCommitSelector, contextInfo);
+}
+
+public void discardEditing() {
+ OS.objc_msgSend(this.id, OS.sel_discardEditing);
+}
+
+public id initWithNibName(NSString nibNameOrNil, NSBundle nibBundleOrNil) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithNibName_1bundle_1, nibNameOrNil != null ? nibNameOrNil.id : 0, nibBundleOrNil != null ? nibBundleOrNil.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void loadView() {
+ OS.objc_msgSend(this.id, OS.sel_loadView);
+}
+
+public NSBundle nibBundle() {
+ int result = OS.objc_msgSend(this.id, OS.sel_nibBundle);
+ return result != 0 ? new NSBundle(result) : null;
+}
+
+public NSString nibName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_nibName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public id representedObject() {
+ int result = OS.objc_msgSend(this.id, OS.sel_representedObject);
+ return result != 0 ? new id(result) : null;
+}
+
+public void setRepresentedObject(id representedObject) {
+ OS.objc_msgSend(this.id, OS.sel_setRepresentedObject_1, representedObject != null ? representedObject.id : 0);
+}
+
+public void setTitle(NSString title) {
+ OS.objc_msgSend(this.id, OS.sel_setTitle_1, title != null ? title.id : 0);
+}
+
+public void setView(NSView view) {
+ OS.objc_msgSend(this.id, OS.sel_setView_1, view != null ? view.id : 0);
+}
+
+public NSString title() {
+ int result = OS.objc_msgSend(this.id, OS.sel_title);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSView view() {
+ int result = OS.objc_msgSend(this.id, OS.sel_view);
+ return result != 0 ? new NSView(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWhoseSpecifier.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWhoseSpecifier.java
new file mode 100644
index 0000000000..e5bd81971f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWhoseSpecifier.java
@@ -0,0 +1,59 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSWhoseSpecifier extends NSScriptObjectSpecifier {
+
+public NSWhoseSpecifier() {
+ super();
+}
+
+public NSWhoseSpecifier(int id) {
+ super(id);
+}
+
+public int endSubelementIdentifier() {
+ return OS.objc_msgSend(this.id, OS.sel_endSubelementIdentifier);
+}
+
+public int endSubelementIndex() {
+ return OS.objc_msgSend(this.id, OS.sel_endSubelementIndex);
+}
+
+public id initWithContainerClassDescription(NSScriptClassDescription classDesc, NSScriptObjectSpecifier container, NSString property, NSScriptWhoseTest test) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContainerClassDescription_1containerSpecifier_1key_1test_1, classDesc != null ? classDesc.id : 0, container != null ? container.id : 0, property != null ? property.id : 0, test != null ? test.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public void setEndSubelementIdentifier(int subelement) {
+ OS.objc_msgSend(this.id, OS.sel_setEndSubelementIdentifier_1, subelement);
+}
+
+public void setEndSubelementIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_setEndSubelementIndex_1, index);
+}
+
+public void setStartSubelementIdentifier(int subelement) {
+ OS.objc_msgSend(this.id, OS.sel_setStartSubelementIdentifier_1, subelement);
+}
+
+public void setStartSubelementIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_setStartSubelementIndex_1, index);
+}
+
+public void setTest(NSScriptWhoseTest test) {
+ OS.objc_msgSend(this.id, OS.sel_setTest_1, test != null ? test.id : 0);
+}
+
+public int startSubelementIdentifier() {
+ return OS.objc_msgSend(this.id, OS.sel_startSubelementIdentifier);
+}
+
+public int startSubelementIndex() {
+ return OS.objc_msgSend(this.id, OS.sel_startSubelementIndex);
+}
+
+public NSScriptWhoseTest test() {
+ int result = OS.objc_msgSend(this.id, OS.sel_test);
+ return result != 0 ? new NSScriptWhoseTest(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWindow.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWindow.java
new file mode 100644
index 0000000000..028141f839
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWindow.java
@@ -0,0 +1,1080 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSWindow extends NSResponder {
+
+public NSWindow() {
+ super();
+}
+
+public NSWindow(int id) {
+ super(id);
+}
+
+public boolean acceptsMouseMovedEvents() {
+ return OS.objc_msgSend(this.id, OS.sel_acceptsMouseMovedEvents) != 0;
+}
+
+public void addChildWindow(NSWindow childWin, int place) {
+ OS.objc_msgSend(this.id, OS.sel_addChildWindow_1ordered_1, childWin != null ? childWin.id : 0, place);
+}
+
+public boolean allowsToolTipsWhenApplicationIsInactive() {
+ return OS.objc_msgSend(this.id, OS.sel_allowsToolTipsWhenApplicationIsInactive) != 0;
+}
+
+public float alphaValue() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_alphaValue);
+}
+
+public double animationResizeTime(NSRect newFrame) {
+ return OS.objc_msgSend_fpret(this.id, OS.sel_animationResizeTime_1, newFrame);
+}
+
+public boolean areCursorRectsEnabled() {
+ return OS.objc_msgSend(this.id, OS.sel_areCursorRectsEnabled) != 0;
+}
+
+public NSSize aspectRatio() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_aspectRatio);
+ return result;
+}
+
+public NSWindow attachedSheet() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attachedSheet);
+ return result == this.id ? this : (result != 0 ? new NSWindow(result) : null);
+}
+
+public boolean autorecalculatesContentBorderThicknessForEdge(int edge) {
+ return OS.objc_msgSend(this.id, OS.sel_autorecalculatesContentBorderThicknessForEdge_1, edge) != 0;
+}
+
+public boolean autorecalculatesKeyViewLoop() {
+ return OS.objc_msgSend(this.id, OS.sel_autorecalculatesKeyViewLoop) != 0;
+}
+
+public NSColor backgroundColor() {
+ int result = OS.objc_msgSend(this.id, OS.sel_backgroundColor);
+ return result != 0 ? new NSColor(result) : null;
+}
+
+public int backingLocation() {
+ return OS.objc_msgSend(this.id, OS.sel_backingLocation);
+}
+
+public int backingType() {
+ return OS.objc_msgSend(this.id, OS.sel_backingType);
+}
+
+public void becomeKeyWindow() {
+ OS.objc_msgSend(this.id, OS.sel_becomeKeyWindow);
+}
+
+public void becomeMainWindow() {
+ OS.objc_msgSend(this.id, OS.sel_becomeMainWindow);
+}
+
+public void cacheImageInRect(NSRect aRect) {
+ OS.objc_msgSend(this.id, OS.sel_cacheImageInRect_1, aRect);
+}
+
+public boolean canBeVisibleOnAllSpaces() {
+ return OS.objc_msgSend(this.id, OS.sel_canBeVisibleOnAllSpaces) != 0;
+}
+
+public boolean canBecomeKeyWindow() {
+ return OS.objc_msgSend(this.id, OS.sel_canBecomeKeyWindow) != 0;
+}
+
+public boolean canBecomeMainWindow() {
+ return OS.objc_msgSend(this.id, OS.sel_canBecomeMainWindow) != 0;
+}
+
+public boolean canBecomeVisibleWithoutLogin() {
+ return OS.objc_msgSend(this.id, OS.sel_canBecomeVisibleWithoutLogin) != 0;
+}
+
+public boolean canHide() {
+ return OS.objc_msgSend(this.id, OS.sel_canHide) != 0;
+}
+
+public boolean canStoreColor() {
+ return OS.objc_msgSend(this.id, OS.sel_canStoreColor) != 0;
+}
+
+public NSPoint cascadeTopLeftFromPoint(NSPoint topLeftPoint) {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_struct(result, this.id, OS.sel_cascadeTopLeftFromPoint_1, topLeftPoint);
+ return result;
+}
+
+public void center() {
+ OS.objc_msgSend(this.id, OS.sel_center);
+}
+
+public NSArray childWindows() {
+ int result = OS.objc_msgSend(this.id, OS.sel_childWindows);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void close() {
+ OS.objc_msgSend(this.id, OS.sel_close);
+}
+
+public int collectionBehavior() {
+ return OS.objc_msgSend(this.id, OS.sel_collectionBehavior);
+}
+
+public NSRect constrainFrameRect(NSRect frameRect, NSScreen screen) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_constrainFrameRect_1toScreen_1, frameRect, screen != null ? screen.id : 0);
+ return result;
+}
+
+public NSSize contentAspectRatio() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_contentAspectRatio);
+ return result;
+}
+
+public float contentBorderThicknessForEdge(int edge) {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_contentBorderThicknessForEdge_1, edge);
+}
+
+public NSSize contentMaxSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_contentMaxSize);
+ return result;
+}
+
+public NSSize contentMinSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_contentMinSize);
+ return result;
+}
+
+public NSRect contentRectForFrameRect_(NSRect frameRect) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_contentRectForFrameRect_1, frameRect);
+ return result;
+}
+
+public static NSRect static_contentRectForFrameRect_styleMask_(NSRect fRect, int aStyle) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, OS.class_NSWindow, OS.sel_contentRectForFrameRect_1styleMask_1, fRect, aStyle);
+ return result;
+}
+
+public NSSize contentResizeIncrements() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_contentResizeIncrements);
+ return result;
+}
+
+public NSView contentView() {
+ int result = OS.objc_msgSend(this.id, OS.sel_contentView);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public NSPoint convertBaseToScreen(NSPoint aPoint) {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_convertBaseToScreen_1, aPoint);
+ return result;
+}
+
+public NSPoint convertScreenToBase(NSPoint aPoint) {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_convertScreenToBase_1, aPoint);
+ return result;
+}
+
+public NSEvent currentEvent() {
+ int result = OS.objc_msgSend(this.id, OS.sel_currentEvent);
+ return result != 0 ? new NSEvent(result) : null;
+}
+
+public NSData dataWithEPSInsideRect(NSRect rect) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dataWithEPSInsideRect_1, rect);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSData dataWithPDFInsideRect(NSRect rect) {
+ int result = OS.objc_msgSend(this.id, OS.sel_dataWithPDFInsideRect_1, rect);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSScreen deepestScreen() {
+ int result = OS.objc_msgSend(this.id, OS.sel_deepestScreen);
+ return result != 0 ? new NSScreen(result) : null;
+}
+
+public NSButtonCell defaultButtonCell() {
+ int result = OS.objc_msgSend(this.id, OS.sel_defaultButtonCell);
+ return result != 0 ? new NSButtonCell(result) : null;
+}
+
+public static int defaultDepthLimit() {
+ return OS.objc_msgSend(OS.class_NSWindow, OS.sel_defaultDepthLimit);
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public void deminiaturize(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_deminiaturize_1, sender != null ? sender.id : 0);
+}
+
+public int depthLimit() {
+ return OS.objc_msgSend(this.id, OS.sel_depthLimit);
+}
+
+public NSDictionary deviceDescription() {
+ int result = OS.objc_msgSend(this.id, OS.sel_deviceDescription);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public void disableCursorRects() {
+ OS.objc_msgSend(this.id, OS.sel_disableCursorRects);
+}
+
+public void disableFlushWindow() {
+ OS.objc_msgSend(this.id, OS.sel_disableFlushWindow);
+}
+
+public void disableKeyEquivalentForDefaultButtonCell() {
+ OS.objc_msgSend(this.id, OS.sel_disableKeyEquivalentForDefaultButtonCell);
+}
+
+public void disableScreenUpdatesUntilFlush() {
+ OS.objc_msgSend(this.id, OS.sel_disableScreenUpdatesUntilFlush);
+}
+
+public void discardCachedImage() {
+ OS.objc_msgSend(this.id, OS.sel_discardCachedImage);
+}
+
+public void discardCursorRects() {
+ OS.objc_msgSend(this.id, OS.sel_discardCursorRects);
+}
+
+public void discardEventsMatchingMask(int mask, NSEvent lastEvent) {
+ OS.objc_msgSend(this.id, OS.sel_discardEventsMatchingMask_1beforeEvent_1, mask, lastEvent != null ? lastEvent.id : 0);
+}
+
+public void display() {
+ OS.objc_msgSend(this.id, OS.sel_display);
+}
+
+public void displayIfNeeded() {
+ OS.objc_msgSend(this.id, OS.sel_displayIfNeeded);
+}
+
+public boolean displaysWhenScreenProfileChanges() {
+ return OS.objc_msgSend(this.id, OS.sel_displaysWhenScreenProfileChanges) != 0;
+}
+
+public NSDockTile dockTile() {
+ int result = OS.objc_msgSend(this.id, OS.sel_dockTile);
+ return result != 0 ? new NSDockTile(result) : null;
+}
+
+public void dragImage(NSImage anImage, NSPoint baseLocation, NSSize initialOffset, NSEvent event, NSPasteboard pboard, id sourceObj, boolean slideFlag) {
+ OS.objc_msgSend(this.id, OS.sel_dragImage_1at_1offset_1event_1pasteboard_1source_1slideBack_1, anImage != null ? anImage.id : 0, baseLocation, initialOffset, event != null ? event.id : 0, pboard != null ? pboard.id : 0, sourceObj != null ? sourceObj.id : 0, slideFlag);
+}
+
+public NSArray drawers() {
+ int result = OS.objc_msgSend(this.id, OS.sel_drawers);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void enableCursorRects() {
+ OS.objc_msgSend(this.id, OS.sel_enableCursorRects);
+}
+
+public void enableFlushWindow() {
+ OS.objc_msgSend(this.id, OS.sel_enableFlushWindow);
+}
+
+public void enableKeyEquivalentForDefaultButtonCell() {
+ OS.objc_msgSend(this.id, OS.sel_enableKeyEquivalentForDefaultButtonCell);
+}
+
+public void endEditingFor(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_endEditingFor_1, anObject != null ? anObject.id : 0);
+}
+
+public NSText fieldEditor(boolean createFlag, id anObject) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fieldEditor_1forObject_1, createFlag, anObject != null ? anObject.id : 0);
+ return result != 0 ? new NSText(result) : null;
+}
+
+public NSResponder firstResponder() {
+ int result = OS.objc_msgSend(this.id, OS.sel_firstResponder);
+ return result != 0 ? new NSResponder(result) : null;
+}
+
+public void flushWindow() {
+ OS.objc_msgSend(this.id, OS.sel_flushWindow);
+}
+
+public void flushWindowIfNeeded() {
+ OS.objc_msgSend(this.id, OS.sel_flushWindowIfNeeded);
+}
+
+public NSRect frame() {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_frame);
+ return result;
+}
+
+public NSString frameAutosaveName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_frameAutosaveName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSRect frameRectForContentRect_(NSRect contentRect) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_frameRectForContentRect_1, contentRect);
+ return result;
+}
+
+public static NSRect static_frameRectForContentRect_styleMask_(NSRect cRect, int aStyle) {
+ NSRect result = new NSRect();
+ OS.objc_msgSend_stret(result, OS.class_NSWindow, OS.sel_frameRectForContentRect_1styleMask_1, cRect, aStyle);
+ return result;
+}
+
+public int gState() {
+ return OS.objc_msgSend(this.id, OS.sel_gState);
+}
+
+public NSGraphicsContext graphicsContext() {
+ int result = OS.objc_msgSend(this.id, OS.sel_graphicsContext);
+ return result != 0 ? new NSGraphicsContext(result) : null;
+}
+
+public id handleCloseScriptCommand(NSCloseCommand command) {
+ int result = OS.objc_msgSend(this.id, OS.sel_handleCloseScriptCommand_1, command != null ? command.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id handlePrintScriptCommand(NSScriptCommand command) {
+ int result = OS.objc_msgSend(this.id, OS.sel_handlePrintScriptCommand_1, command != null ? command.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id handleSaveScriptCommand(NSScriptCommand command) {
+ int result = OS.objc_msgSend(this.id, OS.sel_handleSaveScriptCommand_1, command != null ? command.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean hasCloseBox() {
+ return OS.objc_msgSend(this.id, OS.sel_hasCloseBox) != 0;
+}
+
+public boolean hasDynamicDepthLimit() {
+ return OS.objc_msgSend(this.id, OS.sel_hasDynamicDepthLimit) != 0;
+}
+
+public boolean hasShadow() {
+ return OS.objc_msgSend(this.id, OS.sel_hasShadow) != 0;
+}
+
+public boolean hasTitleBar() {
+ return OS.objc_msgSend(this.id, OS.sel_hasTitleBar) != 0;
+}
+
+public boolean hidesOnDeactivate() {
+ return OS.objc_msgSend(this.id, OS.sel_hidesOnDeactivate) != 0;
+}
+
+public boolean ignoresMouseEvents() {
+ return OS.objc_msgSend(this.id, OS.sel_ignoresMouseEvents) != 0;
+}
+
+public NSWindow initWithContentRect_styleMask_backing_defer_(NSRect contentRect, int aStyle, int bufferingType, boolean flag) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentRect_1styleMask_1backing_1defer_1, contentRect, aStyle, bufferingType, flag);
+ return result != 0 ? this : null;
+}
+
+public NSWindow initWithContentRect_styleMask_backing_defer_screen_(NSRect contentRect, int aStyle, int bufferingType, boolean flag, NSScreen screen) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentRect_1styleMask_1backing_1defer_1screen_1, contentRect, aStyle, bufferingType, flag, screen != null ? screen.id : 0);
+ return result != 0 ? this : null;
+}
+
+public NSWindow initWithWindowRef(int windowRef) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithWindowRef_1, windowRef);
+ return result == this.id ? this : (result != 0 ? new NSWindow(result) : null);
+}
+
+public NSView initialFirstResponder() {
+ int result = OS.objc_msgSend(this.id, OS.sel_initialFirstResponder);
+ return result != 0 ? new NSView(result) : null;
+}
+
+public void invalidateCursorRectsForView(NSView aView) {
+ OS.objc_msgSend(this.id, OS.sel_invalidateCursorRectsForView_1, aView != null ? aView.id : 0);
+}
+
+public void invalidateShadow() {
+ OS.objc_msgSend(this.id, OS.sel_invalidateShadow);
+}
+
+public boolean isAutodisplay() {
+ return OS.objc_msgSend(this.id, OS.sel_isAutodisplay) != 0;
+}
+
+public boolean isDocumentEdited() {
+ return OS.objc_msgSend(this.id, OS.sel_isDocumentEdited) != 0;
+}
+
+public boolean isExcludedFromWindowsMenu() {
+ return OS.objc_msgSend(this.id, OS.sel_isExcludedFromWindowsMenu) != 0;
+}
+
+public boolean isFloatingPanel() {
+ return OS.objc_msgSend(this.id, OS.sel_isFloatingPanel) != 0;
+}
+
+public boolean isFlushWindowDisabled() {
+ return OS.objc_msgSend(this.id, OS.sel_isFlushWindowDisabled) != 0;
+}
+
+public boolean isKeyWindow() {
+ return OS.objc_msgSend(this.id, OS.sel_isKeyWindow) != 0;
+}
+
+public boolean isMainWindow() {
+ return OS.objc_msgSend(this.id, OS.sel_isMainWindow) != 0;
+}
+
+public boolean isMiniaturizable() {
+ return OS.objc_msgSend(this.id, OS.sel_isMiniaturizable) != 0;
+}
+
+public boolean isMiniaturized() {
+ return OS.objc_msgSend(this.id, OS.sel_isMiniaturized) != 0;
+}
+
+public boolean isModalPanel() {
+ return OS.objc_msgSend(this.id, OS.sel_isModalPanel) != 0;
+}
+
+public boolean isMovableByWindowBackground() {
+ return OS.objc_msgSend(this.id, OS.sel_isMovableByWindowBackground) != 0;
+}
+
+public boolean isOneShot() {
+ return OS.objc_msgSend(this.id, OS.sel_isOneShot) != 0;
+}
+
+public boolean isOpaque() {
+ return OS.objc_msgSend(this.id, OS.sel_isOpaque) != 0;
+}
+
+public boolean isReleasedWhenClosed() {
+ return OS.objc_msgSend(this.id, OS.sel_isReleasedWhenClosed) != 0;
+}
+
+public boolean isResizable() {
+ return OS.objc_msgSend(this.id, OS.sel_isResizable) != 0;
+}
+
+public boolean isSheet() {
+ return OS.objc_msgSend(this.id, OS.sel_isSheet) != 0;
+}
+
+public boolean isVisible() {
+ return OS.objc_msgSend(this.id, OS.sel_isVisible) != 0;
+}
+
+public boolean isZoomable() {
+ return OS.objc_msgSend(this.id, OS.sel_isZoomable) != 0;
+}
+
+public boolean isZoomed() {
+ return OS.objc_msgSend(this.id, OS.sel_isZoomed) != 0;
+}
+
+public void keyDown(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_keyDown_1, theEvent != null ? theEvent.id : 0);
+}
+
+public int keyViewSelectionDirection() {
+ return OS.objc_msgSend(this.id, OS.sel_keyViewSelectionDirection);
+}
+
+public int level() {
+ return OS.objc_msgSend(this.id, OS.sel_level);
+}
+
+public boolean makeFirstResponder(NSResponder aResponder) {
+ return OS.objc_msgSend(this.id, OS.sel_makeFirstResponder_1, aResponder != null ? aResponder.id : 0) != 0;
+}
+
+public void makeKeyAndOrderFront(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_makeKeyAndOrderFront_1, sender != null ? sender.id : 0);
+}
+
+public void makeKeyWindow() {
+ OS.objc_msgSend(this.id, OS.sel_makeKeyWindow);
+}
+
+public void makeMainWindow() {
+ OS.objc_msgSend(this.id, OS.sel_makeMainWindow);
+}
+
+public NSSize maxSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_maxSize);
+ return result;
+}
+
+public static void menuChanged(NSMenu menu) {
+ OS.objc_msgSend(OS.class_NSWindow, OS.sel_menuChanged_1, menu != null ? menu.id : 0);
+}
+
+public static float minFrameWidthWithTitle(NSString aTitle, int aStyle) {
+ return (float)OS.objc_msgSend_fpret(OS.class_NSWindow, OS.sel_minFrameWidthWithTitle_1styleMask_1, aTitle != null ? aTitle.id : 0, aStyle);
+}
+
+public NSSize minSize() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_minSize);
+ return result;
+}
+
+public void miniaturize(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_miniaturize_1, sender != null ? sender.id : 0);
+}
+
+public NSImage miniwindowImage() {
+ int result = OS.objc_msgSend(this.id, OS.sel_miniwindowImage);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public NSString miniwindowTitle() {
+ int result = OS.objc_msgSend(this.id, OS.sel_miniwindowTitle);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSPoint mouseLocationOutsideOfEventStream() {
+ NSPoint result = new NSPoint();
+ OS.objc_msgSend_struct(result, this.id, OS.sel_mouseLocationOutsideOfEventStream);
+ return result;
+}
+
+public NSEvent nextEventMatchingMask_(int mask) {
+ int result = OS.objc_msgSend(this.id, OS.sel_nextEventMatchingMask_1, mask);
+ return result != 0 ? new NSEvent(result) : null;
+}
+
+public NSEvent nextEventMatchingMask_untilDate_inMode_dequeue_(int mask, NSDate expiration, NSString mode, boolean deqFlag) {
+ int result = OS.objc_msgSend(this.id, OS.sel_nextEventMatchingMask_1untilDate_1inMode_1dequeue_1, mask, expiration != null ? expiration.id : 0, mode != null ? mode.id : 0, deqFlag);
+ return result != 0 ? new NSEvent(result) : null;
+}
+
+public void orderBack(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_orderBack_1, sender != null ? sender.id : 0);
+}
+
+public void orderFront(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_orderFront_1, sender != null ? sender.id : 0);
+}
+
+public void orderFrontRegardless() {
+ OS.objc_msgSend(this.id, OS.sel_orderFrontRegardless);
+}
+
+public void orderOut(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_orderOut_1, sender != null ? sender.id : 0);
+}
+
+public void orderWindow(int place, int otherWin) {
+ OS.objc_msgSend(this.id, OS.sel_orderWindow_1relativeTo_1, place, otherWin);
+}
+
+public int orderedIndex() {
+ return OS.objc_msgSend(this.id, OS.sel_orderedIndex);
+}
+
+public NSWindow parentWindow() {
+ int result = OS.objc_msgSend(this.id, OS.sel_parentWindow);
+ return result == this.id ? this : (result != 0 ? new NSWindow(result) : null);
+}
+
+public void performClose(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_performClose_1, sender != null ? sender.id : 0);
+}
+
+public void performMiniaturize(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_performMiniaturize_1, sender != null ? sender.id : 0);
+}
+
+public void performZoom(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_performZoom_1, sender != null ? sender.id : 0);
+}
+
+public void postEvent(NSEvent event, boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_postEvent_1atStart_1, event != null ? event.id : 0, flag);
+}
+
+public int preferredBackingLocation() {
+ return OS.objc_msgSend(this.id, OS.sel_preferredBackingLocation);
+}
+
+public boolean preservesContentDuringLiveResize() {
+ return OS.objc_msgSend(this.id, OS.sel_preservesContentDuringLiveResize) != 0;
+}
+
+public void print(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_print_1, sender != null ? sender.id : 0);
+}
+
+public void recalculateKeyViewLoop() {
+ OS.objc_msgSend(this.id, OS.sel_recalculateKeyViewLoop);
+}
+
+public void registerForDraggedTypes(NSArray newTypes) {
+ OS.objc_msgSend(this.id, OS.sel_registerForDraggedTypes_1, newTypes != null ? newTypes.id : 0);
+}
+
+public void removeChildWindow(NSWindow childWin) {
+ OS.objc_msgSend(this.id, OS.sel_removeChildWindow_1, childWin != null ? childWin.id : 0);
+}
+
+public static void removeFrameUsingName(NSString name) {
+ OS.objc_msgSend(OS.class_NSWindow, OS.sel_removeFrameUsingName_1, name != null ? name.id : 0);
+}
+
+public NSString representedFilename() {
+ int result = OS.objc_msgSend(this.id, OS.sel_representedFilename);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSURL representedURL() {
+ int result = OS.objc_msgSend(this.id, OS.sel_representedURL);
+ return result != 0 ? new NSURL(result) : null;
+}
+
+public void resetCursorRects() {
+ OS.objc_msgSend(this.id, OS.sel_resetCursorRects);
+}
+
+public void resignKeyWindow() {
+ OS.objc_msgSend(this.id, OS.sel_resignKeyWindow);
+}
+
+public void resignMainWindow() {
+ OS.objc_msgSend(this.id, OS.sel_resignMainWindow);
+}
+
+public int resizeFlags() {
+ return OS.objc_msgSend(this.id, OS.sel_resizeFlags);
+}
+
+public NSSize resizeIncrements() {
+ NSSize result = new NSSize();
+ OS.objc_msgSend_stret(result, this.id, OS.sel_resizeIncrements);
+ return result;
+}
+
+public void restoreCachedImage() {
+ OS.objc_msgSend(this.id, OS.sel_restoreCachedImage);
+}
+
+public void runToolbarCustomizationPalette(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_runToolbarCustomizationPalette_1, sender != null ? sender.id : 0);
+}
+
+public void saveFrameUsingName(NSString name) {
+ OS.objc_msgSend(this.id, OS.sel_saveFrameUsingName_1, name != null ? name.id : 0);
+}
+
+public NSScreen screen() {
+ int result = OS.objc_msgSend(this.id, OS.sel_screen);
+ return result != 0 ? new NSScreen(result) : null;
+}
+
+public void selectKeyViewFollowingView(NSView aView) {
+ OS.objc_msgSend(this.id, OS.sel_selectKeyViewFollowingView_1, aView != null ? aView.id : 0);
+}
+
+public void selectKeyViewPrecedingView(NSView aView) {
+ OS.objc_msgSend(this.id, OS.sel_selectKeyViewPrecedingView_1, aView != null ? aView.id : 0);
+}
+
+public void selectNextKeyView(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectNextKeyView_1, sender != null ? sender.id : 0);
+}
+
+public void selectPreviousKeyView(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_selectPreviousKeyView_1, sender != null ? sender.id : 0);
+}
+
+public void sendEvent(NSEvent theEvent) {
+ OS.objc_msgSend(this.id, OS.sel_sendEvent_1, theEvent != null ? theEvent.id : 0);
+}
+
+public void setAcceptsMouseMovedEvents(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAcceptsMouseMovedEvents_1, flag);
+}
+
+public void setAllowsToolTipsWhenApplicationIsInactive(boolean allowWhenInactive) {
+ OS.objc_msgSend(this.id, OS.sel_setAllowsToolTipsWhenApplicationIsInactive_1, allowWhenInactive);
+}
+
+public void setAlphaValue(float windowAlpha) {
+ OS.objc_msgSend(this.id, OS.sel_setAlphaValue_1, windowAlpha);
+}
+
+public void setAspectRatio(NSSize ratio) {
+ OS.objc_msgSend(this.id, OS.sel_setAspectRatio_1, ratio);
+}
+
+public void setAutodisplay(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAutodisplay_1, flag);
+}
+
+public void setAutorecalculatesContentBorderThickness(boolean flag, int edge) {
+ OS.objc_msgSend(this.id, OS.sel_setAutorecalculatesContentBorderThickness_1forEdge_1, flag, edge);
+}
+
+public void setAutorecalculatesKeyViewLoop(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setAutorecalculatesKeyViewLoop_1, flag);
+}
+
+public void setBackgroundColor(NSColor color) {
+ OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color != null ? color.id : 0);
+}
+
+public void setBackingType(int bufferingType) {
+ OS.objc_msgSend(this.id, OS.sel_setBackingType_1, bufferingType);
+}
+
+public void setCanBeVisibleOnAllSpaces(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setCanBeVisibleOnAllSpaces_1, flag);
+}
+
+public void setCanBecomeVisibleWithoutLogin(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setCanBecomeVisibleWithoutLogin_1, flag);
+}
+
+public void setCanHide(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setCanHide_1, flag);
+}
+
+public void setCollectionBehavior(int behavior) {
+ OS.objc_msgSend(this.id, OS.sel_setCollectionBehavior_1, behavior);
+}
+
+public void setContentAspectRatio(NSSize ratio) {
+ OS.objc_msgSend(this.id, OS.sel_setContentAspectRatio_1, ratio);
+}
+
+public void setContentBorderThickness(float thickness, int edge) {
+ OS.objc_msgSend(this.id, OS.sel_setContentBorderThickness_1forEdge_1, thickness, edge);
+}
+
+public void setContentMaxSize(NSSize size) {
+ OS.objc_msgSend(this.id, OS.sel_setContentMaxSize_1, size);
+}
+
+public void setContentMinSize(NSSize size) {
+ OS.objc_msgSend(this.id, OS.sel_setContentMinSize_1, size);
+}
+
+public void setContentResizeIncrements(NSSize increments) {
+ OS.objc_msgSend(this.id, OS.sel_setContentResizeIncrements_1, increments);
+}
+
+public void setContentSize(NSSize aSize) {
+ OS.objc_msgSend(this.id, OS.sel_setContentSize_1, aSize);
+}
+
+public void setContentView(NSView aView) {
+ OS.objc_msgSend(this.id, OS.sel_setContentView_1, aView != null ? aView.id : 0);
+}
+
+public void setDefaultButtonCell(NSButtonCell defButt) {
+ OS.objc_msgSend(this.id, OS.sel_setDefaultButtonCell_1, defButt != null ? defButt.id : 0);
+}
+
+public void setDelegate(id anObject) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
+}
+
+public void setDepthLimit(int limit) {
+ OS.objc_msgSend(this.id, OS.sel_setDepthLimit_1, limit);
+}
+
+public void setDisplaysWhenScreenProfileChanges(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setDisplaysWhenScreenProfileChanges_1, flag);
+}
+
+public void setDocumentEdited(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setDocumentEdited_1, flag);
+}
+
+public void setDynamicDepthLimit(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setDynamicDepthLimit_1, flag);
+}
+
+public void setExcludedFromWindowsMenu(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setExcludedFromWindowsMenu_1, flag);
+}
+
+public void setFrame_display_(NSRect frameRect, boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setFrame_1display_1, frameRect, flag);
+}
+
+public void setFrame_display_animate_(NSRect frameRect, boolean displayFlag, boolean animateFlag) {
+ OS.objc_msgSend(this.id, OS.sel_setFrame_1display_1animate_1, frameRect, displayFlag, animateFlag);
+}
+
+public boolean setFrameAutosaveName(NSString name) {
+ return OS.objc_msgSend(this.id, OS.sel_setFrameAutosaveName_1, name != null ? name.id : 0) != 0;
+}
+
+public void setFrameFromString(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setFrameFromString_1, string != null ? string.id : 0);
+}
+
+public void setFrameOrigin(NSPoint aPoint) {
+ OS.objc_msgSend(this.id, OS.sel_setFrameOrigin_1, aPoint);
+}
+
+public void setFrameTopLeftPoint(NSPoint aPoint) {
+ OS.objc_msgSend(this.id, OS.sel_setFrameTopLeftPoint_1, aPoint);
+}
+
+public boolean setFrameUsingName_(NSString name) {
+ return OS.objc_msgSend(this.id, OS.sel_setFrameUsingName_1, name != null ? name.id : 0) != 0;
+}
+
+public boolean setFrameUsingName_force_(NSString name, boolean force) {
+ return OS.objc_msgSend(this.id, OS.sel_setFrameUsingName_1force_1, name != null ? name.id : 0, force) != 0;
+}
+
+public void setHasShadow(boolean hasShadow) {
+ OS.objc_msgSend(this.id, OS.sel_setHasShadow_1, hasShadow);
+}
+
+public void setHidesOnDeactivate(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setHidesOnDeactivate_1, flag);
+}
+
+public void setIgnoresMouseEvents(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setIgnoresMouseEvents_1, flag);
+}
+
+public void setInitialFirstResponder(NSView view) {
+ OS.objc_msgSend(this.id, OS.sel_setInitialFirstResponder_1, view != null ? view.id : 0);
+}
+
+public void setIsMiniaturized(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setIsMiniaturized_1, flag);
+}
+
+public void setIsVisible(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setIsVisible_1, flag);
+}
+
+public void setIsZoomed(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setIsZoomed_1, flag);
+}
+
+public void setLevel(int newLevel) {
+ OS.objc_msgSend(this.id, OS.sel_setLevel_1, newLevel);
+}
+
+public void setMaxSize(NSSize size) {
+ OS.objc_msgSend(this.id, OS.sel_setMaxSize_1, size);
+}
+
+public void setMinSize(NSSize size) {
+ OS.objc_msgSend(this.id, OS.sel_setMinSize_1, size);
+}
+
+public void setMiniwindowImage(NSImage image) {
+ OS.objc_msgSend(this.id, OS.sel_setMiniwindowImage_1, image != null ? image.id : 0);
+}
+
+public void setMiniwindowTitle(NSString title) {
+ OS.objc_msgSend(this.id, OS.sel_setMiniwindowTitle_1, title != null ? title.id : 0);
+}
+
+public void setMovableByWindowBackground(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setMovableByWindowBackground_1, flag);
+}
+
+public void setOneShot(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setOneShot_1, flag);
+}
+
+public void setOpaque(boolean isOpaque) {
+ OS.objc_msgSend(this.id, OS.sel_setOpaque_1, isOpaque);
+}
+
+public void setOrderedIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_setOrderedIndex_1, index);
+}
+
+public void setParentWindow(NSWindow window) {
+ OS.objc_msgSend(this.id, OS.sel_setParentWindow_1, window != null ? window.id : 0);
+}
+
+public void setPreferredBackingLocation(int backingLocation) {
+ OS.objc_msgSend(this.id, OS.sel_setPreferredBackingLocation_1, backingLocation);
+}
+
+public void setPreservesContentDuringLiveResize(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setPreservesContentDuringLiveResize_1, flag);
+}
+
+public void setReleasedWhenClosed(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setReleasedWhenClosed_1, flag);
+}
+
+public void setRepresentedFilename(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setRepresentedFilename_1, aString != null ? aString.id : 0);
+}
+
+public void setRepresentedURL(NSURL url) {
+ OS.objc_msgSend(this.id, OS.sel_setRepresentedURL_1, url != null ? url.id : 0);
+}
+
+public void setResizeIncrements(NSSize increments) {
+ OS.objc_msgSend(this.id, OS.sel_setResizeIncrements_1, increments);
+}
+
+public void setSharingType(int type) {
+ OS.objc_msgSend(this.id, OS.sel_setSharingType_1, type);
+}
+
+public void setShowsResizeIndicator(boolean show) {
+ OS.objc_msgSend(this.id, OS.sel_setShowsResizeIndicator_1, show);
+}
+
+public void setShowsToolbarButton(boolean show) {
+ OS.objc_msgSend(this.id, OS.sel_setShowsToolbarButton_1, show);
+}
+
+public void setTitle(NSString aString) {
+ OS.objc_msgSend(this.id, OS.sel_setTitle_1, aString != null ? aString.id : 0);
+}
+
+public void setTitleWithRepresentedFilename(NSString filename) {
+ OS.objc_msgSend(this.id, OS.sel_setTitleWithRepresentedFilename_1, filename != null ? filename.id : 0);
+}
+
+public void setToolbar(NSToolbar toolbar) {
+ OS.objc_msgSend(this.id, OS.sel_setToolbar_1, toolbar != null ? toolbar.id : 0);
+}
+
+public void setViewsNeedDisplay(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setViewsNeedDisplay_1, flag);
+}
+
+public void setWindowController(NSWindowController windowController) {
+ OS.objc_msgSend(this.id, OS.sel_setWindowController_1, windowController != null ? windowController.id : 0);
+}
+
+public int sharingType() {
+ return OS.objc_msgSend(this.id, OS.sel_sharingType);
+}
+
+public boolean showsResizeIndicator() {
+ return OS.objc_msgSend(this.id, OS.sel_showsResizeIndicator) != 0;
+}
+
+public boolean showsToolbarButton() {
+ return OS.objc_msgSend(this.id, OS.sel_showsToolbarButton) != 0;
+}
+
+public NSButton standardWindowButton_(int b) {
+ int result = OS.objc_msgSend(this.id, OS.sel_standardWindowButton_1, b);
+ return result != 0 ? new NSButton(result) : null;
+}
+
+public static NSButton static_standardWindowButton_forStyleMask_(int b, int styleMask) {
+ int result = OS.objc_msgSend(OS.class_NSWindow, OS.sel_standardWindowButton_1forStyleMask_1, b, styleMask);
+ return result != 0 ? new NSButton(result) : null;
+}
+
+public NSString stringWithSavedFrame() {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringWithSavedFrame);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int styleMask() {
+ return OS.objc_msgSend(this.id, OS.sel_styleMask);
+}
+
+public NSString title() {
+ int result = OS.objc_msgSend(this.id, OS.sel_title);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void toggleToolbarShown(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_toggleToolbarShown_1, sender != null ? sender.id : 0);
+}
+
+public NSToolbar toolbar() {
+ int result = OS.objc_msgSend(this.id, OS.sel_toolbar);
+ return result != 0 ? new NSToolbar(result) : null;
+}
+
+public boolean tryToPerform(int anAction, id anObject) {
+ return OS.objc_msgSend(this.id, OS.sel_tryToPerform_1with_1, anAction, anObject != null ? anObject.id : 0) != 0;
+}
+
+public void unregisterDraggedTypes() {
+ OS.objc_msgSend(this.id, OS.sel_unregisterDraggedTypes);
+}
+
+public void update() {
+ OS.objc_msgSend(this.id, OS.sel_update);
+}
+
+public void useOptimizedDrawing(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_useOptimizedDrawing_1, flag);
+}
+
+public float userSpaceScaleFactor() {
+ return (float)OS.objc_msgSend_fpret(this.id, OS.sel_userSpaceScaleFactor);
+}
+
+public id validRequestorForSendType(NSString sendType, NSString returnType) {
+ int result = OS.objc_msgSend(this.id, OS.sel_validRequestorForSendType_1returnType_1, sendType != null ? sendType.id : 0, returnType != null ? returnType.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean viewsNeedDisplay() {
+ return OS.objc_msgSend(this.id, OS.sel_viewsNeedDisplay) != 0;
+}
+
+public id windowController() {
+ int result = OS.objc_msgSend(this.id, OS.sel_windowController);
+ return result != 0 ? new id(result) : null;
+}
+
+public int windowNumber() {
+ return OS.objc_msgSend(this.id, OS.sel_windowNumber);
+}
+
+public int windowRef() {
+ return OS.objc_msgSend(this.id, OS.sel_windowRef);
+}
+
+public boolean worksWhenModal() {
+ return OS.objc_msgSend(this.id, OS.sel_worksWhenModal) != 0;
+}
+
+public void zoom(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_zoom_1, sender != null ? sender.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWindowController.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWindowController.java
new file mode 100644
index 0000000000..f21089a31e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWindowController.java
@@ -0,0 +1,128 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSWindowController extends NSResponder {
+
+public NSWindowController() {
+ super();
+}
+
+public NSWindowController(int id) {
+ super(id);
+}
+
+public void close() {
+ OS.objc_msgSend(this.id, OS.sel_close);
+}
+
+public id document() {
+ int result = OS.objc_msgSend(this.id, OS.sel_document);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithWindow(NSWindow window) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithWindow_1, window != null ? window.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithWindowNibName_(NSString windowNibName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithWindowNibName_1, windowNibName != null ? windowNibName.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithWindowNibName_owner_(NSString windowNibName, id owner) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithWindowNibName_1owner_1, windowNibName != null ? windowNibName.id : 0, owner != null ? owner.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithWindowNibPath(NSString windowNibPath, id owner) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithWindowNibPath_1owner_1, windowNibPath != null ? windowNibPath.id : 0, owner != null ? owner.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isWindowLoaded() {
+ return OS.objc_msgSend(this.id, OS.sel_isWindowLoaded) != 0;
+}
+
+public void loadWindow() {
+ OS.objc_msgSend(this.id, OS.sel_loadWindow);
+}
+
+public id owner() {
+ int result = OS.objc_msgSend(this.id, OS.sel_owner);
+ return result != 0 ? new id(result) : null;
+}
+
+public void setDocument(NSDocument document) {
+ OS.objc_msgSend(this.id, OS.sel_setDocument_1, document != null ? document.id : 0);
+}
+
+public void setDocumentEdited(boolean dirtyFlag) {
+ OS.objc_msgSend(this.id, OS.sel_setDocumentEdited_1, dirtyFlag);
+}
+
+public void setShouldCascadeWindows(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setShouldCascadeWindows_1, flag);
+}
+
+public void setShouldCloseDocument(boolean flag) {
+ OS.objc_msgSend(this.id, OS.sel_setShouldCloseDocument_1, flag);
+}
+
+public void setWindow(NSWindow window) {
+ OS.objc_msgSend(this.id, OS.sel_setWindow_1, window != null ? window.id : 0);
+}
+
+public void setWindowFrameAutosaveName(NSString name) {
+ OS.objc_msgSend(this.id, OS.sel_setWindowFrameAutosaveName_1, name != null ? name.id : 0);
+}
+
+public boolean shouldCascadeWindows() {
+ return OS.objc_msgSend(this.id, OS.sel_shouldCascadeWindows) != 0;
+}
+
+public boolean shouldCloseDocument() {
+ return OS.objc_msgSend(this.id, OS.sel_shouldCloseDocument) != 0;
+}
+
+public void showWindow(id sender) {
+ OS.objc_msgSend(this.id, OS.sel_showWindow_1, sender != null ? sender.id : 0);
+}
+
+public void synchronizeWindowTitleWithDocumentName() {
+ OS.objc_msgSend(this.id, OS.sel_synchronizeWindowTitleWithDocumentName);
+}
+
+public NSWindow window() {
+ int result = OS.objc_msgSend(this.id, OS.sel_window);
+ return result != 0 ? new NSWindow(result) : null;
+}
+
+public void windowDidLoad() {
+ OS.objc_msgSend(this.id, OS.sel_windowDidLoad);
+}
+
+public NSString windowFrameAutosaveName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_windowFrameAutosaveName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString windowNibName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_windowNibName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString windowNibPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_windowNibPath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString windowTitleForDocumentDisplayName(NSString displayName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_windowTitleForDocumentDisplayName_1, displayName != null ? displayName.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void windowWillLoad() {
+ OS.objc_msgSend(this.id, OS.sel_windowWillLoad);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWorkspace.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWorkspace.java
new file mode 100644
index 0000000000..d9ade4c041
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSWorkspace.java
@@ -0,0 +1,204 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSWorkspace extends NSObject {
+
+public NSWorkspace() {
+ super();
+}
+
+public NSWorkspace(int id) {
+ super(id);
+}
+
+public NSString absolutePathForAppBundleWithIdentifier(NSString bundleIdentifier) {
+ int result = OS.objc_msgSend(this.id, OS.sel_absolutePathForAppBundleWithIdentifier_1, bundleIdentifier != null ? bundleIdentifier.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSDictionary activeApplication() {
+ int result = OS.objc_msgSend(this.id, OS.sel_activeApplication);
+ return result != 0 ? new NSDictionary(result) : null;
+}
+
+public void checkForRemovableMedia() {
+ OS.objc_msgSend(this.id, OS.sel_checkForRemovableMedia);
+}
+
+public int extendPowerOffBy(int requested) {
+ return OS.objc_msgSend(this.id, OS.sel_extendPowerOffBy_1, requested);
+}
+
+public boolean fileSystemChanged() {
+ return OS.objc_msgSend(this.id, OS.sel_fileSystemChanged) != 0;
+}
+
+public boolean filenameExtension(NSString filenameExtension, NSString typeName) {
+ return OS.objc_msgSend(this.id, OS.sel_filenameExtension_1isValidForType_1, filenameExtension != null ? filenameExtension.id : 0, typeName != null ? typeName.id : 0) != 0;
+}
+
+public void findApplications() {
+ OS.objc_msgSend(this.id, OS.sel_findApplications);
+}
+
+public NSString fullPathForApplication(NSString appName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_fullPathForApplication_1, appName != null ? appName.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean getFileSystemInfoForPath(NSString fullPath, int removableFlag, int writableFlag, int unmountableFlag, int description, int fileSystemType) {
+ return OS.objc_msgSend(this.id, OS.sel_getFileSystemInfoForPath_1isRemovable_1isWritable_1isUnmountable_1description_1type_1, fullPath != null ? fullPath.id : 0, removableFlag, writableFlag, unmountableFlag, description, fileSystemType) != 0;
+}
+
+public boolean getInfoForFile(NSString fullPath, int appName, int type) {
+ return OS.objc_msgSend(this.id, OS.sel_getInfoForFile_1application_1type_1, fullPath != null ? fullPath.id : 0, appName, type) != 0;
+}
+
+public void hideOtherApplications() {
+ OS.objc_msgSend(this.id, OS.sel_hideOtherApplications);
+}
+
+public NSImage iconForFile(NSString fullPath) {
+ int result = OS.objc_msgSend(this.id, OS.sel_iconForFile_1, fullPath != null ? fullPath.id : 0);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public NSImage iconForFileType(NSString fileType) {
+ int result = OS.objc_msgSend(this.id, OS.sel_iconForFileType_1, fileType != null ? fileType.id : 0);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public NSImage iconForFiles(NSArray fullPaths) {
+ int result = OS.objc_msgSend(this.id, OS.sel_iconForFiles_1, fullPaths != null ? fullPaths.id : 0);
+ return result != 0 ? new NSImage(result) : null;
+}
+
+public boolean isFilePackageAtPath(NSString fullPath) {
+ return OS.objc_msgSend(this.id, OS.sel_isFilePackageAtPath_1, fullPath != null ? fullPath.id : 0) != 0;
+}
+
+public boolean launchAppWithBundleIdentifier(NSString bundleIdentifier, int options, NSAppleEventDescriptor descriptor, int identifier) {
+ return OS.objc_msgSend(this.id, OS.sel_launchAppWithBundleIdentifier_1options_1additionalEventParamDescriptor_1launchIdentifier_1, bundleIdentifier != null ? bundleIdentifier.id : 0, options, descriptor != null ? descriptor.id : 0, identifier) != 0;
+}
+
+public boolean launchApplication_(NSString appName) {
+ return OS.objc_msgSend(this.id, OS.sel_launchApplication_1, appName != null ? appName.id : 0) != 0;
+}
+
+public boolean launchApplication_showIcon_autolaunch_(NSString appName, boolean showIcon, boolean autolaunch) {
+ return OS.objc_msgSend(this.id, OS.sel_launchApplication_1showIcon_1autolaunch_1, appName != null ? appName.id : 0, showIcon, autolaunch) != 0;
+}
+
+public NSArray launchedApplications() {
+ int result = OS.objc_msgSend(this.id, OS.sel_launchedApplications);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSString localizedDescriptionForType(NSString typeName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_localizedDescriptionForType_1, typeName != null ? typeName.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSArray mountNewRemovableMedia() {
+ int result = OS.objc_msgSend(this.id, OS.sel_mountNewRemovableMedia);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray mountedLocalVolumePaths() {
+ int result = OS.objc_msgSend(this.id, OS.sel_mountedLocalVolumePaths);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray mountedRemovableMedia() {
+ int result = OS.objc_msgSend(this.id, OS.sel_mountedRemovableMedia);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void noteFileSystemChanged() {
+ OS.objc_msgSend(this.id, OS.sel_noteFileSystemChanged);
+}
+
+public void noteFileSystemChanged_(NSString path) {
+ OS.objc_msgSend(this.id, OS.sel_noteFileSystemChanged_1, path != null ? path.id : 0);
+}
+
+public void noteUserDefaultsChanged() {
+ OS.objc_msgSend(this.id, OS.sel_noteUserDefaultsChanged);
+}
+
+public NSNotificationCenter notificationCenter() {
+ int result = OS.objc_msgSend(this.id, OS.sel_notificationCenter);
+ return result != 0 ? new NSNotificationCenter(result) : null;
+}
+
+public boolean openFile_(NSString fullPath) {
+ return OS.objc_msgSend(this.id, OS.sel_openFile_1, fullPath != null ? fullPath.id : 0) != 0;
+}
+
+public boolean openFile_fromImage_at_inView_(NSString fullPath, NSImage anImage, NSPoint point, NSView aView) {
+ return OS.objc_msgSend(this.id, OS.sel_openFile_1fromImage_1at_1inView_1, fullPath != null ? fullPath.id : 0, anImage != null ? anImage.id : 0, point, aView != null ? aView.id : 0) != 0;
+}
+
+public boolean openFile_withApplication_(NSString fullPath, NSString appName) {
+ return OS.objc_msgSend(this.id, OS.sel_openFile_1withApplication_1, fullPath != null ? fullPath.id : 0, appName != null ? appName.id : 0) != 0;
+}
+
+public boolean openFile_withApplication_andDeactivate_(NSString fullPath, NSString appName, boolean flag) {
+ return OS.objc_msgSend(this.id, OS.sel_openFile_1withApplication_1andDeactivate_1, fullPath != null ? fullPath.id : 0, appName != null ? appName.id : 0, flag) != 0;
+}
+
+public boolean openTempFile(NSString fullPath) {
+ return OS.objc_msgSend(this.id, OS.sel_openTempFile_1, fullPath != null ? fullPath.id : 0) != 0;
+}
+
+public boolean openURL(NSURL url) {
+ return OS.objc_msgSend(this.id, OS.sel_openURL_1, url != null ? url.id : 0) != 0;
+}
+
+public boolean openURLs(NSArray urls, NSString bundleIdentifier, int options, NSAppleEventDescriptor descriptor, int identifiers) {
+ return OS.objc_msgSend(this.id, OS.sel_openURLs_1withAppBundleIdentifier_1options_1additionalEventParamDescriptor_1launchIdentifiers_1, urls != null ? urls.id : 0, bundleIdentifier != null ? bundleIdentifier.id : 0, options, descriptor != null ? descriptor.id : 0, identifiers) != 0;
+}
+
+public boolean performFileOperation(NSString operation, NSString source, NSString destination, NSArray files, int tag) {
+ return OS.objc_msgSend(this.id, OS.sel_performFileOperation_1source_1destination_1files_1tag_1, operation != null ? operation.id : 0, source != null ? source.id : 0, destination != null ? destination.id : 0, files != null ? files.id : 0, tag) != 0;
+}
+
+public NSString preferredFilenameExtensionForType(NSString typeName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_preferredFilenameExtensionForType_1, typeName != null ? typeName.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean selectFile(NSString fullPath, NSString rootFullpath) {
+ return OS.objc_msgSend(this.id, OS.sel_selectFile_1inFileViewerRootedAtPath_1, fullPath != null ? fullPath.id : 0, rootFullpath != null ? rootFullpath.id : 0) != 0;
+}
+
+public boolean setIcon(NSImage image, NSString fullPath, int options) {
+ return OS.objc_msgSend(this.id, OS.sel_setIcon_1forFile_1options_1, image != null ? image.id : 0, fullPath != null ? fullPath.id : 0, options) != 0;
+}
+
+public static NSWorkspace sharedWorkspace() {
+ int result = OS.objc_msgSend(OS.class_NSWorkspace, OS.sel_sharedWorkspace);
+ return result != 0 ? new NSWorkspace(result) : null;
+}
+
+public void slideImage(NSImage image, NSPoint fromPoint, NSPoint toPoint) {
+ OS.objc_msgSend(this.id, OS.sel_slideImage_1from_1to_1, image != null ? image.id : 0, fromPoint, toPoint);
+}
+
+public boolean type(NSString firstTypeName, NSString secondTypeName) {
+ return OS.objc_msgSend(this.id, OS.sel_type_1conformsToType_1, firstTypeName != null ? firstTypeName.id : 0, secondTypeName != null ? secondTypeName.id : 0) != 0;
+}
+
+public NSString typeOfFile(NSString absoluteFilePath, int outError) {
+ int result = OS.objc_msgSend(this.id, OS.sel_typeOfFile_1error_1, absoluteFilePath != null ? absoluteFilePath.id : 0, outError);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public boolean unmountAndEjectDeviceAtPath(NSString path) {
+ return OS.objc_msgSend(this.id, OS.sel_unmountAndEjectDeviceAtPath_1, path != null ? path.id : 0) != 0;
+}
+
+public boolean userDefaultsChanged() {
+ return OS.objc_msgSend(this.id, OS.sel_userDefaultsChanged) != 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLDTD.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLDTD.java
new file mode 100644
index 0000000000..3fcd5250af
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLDTD.java
@@ -0,0 +1,90 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSXMLDTD extends NSXMLNode {
+
+public NSXMLDTD() {
+ super();
+}
+
+public NSXMLDTD(int id) {
+ super(id);
+}
+
+public void addChild(NSXMLNode child) {
+ OS.objc_msgSend(this.id, OS.sel_addChild_1, child != null ? child.id : 0);
+}
+
+public NSXMLDTDNode attributeDeclarationForName(NSString name, NSString elementName) {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributeDeclarationForName_1elementName_1, name != null ? name.id : 0, elementName != null ? elementName.id : 0);
+ return result != 0 ? new NSXMLDTDNode(result) : null;
+}
+
+public NSXMLDTDNode elementDeclarationForName(NSString name) {
+ int result = OS.objc_msgSend(this.id, OS.sel_elementDeclarationForName_1, name != null ? name.id : 0);
+ return result != 0 ? new NSXMLDTDNode(result) : null;
+}
+
+public NSXMLDTDNode entityDeclarationForName(NSString name) {
+ int result = OS.objc_msgSend(this.id, OS.sel_entityDeclarationForName_1, name != null ? name.id : 0);
+ return result != 0 ? new NSXMLDTDNode(result) : null;
+}
+
+public id initWithContentsOfURL(NSURL url, int mask, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1options_1error_1, url != null ? url.id : 0, mask, error);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithData(NSData data, int mask, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithData_1options_1error_1, data != null ? data.id : 0, mask, error);
+ return result != 0 ? new id(result) : null;
+}
+
+public void insertChild(NSXMLNode child, int index) {
+ OS.objc_msgSend(this.id, OS.sel_insertChild_1atIndex_1, child != null ? child.id : 0, index);
+}
+
+public void insertChildren(NSArray children, int index) {
+ OS.objc_msgSend(this.id, OS.sel_insertChildren_1atIndex_1, children != null ? children.id : 0, index);
+}
+
+public NSXMLDTDNode notationDeclarationForName(NSString name) {
+ int result = OS.objc_msgSend(this.id, OS.sel_notationDeclarationForName_1, name != null ? name.id : 0);
+ return result != 0 ? new NSXMLDTDNode(result) : null;
+}
+
+public static NSXMLDTDNode predefinedEntityDeclarationForName(NSString name) {
+ int result = OS.objc_msgSend(OS.class_NSXMLDTD, OS.sel_predefinedEntityDeclarationForName_1, name != null ? name.id : 0);
+ return result != 0 ? new NSXMLDTDNode(result) : null;
+}
+
+public NSString publicID() {
+ int result = OS.objc_msgSend(this.id, OS.sel_publicID);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void removeChildAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_removeChildAtIndex_1, index);
+}
+
+public void replaceChildAtIndex(int index, NSXMLNode node) {
+ OS.objc_msgSend(this.id, OS.sel_replaceChildAtIndex_1withNode_1, index, node != null ? node.id : 0);
+}
+
+public void setChildren(NSArray children) {
+ OS.objc_msgSend(this.id, OS.sel_setChildren_1, children != null ? children.id : 0);
+}
+
+public void setPublicID(NSString publicID) {
+ OS.objc_msgSend(this.id, OS.sel_setPublicID_1, publicID != null ? publicID.id : 0);
+}
+
+public void setSystemID(NSString systemID) {
+ OS.objc_msgSend(this.id, OS.sel_setSystemID_1, systemID != null ? systemID.id : 0);
+}
+
+public NSString systemID() {
+ int result = OS.objc_msgSend(this.id, OS.sel_systemID);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLDTDNode.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLDTDNode.java
new file mode 100644
index 0000000000..9b9aaafb1c
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLDTDNode.java
@@ -0,0 +1,57 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSXMLDTDNode extends NSXMLNode {
+
+public NSXMLDTDNode() {
+ super();
+}
+
+public NSXMLDTDNode(int id) {
+ super(id);
+}
+
+public int DTDKind() {
+ return OS.objc_msgSend(this.id, OS.sel_DTDKind);
+}
+
+public id initWithXMLString(NSString string) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithXMLString_1, string != null ? string.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public boolean isExternal() {
+ return OS.objc_msgSend(this.id, OS.sel_isExternal) != 0;
+}
+
+public NSString notationName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_notationName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString publicID() {
+ int result = OS.objc_msgSend(this.id, OS.sel_publicID);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void setDTDKind(int kind) {
+ OS.objc_msgSend(this.id, OS.sel_setDTDKind_1, kind);
+}
+
+public void setNotationName(NSString notationName) {
+ OS.objc_msgSend(this.id, OS.sel_setNotationName_1, notationName != null ? notationName.id : 0);
+}
+
+public void setPublicID(NSString publicID) {
+ OS.objc_msgSend(this.id, OS.sel_setPublicID_1, publicID != null ? publicID.id : 0);
+}
+
+public void setSystemID(NSString systemID) {
+ OS.objc_msgSend(this.id, OS.sel_setSystemID_1, systemID != null ? systemID.id : 0);
+}
+
+public NSString systemID() {
+ int result = OS.objc_msgSend(this.id, OS.sel_systemID);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLDocument.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLDocument.java
new file mode 100644
index 0000000000..3e33cddc67
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLDocument.java
@@ -0,0 +1,151 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSXMLDocument extends NSXMLNode {
+
+public NSXMLDocument() {
+ super();
+}
+
+public NSXMLDocument(int id) {
+ super(id);
+}
+
+public NSXMLDTD DTD() {
+ int result = OS.objc_msgSend(this.id, OS.sel_DTD);
+ return result != 0 ? new NSXMLDTD(result) : null;
+}
+
+public NSString MIMEType() {
+ int result = OS.objc_msgSend(this.id, OS.sel_MIMEType);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSData XMLData() {
+ int result = OS.objc_msgSend(this.id, OS.sel_XMLData);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public NSData XMLDataWithOptions(int options) {
+ int result = OS.objc_msgSend(this.id, OS.sel_XMLDataWithOptions_1, options);
+ return result != 0 ? new NSData(result) : null;
+}
+
+public void addChild(NSXMLNode child) {
+ OS.objc_msgSend(this.id, OS.sel_addChild_1, child != null ? child.id : 0);
+}
+
+public NSString characterEncoding() {
+ int result = OS.objc_msgSend(this.id, OS.sel_characterEncoding);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public int documentContentKind() {
+ return OS.objc_msgSend(this.id, OS.sel_documentContentKind);
+}
+
+public id initWithContentsOfURL(NSURL url, int mask, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1options_1error_1, url != null ? url.id : 0, mask, error);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithData(NSData data, int mask, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithData_1options_1error_1, data != null ? data.id : 0, mask, error);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithRootElement(NSXMLElement element) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithRootElement_1, element != null ? element.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithXMLString(NSString string, int mask, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithXMLString_1options_1error_1, string != null ? string.id : 0, mask, error);
+ return result != 0 ? new id(result) : null;
+}
+
+public void insertChild(NSXMLNode child, int index) {
+ OS.objc_msgSend(this.id, OS.sel_insertChild_1atIndex_1, child != null ? child.id : 0, index);
+}
+
+public void insertChildren(NSArray children, int index) {
+ OS.objc_msgSend(this.id, OS.sel_insertChildren_1atIndex_1, children != null ? children.id : 0, index);
+}
+
+public boolean isStandalone() {
+ return OS.objc_msgSend(this.id, OS.sel_isStandalone) != 0;
+}
+
+public id objectByApplyingXSLT(NSData xslt, NSDictionary arguments, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectByApplyingXSLT_1arguments_1error_1, xslt != null ? xslt.id : 0, arguments != null ? arguments.id : 0, error);
+ return result != 0 ? new id(result) : null;
+}
+
+public id objectByApplyingXSLTAtURL(NSURL xsltURL, NSDictionary argument, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectByApplyingXSLTAtURL_1arguments_1error_1, xsltURL != null ? xsltURL.id : 0, argument != null ? argument.id : 0, error);
+ return result != 0 ? new id(result) : null;
+}
+
+public id objectByApplyingXSLTString(NSString xslt, NSDictionary arguments, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectByApplyingXSLTString_1arguments_1error_1, xslt != null ? xslt.id : 0, arguments != null ? arguments.id : 0, error);
+ return result != 0 ? new id(result) : null;
+}
+
+public void removeChildAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_removeChildAtIndex_1, index);
+}
+
+public void replaceChildAtIndex(int index, NSXMLNode node) {
+ OS.objc_msgSend(this.id, OS.sel_replaceChildAtIndex_1withNode_1, index, node != null ? node.id : 0);
+}
+
+public static int replacementClassForClass(int cls) {
+ return OS.objc_msgSend(OS.class_NSXMLDocument, OS.sel_replacementClassForClass_1, cls);
+}
+
+public NSXMLElement rootElement() {
+ int result = OS.objc_msgSend(this.id, OS.sel_rootElement);
+ return result != 0 ? new NSXMLElement(result) : null;
+}
+
+public void setCharacterEncoding(NSString encoding) {
+ OS.objc_msgSend(this.id, OS.sel_setCharacterEncoding_1, encoding != null ? encoding.id : 0);
+}
+
+public void setChildren(NSArray children) {
+ OS.objc_msgSend(this.id, OS.sel_setChildren_1, children != null ? children.id : 0);
+}
+
+public void setDTD(NSXMLDTD documentTypeDeclaration) {
+ OS.objc_msgSend(this.id, OS.sel_setDTD_1, documentTypeDeclaration != null ? documentTypeDeclaration.id : 0);
+}
+
+public void setDocumentContentKind(int kind) {
+ OS.objc_msgSend(this.id, OS.sel_setDocumentContentKind_1, kind);
+}
+
+public void setMIMEType(NSString MIMEType) {
+ OS.objc_msgSend(this.id, OS.sel_setMIMEType_1, MIMEType != null ? MIMEType.id : 0);
+}
+
+public void setRootElement(NSXMLNode root) {
+ OS.objc_msgSend(this.id, OS.sel_setRootElement_1, root != null ? root.id : 0);
+}
+
+public void setStandalone(boolean standalone) {
+ OS.objc_msgSend(this.id, OS.sel_setStandalone_1, standalone);
+}
+
+public void setVersion(NSString version) {
+ OS.objc_msgSend(this.id, OS.sel_setVersion_1, version != null ? version.id : 0);
+}
+
+public boolean validateAndReturnError(int error) {
+ return OS.objc_msgSend(this.id, OS.sel_validateAndReturnError_1, error) != 0;
+}
+
+//public NSString version() {
+// int result = OS.objc_msgSend(this.id, OS.sel_version);
+// return result != 0 ? new NSString(result) : null;
+//}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLElement.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLElement.java
new file mode 100644
index 0000000000..676e7c1bb7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLElement.java
@@ -0,0 +1,134 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSXMLElement extends NSXMLNode {
+
+public NSXMLElement() {
+ super();
+}
+
+public NSXMLElement(int id) {
+ super(id);
+}
+
+public void addAttribute(NSXMLNode attribute) {
+ OS.objc_msgSend(this.id, OS.sel_addAttribute_1, attribute != null ? attribute.id : 0);
+}
+
+public void addChild(NSXMLNode child) {
+ OS.objc_msgSend(this.id, OS.sel_addChild_1, child != null ? child.id : 0);
+}
+
+public void addNamespace(NSXMLNode aNamespace) {
+ OS.objc_msgSend(this.id, OS.sel_addNamespace_1, aNamespace != null ? aNamespace.id : 0);
+}
+
+public NSXMLNode attributeForLocalName(NSString localName, NSString URI) {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributeForLocalName_1URI_1, localName != null ? localName.id : 0, URI != null ? URI.id : 0);
+ return result != 0 ? new NSXMLNode(result) : null;
+}
+
+public NSXMLNode attributeForName(NSString name) {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributeForName_1, name != null ? name.id : 0);
+ return result != 0 ? new NSXMLNode(result) : null;
+}
+
+public NSArray attributes() {
+ int result = OS.objc_msgSend(this.id, OS.sel_attributes);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray elementsForLocalName(NSString localName, NSString URI) {
+ int result = OS.objc_msgSend(this.id, OS.sel_elementsForLocalName_1URI_1, localName != null ? localName.id : 0, URI != null ? URI.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray elementsForName(NSString name) {
+ int result = OS.objc_msgSend(this.id, OS.sel_elementsForName_1, name != null ? name.id : 0);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public id initWithName_(NSString name) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithName_1, name != null ? name.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithName_URI_(NSString name, NSString URI) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithName_1URI_1, name != null ? name.id : 0, URI != null ? URI.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithName_stringValue_(NSString name, NSString string) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithName_1stringValue_1, name != null ? name.id : 0, string != null ? string.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithXMLString(NSString string, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithXMLString_1error_1, string != null ? string.id : 0, error);
+ return result != 0 ? new id(result) : null;
+}
+
+public void insertChild(NSXMLNode child, int index) {
+ OS.objc_msgSend(this.id, OS.sel_insertChild_1atIndex_1, child != null ? child.id : 0, index);
+}
+
+public void insertChildren(NSArray children, int index) {
+ OS.objc_msgSend(this.id, OS.sel_insertChildren_1atIndex_1, children != null ? children.id : 0, index);
+}
+
+public NSXMLNode namespaceForPrefix(NSString name) {
+ int result = OS.objc_msgSend(this.id, OS.sel_namespaceForPrefix_1, name != null ? name.id : 0);
+ return result != 0 ? new NSXMLNode(result) : null;
+}
+
+public NSArray namespaces() {
+ int result = OS.objc_msgSend(this.id, OS.sel_namespaces);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public void normalizeAdjacentTextNodesPreservingCDATA(boolean preserve) {
+ OS.objc_msgSend(this.id, OS.sel_normalizeAdjacentTextNodesPreservingCDATA_1, preserve);
+}
+
+public void removeAttributeForName(NSString name) {
+ OS.objc_msgSend(this.id, OS.sel_removeAttributeForName_1, name != null ? name.id : 0);
+}
+
+public void removeChildAtIndex(int index) {
+ OS.objc_msgSend(this.id, OS.sel_removeChildAtIndex_1, index);
+}
+
+public void removeNamespaceForPrefix(NSString name) {
+ OS.objc_msgSend(this.id, OS.sel_removeNamespaceForPrefix_1, name != null ? name.id : 0);
+}
+
+public void replaceChildAtIndex(int index, NSXMLNode node) {
+ OS.objc_msgSend(this.id, OS.sel_replaceChildAtIndex_1withNode_1, index, node != null ? node.id : 0);
+}
+
+public NSXMLNode resolveNamespaceForName(NSString name) {
+ int result = OS.objc_msgSend(this.id, OS.sel_resolveNamespaceForName_1, name != null ? name.id : 0);
+ return result != 0 ? new NSXMLNode(result) : null;
+}
+
+public NSString resolvePrefixForNamespaceURI(NSString namespaceURI) {
+ int result = OS.objc_msgSend(this.id, OS.sel_resolvePrefixForNamespaceURI_1, namespaceURI != null ? namespaceURI.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void setAttributes(NSArray attributes) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributes_1, attributes != null ? attributes.id : 0);
+}
+
+public void setAttributesAsDictionary(NSDictionary attributes) {
+ OS.objc_msgSend(this.id, OS.sel_setAttributesAsDictionary_1, attributes != null ? attributes.id : 0);
+}
+
+public void setChildren(NSArray children) {
+ OS.objc_msgSend(this.id, OS.sel_setChildren_1, children != null ? children.id : 0);
+}
+
+public void setNamespaces(NSArray namespaces) {
+ OS.objc_msgSend(this.id, OS.sel_setNamespaces_1, namespaces != null ? namespaces.id : 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLNode.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLNode.java
new file mode 100644
index 0000000000..6362602bca
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLNode.java
@@ -0,0 +1,253 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSXMLNode extends NSObject {
+
+public NSXMLNode() {
+ super();
+}
+
+public NSXMLNode(int id) {
+ super(id);
+}
+
+public static id DTDNodeWithXMLString(NSString string) {
+ int result = OS.objc_msgSend(OS.class_NSXMLNode, OS.sel_DTDNodeWithXMLString_1, string != null ? string.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString URI() {
+ int result = OS.objc_msgSend(this.id, OS.sel_URI);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString XMLString() {
+ int result = OS.objc_msgSend(this.id, OS.sel_XMLString);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString XMLStringWithOptions(int options) {
+ int result = OS.objc_msgSend(this.id, OS.sel_XMLStringWithOptions_1, options);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString XPath() {
+ int result = OS.objc_msgSend(this.id, OS.sel_XPath);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static id static_attributeWithName_URI_stringValue_(NSString name, NSString URI, NSString stringValue) {
+ int result = OS.objc_msgSend(OS.class_NSXMLNode, OS.sel_attributeWithName_1URI_1stringValue_1, name != null ? name.id : 0, URI != null ? URI.id : 0, stringValue != null ? stringValue.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_attributeWithName_stringValue_(NSString name, NSString stringValue) {
+ int result = OS.objc_msgSend(OS.class_NSXMLNode, OS.sel_attributeWithName_1stringValue_1, name != null ? name.id : 0, stringValue != null ? stringValue.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString canonicalXMLStringPreservingComments(boolean comments) {
+ int result = OS.objc_msgSend(this.id, OS.sel_canonicalXMLStringPreservingComments_1, comments);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSXMLNode childAtIndex(int index) {
+ int result = OS.objc_msgSend(this.id, OS.sel_childAtIndex_1, index);
+ return result == this.id ? this : (result != 0 ? new NSXMLNode(result) : null);
+}
+
+public int childCount() {
+ return OS.objc_msgSend(this.id, OS.sel_childCount);
+}
+
+public NSArray children() {
+ int result = OS.objc_msgSend(this.id, OS.sel_children);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public static id commentWithStringValue(NSString stringValue) {
+ int result = OS.objc_msgSend(OS.class_NSXMLNode, OS.sel_commentWithStringValue_1, stringValue != null ? stringValue.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSString description() {
+ int result = OS.objc_msgSend(this.id, OS.sel_description);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void detach() {
+ OS.objc_msgSend(this.id, OS.sel_detach);
+}
+
+public static id document() {
+ int result = OS.objc_msgSend(OS.class_NSXMLNode, OS.sel_document);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id documentWithRootElement(NSXMLElement element) {
+ int result = OS.objc_msgSend(OS.class_NSXMLNode, OS.sel_documentWithRootElement_1, element != null ? element.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_elementWithName_(NSString name) {
+ int result = OS.objc_msgSend(OS.class_NSXMLNode, OS.sel_elementWithName_1, name != null ? name.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_elementWithName_URI_(NSString name, NSString URI) {
+ int result = OS.objc_msgSend(OS.class_NSXMLNode, OS.sel_elementWithName_1URI_1, name != null ? name.id : 0, URI != null ? URI.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_elementWithName_children_attributes_(NSString name, NSArray children, NSArray attributes) {
+ int result = OS.objc_msgSend(OS.class_NSXMLNode, OS.sel_elementWithName_1children_1attributes_1, name != null ? name.id : 0, children != null ? children.id : 0, attributes != null ? attributes.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public static id static_elementWithName_stringValue_(NSString name, NSString string) {
+ int result = OS.objc_msgSend(OS.class_NSXMLNode, OS.sel_elementWithName_1stringValue_1, name != null ? name.id : 0, string != null ? string.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public int index() {
+ return OS.objc_msgSend(this.id, OS.sel_index);
+}
+
+public id initWithKind_(int kind) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithKind_1, kind);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithKind_options_(int kind, int options) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithKind_1options_1, kind, options);
+ return result != 0 ? new id(result) : null;
+}
+
+public int kind() {
+ return OS.objc_msgSend(this.id, OS.sel_kind);
+}
+
+public int level() {
+ return OS.objc_msgSend(this.id, OS.sel_level);
+}
+
+public NSString localName() {
+ int result = OS.objc_msgSend(this.id, OS.sel_localName);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSString localNameForName(NSString name) {
+ int result = OS.objc_msgSend(OS.class_NSXMLNode, OS.sel_localNameForName_1, name != null ? name.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSString name() {
+ int result = OS.objc_msgSend(this.id, OS.sel_name);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static id namespaceWithName(NSString name, NSString stringValue) {
+ int result = OS.objc_msgSend(OS.class_NSXMLNode, OS.sel_namespaceWithName_1stringValue_1, name != null ? name.id : 0, stringValue != null ? stringValue.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSXMLNode nextNode() {
+ int result = OS.objc_msgSend(this.id, OS.sel_nextNode);
+ return result == this.id ? this : (result != 0 ? new NSXMLNode(result) : null);
+}
+
+public NSXMLNode nextSibling() {
+ int result = OS.objc_msgSend(this.id, OS.sel_nextSibling);
+ return result == this.id ? this : (result != 0 ? new NSXMLNode(result) : null);
+}
+
+public NSArray nodesForXPath(NSString xpath, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_nodesForXPath_1error_1, xpath != null ? xpath.id : 0, error);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public id objectValue() {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectValue);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSArray objectsForXQuery_constants_error_(NSString xquery, NSDictionary constants, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectsForXQuery_1constants_1error_1, xquery != null ? xquery.id : 0, constants != null ? constants.id : 0, error);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSArray objectsForXQuery_error_(NSString xquery, int error) {
+ int result = OS.objc_msgSend(this.id, OS.sel_objectsForXQuery_1error_1, xquery != null ? xquery.id : 0, error);
+ return result != 0 ? new NSArray(result) : null;
+}
+
+public NSXMLNode parent() {
+ int result = OS.objc_msgSend(this.id, OS.sel_parent);
+ return result == this.id ? this : (result != 0 ? new NSXMLNode(result) : null);
+}
+
+public static NSXMLNode predefinedNamespaceForPrefix(NSString name) {
+ int result = OS.objc_msgSend(OS.class_NSXMLNode, OS.sel_predefinedNamespaceForPrefix_1, name != null ? name.id : 0);
+ return result != 0 ? new NSXMLNode(result) : null;
+}
+
+public NSString prefix() {
+ int result = OS.objc_msgSend(this.id, OS.sel_prefix);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static NSString prefixForName(NSString name) {
+ int result = OS.objc_msgSend(OS.class_NSXMLNode, OS.sel_prefixForName_1, name != null ? name.id : 0);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public NSXMLNode previousNode() {
+ int result = OS.objc_msgSend(this.id, OS.sel_previousNode);
+ return result == this.id ? this : (result != 0 ? new NSXMLNode(result) : null);
+}
+
+public NSXMLNode previousSibling() {
+ int result = OS.objc_msgSend(this.id, OS.sel_previousSibling);
+ return result == this.id ? this : (result != 0 ? new NSXMLNode(result) : null);
+}
+
+public static id processingInstructionWithName(NSString name, NSString stringValue) {
+ int result = OS.objc_msgSend(OS.class_NSXMLNode, OS.sel_processingInstructionWithName_1stringValue_1, name != null ? name.id : 0, stringValue != null ? stringValue.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public NSXMLDocument rootDocument() {
+ int result = OS.objc_msgSend(this.id, OS.sel_rootDocument);
+ return result != 0 ? new NSXMLDocument(result) : null;
+}
+
+public void setName(NSString name) {
+ OS.objc_msgSend(this.id, OS.sel_setName_1, name != null ? name.id : 0);
+}
+
+public void setObjectValue(id value) {
+ OS.objc_msgSend(this.id, OS.sel_setObjectValue_1, value != null ? value.id : 0);
+}
+
+public void setStringValue_(NSString string) {
+ OS.objc_msgSend(this.id, OS.sel_setStringValue_1, string != null ? string.id : 0);
+}
+
+public void setStringValue_resolvingEntities_(NSString string, boolean resolve) {
+ OS.objc_msgSend(this.id, OS.sel_setStringValue_1resolvingEntities_1, string != null ? string.id : 0, resolve);
+}
+
+public void setURI(NSString URI) {
+ OS.objc_msgSend(this.id, OS.sel_setURI_1, URI != null ? URI.id : 0);
+}
+
+public NSString stringValue() {
+ int result = OS.objc_msgSend(this.id, OS.sel_stringValue);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public static id textWithStringValue(NSString stringValue) {
+ int result = OS.objc_msgSend(OS.class_NSXMLNode, OS.sel_textWithStringValue_1, stringValue != null ? stringValue.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLParser.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLParser.java
new file mode 100644
index 0000000000..81c3c6e010
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSXMLParser.java
@@ -0,0 +1,87 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class NSXMLParser extends NSObject {
+
+public NSXMLParser() {
+ super();
+}
+
+public NSXMLParser(int id) {
+ super(id);
+}
+
+public void abortParsing() {
+ OS.objc_msgSend(this.id, OS.sel_abortParsing);
+}
+
+public int columnNumber() {
+ return OS.objc_msgSend(this.id, OS.sel_columnNumber);
+}
+
+public id delegate() {
+ int result = OS.objc_msgSend(this.id, OS.sel_delegate);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithContentsOfURL(NSURL url) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1, url != null ? url.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public id initWithData(NSData data) {
+ int result = OS.objc_msgSend(this.id, OS.sel_initWithData_1, data != null ? data.id : 0);
+ return result != 0 ? new id(result) : null;
+}
+
+public int lineNumber() {
+ return OS.objc_msgSend(this.id, OS.sel_lineNumber);
+}
+
+public boolean parse() {
+ return OS.objc_msgSend(this.id, OS.sel_parse) != 0;
+}
+
+public NSError parserError() {
+ int result = OS.objc_msgSend(this.id, OS.sel_parserError);
+ return result != 0 ? new NSError(result) : null;
+}
+
+public NSString publicID() {
+ int result = OS.objc_msgSend(this.id, OS.sel_publicID);
+ return result != 0 ? new NSString(result) : null;
+}
+
+public void setDelegate(id delegate) {
+ OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegate != null ? delegate.id : 0);
+}
+
+public void setShouldProcessNamespaces(boolean shouldProcessNamespaces) {
+ OS.objc_msgSend(this.id, OS.sel_setShouldProcessNamespaces_1, shouldProcessNamespaces);
+}
+
+public void setShouldReportNamespacePrefixes(boolean shouldReportNamespacePrefixes) {
+ OS.objc_msgSend(this.id, OS.sel_setShouldReportNamespacePrefixes_1, shouldReportNamespacePrefixes);
+}
+
+public void setShouldResolveExternalEntities(boolean shouldResolveExternalEntities) {
+ OS.objc_msgSend(this.id, OS.sel_setShouldResolveExternalEntities_1, shouldResolveExternalEntities);
+}
+
+public boolean shouldProcessNamespaces() {
+ return OS.objc_msgSend(this.id, OS.sel_shouldProcessNamespaces) != 0;
+}
+
+public boolean shouldReportNamespacePrefixes() {
+ return OS.objc_msgSend(this.id, OS.sel_shouldReportNamespacePrefixes) != 0;
+}
+
+public boolean shouldResolveExternalEntities() {
+ return OS.objc_msgSend(this.id, OS.sel_shouldResolveExternalEntities) != 0;
+}
+
+public NSString systemID() {
+ int result = OS.objc_msgSend(this.id, OS.sel_systemID);
+ return result != 0 ? new NSString(result) : null;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
new file mode 100644
index 0000000000..2b799aff9f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
@@ -0,0 +1,9977 @@
+package org.eclipse.swt.internal.cocoa;
+
+import org.eclipse.swt.internal.*;
+
+public class OS extends C {
+ static {
+ Library.loadLibrary("swt-pi"); //$NON-NLS-1$
+ }
+
+ //TODO - don't hard code
+ public static final int VERSION = 0x1040;
+ public static final int PTR_SIZEOF = 4;
+ public static final int noErr = 0;
+ public static final int kProcessTransformToForegroundApplication = 1;
+
+ public static final int sel_sendSelection = sel_registerName("sendSelection");
+ public static final int sel_sendDoubleSelection = sel_registerName("sendDoubleSelection");
+ public static final int sel_sendVerticalSelection = sel_registerName("sendVerticalSelection");
+ public static final int sel_sendHorizontalSelection = sel_registerName("sendHorizontalSelection");
+ public static final int sel_drawAtPoint_ = sel_registerName("drawAtPoint:");
+ public static final int sel_timerProc_1 = sel_registerName("timerProc:");
+
+ public static final native int NSDeviceRGBColorSpace();
+
+/** JNI natives */
+public static final native int NewGlobalRef(Object object);
+public static final native void DeleteGlobalRef(int globalRef);
+public static final native Object JNIGetObject(int globalRef);
+
+public static final native int GetCurrentProcess(int[] psn);
+public static final native int SetFrontProcess(int[] psn);
+public static final native int TransformProcessType(int[] psn, int transformState);
+public static final native void NSIntersectionRect (NSRect result, NSRect aRect, NSRect bRect);
+public static final native int CGWarpMouseCursorPosition (CGPoint newCursorPosition);
+
+/** QuickDraw calls */
+public static final native int NewRgn();
+public static final native void RectRgn(int rgnHandle, short[] rect);
+public static final native void OpenRgn();
+public static final native void OffsetRgn(int rgnHandle, short dh, short dv);
+public static final native void MoveTo(short h, short v);
+public static final native void LineTo(short h, short v);
+public static final native void UnionRgn(int srcRgnA, int srcRgnB, int dstRgn);
+public static final native void CloseRgn(int dstRgn);
+public static final native void DisposeRgn(int rgnHandle);
+public static final native boolean PtInRgn(short[] pt, int rgnHandle);
+public static final native void GetRegionBounds(int rgnHandle, short[] bounds);
+public static final native void SectRgn(int srcRgnA, int srcRgnB, int dstRgn);
+public static final native boolean EmptyRgn(int rgnHandle);
+public static final native void DiffRgn(int srcRgnA, int srcRgnB, int dstRgn);
+public static final native boolean RectInRgn(short[] rect, int rgnHandle);
+public static final native int QDRegionToRects(int rgn, int dir, int proc, int userData);
+public static final native void CopyRgn(int srcRgnHandle, int dstRgnHandle);
+public static final int kQDParseRegionFromTop = (1 << 0);
+public static final int kQDParseRegionFromBottom = (1 << 1);
+public static final int kQDParseRegionFromLeft = (1 << 2);
+public static final int kQDParseRegionFromRight = (1 << 3);
+public static final int kQDParseRegionFromTopLeft = kQDParseRegionFromTop | kQDParseRegionFromLeft;
+public static final int kQDRegionToRectsMsgParse = 2;
+
+
+public static final native boolean class_addIvar(int cls, String name, int size, byte alignment, String types);
+public static final native boolean class_addMethod(int cls, int name, int imp, String types);
+public static final native int objc_allocateClassPair(int superclass, String name, int extraBytes);
+public static final native int objc_getClass(String className);
+public static final native int objc_lookUpClass(String className);
+public static final native void objc_registerClassPair(int cls);
+public static final native int object_getClassName(int obj);
+public static final native int object_getInstanceVariable(int obj, String name, int[] outValue);
+public static final native int object_setInstanceVariable(int obj, String name, int value);
+public static final native int sel_registerName(String selectorName);
+
+
+public static final native int objc_msgSend(int id, int sel, char[] arg0);
+public static final native int objc_msgSend(int id, int sel, char[] arg0, int arg1);
+public static final native int objc_msgSend(int id, int sel, float[] arg0, int arg1, float arg2);
+public static final native int objc_msgSend(int id, int sel, float[] arg0);
+public static final native int objc_msgSend(int id, int sel, char[] arg0, NSRange arg1);
+public static final native int objc_msgSend(int id, int sel, String arg0);
+
+public static final native int objc_msgSend_struct(NSSize result, int object, int selector);
+public static final native void objc_msgSend_struct(NSRange result, int id, int sel, NSRange arg0, int arg1);
+public static final native void objc_msgSend_struct(NSSize result, int id, int sel, NSSize arg0, boolean arg1, boolean arg2, int arg3);
+public static final native int objc_msgSend_struct(NSPoint result, int object, int selector);
+public static final native int objc_msgSend_struct(NSPoint result, int object, int selector, int arg0);
+public static final native int objc_msgSend_struct(NSPoint result, int object, int selector, NSPoint arg0);
+public static final native int objc_msgSend_struct(NSRange result, int object, int selector, NSRange arg0);
+public static final native int objc_msgSend_struct(NSPoint result, int object, int selector, NSPoint arg0, int arg1);
+public static final native int objc_msgSend_struct(NSRange result, int object, int selector);
+public static final native int objc_msgSend_struct(NSRange result, int object, int selector, int arg0);
+
+public static final native int drawRect_CALLBACK(int func);
+
+public static final native int objc_msgSendSuper(objc_super superId, int sel);
+public static final native int objc_msgSendSuper(objc_super superId, int sel, NSRect arg0);
+public static final native int objc_msgSendSuper(objc_super superId, int sel, int arg0);
+public static final native void memmove (int /*long*/ dest, NSRect src, int /*long*/ size);
+public static final native void memmove (NSRect dest, int /*long*/ src, int /*long*/ size);
+public static final native void memmove (NSPoint dest, int /*long*/ src, int /*long*/ size);
+public static final native void memmove (NSRange dest, int /*long*/ src, int /*long*/ size);
+
+/** Classes */
+public static final int class_NSScanner = objc_getClass("NSScanner");
+public static final int class_NSCIImageRep = objc_getClass("NSCIImageRep");
+public static final int class_NSPathControl = objc_getClass("NSPathControl");
+public static final int class_NSTreeController = objc_getClass("NSTreeController");
+public static final int class_NSPDFImageRep = objc_getClass("NSPDFImageRep");
+public static final int class_NSPageLayout = objc_getClass("NSPageLayout");
+public static final int class_NSMetadataQueryAttributeValueTuple = objc_getClass("NSMetadataQueryAttributeValueTuple");
+public static final int class_NSAppleScript = objc_getClass("NSAppleScript");
+public static final int class_NSGradient = objc_getClass("NSGradient");
+public static final int class_NSColorPanel = objc_getClass("NSColorPanel");
+public static final int class_NSPrinter = objc_getClass("NSPrinter");
+public static final int class_NSCachedURLResponse = objc_getClass("NSCachedURLResponse");
+public static final int class_NSLevelIndicatorCell = objc_getClass("NSLevelIndicatorCell");
+public static final int class_NSScriptClassDescription = objc_getClass("NSScriptClassDescription");
+public static final int class_NSDistantObjectRequest = objc_getClass("NSDistantObjectRequest");
+public static final int class_NSOpenPanel = objc_getClass("NSOpenPanel");
+public static final int class_NSOperationQueue = objc_getClass("NSOperationQueue");
+public static final int class_NSOpenGLPixelBuffer = objc_getClass("NSOpenGLPixelBuffer");
+public static final int class_NSRelativeSpecifier = objc_getClass("NSRelativeSpecifier");
+public static final int class_NSTextStorage = objc_getClass("NSTextStorage");
+public static final int class_NSPopUpButtonCell = objc_getClass("NSPopUpButtonCell");
+public static final int class_NSTextContainer = objc_getClass("NSTextContainer");
+public static final int class_NSStepperCell = objc_getClass("NSStepperCell");
+public static final int class_NSTextTable = objc_getClass("NSTextTable");
+public static final int class_NSInvocationOperation = objc_getClass("NSInvocationOperation");
+public static final int class_NSDeleteCommand = objc_getClass("NSDeleteCommand");
+public static final int class_NSImageView = objc_getClass("NSImageView");
+public static final int class_NSMovieView = objc_getClass("NSMovieView");
+public static final int class_NSLock = objc_getClass("NSLock");
+public static final int class_NSCoder = objc_getClass("NSCoder");
+public static final int class_NSXMLElement = objc_getClass("NSXMLElement");
+public static final int class_NSLayoutManager = objc_getClass("NSLayoutManager");
+public static final int class_NSTabView = objc_getClass("NSTabView");
+public static final int class_NSSpeechRecognizer = objc_getClass("NSSpeechRecognizer");
+public static final int class_NSAttributedString = objc_getClass("NSAttributedString");
+public static final int class_NSProcessInfo = objc_getClass("NSProcessInfo");
+public static final int class_NSTextFieldCell = objc_getClass("NSTextFieldCell");
+public static final int class_NSDate = objc_getClass("NSDate");
+public static final int class_NSMachBootstrapServer = objc_getClass("NSMachBootstrapServer");
+public static final int class_NSData = objc_getClass("NSData");
+public static final int class_NSNumberFormatter = objc_getClass("NSNumberFormatter");
+public static final int class_NSPositionalSpecifier = objc_getClass("NSPositionalSpecifier");
+public static final int class_NSSegmentedControl = objc_getClass("NSSegmentedControl");
+public static final int class_NSMatrix = objc_getClass("NSMatrix");
+public static final int class_NSPanel = objc_getClass("NSPanel");
+public static final int class_NSPrintInfo = objc_getClass("NSPrintInfo");
+public static final int class_NSResponder = objc_getClass("NSResponder");
+public static final int class_NSNull = objc_getClass("NSNull");
+public static final int class_NSRunLoop = objc_getClass("NSRunLoop");
+public static final int class_NSMutableAttributedString = objc_getClass("NSMutableAttributedString");
+public static final int class_NSImageCell = objc_getClass("NSImageCell");
+public static final int class_CIColor = objc_getClass("CIColor");
+public static final int class_NSSegmentedCell = objc_getClass("NSSegmentedCell");
+public static final int class_NSDocument = objc_getClass("NSDocument");
+public static final int class_NSTextTab = objc_getClass("NSTextTab");
+public static final int class_NSWhoseSpecifier = objc_getClass("NSWhoseSpecifier");
+public static final int class_NSMenu = objc_getClass("NSMenu");
+public static final int class_NSPopUpButton = objc_getClass("NSPopUpButton");
+public static final int class_NSInvocation = objc_getClass("NSInvocation");
+public static final int class_NSDatePicker = objc_getClass("NSDatePicker");
+public static final int class_NSSliderCell = objc_getClass("NSSliderCell");
+public static final int class_NSURLCache = objc_getClass("NSURLCache");
+public static final int class_NSSpeechSynthesizer = objc_getClass("NSSpeechSynthesizer");
+public static final int class_NSBezierPath = objc_getClass("NSBezierPath");
+public static final int class_NSSavePanel = objc_getClass("NSSavePanel");
+public static final int class_NSMetadataQuery = objc_getClass("NSMetadataQuery");
+public static final int class_NSLogicalTest = objc_getClass("NSLogicalTest");
+public static final int class_NSAffineTransform = objc_getClass("NSAffineTransform");
+public static final int class_NSTreeNode = objc_getClass("NSTreeNode");
+public static final int class_NSControl = objc_getClass("NSControl");
+public static final int class_NSWindowController = objc_getClass("NSWindowController");
+public static final int class_NSURLResponse = objc_getClass("NSURLResponse");
+public static final int class_NSFormatter = objc_getClass("NSFormatter");
+public static final int class_NSAssertionHandler = objc_getClass("NSAssertionHandler");
+public static final int class_NSPort = objc_getClass("NSPort");
+public static final int class_NSURLProtectionSpace = objc_getClass("NSURLProtectionSpace");
+public static final int class_NSPredicate = objc_getClass("NSPredicate");
+public static final int class_NSIndexSpecifier = objc_getClass("NSIndexSpecifier");
+public static final int class_NSPortMessage = objc_getClass("NSPortMessage");
+public static final int class_NSTypesetter = objc_getClass("NSTypesetter");
+public static final int class_NSCompoundPredicate = objc_getClass("NSCompoundPredicate");
+public static final int class_NSBundle = objc_getClass("NSBundle");
+public static final int class_NSSortDescriptor = objc_getClass("NSSortDescriptor");
+public static final int class_NSFontManager = objc_getClass("NSFontManager");
+public static final int class_NSProxy = objc_getClass("NSProxy");
+public static final int class_NSTextView = objc_getClass("NSTextView");
+public static final int class_NSMutableSet = objc_getClass("NSMutableSet");
+public static final int class_NSDatePickerCell = objc_getClass("NSDatePickerCell");
+public static final int class_NSStatusItem = objc_getClass("NSStatusItem");
+public static final int class_NSDirectoryEnumerator = objc_getClass("NSDirectoryEnumerator");
+public static final int class_NSPropertyListSerialization = objc_getClass("NSPropertyListSerialization");
+public static final int class_NSHost = objc_getClass("NSHost");
+public static final int class_NSPipe = objc_getClass("NSPipe");
+public static final int class_NSNibConnector = objc_getClass("NSNibConnector");
+public static final int class_NSDecimalNumber = objc_getClass("NSDecimalNumber");
+public static final int class_NSMenuView = objc_getClass("NSMenuView");
+public static final int class_NSMenuItem = objc_getClass("NSMenuItem");
+public static final int class_NSPICTImageRep = objc_getClass("NSPICTImageRep");
+public static final int class_NSPasteboard = objc_getClass("NSPasteboard");
+public static final int class_NSScriptExecutionContext = objc_getClass("NSScriptExecutionContext");
+public static final int class_NSNotificationQueue = objc_getClass("NSNotificationQueue");
+public static final int class_NSError = objc_getClass("NSError");
+public static final int class_NSNib = objc_getClass("NSNib");
+public static final int class_NSAppleEventManager = objc_getClass("NSAppleEventManager");
+public static final int class_NSCondition = objc_getClass("NSCondition");
+public static final int class_NSBrowser = objc_getClass("NSBrowser");
+public static final int class_NSDocumentController = objc_getClass("NSDocumentController");
+public static final int class_NSMethodSignature = objc_getClass("NSMethodSignature");
+public static final int class_NSTextList = objc_getClass("NSTextList");
+public static final int class_NSURLCredentialStorage = objc_getClass("NSURLCredentialStorage");
+public static final int class_NSEvent = objc_getClass("NSEvent");
+public static final int class_NSScreen = objc_getClass("NSScreen");
+public static final int class_NSMutableCharacterSet = objc_getClass("NSMutableCharacterSet");
+public static final int class_NSSecureTextFieldCell = objc_getClass("NSSecureTextFieldCell");
+public static final int class_NSOpenGLPixelFormat = objc_getClass("NSOpenGLPixelFormat");
+public static final int class_NSInputServer = objc_getClass("NSInputServer");
+public static final int class_NSNotification = objc_getClass("NSNotification");
+public static final int class_NSSpecifierTest = objc_getClass("NSSpecifierTest");
+public static final int class_NSCustomImageRep = objc_getClass("NSCustomImageRep");
+public static final int class_NSParagraphStyle = objc_getClass("NSParagraphStyle");
+public static final int class_NSTableView = objc_getClass("NSTableView");
+public static final int class_NSFileWrapper = objc_getClass("NSFileWrapper");
+public static final int class_NSNotificationCenter = objc_getClass("NSNotificationCenter");
+public static final int class_NSMutableString = objc_getClass("NSMutableString");
+public static final int class_NSFontPanel = objc_getClass("NSFontPanel");
+public static final int class_NSAppleEventDescriptor = objc_getClass("NSAppleEventDescriptor");
+public static final int class_NSConnection = objc_getClass("NSConnection");
+public static final int class_NSURLDownload = objc_getClass("NSURLDownload");
+public static final int class_NSKeyedUnarchiver = objc_getClass("NSKeyedUnarchiver");
+public static final int class_NSCountedSet = objc_getClass("NSCountedSet");
+public static final int class_NSSlider = objc_getClass("NSSlider");
+public static final int class_NSCharacterSet = objc_getClass("NSCharacterSet");
+public static final int class_NSDictionary = objc_getClass("NSDictionary");
+public static final int class_NSOpenGLContext = objc_getClass("NSOpenGLContext");
+public static final int class_NSCachedImageRep = objc_getClass("NSCachedImageRep");
+public static final int class_NSURL = objc_getClass("NSURL");
+public static final int class_NSInputStream = objc_getClass("NSInputStream");
+public static final int class_NSMutableURLRequest = objc_getClass("NSMutableURLRequest");
+public static final int class_NSURLConnection = objc_getClass("NSURLConnection");
+public static final int class_NSPersistentDocument = objc_getClass("NSPersistentDocument");
+public static final int class_NSClipView = objc_getClass("NSClipView");
+public static final int class_NSScriptSuiteRegistry = objc_getClass("NSScriptSuiteRegistry");
+public static final int class_NSStepper = objc_getClass("NSStepper");
+public static final int class_NSXMLNode = objc_getClass("NSXMLNode");
+public static final int class_NSHTTPCookie = objc_getClass("NSHTTPCookie");
+public static final int class_NSMetadataQueryResultGroup = objc_getClass("NSMetadataQueryResultGroup");
+public static final int class_NSURLCredential = objc_getClass("NSURLCredential");
+public static final int class_NSHashTable = objc_getClass("NSHashTable");
+public static final int class_NSColor = objc_getClass("NSColor");
+public static final int class_NSPathComponentCell = objc_getClass("NSPathComponentCell");
+public static final int class_NSToolbar = objc_getClass("NSToolbar");
+public static final int class_NSUndoManager = objc_getClass("NSUndoManager");
+public static final int class_NSNibControlConnector = objc_getClass("NSNibControlConnector");
+public static final int class_NSFontDescriptor = objc_getClass("NSFontDescriptor");
+public static final int class_NSSpellChecker = objc_getClass("NSSpellChecker");
+public static final int class_NSTableColumn = objc_getClass("NSTableColumn");
+public static final int class_NSSpellServer = objc_getClass("NSSpellServer");
+public static final int class_NSAutoreleasePool = objc_getClass("NSAutoreleasePool");
+public static final int class_NSUnarchiver = objc_getClass("NSUnarchiver");
+public static final int class_NSColorSpace = objc_getClass("NSColorSpace");
+public static final int class_NSQuickDrawView = objc_getClass("NSQuickDrawView");
+public static final int class_NSDrawer = objc_getClass("NSDrawer");
+public static final int class_NSFileHandle = objc_getClass("NSFileHandle");
+public static final int class_NSCalendarDate = objc_getClass("NSCalendarDate");
+public static final int class_NSThread = objc_getClass("NSThread");
+public static final int class_NSProtocolChecker = objc_getClass("NSProtocolChecker");
+public static final int class_NSDateComponents = objc_getClass("NSDateComponents");
+public static final int class_NSAnimationContext = objc_getClass("NSAnimationContext");
+public static final int class_NSURLRequest = objc_getClass("NSURLRequest");
+public static final int class_NSViewAnimation = objc_getClass("NSViewAnimation");
+public static final int class_NSScriptObjectSpecifier = objc_getClass("NSScriptObjectSpecifier");
+public static final int class_NSCell = objc_getClass("NSCell");
+public static final int class_NSTableHeaderCell = objc_getClass("NSTableHeaderCell");
+public static final int class_NSATSTypesetter = objc_getClass("NSATSTypesetter");
+public static final int class_NSNetService = objc_getClass("NSNetService");
+public static final int class_NSMutableParagraphStyle = objc_getClass("NSMutableParagraphStyle");
+public static final int class_NSButton = objc_getClass("NSButton");
+public static final int class_NSAnimation = objc_getClass("NSAnimation");
+public static final int class_NSText = objc_getClass("NSText");
+public static final int class_NSMapTable = objc_getClass("NSMapTable");
+public static final int class_NSDictionaryController = objc_getClass("NSDictionaryController");
+public static final int class_NSTrackingArea = objc_getClass("NSTrackingArea");
+public static final int class_NSURLProtocol = objc_getClass("NSURLProtocol");
+public static final int class_NSGlyphInfo = objc_getClass("NSGlyphInfo");
+public static final int class_NSSocketPortNameServer = objc_getClass("NSSocketPortNameServer");
+public static final int class_NSQuitCommand = objc_getClass("NSQuitCommand");
+public static final int class_NSDistributedNotificationCenter = objc_getClass("NSDistributedNotificationCenter");
+public static final int class_NSCloseCommand = objc_getClass("NSCloseCommand");
+public static final int class_NSPrintOperation = objc_getClass("NSPrintOperation");
+public static final int class_NSGraphicsContext = objc_getClass("NSGraphicsContext");
+public static final int class_NSNumber = objc_getClass("NSNumber");
+public static final int class_NSPortCoder = objc_getClass("NSPortCoder");
+public static final int class_NSTextTableBlock = objc_getClass("NSTextTableBlock");
+public static final int class_NSNibOutletConnector = objc_getClass("NSNibOutletConnector");
+public static final int class_NSLocale = objc_getClass("NSLocale");
+public static final int class_NSTableHeaderView = objc_getClass("NSTableHeaderView");
+public static final int class_NSScriptWhoseTest = objc_getClass("NSScriptWhoseTest");
+public static final int class_NSNetServiceBrowser = objc_getClass("NSNetServiceBrowser");
+public static final int class_NSConditionLock = objc_getClass("NSConditionLock");
+public static final int class_NSTimeZone = objc_getClass("NSTimeZone");
+public static final int class_NSComparisonPredicate = objc_getClass("NSComparisonPredicate");
+public static final int class_NSScriptCoercionHandler = objc_getClass("NSScriptCoercionHandler");
+public static final int class_NSFileManager = objc_getClass("NSFileManager");
+public static final int class_NSPredicateEditorRowTemplate = objc_getClass("NSPredicateEditorRowTemplate");
+public static final int class_NSString = objc_getClass("NSString");
+public static final int class_NSToolbarItem = objc_getClass("NSToolbarItem");
+public static final int class_NSPointerArray = objc_getClass("NSPointerArray");
+public static final int class_NSURLAuthenticationChallenge = objc_getClass("NSURLAuthenticationChallenge");
+public static final int class_NSStatusBar = objc_getClass("NSStatusBar");
+public static final int class_NSTextField = objc_getClass("NSTextField");
+public static final int class_NSOutputStream = objc_getClass("NSOutputStream");
+public static final int class_NSComboBoxCell = objc_getClass("NSComboBoxCell");
+public static final int class_NSXMLDTDNode = objc_getClass("NSXMLDTDNode");
+public static final int class_NSMessagePortNameServer = objc_getClass("NSMessagePortNameServer");
+public static final int class_NSHTTPCookieStorage = objc_getClass("NSHTTPCookieStorage");
+public static final int class_NSActionCell = objc_getClass("NSActionCell");
+public static final int class_NSXMLDocument = objc_getClass("NSXMLDocument");
+public static final int class_NSBitmapImageRep = objc_getClass("NSBitmapImageRep");
+public static final int class_NSHTTPURLResponse = objc_getClass("NSHTTPURLResponse");
+public static final int class_NSImage = objc_getClass("NSImage");
+public static final int class_NSIndexSet = objc_getClass("NSIndexSet");
+public static final int class_NSRangeSpecifier = objc_getClass("NSRangeSpecifier");
+public static final int class_NSGlyphGenerator = objc_getClass("NSGlyphGenerator");
+public static final int class_NSFormCell = objc_getClass("NSFormCell");
+public static final int class_NSScroller = objc_getClass("NSScroller");
+public static final int class_NSMetadataItem = objc_getClass("NSMetadataItem");
+public static final int class_NSStream = objc_getClass("NSStream");
+public static final int class_NSClassDescription = objc_getClass("NSClassDescription");
+public static final int class_NSMutableIndexSet = objc_getClass("NSMutableIndexSet");
+public static final int class_NSView = objc_getClass("NSView");
+public static final int class_NSUserDefaults = objc_getClass("NSUserDefaults");
+public static final int class_NSSetCommand = objc_getClass("NSSetCommand");
+public static final int class_NSPathCell = objc_getClass("NSPathCell");
+public static final int class_NSMoveCommand = objc_getClass("NSMoveCommand");
+public static final int class_NSSplitView = objc_getClass("NSSplitView");
+public static final int class_NSTextBlock = objc_getClass("NSTextBlock");
+public static final int class_NSTabViewItem = objc_getClass("NSTabViewItem");
+public static final int class_NSCollectionViewItem = objc_getClass("NSCollectionViewItem");
+public static final int class_NSValue = objc_getClass("NSValue");
+public static final int class_NSHelpManager = objc_getClass("NSHelpManager");
+public static final int class_NSEnumerator = objc_getClass("NSEnumerator");
+public static final int class_NSDistantObject = objc_getClass("NSDistantObject");
+public static final int class_NSGarbageCollector = objc_getClass("NSGarbageCollector");
+public static final int class_NSXMLParser = objc_getClass("NSXMLParser");
+public static final int class_NSFont = objc_getClass("NSFont");
+public static final int class_NSAlert = objc_getClass("NSAlert");
+public static final int class_NSUniqueIDSpecifier = objc_getClass("NSUniqueIDSpecifier");
+public static final int class_NSOutlineView = objc_getClass("NSOutlineView");
+public static final int class_NSProgressIndicator = objc_getClass("NSProgressIndicator");
+public static final int class_NSController = objc_getClass("NSController");
+public static final int class_NSComboBox = objc_getClass("NSComboBox");
+public static final int class_NSArrayController = objc_getClass("NSArrayController");
+public static final int class_NSKeyedArchiver = objc_getClass("NSKeyedArchiver");
+public static final int class_NSDecimalNumberHandler = objc_getClass("NSDecimalNumberHandler");
+public static final int class_NSObject = objc_getClass("NSObject");
+public static final int class_NSNameSpecifier = objc_getClass("NSNameSpecifier");
+public static final int class_NSUserDefaultsController = objc_getClass("NSUserDefaultsController");
+public static final int class_NSLevelIndicator = objc_getClass("NSLevelIndicator");
+public static final int class_NSDistributedLock = objc_getClass("NSDistributedLock");
+public static final int class_NSTokenFieldCell = objc_getClass("NSTokenFieldCell");
+public static final int class_NSSet = objc_getClass("NSSet");
+public static final int class_NSMutableData = objc_getClass("NSMutableData");
+public static final int class_NSArray = objc_getClass("NSArray");
+public static final int class_NSExpression = objc_getClass("NSExpression");
+public static final int class_NSMenuItemCell = objc_getClass("NSMenuItemCell");
+public static final int class_NSColorPicker = objc_getClass("NSColorPicker");
+public static final int class_NSForm = objc_getClass("NSForm");
+public static final int class_NSApplication = objc_getClass("NSApplication");
+public static final int class_NSInputManager = objc_getClass("NSInputManager");
+public static final int class_NSPointerFunctions = objc_getClass("NSPointerFunctions");
+public static final int class_NSRecursiveLock = objc_getClass("NSRecursiveLock");
+public static final int class_NSBox = objc_getClass("NSBox");
+public static final int class_NSDockTile = objc_getClass("NSDockTile");
+public static final int class_NSTextAttachment = objc_getClass("NSTextAttachment");
+public static final int class_NSIndexPath = objc_getClass("NSIndexPath");
+public static final int class_NSEPSImageRep = objc_getClass("NSEPSImageRep");
+public static final int class_NSBrowserCell = objc_getClass("NSBrowserCell");
+public static final int class_NSValueTransformer = objc_getClass("NSValueTransformer");
+public static final int class_CIImage = objc_getClass("CIImage");
+public static final int class_NSMovie = objc_getClass("NSMovie");
+public static final int class_NSTimer = objc_getClass("NSTimer");
+public static final int class_NSMachPort = objc_getClass("NSMachPort");
+public static final int class_NSCreateCommand = objc_getClass("NSCreateCommand");
+public static final int class_NSPortNameServer = objc_getClass("NSPortNameServer");
+public static final int class_NSRulerMarker = objc_getClass("NSRulerMarker");
+public static final int class_NSImageRep = objc_getClass("NSImageRep");
+public static final int class_NSWindow = objc_getClass("NSWindow");
+public static final int class_NSColorWell = objc_getClass("NSColorWell");
+public static final int class_NSSound = objc_getClass("NSSound");
+public static final int class_NSToolbarItemGroup = objc_getClass("NSToolbarItemGroup");
+public static final int class_NSRulerView = objc_getClass("NSRulerView");
+public static final int class_NSWorkspace = objc_getClass("NSWorkspace");
+public static final int class_NSSearchFieldCell = objc_getClass("NSSearchFieldCell");
+public static final int class_NSMutableArray = objc_getClass("NSMutableArray");
+public static final int class_NSRuleEditor = objc_getClass("NSRuleEditor");
+public static final int class_NSScriptCommandDescription = objc_getClass("NSScriptCommandDescription");
+public static final int class_NSViewController = objc_getClass("NSViewController");
+public static final int class_NSPredicateEditor = objc_getClass("NSPredicateEditor");
+public static final int class_NSCloneCommand = objc_getClass("NSCloneCommand");
+public static final int class_NSOpenGLView = objc_getClass("NSOpenGLView");
+public static final int class_NSCursor = objc_getClass("NSCursor");
+public static final int class_NSSearchField = objc_getClass("NSSearchField");
+public static final int class_NSXMLDTD = objc_getClass("NSXMLDTD");
+public static final int class_NSSocketPort = objc_getClass("NSSocketPort");
+public static final int class_NSObjectController = objc_getClass("NSObjectController");
+public static final int class_NSScriptCommand = objc_getClass("NSScriptCommand");
+public static final int class_NSShadow = objc_getClass("NSShadow");
+public static final int class_NSScrollView = objc_getClass("NSScrollView");
+public static final int class_NSPrintPanel = objc_getClass("NSPrintPanel");
+public static final int class_NSURLHandle = objc_getClass("NSURLHandle");
+public static final int class_NSOperation = objc_getClass("NSOperation");
+public static final int class_NSMutableDictionary = objc_getClass("NSMutableDictionary");
+public static final int class_NSException = objc_getClass("NSException");
+public static final int class_NSButtonCell = objc_getClass("NSButtonCell");
+public static final int class_NSTask = objc_getClass("NSTask");
+public static final int class_NSArchiver = objc_getClass("NSArchiver");
+public static final int class_NSDateFormatter = objc_getClass("NSDateFormatter");
+public static final int class_NSCalendar = objc_getClass("NSCalendar");
+public static final int class_NSTokenField = objc_getClass("NSTokenField");
+public static final int class_NSCollectionView = objc_getClass("NSCollectionView");
+public static final int class_NSColorList = objc_getClass("NSColorList");
+
+/** Selectors */
+public static final int sel_inputClientEnabled_1 = sel_registerName("inputClientEnabled:");
+public static final int sel_setVerticalPagination_1 = sel_registerName("setVerticalPagination:");
+public static final int sel_isEqualToHost_1 = sel_registerName("isEqualToHost:");
+public static final int sel_compare_1 = sel_registerName("compare:");
+public static final int sel_printPanel = sel_registerName("printPanel");
+public static final int sel_unregisterImageRepClass_1 = sel_registerName("unregisterImageRepClass:");
+public static final int sel_dataWithLength_1 = sel_registerName("dataWithLength:");
+public static final int sel_dismissPopUp = sel_registerName("dismissPopUp");
+public static final int sel_substituteFontForFont_1 = sel_registerName("substituteFontForFont:");
+public static final int sel_sendAction_1to_1 = sel_registerName("sendAction:to:");
+public static final int sel_rangeOfCharacterFromSet_1options_1range_1 = sel_registerName("rangeOfCharacterFromSet:options:range:");
+public static final int sel_autoupdatingCurrentCalendar = sel_registerName("autoupdatingCurrentCalendar");
+public static final int sel_nextDaylightSavingTimeTransitionAfterDate_1 = sel_registerName("nextDaylightSavingTimeTransitionAfterDate:");
+public static final int sel_attachmentSizeForGlyphAtIndex_1 = sel_registerName("attachmentSizeForGlyphAtIndex:");
+public static final int sel_shouldCollapseAutoExpandedItemsForDeposited_1 = sel_registerName("shouldCollapseAutoExpandedItemsForDeposited:");
+public static final int sel_decimalNumberByRoundingAccordingToBehavior_1 = sel_registerName("decimalNumberByRoundingAccordingToBehavior:");
+public static final int sel_scanHexFloat_1 = sel_registerName("scanHexFloat:");
+public static final int sel_rangesForUserTextChange = sel_registerName("rangesForUserTextChange");
+public static final int sel_indexOfItemWithObjectValue_1 = sel_registerName("indexOfItemWithObjectValue:");
+public static final int sel_sendsSearchStringImmediately = sel_registerName("sendsSearchStringImmediately");
+public static final int sel_isTransparent = sel_registerName("isTransparent");
+public static final int sel_widthOfColumn_1 = sel_registerName("widthOfColumn:");
+public static final int sel_calendarFormat = sel_registerName("calendarFormat");
+public static final int sel_lineBreakByHyphenatingBeforeIndex_1withinRange_1 = sel_registerName("lineBreakByHyphenatingBeforeIndex:withinRange:");
+public static final int sel_parentNode = sel_registerName("parentNode");
+public static final int sel_setDrawsOutsideLineFragment_1forGlyphRange_1 = sel_registerName("setDrawsOutsideLineFragment:forGlyphRange:");
+public static final int sel_negativeSuffix = sel_registerName("negativeSuffix");
+public static final int sel_setFlatness_1 = sel_registerName("setFlatness:");
+public static final int sel_ignoresAlpha = sel_registerName("ignoresAlpha");
+public static final int sel_setValue_1type_1forDimension_1 = sel_registerName("setValue:type:forDimension:");
+public static final int sel_setLayer_1 = sel_registerName("setLayer:");
+public static final int sel_setActionName_1 = sel_registerName("setActionName:");
+public static final int sel_setIcon_1 = sel_registerName("setIcon:");
+public static final int sel_tokenFieldCell_1readFromPasteboard_1 = sel_registerName("tokenFieldCell:readFromPasteboard:");
+public static final int sel_setPropertyList_1forType_1 = sel_registerName("setPropertyList:forType:");
+public static final int sel_endModalSession_1 = sel_registerName("endModalSession:");
+public static final int sel_sharedColorPanel = sel_registerName("sharedColorPanel");
+public static final int sel_contentSizeForFrameSize_1hasHorizontalScroller_1hasVerticalScroller_1borderType_1 = sel_registerName("contentSizeForFrameSize:hasHorizontalScroller:hasVerticalScroller:borderType:");
+public static final int sel_layoutRectForTextBlock_1glyphRange_1 = sel_registerName("layoutRectForTextBlock:glyphRange:");
+public static final int sel_scrollRowToVisible_1 = sel_registerName("scrollRowToVisible:");
+public static final int sel_attributedStringForZero = sel_registerName("attributedStringForZero");
+public static final int sel_showsInvisibleCharacters = sel_registerName("showsInvisibleCharacters");
+public static final int sel_adjustPageWidthNew_1left_1right_1limit_1 = sel_registerName("adjustPageWidthNew:left:right:limit:");
+public static final int sel_client = sel_registerName("client");
+public static final int sel_initWithKey_1ascending_1selector_1 = sel_registerName("initWithKey:ascending:selector:");
+public static final int sel_completedString_1 = sel_registerName("completedString:");
+public static final int sel_bundleForClass_1 = sel_registerName("bundleForClass:");
+public static final int sel_pathControl_1acceptDrop_1 = sel_registerName("pathControl:acceptDrop:");
+public static final int sel_imageRepsWithPasteboard_1 = sel_registerName("imageRepsWithPasteboard:");
+public static final int sel_toolTipForSegment_1 = sel_registerName("toolTipForSegment:");
+public static final int sel_suspended = sel_registerName("suspended");
+public static final int sel_encodeDouble_1forKey_1 = sel_registerName("encodeDouble:forKey:");
+public static final int sel_setNextState = sel_registerName("setNextState");
+public static final int sel_ignoreWord_1inSpellDocumentWithTag_1 = sel_registerName("ignoreWord:inSpellDocumentWithTag:");
+public static final int sel_stopMonitoring = sel_registerName("stopMonitoring");
+public static final int sel_initWithTitle_1action_1keyEquivalent_1 = sel_registerName("initWithTitle:action:keyEquivalent:");
+public static final int sel_setDropRow_1dropOperation_1 = sel_registerName("setDropRow:dropOperation:");
+public static final int sel_contentView = sel_registerName("contentView");
+public static final int sel_setNilSymbol_1 = sel_registerName("setNilSymbol:");
+public static final int sel_removePropertyForKey_1inRequest_1 = sel_registerName("removePropertyForKey:inRequest:");
+public static final int sel_setMarkerLocation_1 = sel_registerName("setMarkerLocation:");
+public static final int sel_resolvedKeyDictionary = sel_registerName("resolvedKeyDictionary");
+public static final int sel_enumeratorAtPath_1 = sel_registerName("enumeratorAtPath:");
+public static final int sel_decodeObjectForKey_1 = sel_registerName("decodeObjectForKey:");
+public static final int sel_loadInForeground = sel_registerName("loadInForeground");
+public static final int sel_baseSpecifier = sel_registerName("baseSpecifier");
+public static final int sel_isMemberOfClass_1 = sel_registerName("isMemberOfClass:");
+public static final int sel_setMaxVisibleColumns_1 = sel_registerName("setMaxVisibleColumns:");
+public static final int sel_unmountAndEjectDeviceAtPath_1 = sel_registerName("unmountAndEjectDeviceAtPath:");
+public static final int sel_openTempFile_1 = sel_registerName("openTempFile:");
+public static final int sel_isRowSelected_1 = sel_registerName("isRowSelected:");
+public static final int sel_insertItemWithItemIdentifier_1atIndex_1 = sel_registerName("insertItemWithItemIdentifier:atIndex:");
+public static final int sel_parserDidEndDocument_1 = sel_registerName("parserDidEndDocument:");
+public static final int sel_reverseTransformedValue_1 = sel_registerName("reverseTransformedValue:");
+public static final int sel_setTimeStyle_1 = sel_registerName("setTimeStyle:");
+public static final int sel_initWithContentsOfFile_1usedEncoding_1error_1 = sel_registerName("initWithContentsOfFile:usedEncoding:error:");
+public static final int sel_endGrouping = sel_registerName("endGrouping");
+public static final int sel_initWithProxyHost_1port_1type_1realm_1authenticationMethod_1 = sel_registerName("initWithProxyHost:port:type:realm:authenticationMethod:");
+public static final int sel_tableView_1dataCellForTableColumn_1row_1 = sel_registerName("tableView:dataCellForTableColumn:row:");
+public static final int sel_convertPoint_1toView_1 = sel_registerName("convertPoint:toView:");
+public static final int sel_setFrame_1display_1animate_1 = sel_registerName("setFrame:display:animate:");
+public static final int sel_exceptionDuringOperation_1error_1leftOperand_1rightOperand_1 = sel_registerName("exceptionDuringOperation:error:leftOperand:rightOperand:");
+public static final int sel_applicationOpenUntitledFile_1 = sel_registerName("applicationOpenUntitledFile:");
+public static final int sel_initWithRootElement_1 = sel_registerName("initWithRootElement:");
+public static final int sel_setHorizontalScroller_1 = sel_registerName("setHorizontalScroller:");
+public static final int sel_finalWritePrintInfo = sel_registerName("finalWritePrintInfo");
+public static final int sel_addItemWithTitle_1 = sel_registerName("addItemWithTitle:");
+public static final int sel_setColor_1 = sel_registerName("setColor:");
+public static final int sel_isHostCacheEnabled = sel_registerName("isHostCacheEnabled");
+public static final int sel_controlTextDidChange_1 = sel_registerName("controlTextDidChange:");
+public static final int sel_headerLevel = sel_registerName("headerLevel");
+public static final int sel_loadInBackground = sel_registerName("loadInBackground");
+public static final int sel_setNeedsDisplayForItemAtIndex_1 = sel_registerName("setNeedsDisplayForItemAtIndex:");
+public static final int sel_setCellPrototype_1 = sel_registerName("setCellPrototype:");
+public static final int sel_enqueueNotification_1postingStyle_1coalesceMask_1forModes_1 = sel_registerName("enqueueNotification:postingStyle:coalesceMask:forModes:");
+public static final int sel_minColumnWidth = sel_registerName("minColumnWidth");
+public static final int sel_tableView_1shouldTypeSelectForEvent_1withCurrentSearchString_1 = sel_registerName("tableView:shouldTypeSelectForEvent:withCurrentSearchString:");
+public static final int sel_validateValue_1forKey_1error_1 = sel_registerName("validateValue:forKey:error:");
+public static final int sel_canBeConvertedToEncoding_1 = sel_registerName("canBeConvertedToEncoding:");
+public static final int sel_numberOfItems = sel_registerName("numberOfItems");
+public static final int sel_bestRepresentationForDevice_1 = sel_registerName("bestRepresentationForDevice:");
+public static final int sel_setBorderColor_1forEdge_1 = sel_registerName("setBorderColor:forEdge:");
+public static final int sel_setHorizontalLineScroll_1 = sel_registerName("setHorizontalLineScroll:");
+public static final int sel_sharedHTTPCookieStorage = sel_registerName("sharedHTTPCookieStorage");
+public static final int sel_cachesBezierPath = sel_registerName("cachesBezierPath");
+public static final int sel_strokeLineFromPoint_1toPoint_1 = sel_registerName("strokeLineFromPoint:toPoint:");
+public static final int sel_preferredBackingLocation = sel_registerName("preferredBackingLocation");
+public static final int sel_removeRowAtIndex_1 = sel_registerName("removeRowAtIndex:");
+public static final int sel_setCurrentTime_1 = sel_registerName("setCurrentTime:");
+public static final int sel_string = sel_registerName("string");
+public static final int sel_hasVerticalScroller = sel_registerName("hasVerticalScroller");
+public static final int sel_initWithTimeInterval_1sinceDate_1 = sel_registerName("initWithTimeInterval:sinceDate:");
+public static final int sel_showsProgressPanel = sel_registerName("showsProgressPanel");
+public static final int sel_setDirectParameter_1 = sel_registerName("setDirectParameter:");
+public static final int sel_storeCachedResponse_1forRequest_1 = sel_registerName("storeCachedResponse:forRequest:");
+public static final int sel_textUnfilteredPasteboardTypes = sel_registerName("textUnfilteredPasteboardTypes");
+public static final int sel_isDragging = sel_registerName("isDragging");
+public static final int sel_tableView_1shouldTrackCell_1forTableColumn_1row_1 = sel_registerName("tableView:shouldTrackCell:forTableColumn:row:");
+public static final int sel_dictionaryRepresentation = sel_registerName("dictionaryRepresentation");
+public static final int sel_attributesForExtraLineFragment = sel_registerName("attributesForExtraLineFragment");
+public static final int sel_getCharacters_1range_1 = sel_registerName("getCharacters:range:");
+public static final int sel_nibName = sel_registerName("nibName");
+public static final int sel_initWithURL_1options_1documentAttributes_1error_1 = sel_registerName("initWithURL:options:documentAttributes:error:");
+public static final int sel_initWithFrame_1mode_1cellClass_1numberOfRows_1numberOfColumns_1 = sel_registerName("initWithFrame:mode:cellClass:numberOfRows:numberOfColumns:");
+public static final int sel_reflectScrolledClipView_1 = sel_registerName("reflectScrolledClipView:");
+public static final int sel_stringWithContentsOfURL_1usedEncoding_1error_1 = sel_registerName("stringWithContentsOfURL:usedEncoding:error:");
+public static final int sel_displayIfNeededIgnoringOpacity = sel_registerName("displayIfNeededIgnoringOpacity");
+public static final int sel_archiverWillFinish_1 = sel_registerName("archiverWillFinish:");
+public static final int sel_initWithOptions_1 = sel_registerName("initWithOptions:");
+public static final int sel_ruleEditor_1numberOfChildrenForCriterion_1withRowType_1 = sel_registerName("ruleEditor:numberOfChildrenForCriterion:withRowType:");
+public static final int sel_removeColorWithKey_1 = sel_registerName("removeColorWithKey:");
+public static final int sel_setObjectValue_1 = sel_registerName("setObjectValue:");
+public static final int sel_graphicsContextWithGraphicsPort_1flipped_1 = sel_registerName("graphicsContextWithGraphicsPort:flipped:");
+public static final int sel_setMarkedText_1selectedRange_1replacementRange_1 = sel_registerName("setMarkedText:selectedRange:replacementRange:");
+public static final int sel_outlineView_1numberOfChildrenOfItem_1 = sel_registerName("outlineView:numberOfChildrenOfItem:");
+public static final int sel_cellFrameAtRow_1column_1 = sel_registerName("cellFrameAtRow:column:");
+public static final int sel_blueColor = sel_registerName("blueColor");
+public static final int sel_selectedTextBackgroundColor = sel_registerName("selectedTextBackgroundColor");
+public static final int sel_initWithFormat_1locale_1 = sel_registerName("initWithFormat:locale:");
+public static final int sel_propertyListForType_1 = sel_registerName("propertyListForType:");
+public static final int sel_setConfigurationFromDictionary_1 = sel_registerName("setConfigurationFromDictionary:");
+public static final int sel_registerClassDescription_1forClass_1 = sel_registerName("registerClassDescription:forClass:");
+public static final int sel_removeAllItems = sel_registerName("removeAllItems");
+public static final int sel_setFontPanelFactory_1 = sel_registerName("setFontPanelFactory:");
+public static final int sel_didChangeValueForKey_1withSetMutation_1usingObjects_1 = sel_registerName("didChangeValueForKey:withSetMutation:usingObjects:");
+public static final int sel_CGEvent = sel_registerName("CGEvent");
+public static final int sel_disable = sel_registerName("disable");
+public static final int sel_setColumnAutoresizingStyle_1 = sel_registerName("setColumnAutoresizingStyle:");
+public static final int sel_absoluteZ = sel_registerName("absoluteZ");
+public static final int sel_intForKey_1inTable_1 = sel_registerName("intForKey:inTable:");
+public static final int sel_minFrameWidthWithTitle_1styleMask_1 = sel_registerName("minFrameWidthWithTitle:styleMask:");
+public static final int sel_highlightColor = sel_registerName("highlightColor");
+public static final int sel_setRoundingMode_1 = sel_registerName("setRoundingMode:");
+public static final int sel_didChangeValueForKey_1 = sel_registerName("didChangeValueForKey:");
+public static final int sel_setMenuZone_1 = sel_registerName("setMenuZone:");
+public static final int sel_updateFromPrintInfo = sel_registerName("updateFromPrintInfo");
+public static final int sel_setSelectedItemIdentifier_1 = sel_registerName("setSelectedItemIdentifier:");
+public static final int sel_setReplyTimeout_1 = sel_registerName("setReplyTimeout:");
+public static final int sel_showsFirstResponder = sel_registerName("showsFirstResponder");
+public static final int sel_loadNibNamed_1owner_1 = sel_registerName("loadNibNamed:owner:");
+public static final int sel_setDocument_1 = sel_registerName("setDocument:");
+public static final int sel_filePosixPermissions = sel_registerName("filePosixPermissions");
+public static final int sel_collapseItem_1collapseChildren_1 = sel_registerName("collapseItem:collapseChildren:");
+public static final int sel_setCell_1 = sel_registerName("setCell:");
+public static final int sel_setHTTPBodyStream_1 = sel_registerName("setHTTPBodyStream:");
+public static final int sel_updateAttachmentsFromPath_1 = sel_registerName("updateAttachmentsFromPath:");
+public static final int sel_updateFontPanel = sel_registerName("updateFontPanel");
+public static final int sel_animationDidStop_1 = sel_registerName("animationDidStop:");
+public static final int sel_URL_1resourceDidFailLoadingWithReason_1 = sel_registerName("URL:resourceDidFailLoadingWithReason:");
+public static final int sel_defaultBaselineOffsetForFont_1 = sel_registerName("defaultBaselineOffsetForFont:");
+public static final int sel_browser_1shouldShowCellExpansionForRow_1column_1 = sel_registerName("browser:shouldShowCellExpansionForRow:column:");
+public static final int sel_draggingEnded_1 = sel_registerName("draggingEnded:");
+public static final int sel_openURL_1 = sel_registerName("openURL:");
+public static final int sel_longLongValue = sel_registerName("longLongValue");
+public static final int sel_colorPanel = sel_registerName("colorPanel");
+public static final int sel_encodeFloat_1forKey_1 = sel_registerName("encodeFloat:forKey:");
+public static final int sel_shouldBreakLineByHyphenatingBeforeCharacterAtIndex_1 = sel_registerName("shouldBreakLineByHyphenatingBeforeCharacterAtIndex:");
+public static final int sel_performSelectorInBackground_1withObject_1 = sel_registerName("performSelectorInBackground:withObject:");
+public static final int sel_initTextCell_1 = sel_registerName("initTextCell:");
+public static final int sel_classDescription = sel_registerName("classDescription");
+public static final int sel_menuFontOfSize_1 = sel_registerName("menuFontOfSize:");
+public static final int sel_window_1willPositionSheet_1usingRect_1 = sel_registerName("window:willPositionSheet:usingRect:");
+public static final int sel_allowsTypeSelect = sel_registerName("allowsTypeSelect");
+public static final int sel_attributeWithName_1URI_1stringValue_1 = sel_registerName("attributeWithName:URI:stringValue:");
+public static final int sel_setLinkTextAttributes_1 = sel_registerName("setLinkTextAttributes:");
+public static final int sel_stringWithFormat_1 = sel_registerName("stringWithFormat:");
+public static final int sel_initWithTable_1startingRow_1rowSpan_1startingColumn_1columnSpan_1 = sel_registerName("initWithTable:startingRow:rowSpan:startingColumn:columnSpan:");
+public static final int sel_setShouldProcessNamespaces_1 = sel_registerName("setShouldProcessNamespaces:");
+public static final int sel_orderFrontRegardless = sel_registerName("orderFrontRegardless");
+public static final int sel_setProtocolForProxy_1 = sel_registerName("setProtocolForProxy:");
+public static final int sel_bundlePath = sel_registerName("bundlePath");
+public static final int sel_isAutoscroll = sel_registerName("isAutoscroll");
+public static final int sel_addConnection_1toRunLoop_1forMode_1 = sel_registerName("addConnection:toRunLoop:forMode:");
+public static final int sel_moveWordBackwardAndModifySelection_1 = sel_registerName("moveWordBackwardAndModifySelection:");
+public static final int sel_textContainerChangedGeometry_1 = sel_registerName("textContainerChangedGeometry:");
+public static final int sel_conversation = sel_registerName("conversation");
+public static final int sel_showWindow_1 = sel_registerName("showWindow:");
+public static final int sel_showGuessPanel_1 = sel_registerName("showGuessPanel:");
+public static final int sel_setBorderWidth_1 = sel_registerName("setBorderWidth:");
+public static final int sel_buttons = sel_registerName("buttons");
+public static final int sel_bitmapRepresentation = sel_registerName("bitmapRepresentation");
+public static final int sel_nextObject = sel_registerName("nextObject");
+public static final int sel_predicate = sel_registerName("predicate");
+public static final int sel_verticalPagination = sel_registerName("verticalPagination");
+public static final int sel_readInBackgroundAndNotify = sel_registerName("readInBackgroundAndNotify");
+public static final int sel_pixelBufferMipMapLevel = sel_registerName("pixelBufferMipMapLevel");
+public static final int sel_getValue_1 = sel_registerName("getValue:");
+public static final int sel_eventID = sel_registerName("eventID");
+public static final int sel_sortDescriptors = sel_registerName("sortDescriptors");
+public static final int sel_removeObjectAtArrangedObjectIndexPath_1 = sel_registerName("removeObjectAtArrangedObjectIndexPath:");
+public static final int sel_decodeBytesWithReturnedLength_1 = sel_registerName("decodeBytesWithReturnedLength:");
+public static final int sel_textView_1shouldChangeTextInRange_1replacementString_1 = sel_registerName("textView:shouldChangeTextInRange:replacementString:");
+public static final int sel_removeCursorRect_1cursor_1 = sel_registerName("removeCursorRect:cursor:");
+public static final int sel_hasPassword = sel_registerName("hasPassword");
+public static final int sel_updateWindows = sel_registerName("updateWindows");
+public static final int sel_pasteboardWithName_1 = sel_registerName("pasteboardWithName:");
+public static final int sel_writeSelectionToPasteboard_1types_1 = sel_registerName("writeSelectionToPasteboard:types:");
+public static final int sel_setFlipped_1 = sel_registerName("setFlipped:");
+public static final int sel_glyphWithName_1 = sel_registerName("glyphWithName:");
+public static final int sel_launchApplication_1showIcon_1autolaunch_1 = sel_registerName("launchApplication:showIcon:autolaunch:");
+public static final int sel_indexPath = sel_registerName("indexPath");
+public static final int sel_setAttributeDescriptor_1forKeyword_1 = sel_registerName("setAttributeDescriptor:forKeyword:");
+public static final int sel_removeAllActions = sel_registerName("removeAllActions");
+public static final int sel_defaultAttachmentScaling = sel_registerName("defaultAttachmentScaling");
+public static final int sel_localizedStringWithFormat_1 = sel_registerName("localizedStringWithFormat:");
+public static final int sel_setAutoscroll_1 = sel_registerName("setAutoscroll:");
+public static final int sel_heightAdjustLimit = sel_registerName("heightAdjustLimit");
+public static final int sel_moveUpAndModifySelection_1 = sel_registerName("moveUpAndModifySelection:");
+public static final int sel_visibilityPriority = sel_registerName("visibilityPriority");
+public static final int sel_textView_1clickedOnCell_1inRect_1atIndex_1 = sel_registerName("textView:clickedOnCell:inRect:atIndex:");
+public static final int sel_archivedDataWithRootObject_1 = sel_registerName("archivedDataWithRootObject:");
+public static final int sel_parser_1foundCDATA_1 = sel_registerName("parser:foundCDATA:");
+public static final int sel_setWidth_1ofColumn_1 = sel_registerName("setWidth:ofColumn:");
+public static final int sel_setHighlightedTableColumn_1 = sel_registerName("setHighlightedTableColumn:");
+public static final int sel_toggle_1 = sel_registerName("toggle:");
+public static final int sel_parent = sel_registerName("parent");
+public static final int sel_tableView_1shouldSelectRow_1 = sel_registerName("tableView:shouldSelectRow:");
+public static final int sel_setWithObject_1 = sel_registerName("setWithObject:");
+public static final int sel_attribute_1atIndex_1effectiveRange_1 = sel_registerName("attribute:atIndex:effectiveRange:");
+public static final int sel_columnsInRect_1 = sel_registerName("columnsInRect:");
+public static final int sel_setSearchScopes_1 = sel_registerName("setSearchScopes:");
+public static final int sel_setByAddingObjectsFromArray_1 = sel_registerName("setByAddingObjectsFromArray:");
+public static final int sel_textViewDidChangeTypingAttributes_1 = sel_registerName("textViewDidChangeTypingAttributes:");
+public static final int sel_frameRate = sel_registerName("frameRate");
+public static final int sel_browser_1writeRowsWithIndexes_1inColumn_1toPasteboard_1 = sel_registerName("browser:writeRowsWithIndexes:inColumn:toPasteboard:");
+public static final int sel_errorWithDomain_1code_1userInfo_1 = sel_registerName("errorWithDomain:code:userInfo:");
+public static final int sel_setAlternate_1 = sel_registerName("setAlternate:");
+public static final int sel_currentValue = sel_registerName("currentValue");
+public static final int sel_download_1decideDestinationWithSuggestedFilename_1 = sel_registerName("download:decideDestinationWithSuggestedFilename:");
+public static final int sel_setBoxType_1 = sel_registerName("setBoxType:");
+public static final int sel_fileNamesFromRunningOpenPanel = sel_registerName("fileNamesFromRunningOpenPanel");
+public static final int sel_valueWithPointer_1 = sel_registerName("valueWithPointer:");
+public static final int sel_metadataQuery_1replacementObjectForResultObject_1 = sel_registerName("metadataQuery:replacementObjectForResultObject:");
+public static final int sel_editedColumn = sel_registerName("editedColumn");
+public static final int sel_cachedResponseForRequest_1 = sel_registerName("cachedResponseForRequest:");
+public static final int sel_failureReason = sel_registerName("failureReason");
+public static final int sel_constantValue = sel_registerName("constantValue");
+public static final int sel_commandClassName = sel_registerName("commandClassName");
+public static final int sel_fileWrapper = sel_registerName("fileWrapper");
+public static final int sel_setUsesUserKeyEquivalents_1 = sel_registerName("setUsesUserKeyEquivalents:");
+public static final int sel_prototype = sel_registerName("prototype");
+public static final int sel_clearStartAnimation = sel_registerName("clearStartAnimation");
+public static final int sel_setMovableByWindowBackground_1 = sel_registerName("setMovableByWindowBackground:");
+public static final int sel_setDateFormat_1 = sel_registerName("setDateFormat:");
+public static final int sel_stringWithContentsOfFile_1usedEncoding_1error_1 = sel_registerName("stringWithContentsOfFile:usedEncoding:error:");
+public static final int sel_toggleAutomaticLinkDetection_1 = sel_registerName("toggleAutomaticLinkDetection:");
+public static final int sel_statusForTable_1 = sel_registerName("statusForTable:");
+public static final int sel_setAllowsColumnSelection_1 = sel_registerName("setAllowsColumnSelection:");
+public static final int sel_lowercaseWord_1 = sel_registerName("lowercaseWord:");
+public static final int sel_setResolvesAliases_1 = sel_registerName("setResolvesAliases:");
+public static final int sel_appendFormat_1 = sel_registerName("appendFormat:");
+public static final int sel_isAnimating = sel_registerName("isAnimating");
+public static final int sel_dateFormat = sel_registerName("dateFormat");
+public static final int sel_setMuted_1 = sel_registerName("setMuted:");
+public static final int sel_drawWithExpansionFrame_1inView_1 = sel_registerName("drawWithExpansionFrame:inView:");
+public static final int sel_copyPath_1toPath_1handler_1 = sel_registerName("copyPath:toPath:handler:");
+public static final int sel_isExplicitlyIncluded = sel_registerName("isExplicitlyIncluded");
+public static final int sel_isExtensionHidden = sel_registerName("isExtensionHidden");
+public static final int sel_showPackedGlyphs_1length_1glyphRange_1atPoint_1font_1color_1printingAdjustment_1 = sel_registerName("showPackedGlyphs:length:glyphRange:atPoint:font:color:printingAdjustment:");
+public static final int sel_rulerView_1didRemoveMarker_1 = sel_registerName("rulerView:didRemoveMarker:");
+public static final int sel_setControlTint_1 = sel_registerName("setControlTint:");
+public static final int sel_isSelectable = sel_registerName("isSelectable");
+public static final int sel_initWithMachPort_1 = sel_registerName("initWithMachPort:");
+public static final int sel_fill = sel_registerName("fill");
+public static final int sel_isEnteringProximity = sel_registerName("isEnteringProximity");
+public static final int sel_drawingRectForBounds_1 = sel_registerName("drawingRectForBounds:");
+public static final int sel_decodeInt32ForKey_1 = sel_registerName("decodeInt32ForKey:");
+public static final int sel_deltaY = sel_registerName("deltaY");
+public static final int sel_displaysLinkToolTips = sel_registerName("displaysLinkToolTips");
+public static final int sel_moveToEndOfDocument_1 = sel_registerName("moveToEndOfDocument:");
+public static final int sel_isFirstResponder = sel_registerName("isFirstResponder");
+public static final int sel_receiversSpecifier = sel_registerName("receiversSpecifier");
+public static final int sel_canInitWithURL_1 = sel_registerName("canInitWithURL:");
+public static final int sel_parameterString = sel_registerName("parameterString");
+public static final int sel_isMovable = sel_registerName("isMovable");
+public static final int sel_setAvoidsEmptySelection_1 = sel_registerName("setAvoidsEmptySelection:");
+public static final int sel_lockFocusIfCanDrawInContext_1 = sel_registerName("lockFocusIfCanDrawInContext:");
+public static final int sel_updateChangeCount_1 = sel_registerName("updateChangeCount:");
+public static final int sel_rootDocument = sel_registerName("rootDocument");
+public static final int sel_superview = sel_registerName("superview");
+public static final int sel_resolveNamespaceForName_1 = sel_registerName("resolveNamespaceForName:");
+public static final int sel_maxNumberOfColumns = sel_registerName("maxNumberOfColumns");
+public static final int sel_setMaxSize_1 = sel_registerName("setMaxSize:");
+public static final int sel_completePathIntoString_1caseSensitive_1matchesIntoArray_1filterTypes_1 = sel_registerName("completePathIntoString:caseSensitive:matchesIntoArray:filterTypes:");
+public static final int sel_updateCell_1 = sel_registerName("updateCell:");
+public static final int sel_setWeek_1 = sel_registerName("setWeek:");
+public static final int sel_titleRectForBounds_1 = sel_registerName("titleRectForBounds:");
+public static final int sel_rulerView_1willAddMarker_1atLocation_1 = sel_registerName("rulerView:willAddMarker:atLocation:");
+public static final int sel_message = sel_registerName("message");
+public static final int sel_setContentSize_1 = sel_registerName("setContentSize:");
+public static final int sel_broadcast = sel_registerName("broadcast");
+public static final int sel_isNativeType_1 = sel_registerName("isNativeType:");
+public static final int sel_contentBorderThicknessForEdge_1 = sel_registerName("contentBorderThicknessForEdge:");
+public static final int sel_keyEquivalentOffset = sel_registerName("keyEquivalentOffset");
+public static final int sel_makeUntitledDocumentOfType_1 = sel_registerName("makeUntitledDocumentOfType:");
+public static final int sel_windowFrameTextColor = sel_registerName("windowFrameTextColor");
+public static final int sel_addItemsWithTitles_1 = sel_registerName("addItemsWithTitles:");
+public static final int sel_levelForRow_1 = sel_registerName("levelForRow:");
+public static final int sel_dissolveToPoint_1fromRect_1fraction_1 = sel_registerName("dissolveToPoint:fromRect:fraction:");
+public static final int sel_discardCachedImage = sel_registerName("discardCachedImage");
+public static final int sel_rootProxyForConnectionWithRegisteredName_1host_1usingNameServer_1 = sel_registerName("rootProxyForConnectionWithRegisteredName:host:usingNameServer:");
+public static final int sel_mouseExited_1 = sel_registerName("mouseExited:");
+public static final int sel_stringWithCString_1 = sel_registerName("stringWithCString:");
+public static final int sel_standardUserDefaults = sel_registerName("standardUserDefaults");
+public static final int sel_archiver_1didEncodeObject_1 = sel_registerName("archiver:didEncodeObject:");
+public static final int sel_canDraw = sel_registerName("canDraw");
+public static final int sel_shouldDelayWindowOrderingForEvent_1 = sel_registerName("shouldDelayWindowOrderingForEvent:");
+public static final int sel_selectedMenuItemTextColor = sel_registerName("selectedMenuItemTextColor");
+public static final int sel_attachSubmenuForItemAtIndex_1 = sel_registerName("attachSubmenuForItemAtIndex:");
+public static final int sel_condition = sel_registerName("condition");
+public static final int sel_setReservedThicknessForAccessoryView_1 = sel_registerName("setReservedThicknessForAccessoryView:");
+public static final int sel_replaceObjectsInRange_1withObjectsFromArray_1 = sel_registerName("replaceObjectsInRange:withObjectsFromArray:");
+public static final int sel_placeholderString = sel_registerName("placeholderString");
+public static final int sel_setPMSymbol_1 = sel_registerName("setPMSymbol:");
+public static final int sel_localizedNameOfStringEncoding_1 = sel_registerName("localizedNameOfStringEncoding:");
+public static final int sel_outlineViewItemWillCollapse_1 = sel_registerName("outlineViewItemWillCollapse:");
+public static final int sel_localizedKey = sel_registerName("localizedKey");
+public static final int sel_whiteColor = sel_registerName("whiteColor");
+public static final int sel_viewBoundsChanged_1 = sel_registerName("viewBoundsChanged:");
+public static final int sel_vendorDefined = sel_registerName("vendorDefined");
+public static final int sel_classNameDecodedForArchiveClassName_1 = sel_registerName("classNameDecodedForArchiveClassName:");
+public static final int sel_lockDate = sel_registerName("lockDate");
+public static final int sel_twoDigitStartDate = sel_registerName("twoDigitStartDate");
+public static final int sel_rectOfRow_1 = sel_registerName("rectOfRow:");
+public static final int sel_receivePort = sel_registerName("receivePort");
+public static final int sel_decimalNumberByMultiplyingByPowerOf10_1withBehavior_1 = sel_registerName("decimalNumberByMultiplyingByPowerOf10:withBehavior:");
+public static final int sel_isAnyApplicationSpeaking = sel_registerName("isAnyApplicationSpeaking");
+public static final int sel_aeDesc = sel_registerName("aeDesc");
+public static final int sel_windowWillBeginSheet_1 = sel_registerName("windowWillBeginSheet:");
+public static final int sel_accessibilityFocusedUIElement = sel_registerName("accessibilityFocusedUIElement");
+public static final int sel_orderBack_1 = sel_registerName("orderBack:");
+public static final int sel_scanDecimal_1 = sel_registerName("scanDecimal:");
+public static final int sel_transformStruct = sel_registerName("transformStruct");
+public static final int sel_fileAttributesToWriteToFile_1ofType_1saveOperation_1 = sel_registerName("fileAttributesToWriteToFile:ofType:saveOperation:");
+public static final int sel_controlCharacterSet = sel_registerName("controlCharacterSet");
+public static final int sel_setNextResponder_1 = sel_registerName("setNextResponder:");
+public static final int sel_pasteboardChangedOwner_1 = sel_registerName("pasteboardChangedOwner:");
+public static final int sel_canSelectHiddenExtension = sel_registerName("canSelectHiddenExtension");
+public static final int sel_attribute_1atIndex_1longestEffectiveRange_1inRange_1 = sel_registerName("attribute:atIndex:longestEffectiveRange:inRange:");
+public static final int sel_setAutovalidates_1 = sel_registerName("setAutovalidates:");
+public static final int sel_setAllowsFloats_1 = sel_registerName("setAllowsFloats:");
+public static final int sel_sortDescriptorPrototype = sel_registerName("sortDescriptorPrototype");
+public static final int sel_trackKnob_1 = sel_registerName("trackKnob:");
+public static final int sel_comboBox_1indexOfItemWithStringValue_1 = sel_registerName("comboBox:indexOfItemWithStringValue:");
+public static final int sel_setSource_1 = sel_registerName("setSource:");
+public static final int sel_contentFilters = sel_registerName("contentFilters");
+public static final int sel_dictionaryWithContentsOfFile_1 = sel_registerName("dictionaryWithContentsOfFile:");
+public static final int sel_drawArrow_1highlight_1 = sel_registerName("drawArrow:highlight:");
+public static final int sel_handleSaveScriptCommand_1 = sel_registerName("handleSaveScriptCommand:");
+public static final int sel_rangeOfString_1options_1 = sel_registerName("rangeOfString:options:");
+public static final int sel_setPickerMode_1 = sel_registerName("setPickerMode:");
+public static final int sel_setStandaloneQuarterSymbols_1 = sel_registerName("setStandaloneQuarterSymbols:");
+public static final int sel_setSize_1 = sel_registerName("setSize:");
+public static final int sel_setAllowsUndo_1 = sel_registerName("setAllowsUndo:");
+public static final int sel_edge = sel_registerName("edge");
+public static final int sel_stopLoading = sel_registerName("stopLoading");
+public static final int sel_fileURLWithPath_1isDirectory_1 = sel_registerName("fileURLWithPath:isDirectory:");
+public static final int sel_userInfo = sel_registerName("userInfo");
+public static final int sel_components_1fromDate_1 = sel_registerName("components:fromDate:");
+public static final int sel_dictionary = sel_registerName("dictionary");
+public static final int sel_connection_1didCancelAuthenticationChallenge_1 = sel_registerName("connection:didCancelAuthenticationChallenge:");
+public static final int sel_selectParagraph_1 = sel_registerName("selectParagraph:");
+public static final int sel_initWithCapacity_1 = sel_registerName("initWithCapacity:");
+public static final int sel_initWithObjectSpecifier_1comparisonOperator_1testObject_1 = sel_registerName("initWithObjectSpecifier:comparisonOperator:testObject:");
+public static final int sel_nestingMode = sel_registerName("nestingMode");
+public static final int sel_paragraphSpacingBefore = sel_registerName("paragraphSpacingBefore");
+public static final int sel_itemChanged_1 = sel_registerName("itemChanged:");
+public static final int sel_setSelectionIndexes_1 = sel_registerName("setSelectionIndexes:");
+public static final int sel_open = sel_registerName("open");
+public static final int sel_sendActionOn_1 = sel_registerName("sendActionOn:");
+public static final int sel_initWithFireDate_1interval_1target_1selector_1userInfo_1repeats_1 = sel_registerName("initWithFireDate:interval:target:selector:userInfo:repeats:");
+public static final int sel_formatterBehavior = sel_registerName("formatterBehavior");
+public static final int sel_fillRect_1 = sel_registerName("fillRect:");
+public static final int sel_animationCurve = sel_registerName("animationCurve");
+public static final int sel_remoteObjects = sel_registerName("remoteObjects");
+public static final int sel_setSelectionIndexPath_1 = sel_registerName("setSelectionIndexPath:");
+public static final int sel_availableFontNamesWithTraits_1 = sel_registerName("availableFontNamesWithTraits:");
+public static final int sel_convertFont_1toFamily_1 = sel_registerName("convertFont:toFamily:");
+public static final int sel_splitView_1resizeSubviewsWithOldSize_1 = sel_registerName("splitView:resizeSubviewsWithOldSize:");
+public static final int sel_setSmartInsertDeleteEnabled_1 = sel_registerName("setSmartInsertDeleteEnabled:");
+public static final int sel_shouldChangePrintInfo_1 = sel_registerName("shouldChangePrintInfo:");
+public static final int sel_objectBeingTested = sel_registerName("objectBeingTested");
+public static final int sel_selectItemWithObjectValue_1 = sel_registerName("selectItemWithObjectValue:");
+public static final int sel_rightExpressions = sel_registerName("rightExpressions");
+public static final int sel_unableToSetNilForKey_1 = sel_registerName("unableToSetNilForKey:");
+public static final int sel_visibleItems = sel_registerName("visibleItems");
+public static final int sel_items = sel_registerName("items");
+public static final int sel_templatesWithAttributeKeyPaths_1inEntityDescription_1 = sel_registerName("templatesWithAttributeKeyPaths:inEntityDescription:");
+public static final int sel_setMaximumIntegerDigits_1 = sel_registerName("setMaximumIntegerDigits:");
+public static final int sel_scrollRectToVisible_1 = sel_registerName("scrollRectToVisible:");
+public static final int sel_disableKeyEquivalentForDefaultButtonCell = sel_registerName("disableKeyEquivalentForDefaultButtonCell");
+public static final int sel_objectsForXQuery_1error_1 = sel_registerName("objectsForXQuery:error:");
+public static final int sel_readToEndOfFileInBackgroundAndNotifyForModes_1 = sel_registerName("readToEndOfFileInBackgroundAndNotifyForModes:");
+public static final int sel_scanHexLongLong_1 = sel_registerName("scanHexLongLong:");
+public static final int sel_ascender = sel_registerName("ascender");
+public static final int sel_arrangeObjects_1 = sel_registerName("arrangeObjects:");
+public static final int sel_setNegativeSuffix_1 = sel_registerName("setNegativeSuffix:");
+public static final int sel_initWithString_1 = sel_registerName("initWithString:");
+public static final int sel_initWithName_1data_1 = sel_registerName("initWithName:data:");
+public static final int sel_data = sel_registerName("data");
+public static final int sel_encodePortObject_1 = sel_registerName("encodePortObject:");
+public static final int sel_becomeFirstResponder = sel_registerName("becomeFirstResponder");
+public static final int sel_setImage_1forSegment_1 = sel_registerName("setImage:forSegment:");
+public static final int sel_copyRuler_1 = sel_registerName("copyRuler:");
+public static final int sel_appendBezierPathWithGlyphs_1count_1inFont_1 = sel_registerName("appendBezierPathWithGlyphs:count:inFont:");
+public static final int sel_playsSelectionOnly = sel_registerName("playsSelectionOnly");
+public static final int sel_boundsRectForTextBlock_1glyphRange_1 = sel_registerName("boundsRectForTextBlock:glyphRange:");
+public static final int sel_makeObjectsPerformSelector_1withObject_1 = sel_registerName("makeObjectsPerformSelector:withObject:");
+public static final int sel_stringByTrimmingCharactersInSet_1 = sel_registerName("stringByTrimmingCharactersInSet:");
+public static final int sel_timerWithTimeInterval_1invocation_1repeats_1 = sel_registerName("timerWithTimeInterval:invocation:repeats:");
+public static final int sel_viewDidMoveToSuperview = sel_registerName("viewDidMoveToSuperview");
+public static final int sel_pathCell_1willDisplayOpenPanel_1 = sel_registerName("pathCell:willDisplayOpenPanel:");
+public static final int sel_pathSeparator = sel_registerName("pathSeparator");
+public static final int sel_generatesCalendarDates = sel_registerName("generatesCalendarDates");
+public static final int sel_pressure = sel_registerName("pressure");
+public static final int sel_sendPort = sel_registerName("sendPort");
+public static final int sel_argumentsRetained = sel_registerName("argumentsRetained");
+public static final int sel_setContainerSpecifier_1 = sel_registerName("setContainerSpecifier:");
+public static final int sel_decodeNXColor = sel_registerName("decodeNXColor");
+public static final int sel_orientation = sel_registerName("orientation");
+public static final int sel_setScriptErrorString_1 = sel_registerName("setScriptErrorString:");
+public static final int sel_makeDocumentWithContentsOfFile_1ofType_1 = sel_registerName("makeDocumentWithContentsOfFile:ofType:");
+public static final int sel_reason = sel_registerName("reason");
+public static final int sel_currentEvent = sel_registerName("currentEvent");
+public static final int sel_setOffScreen_1width_1height_1rowbytes_1 = sel_registerName("setOffScreen:width:height:rowbytes:");
+public static final int sel_invalidateAttributesInRange_1 = sel_registerName("invalidateAttributesInRange:");
+public static final int sel_descriptorWithDescriptorType_1bytes_1length_1 = sel_registerName("descriptorWithDescriptorType:bytes:length:");
+public static final int sel_setCredential_1forProtectionSpace_1 = sel_registerName("setCredential:forProtectionSpace:");
+public static final int sel_fileGroupOwnerAccountName = sel_registerName("fileGroupOwnerAccountName");
+public static final int sel_setColor_1forKey_1 = sel_registerName("setColor:forKey:");
+public static final int sel_setAutohidesScrollers_1 = sel_registerName("setAutohidesScrollers:");
+public static final int sel_noteNumberOfRowsChanged = sel_registerName("noteNumberOfRowsChanged");
+public static final int sel_disableCursorRects = sel_registerName("disableCursorRects");
+public static final int sel_setLenient_1 = sel_registerName("setLenient:");
+public static final int sel_registerUnitWithName_1abbreviation_1unitToPointsConversionFactor_1stepUpCycle_1stepDownCycle_1 = sel_registerName("registerUnitWithName:abbreviation:unitToPointsConversionFactor:stepUpCycle:stepDownCycle:");
+public static final int sel_standardWindowButton_1 = sel_registerName("standardWindowButton:");
+public static final int sel_objectForProperty_1error_1 = sel_registerName("objectForProperty:error:");
+public static final int sel_imageRepWithData_1 = sel_registerName("imageRepWithData:");
+public static final int sel_flushGraphics = sel_registerName("flushGraphics");
+public static final int sel_setCacheDepthMatchesImageDepth_1 = sel_registerName("setCacheDepthMatchesImageDepth:");
+public static final int sel_highlightColorInView_1 = sel_registerName("highlightColorInView:");
+public static final int sel_setBaseSpecifier_1 = sel_registerName("setBaseSpecifier:");
+public static final int sel_performFileOperation_1source_1destination_1files_1tag_1 = sel_registerName("performFileOperation:source:destination:files:tag:");
+public static final int sel_outlineView_1itemForPersistentObject_1 = sel_registerName("outlineView:itemForPersistentObject:");
+public static final int sel_propertyListFromData_1mutabilityOption_1format_1errorDescription_1 = sel_registerName("propertyListFromData:mutabilityOption:format:errorDescription:");
+public static final int sel_setDocumentView_1 = sel_registerName("setDocumentView:");
+public static final int sel_drawsOutsideLineFragmentForGlyphAtIndex_1 = sel_registerName("drawsOutsideLineFragmentForGlyphAtIndex:");
+public static final int sel_dragImageForSelectionWithEvent_1origin_1 = sel_registerName("dragImageForSelectionWithEvent:origin:");
+public static final int sel_buttonNumber = sel_registerName("buttonNumber");
+public static final int sel_advancementForGlyph_1 = sel_registerName("advancementForGlyph:");
+public static final int sel_parser_1validationErrorOccurred_1 = sel_registerName("parser:validationErrorOccurred:");
+public static final int sel_reusesColumns = sel_registerName("reusesColumns");
+public static final int sel_minute = sel_registerName("minute");
+public static final int sel_setCanChooseFiles_1 = sel_registerName("setCanChooseFiles:");
+public static final int sel_groupingSize = sel_registerName("groupingSize");
+public static final int sel_containsAttachments = sel_registerName("containsAttachments");
+public static final int sel_selectedControlTextColor = sel_registerName("selectedControlTextColor");
+public static final int sel_initWithMantissa_1exponent_1isNegative_1 = sel_registerName("initWithMantissa:exponent:isNegative:");
+public static final int sel_initWithVoice_1 = sel_registerName("initWithVoice:");
+public static final int sel_setResizingMask_1 = sel_registerName("setResizingMask:");
+public static final int sel_setOnMouseExited_1 = sel_registerName("setOnMouseExited:");
+public static final int sel_toggleContinuousSpellChecking_1 = sel_registerName("toggleContinuousSpellChecking:");
+public static final int sel_allowsCutCopyPaste = sel_registerName("allowsCutCopyPaste");
+public static final int sel_endSheet_1 = sel_registerName("endSheet:");
+public static final int sel_allowsBranchSelection = sel_registerName("allowsBranchSelection");
+public static final int sel_initWithRequest_1delegate_1 = sel_registerName("initWithRequest:delegate:");
+public static final int sel_isAtEnd = sel_registerName("isAtEnd");
+public static final int sel_relativeString = sel_registerName("relativeString");
+public static final int sel_tableView_1willDisplayCell_1forTableColumn_1row_1 = sel_registerName("tableView:willDisplayCell:forTableColumn:row:");
+public static final int sel_resizeSubviewsWithOldSize_1 = sel_registerName("resizeSubviewsWithOldSize:");
+public static final int sel_compoundPredicateType = sel_registerName("compoundPredicateType");
+public static final int sel_accessoryControllers = sel_registerName("accessoryControllers");
+public static final int sel_shouldDrawColor = sel_registerName("shouldDrawColor");
+public static final int sel_applicationShouldTerminate_1 = sel_registerName("applicationShouldTerminate:");
+public static final int sel_setTextContainer_1 = sel_registerName("setTextContainer:");
+public static final int sel_discardCursorRects = sel_registerName("discardCursorRects");
+public static final int sel_deviceCMYKColorSpace = sel_registerName("deviceCMYKColorSpace");
+public static final int sel_setDefaultPlaceholder_1forMarker_1withBinding_1 = sel_registerName("setDefaultPlaceholder:forMarker:withBinding:");
+public static final int sel_setIsZoomed_1 = sel_registerName("setIsZoomed:");
+public static final int sel_blueComponent = sel_registerName("blueComponent");
+public static final int sel_portWithMachPort_1options_1 = sel_registerName("portWithMachPort:options:");
+public static final int sel_restoreGraphicsState = sel_registerName("restoreGraphicsState");
+public static final int sel_isTemplate = sel_registerName("isTemplate");
+public static final int sel_setScanLocation_1 = sel_registerName("setScanLocation:");
+public static final int sel_initWithBool_1 = sel_registerName("initWithBool:");
+public static final int sel_initWithSet_1copyItems_1 = sel_registerName("initWithSet:copyItems:");
+public static final int sel_setPositivePrefix_1 = sel_registerName("setPositivePrefix:");
+public static final int sel_propertyForKeyIfAvailable_1 = sel_registerName("propertyForKeyIfAvailable:");
+public static final int sel_fileOwnerAccountID = sel_registerName("fileOwnerAccountID");
+public static final int sel_initForIncrementalLoad = sel_registerName("initForIncrementalLoad");
+public static final int sel_cellAttribute_1 = sel_registerName("cellAttribute:");
+public static final int sel_baselineLocation = sel_registerName("baselineLocation");
+public static final int sel_initWithAttributedString_1 = sel_registerName("initWithAttributedString:");
+public static final int sel_showWindows = sel_registerName("showWindows");
+public static final int sel_writeToFile_1atomically_1updateFilenames_1 = sel_registerName("writeToFile:atomically:updateFilenames:");
+public static final int sel_setCookies_1forURL_1mainDocumentURL_1 = sel_registerName("setCookies:forURL:mainDocumentURL:");
+public static final int sel_unarchiver_1cannotDecodeObjectOfClassName_1originalClasses_1 = sel_registerName("unarchiver:cannotDecodeObjectOfClassName:originalClasses:");
+public static final int sel_selectRow_1inColumn_1 = sel_registerName("selectRow:inColumn:");
+public static final int sel_dissolveToPoint_1fraction_1 = sel_registerName("dissolveToPoint:fraction:");
+public static final int sel_wantsToTrackMouseForEvent_1inRect_1ofView_1atCharacterIndex_1 = sel_registerName("wantsToTrackMouseForEvent:inRect:ofView:atCharacterIndex:");
+public static final int sel_openURLs_1withAppBundleIdentifier_1options_1additionalEventParamDescriptor_1launchIdentifiers_1 = sel_registerName("openURLs:withAppBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifiers:");
+public static final int sel_checkForRemovableMedia = sel_registerName("checkForRemovableMedia");
+public static final int sel_setImage_1 = sel_registerName("setImage:");
+public static final int sel_isFixedPitch = sel_registerName("isFixedPitch");
+public static final int sel_protocolFamily = sel_registerName("protocolFamily");
+public static final int sel_protocolCheckerWithTarget_1protocol_1 = sel_registerName("protocolCheckerWithTarget:protocol:");
+public static final int sel_streamError = sel_registerName("streamError");
+public static final int sel_replaceBytesInRange_1withBytes_1length_1 = sel_registerName("replaceBytesInRange:withBytes:length:");
+public static final int sel_canChooseDirectories = sel_registerName("canChooseDirectories");
+public static final int sel_classForPortCoder = sel_registerName("classForPortCoder");
+public static final int sel_mainRunLoop = sel_registerName("mainRunLoop");
+public static final int sel_setItemPrototype_1 = sel_registerName("setItemPrototype:");
+public static final int sel_controlShadowColor = sel_registerName("controlShadowColor");
+public static final int sel_level = sel_registerName("level");
+public static final int sel_setContextHelpModeActive_1 = sel_registerName("setContextHelpModeActive:");
+public static final int sel_levelForItem_1 = sel_registerName("levelForItem:");
+public static final int sel_setHeightTracksTextView_1 = sel_registerName("setHeightTracksTextView:");
+public static final int sel_applicationWillTerminate_1 = sel_registerName("applicationWillTerminate:");
+public static final int sel_wantsPeriodicDraggingUpdates = sel_registerName("wantsPeriodicDraggingUpdates");
+public static final int sel_createCommandInstance = sel_registerName("createCommandInstance");
+public static final int sel_parser_1foundElementDeclarationWithName_1model_1 = sel_registerName("parser:foundElementDeclarationWithName:model:");
+public static final int sel_window_1shouldPopUpDocumentPathMenu_1 = sel_registerName("window:shouldPopUpDocumentPathMenu:");
+public static final int sel_setRepresentedURL_1 = sel_registerName("setRepresentedURL:");
+public static final int sel_outlineView_1didDragTableColumn_1 = sel_registerName("outlineView:didDragTableColumn:");
+public static final int sel_appendTransform_1 = sel_registerName("appendTransform:");
+public static final int sel_setMIMEType_1 = sel_registerName("setMIMEType:");
+public static final int sel_setHeadIndent_1 = sel_registerName("setHeadIndent:");
+public static final int sel_setConstrainedFrameSize_1 = sel_registerName("setConstrainedFrameSize:");
+public static final int sel_setUsesDataSource_1 = sel_registerName("setUsesDataSource:");
+public static final int sel_replaceBytesInRange_1withBytes_1 = sel_registerName("replaceBytesInRange:withBytes:");
+public static final int sel_rowTypeKeyPath = sel_registerName("rowTypeKeyPath");
+public static final int sel_undoManager = sel_registerName("undoManager");
+public static final int sel_frameCenterRotation = sel_registerName("frameCenterRotation");
+public static final int sel_setTextView_1 = sel_registerName("setTextView:");
+public static final int sel_executeAppleEvent_1error_1 = sel_registerName("executeAppleEvent:error:");
+public static final int sel_setFormatter_1 = sel_registerName("setFormatter:");
+public static final int sel_scanLocation = sel_registerName("scanLocation");
+public static final int sel_scrollsDynamically = sel_registerName("scrollsDynamically");
+public static final int sel_setIndentationLevel_1 = sel_registerName("setIndentationLevel:");
+public static final int sel_minimumRangeOfUnit_1 = sel_registerName("minimumRangeOfUnit:");
+public static final int sel_textViewForBeginningOfSelection = sel_registerName("textViewForBeginningOfSelection");
+public static final int sel_tokenFieldCell_1displayStringForRepresentedObject_1 = sel_registerName("tokenFieldCell:displayStringForRepresentedObject:");
+public static final int sel_constrainFrameRect_1toScreen_1 = sel_registerName("constrainFrameRect:toScreen:");
+public static final int sel_getObjectValue_1forString_1range_1error_1 = sel_registerName("getObjectValue:forString:range:error:");
+public static final int sel_writeFileContents_1 = sel_registerName("writeFileContents:");
+public static final int sel_setProgressMarks_1 = sel_registerName("setProgressMarks:");
+public static final int sel_lastComponentOfFileName = sel_registerName("lastComponentOfFileName");
+public static final int sel_preventWindowOrdering = sel_registerName("preventWindowOrdering");
+public static final int sel_setDefaultDate_1 = sel_registerName("setDefaultDate:");
+public static final int sel_submenu = sel_registerName("submenu");
+public static final int sel_setTXTRecordData_1 = sel_registerName("setTXTRecordData:");
+public static final int sel_bytesPerRow = sel_registerName("bytesPerRow");
+public static final int sel_outlineView_1toolTipForCell_1rect_1tableColumn_1item_1mouseLocation_1 = sel_registerName("outlineView:toolTipForCell:rect:tableColumn:item:mouseLocation:");
+public static final int sel_outlineView_1shouldEditTableColumn_1item_1 = sel_registerName("outlineView:shouldEditTableColumn:item:");
+public static final int sel_initWithContainerSize_1 = sel_registerName("initWithContainerSize:");
+public static final int sel_setEvaluationErrorNumber_1 = sel_registerName("setEvaluationErrorNumber:");
+public static final int sel_setTopLevelObject_1 = sel_registerName("setTopLevelObject:");
+public static final int sel_dataOfType_1error_1 = sel_registerName("dataOfType:error:");
+public static final int sel_isSupersetOfSet_1 = sel_registerName("isSupersetOfSet:");
+public static final int sel_initWithURL_1cachePolicy_1timeoutInterval_1 = sel_registerName("initWithURL:cachePolicy:timeoutInterval:");
+public static final int sel_setAutosaveExpandedItems_1 = sel_registerName("setAutosaveExpandedItems:");
+public static final int sel_rangeValue = sel_registerName("rangeValue");
+public static final int sel_indexPathByAddingIndex_1 = sel_registerName("indexPathByAddingIndex:");
+public static final int sel_deleteToMark_1 = sel_registerName("deleteToMark:");
+public static final int sel_appleEventCodeForSuite_1 = sel_registerName("appleEventCodeForSuite:");
+public static final int sel_getBytes_1 = sel_registerName("getBytes:");
+public static final int sel_setMinimumDaysInFirstWeek_1 = sel_registerName("setMinimumDaysInFirstWeek:");
+public static final int sel_refusesFirstResponder = sel_registerName("refusesFirstResponder");
+public static final int sel_setMaxItemSize_1 = sel_registerName("setMaxItemSize:");
+public static final int sel_localizedStringForKey_1value_1table_1 = sel_registerName("localizedStringForKey:value:table:");
+public static final int sel_mapTableWithKeyOptions_1valueOptions_1 = sel_registerName("mapTableWithKeyOptions:valueOptions:");
+public static final int sel_test = sel_registerName("test");
+public static final int sel_trackScrollButtons_1 = sel_registerName("trackScrollButtons:");
+public static final int sel_PDFRepresentation = sel_registerName("PDFRepresentation");
+public static final int sel_setImageFrameStyle_1 = sel_registerName("setImageFrameStyle:");
+public static final int sel_encodeClassName_1intoClassName_1 = sel_registerName("encodeClassName:intoClassName:");
+public static final int sel_beginPageInRect_1atPlacement_1 = sel_registerName("beginPageInRect:atPlacement:");
+public static final int sel_setAllowsOtherFileTypes_1 = sel_registerName("setAllowsOtherFileTypes:");
+public static final int sel_isWordInUserDictionaries_1caseSensitive_1 = sel_registerName("isWordInUserDictionaries:caseSensitive:");
+public static final int sel_dispatchRawAppleEvent_1withRawReply_1handlerRefCon_1 = sel_registerName("dispatchRawAppleEvent:withRawReply:handlerRefCon:");
+public static final int sel_isScrollable = sel_registerName("isScrollable");
+public static final int sel_numberOfColorStops = sel_registerName("numberOfColorStops");
+public static final int sel_unhideAllApplications_1 = sel_registerName("unhideAllApplications:");
+public static final int sel_retainCount = sel_registerName("retainCount");
+public static final int sel_runModalPrintOperation_1delegate_1didRunSelector_1contextInfo_1 = sel_registerName("runModalPrintOperation:delegate:didRunSelector:contextInfo:");
+public static final int sel_update = sel_registerName("update");
+public static final int sel_isRotatedOrScaledFromBase = sel_registerName("isRotatedOrScaledFromBase");
+public static final int sel_initWithWindowNibPath_1owner_1 = sel_registerName("initWithWindowNibPath:owner:");
+public static final int sel_entryType = sel_registerName("entryType");
+public static final int sel_dictionaryFromTXTRecordData_1 = sel_registerName("dictionaryFromTXTRecordData:");
+public static final int sel_setLineCapStyle_1 = sel_registerName("setLineCapStyle:");
+public static final int sel_setValues_1forParameter_1 = sel_registerName("setValues:forParameter:");
+public static final int sel_numberStyle = sel_registerName("numberStyle");
+public static final int sel_disableCollectorForPointer_1 = sel_registerName("disableCollectorForPointer:");
+public static final int sel_initWithPointerFunctions_1capacity_1 = sel_registerName("initWithPointerFunctions:capacity:");
+public static final int sel_sendEvent_1 = sel_registerName("sendEvent:");
+public static final int sel_removeSelectedObjects_1 = sel_registerName("removeSelectedObjects:");
+public static final int sel_serviceConnectionWithName_1rootObject_1usingNameServer_1 = sel_registerName("serviceConnectionWithName:rootObject:usingNameServer:");
+public static final int sel_decimalNumberByMultiplyingBy_1 = sel_registerName("decimalNumberByMultiplyingBy:");
+public static final int sel_shouldChangeTextInRanges_1replacementStrings_1 = sel_registerName("shouldChangeTextInRanges:replacementStrings:");
+public static final int sel_setResizeIncrements_1 = sel_registerName("setResizeIncrements:");
+public static final int sel_alignLeft_1 = sel_registerName("alignLeft:");
+public static final int sel_launch = sel_registerName("launch");
+public static final int sel_executeCommand = sel_registerName("executeCommand");
+public static final int sel_setPixelBuffer_1cubeMapFace_1mipMapLevel_1currentVirtualScreen_1 = sel_registerName("setPixelBuffer:cubeMapFace:mipMapLevel:currentVirtualScreen:");
+public static final int sel_isCachedSeparately = sel_registerName("isCachedSeparately");
+public static final int sel_setUsesSignificantDigits_1 = sel_registerName("setUsesSignificantDigits:");
+public static final int sel_countKeyPathForNode_1 = sel_registerName("countKeyPathForNode:");
+public static final int sel_setContainerIsRangeContainerObject_1 = sel_registerName("setContainerIsRangeContainerObject:");
+public static final int sel_showsStateColumn = sel_registerName("showsStateColumn");
+public static final int sel_uppercaseString = sel_registerName("uppercaseString");
+public static final int sel_directoryContentsAtPath_1 = sel_registerName("directoryContentsAtPath:");
+public static final int sel_titleFont = sel_registerName("titleFont");
+public static final int sel_comparisonPredicateModifier = sel_registerName("comparisonPredicateModifier");
+public static final int sel_isMultiThreaded = sel_registerName("isMultiThreaded");
+public static final int sel_setGroupingAttributes_1 = sel_registerName("setGroupingAttributes:");
+public static final int sel_selectedRowIndexesInColumn_1 = sel_registerName("selectedRowIndexesInColumn:");
+public static final int sel_isFlushWindowDisabled = sel_registerName("isFlushWindowDisabled");
+public static final int sel_setReusesColumns_1 = sel_registerName("setReusesColumns:");
+public static final int sel_getCString_1maxLength_1 = sel_registerName("getCString:maxLength:");
+public static final int sel_setIndicatorImage_1inTableColumn_1 = sel_registerName("setIndicatorImage:inTableColumn:");
+public static final int sel_keyEquivalent = sel_registerName("keyEquivalent");
+public static final int sel_skipDescendents = sel_registerName("skipDescendents");
+public static final int sel_waitUntilExit = sel_registerName("waitUntilExit");
+public static final int sel_initWithWindowNibName_1owner_1 = sel_registerName("initWithWindowNibName:owner:");
+public static final int sel_objectClass = sel_registerName("objectClass");
+public static final int sel_allFrameworks = sel_registerName("allFrameworks");
+public static final int sel_cellWithTag_1 = sel_registerName("cellWithTag:");
+public static final int sel_representationUsingType_1properties_1 = sel_registerName("representationUsingType:properties:");
+public static final int sel_textPasteboardTypes = sel_registerName("textPasteboardTypes");
+public static final int sel_contentViewMargins = sel_registerName("contentViewMargins");
+public static final int sel_canUndo = sel_registerName("canUndo");
+public static final int sel_initWithFormat_1locale_1arguments_1 = sel_registerName("initWithFormat:locale:arguments:");
+public static final int sel_usableParts = sel_registerName("usableParts");
+public static final int sel_comboBoxSelectionIsChanging_1 = sel_registerName("comboBoxSelectionIsChanging:");
+public static final int sel_raise_1format_1arguments_1 = sel_registerName("raise:format:arguments:");
+public static final int sel_isWindowLoaded = sel_registerName("isWindowLoaded");
+public static final int sel_levelIndicatorStyle = sel_registerName("levelIndicatorStyle");
+public static final int sel_localizedFailureReason = sel_registerName("localizedFailureReason");
+public static final int sel_characterRangeForGlyphRange_1actualGlyphRange_1 = sel_registerName("characterRangeForGlyphRange:actualGlyphRange:");
+public static final int sel_lineNumber = sel_registerName("lineNumber");
+public static final int sel_HTTPBody = sel_registerName("HTTPBody");
+public static final int sel_lineBreakMode = sel_registerName("lineBreakMode");
+public static final int sel_isStopped = sel_registerName("isStopped");
+public static final int sel_canResumeDownloadDecodedWithEncodingMIMEType_1 = sel_registerName("canResumeDownloadDecodedWithEncodingMIMEType:");
+public static final int sel_removeObjectsAtArrangedObjectIndexPaths_1 = sel_registerName("removeObjectsAtArrangedObjectIndexPaths:");
+public static final int sel_isHidden = sel_registerName("isHidden");
+public static final int sel_otherMouseDragged_1 = sel_registerName("otherMouseDragged:");
+public static final int sel_headerRectOfColumn_1 = sel_registerName("headerRectOfColumn:");
+public static final int sel_hasVerticalRuler = sel_registerName("hasVerticalRuler");
+public static final int sel_setBottomMargin_1 = sel_registerName("setBottomMargin:");
+public static final int sel_initWithNotificationCenter_1 = sel_registerName("initWithNotificationCenter:");
+public static final int sel_addSpeechDictionary_1 = sel_registerName("addSpeechDictionary:");
+public static final int sel_setPositiveFormat_1 = sel_registerName("setPositiveFormat:");
+public static final int sel_application_1openTempFile_1 = sel_registerName("application:openTempFile:");
+public static final int sel_setEntityName_1 = sel_registerName("setEntityName:");
+public static final int sel_setForegroundColor_1 = sel_registerName("setForegroundColor:");
+public static final int sel_initWithUnsignedLong_1 = sel_registerName("initWithUnsignedLong:");
+public static final int sel_setWindowsMenu_1 = sel_registerName("setWindowsMenu:");
+public static final int sel_applicationDidUnhide_1 = sel_registerName("applicationDidUnhide:");
+public static final int sel_availableData = sel_registerName("availableData");
+public static final int sel_setVertical_1 = sel_registerName("setVertical:");
+public static final int sel_disableUpdates = sel_registerName("disableUpdates");
+public static final int sel_compileAndReturnError_1 = sel_registerName("compileAndReturnError:");
+public static final int sel_containsIndex_1 = sel_registerName("containsIndex:");
+public static final int sel_canSelectPrevious = sel_registerName("canSelectPrevious");
+public static final int sel_initWithBytes_1length_1encoding_1 = sel_registerName("initWithBytes:length:encoding:");
+public static final int sel_setTextColor_1 = sel_registerName("setTextColor:");
+public static final int sel_stream_1handleEvent_1 = sel_registerName("stream:handleEvent:");
+public static final int sel_setWeekdaySymbols_1 = sel_registerName("setWeekdaySymbols:");
+public static final int sel_setHiddenUntilMouseMoves_1 = sel_registerName("setHiddenUntilMouseMoves:");
+public static final int sel_orderFrontStandardAboutPanelWithOptions_1 = sel_registerName("orderFrontStandardAboutPanelWithOptions:");
+public static final int sel_setAttributesAsDictionary_1 = sel_registerName("setAttributesAsDictionary:");
+public static final int sel_rowTypeForRow_1 = sel_registerName("rowTypeForRow:");
+public static final int sel_setRequestTimeout_1 = sel_registerName("setRequestTimeout:");
+public static final int sel_XMLDataWithOptions_1 = sel_registerName("XMLDataWithOptions:");
+public static final int sel_closedHandCursor = sel_registerName("closedHandCursor");
+public static final int sel_nextSibling = sel_registerName("nextSibling");
+public static final int sel_controlTextColor = sel_registerName("controlTextColor");
+public static final int sel_abbreviationDictionary = sel_registerName("abbreviationDictionary");
+public static final int sel_archiverDidFinish_1 = sel_registerName("archiverDidFinish:");
+public static final int sel_valueTypeForDimension_1 = sel_registerName("valueTypeForDimension:");
+public static final int sel_setCriteriaKeyPath_1 = sel_registerName("setCriteriaKeyPath:");
+public static final int sel_isLessThan_1 = sel_registerName("isLessThan:");
+public static final int sel_processName = sel_registerName("processName");
+public static final int sel_frameOfOutlineCellAtRow_1 = sel_registerName("frameOfOutlineCellAtRow:");
+public static final int sel_removeObjectsInArray_1 = sel_registerName("removeObjectsInArray:");
+public static final int sel_leftExpression = sel_registerName("leftExpression");
+public static final int sel_removeToolTip_1 = sel_registerName("removeToolTip:");
+public static final int sel_mutableCopy = sel_registerName("mutableCopy");
+public static final int sel_directParameter = sel_registerName("directParameter");
+public static final int sel_name = sel_registerName("name");
+public static final int sel_bitsPerPixel = sel_registerName("bitsPerPixel");
+public static final int sel_weekday = sel_registerName("weekday");
+public static final int sel_descendantNodeAtIndexPath_1 = sel_registerName("descendantNodeAtIndexPath:");
+public static final int sel_setPercentSymbol_1 = sel_registerName("setPercentSymbol:");
+public static final int sel_selectedCell = sel_registerName("selectedCell");
+public static final int sel_windowWillClose_1 = sel_registerName("windowWillClose:");
+public static final int sel_setDatePickerStyle_1 = sel_registerName("setDatePickerStyle:");
+public static final int sel_initWithObjects_1 = sel_registerName("initWithObjects:");
+public static final int sel_numberWithInt_1 = sel_registerName("numberWithInt:");
+public static final int sel_collection = sel_registerName("collection");
+public static final int sel_initWithTarget_1selector_1object_1 = sel_registerName("initWithTarget:selector:object:");
+public static final int sel_insertText_1replacementRange_1 = sel_registerName("insertText:replacementRange:");
+public static final int sel_initWithAEDescNoCopy_1 = sel_registerName("initWithAEDescNoCopy:");
+public static final int sel_usesGroupingSeparator = sel_registerName("usesGroupingSeparator");
+public static final int sel_pathControl_1shouldDragPathComponentCell_1withPasteboard_1 = sel_registerName("pathControl:shouldDragPathComponentCell:withPasteboard:");
+public static final int sel_decimalNumberByAdding_1withBehavior_1 = sel_registerName("decimalNumberByAdding:withBehavior:");
+public static final int sel_setTextContainer_1forGlyphRange_1 = sel_registerName("setTextContainer:forGlyphRange:");
+public static final int sel_needsToDrawRect_1 = sel_registerName("needsToDrawRect:");
+public static final int sel_activeConversationChanged_1toNewConversation_1 = sel_registerName("activeConversationChanged:toNewConversation:");
+public static final int sel_italicAngle = sel_registerName("italicAngle");
+public static final int sel_aeteResource_1 = sel_registerName("aeteResource:");
+public static final int sel_noteNewRecentDocumentURL_1 = sel_registerName("noteNewRecentDocumentURL:");
+public static final int sel_setPageScroll_1 = sel_registerName("setPageScroll:");
+public static final int sel_speechSynthesizer_1didFinishSpeaking_1 = sel_registerName("speechSynthesizer:didFinishSpeaking:");
+public static final int sel_convertSizeToBase_1 = sel_registerName("convertSizeToBase:");
+public static final int sel_pointerFunctionsWithOptions_1 = sel_registerName("pointerFunctionsWithOptions:");
+public static final int sel_setHTTPBody_1 = sel_registerName("setHTTPBody:");
+public static final int sel_itemWithTag_1 = sel_registerName("itemWithTag:");
+public static final int sel_spellServer_1checkGrammarInString_1language_1details_1 = sel_registerName("spellServer:checkGrammarInString:language:details:");
+public static final int sel_vendorPointingDeviceType = sel_registerName("vendorPointingDeviceType");
+public static final int sel_firstRectForCharacterRange_1 = sel_registerName("firstRectForCharacterRange:");
+public static final int sel_classDescriptionsInSuite_1 = sel_registerName("classDescriptionsInSuite:");
+public static final int sel_setAttachmentSize_1forGlyphRange_1 = sel_registerName("setAttachmentSize:forGlyphRange:");
+public static final int sel_isEmpty = sel_registerName("isEmpty");
+public static final int sel_soundNamed_1 = sel_registerName("soundNamed:");
+public static final int sel_preparedCellAtColumn_1row_1 = sel_registerName("preparedCellAtColumn:row:");
+public static final int sel_setLeafKeyPath_1 = sel_registerName("setLeafKeyPath:");
+public static final int sel_initWithUnsignedInteger_1 = sel_registerName("initWithUnsignedInteger:");
+public static final int sel_fractionOfDistanceThroughGlyphForPoint_1inTextContainer_1 = sel_registerName("fractionOfDistanceThroughGlyphForPoint:inTextContainer:");
+public static final int sel_isFloatingPanel = sel_registerName("isFloatingPanel");
+public static final int sel_replaceObjectsAtIndexes_1withObjects_1 = sel_registerName("replaceObjectsAtIndexes:withObjects:");
+public static final int sel_getComponents_1 = sel_registerName("getComponents:");
+public static final int sel_fileType = sel_registerName("fileType");
+public static final int sel_setShowsBaselineSeparator_1 = sel_registerName("setShowsBaselineSeparator:");
+public static final int sel_removeCredential_1forProtectionSpace_1 = sel_registerName("removeCredential:forProtectionSpace:");
+public static final int sel_imageRepWithContentsOfFile_1 = sel_registerName("imageRepWithContentsOfFile:");
+public static final int sel_predicateWithFormat_1argumentArray_1 = sel_registerName("predicateWithFormat:argumentArray:");
+public static final int sel_positiveSuffix = sel_registerName("positiveSuffix");
+public static final int sel_formatter = sel_registerName("formatter");
+public static final int sel_setAnimationDelay_1 = sel_registerName("setAnimationDelay:");
+public static final int sel_maxConcurrentOperationCount = sel_registerName("maxConcurrentOperationCount");
+public static final int sel_childSpecifier = sel_registerName("childSpecifier");
+public static final int sel_cacheMode = sel_registerName("cacheMode");
+public static final int sel_registerForServices = sel_registerName("registerForServices");
+public static final int sel_setFirstWeekday_1 = sel_registerName("setFirstWeekday:");
+public static final int sel_rulerViewClass = sel_registerName("rulerViewClass");
+public static final int sel_initialValue = sel_registerName("initialValue");
+public static final int sel_redColor = sel_registerName("redColor");
+public static final int sel_addDependency_1 = sel_registerName("addDependency:");
+public static final int sel_pathExtension = sel_registerName("pathExtension");
+public static final int sel_fastestEncoding = sel_registerName("fastestEncoding");
+public static final int sel_socketType = sel_registerName("socketType");
+public static final int sel_setRuleThickness_1 = sel_registerName("setRuleThickness:");
+public static final int sel_setDTDKind_1 = sel_registerName("setDTDKind:");
+public static final int sel_setClass_1forClassName_1 = sel_registerName("setClass:forClassName:");
+public static final int sel_setDocumentCursor_1 = sel_registerName("setDocumentCursor:");
+public static final int sel_extraLineFragmentRect = sel_registerName("extraLineFragmentRect");
+public static final int sel_attributeForName_1 = sel_registerName("attributeForName:");
+public static final int sel_defaultCredentialForProtectionSpace_1 = sel_registerName("defaultCredentialForProtectionSpace:");
+public static final int sel_indexOfItemWithTag_1 = sel_registerName("indexOfItemWithTag:");
+public static final int sel_fontManager_1willIncludeFont_1 = sel_registerName("fontManager:willIncludeFont:");
+public static final int sel_scrollRangeToVisible_1 = sel_registerName("scrollRangeToVisible:");
+public static final int sel_fileTypeFromLastRunSavePanel = sel_registerName("fileTypeFromLastRunSavePanel");
+public static final int sel_collectionView = sel_registerName("collectionView");
+public static final int sel_tabView = sel_registerName("tabView");
+public static final int sel_commonISOCurrencyCodes = sel_registerName("commonISOCurrencyCodes");
+public static final int sel_removeFontTrait_1 = sel_registerName("removeFontTrait:");
+public static final int sel_drawKnob_1 = sel_registerName("drawKnob:");
+public static final int sel_tokenField_1menuForRepresentedObject_1 = sel_registerName("tokenField:menuForRepresentedObject:");
+public static final int sel_setFrameUsingName_1 = sel_registerName("setFrameUsingName:");
+public static final int sel_classNameEncodedForTrueClassName_1 = sel_registerName("classNameEncodedForTrueClassName:");
+public static final int sel_windowFrameAutosaveName = sel_registerName("windowFrameAutosaveName");
+public static final int sel_characterAtIndex_1 = sel_registerName("characterAtIndex:");
+public static final int sel_smartInsertAfterStringForString_1replacingRange_1 = sel_registerName("smartInsertAfterStringForString:replacingRange:");
+public static final int sel_version = sel_registerName("version");
+public static final int sel_objectsAtIndexes_1 = sel_registerName("objectsAtIndexes:");
+public static final int sel_requestIsCacheEquivalent_1toRequest_1 = sel_registerName("requestIsCacheEquivalent:toRequest:");
+public static final int sel_columnOfMatrix_1 = sel_registerName("columnOfMatrix:");
+public static final int sel_isBezeled = sel_registerName("isBezeled");
+public static final int sel_setAutosaveName_1 = sel_registerName("setAutosaveName:");
+public static final int sel_becomeMainWindow = sel_registerName("becomeMainWindow");
+public static final int sel_pasteAsRichText_1 = sel_registerName("pasteAsRichText:");
+public static final int sel_isSpeaking = sel_registerName("isSpeaking");
+public static final int sel_format = sel_registerName("format");
+public static final int sel_volume = sel_registerName("volume");
+public static final int sel_setMenu_1 = sel_registerName("setMenu:");
+public static final int sel_setEra_1 = sel_registerName("setEra:");
+public static final int sel_textContainerOrigin = sel_registerName("textContainerOrigin");
+public static final int sel_setLocalizesFormat_1 = sel_registerName("setLocalizesFormat:");
+public static final int sel_removeIndex_1 = sel_registerName("removeIndex:");
+public static final int sel_gotoPosterFrame_1 = sel_registerName("gotoPosterFrame:");
+public static final int sel_validateValue_1forKeyPath_1error_1 = sel_registerName("validateValue:forKeyPath:error:");
+public static final int sel_initWithCharactersNoCopy_1length_1freeWhenDone_1 = sel_registerName("initWithCharactersNoCopy:length:freeWhenDone:");
+public static final int sel_initWithLength_1 = sel_registerName("initWithLength:");
+public static final int sel_setAllowsMultipleSelection_1 = sel_registerName("setAllowsMultipleSelection:");
+public static final int sel_isRotatedFromBase = sel_registerName("isRotatedFromBase");
+public static final int sel_beginDocument = sel_registerName("beginDocument");
+public static final int sel_initWithContentsOfURL_1usedEncoding_1error_1 = sel_registerName("initWithContentsOfURL:usedEncoding:error:");
+public static final int sel_showsSuppressionButton = sel_registerName("showsSuppressionButton");
+public static final int sel_tearOffMenuRepresentation = sel_registerName("tearOffMenuRepresentation");
+public static final int sel_otherEventWithType_1location_1modifierFlags_1timestamp_1windowNumber_1context_1subtype_1data1_1data2_1 = sel_registerName("otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:");
+public static final int sel_imageUnfilteredFileTypes = sel_registerName("imageUnfilteredFileTypes");
+public static final int sel_isGathering = sel_registerName("isGathering");
+public static final int sel_slideImage_1from_1to_1 = sel_registerName("slideImage:from:to:");
+public static final int sel_initWithTCPPort_1 = sel_registerName("initWithTCPPort:");
+public static final int sel_stringByFoldingWithOptions_1locale_1 = sel_registerName("stringByFoldingWithOptions:locale:");
+public static final int sel_viewDidUnhide = sel_registerName("viewDidUnhide");
+public static final int sel_controlSize = sel_registerName("controlSize");
+public static final int sel_resourceDataUsingCache_1 = sel_registerName("resourceDataUsingCache:");
+public static final int sel_startWhenAnimation_1reachesProgress_1 = sel_registerName("startWhenAnimation:reachesProgress:");
+public static final int sel_registerURLHandleClass_1 = sel_registerName("registerURLHandleClass:");
+public static final int sel_indicatorImageInTableColumn_1 = sel_registerName("indicatorImageInTableColumn:");
+public static final int sel_decimalNumberByMultiplyingByPowerOf10_1 = sel_registerName("decimalNumberByMultiplyingByPowerOf10:");
+public static final int sel_scrollPoint_1 = sel_registerName("scrollPoint:");
+public static final int sel_setValue_1forKeyPath_1 = sel_registerName("setValue:forKeyPath:");
+public static final int sel_fontDescriptorWithMatrix_1 = sel_registerName("fontDescriptorWithMatrix:");
+public static final int sel_parser_1foundProcessingInstructionWithTarget_1data_1 = sel_registerName("parser:foundProcessingInstructionWithTarget:data:");
+public static final int sel_interfaceStyle = sel_registerName("interfaceStyle");
+public static final int sel_comboBox_1objectValueForItemAtIndex_1 = sel_registerName("comboBox:objectValueForItemAtIndex:");
+public static final int sel_applicationDidFinishLaunching_1 = sel_registerName("applicationDidFinishLaunching:");
+public static final int sel_currentMemoryUsage = sel_registerName("currentMemoryUsage");
+public static final int sel_altersStateOfSelectedItem = sel_registerName("altersStateOfSelectedItem");
+public static final int sel_selectedColumn = sel_registerName("selectedColumn");
+public static final int sel_convertBaseToScreen_1 = sel_registerName("convertBaseToScreen:");
+public static final int sel_lineHeightMultiple = sel_registerName("lineHeightMultiple");
+public static final int sel_CGColorSpace = sel_registerName("CGColorSpace");
+public static final int sel_descriptionInStringsFileFormat = sel_registerName("descriptionInStringsFileFormat");
+public static final int sel_isOutputStackInReverseOrder = sel_registerName("isOutputStackInReverseOrder");
+public static final int sel_takeValue_1forKey_1 = sel_registerName("takeValue:forKey:");
+public static final int sel_stringWithContentsOfFile_1 = sel_registerName("stringWithContentsOfFile:");
+public static final int sel_addItem_1 = sel_registerName("addItem:");
+public static final int sel_viewWillMoveToWindow_1 = sel_registerName("viewWillMoveToWindow:");
+public static final int sel_changeFileAttributes_1atPath_1 = sel_registerName("changeFileAttributes:atPath:");
+public static final int sel_userFixedPitchFontOfSize_1 = sel_registerName("userFixedPitchFontOfSize:");
+public static final int sel_selectRowIndexes_1inColumn_1 = sel_registerName("selectRowIndexes:inColumn:");
+public static final int sel_defaultLineCapStyle = sel_registerName("defaultLineCapStyle");
+public static final int sel_attributedAlternateTitle = sel_registerName("attributedAlternateTitle");
+public static final int sel_fileExistsAtPath_1 = sel_registerName("fileExistsAtPath:");
+public static final int sel_textView_1clickedOnLink_1atIndex_1 = sel_registerName("textView:clickedOnLink:atIndex:");
+public static final int sel_drawers = sel_registerName("drawers");
+public static final int sel_outlineView_1shouldSelectTableColumn_1 = sel_registerName("outlineView:shouldSelectTableColumn:");
+public static final int sel_pointValue = sel_registerName("pointValue");
+public static final int sel_integerValue = sel_registerName("integerValue");
+public static final int sel_modifyFontViaPanel_1 = sel_registerName("modifyFontViaPanel:");
+public static final int sel_windowTitleForDocumentDisplayName_1 = sel_registerName("windowTitleForDocumentDisplayName:");
+public static final int sel_shortWeekdaySymbols = sel_registerName("shortWeekdaySymbols");
+public static final int sel_titleOfSelectedItem = sel_registerName("titleOfSelectedItem");
+public static final int sel_setWindowsNeedUpdate_1 = sel_registerName("setWindowsNeedUpdate:");
+public static final int sel_stringWithUTF8String_1 = sel_registerName("stringWithUTF8String:");
+public static final int sel_transformedValueClass = sel_registerName("transformedValueClass");
+public static final int sel_initWithColorsAndLocations_1 = sel_registerName("initWithColorsAndLocations:");
+public static final int sel_acceptsMouseMovedEvents = sel_registerName("acceptsMouseMovedEvents");
+public static final int sel_toolTipsFontOfSize_1 = sel_registerName("toolTipsFontOfSize:");
+public static final int sel_setTextAttributesForPositiveValues_1 = sel_registerName("setTextAttributesForPositiveValues:");
+public static final int sel_setAlwaysShowsDecimalSeparator_1 = sel_registerName("setAlwaysShowsDecimalSeparator:");
+public static final int sel_setNumberOfColumns_1 = sel_registerName("setNumberOfColumns:");
+public static final int sel_moveRightAndModifySelection_1 = sel_registerName("moveRightAndModifySelection:");
+public static final int sel_indexOfItem_1 = sel_registerName("indexOfItem:");
+public static final int sel_moveWordRight_1 = sel_registerName("moveWordRight:");
+public static final int sel_numberWithUnsignedLongLong_1 = sel_registerName("numberWithUnsignedLongLong:");
+public static final int sel_initWithAuthenticationChallenge_1sender_1 = sel_registerName("initWithAuthenticationChallenge:sender:");
+public static final int sel_panelConvertFont_1 = sel_registerName("panelConvertFont:");
+public static final int sel_temporaryAttribute_1atCharacterIndex_1effectiveRange_1 = sel_registerName("temporaryAttribute:atCharacterIndex:effectiveRange:");
+public static final int sel_intersectHashTable_1 = sel_registerName("intersectHashTable:");
+public static final int sel_positionOfGlyph_1precededByGlyph_1isNominal_1 = sel_registerName("positionOfGlyph:precededByGlyph:isNominal:");
+public static final int sel_setLocalizedKeyTable_1 = sel_registerName("setLocalizedKeyTable:");
+public static final int sel_fileManager_1shouldLinkItemAtPath_1toPath_1 = sel_registerName("fileManager:shouldLinkItemAtPath:toPath:");
+public static final int sel_setScriptErrorNumber_1 = sel_registerName("setScriptErrorNumber:");
+public static final int sel_initWithLocaleIdentifier_1 = sel_registerName("initWithLocaleIdentifier:");
+public static final int sel_toolTip = sel_registerName("toolTip");
+public static final int sel_alternateMnemonic = sel_registerName("alternateMnemonic");
+public static final int sel_setChannelMapping_1 = sel_registerName("setChannelMapping:");
+public static final int sel_setLocalizedKey_1 = sel_registerName("setLocalizedKey:");
+public static final int sel_selector = sel_registerName("selector");
+public static final int sel_setCurrencyGroupingSeparator_1 = sel_registerName("setCurrencyGroupingSeparator:");
+public static final int sel_initWithKeyOptions_1valueOptions_1capacity_1 = sel_registerName("initWithKeyOptions:valueOptions:capacity:");
+public static final int sel_setStandaloneMonthSymbols_1 = sel_registerName("setStandaloneMonthSymbols:");
+public static final int sel_physicalMemory = sel_registerName("physicalMemory");
+public static final int sel_parse = sel_registerName("parse");
+public static final int sel_defaultTypesetterBehavior = sel_registerName("defaultTypesetterBehavior");
+public static final int sel_setRulerVisible_1 = sel_registerName("setRulerVisible:");
+public static final int sel_resizeDownCursor = sel_registerName("resizeDownCursor");
+public static final int sel_getBoundingRects_1forGlyphs_1count_1 = sel_registerName("getBoundingRects:forGlyphs:count:");
+public static final int sel_openPanel = sel_registerName("openPanel");
+public static final int sel_setEntryWidth_1 = sel_registerName("setEntryWidth:");
+public static final int sel_insertChildren_1atIndex_1 = sel_registerName("insertChildren:atIndex:");
+public static final int sel_selectNext_1 = sel_registerName("selectNext:");
+public static final int sel_paragraphGlyphRange = sel_registerName("paragraphGlyphRange");
+public static final int sel_animations = sel_registerName("animations");
+public static final int sel_setMarkers_1 = sel_registerName("setMarkers:");
+public static final int sel_raise = sel_registerName("raise");
+public static final int sel_menuZone = sel_registerName("menuZone");
+public static final int sel_weekdaySymbols = sel_registerName("weekdaySymbols");
+public static final int sel_setHTTPMethod_1 = sel_registerName("setHTTPMethod:");
+public static final int sel_placeholderAttributedString = sel_registerName("placeholderAttributedString");
+public static final int sel_filenameExtension_1isValidForType_1 = sel_registerName("filenameExtension:isValidForType:");
+public static final int sel_initWithReceivePort_1sendPort_1 = sel_registerName("initWithReceivePort:sendPort:");
+public static final int sel_setContextHelp_1forObject_1 = sel_registerName("setContextHelp:forObject:");
+public static final int sel_archiveRootObject_1toFile_1 = sel_registerName("archiveRootObject:toFile:");
+public static final int sel_setAnimations_1 = sel_registerName("setAnimations:");
+public static final int sel_locationOfPrintRect_1 = sel_registerName("locationOfPrintRect:");
+public static final int sel_setInterfaceStyle_1 = sel_registerName("setInterfaceStyle:");
+public static final int sel_startMonitoring = sel_registerName("startMonitoring");
+public static final int sel_presentError_1modalForWindow_1delegate_1didPresentSelector_1contextInfo_1 = sel_registerName("presentError:modalForWindow:delegate:didPresentSelector:contextInfo:");
+public static final int sel_windowFrameColor = sel_registerName("windowFrameColor");
+public static final int sel_paragraphSpacing = sel_registerName("paragraphSpacing");
+public static final int sel_fileAttributes = sel_registerName("fileAttributes");
+public static final int sel_setDisplayedCommandsTitle_1 = sel_registerName("setDisplayedCommandsTitle:");
+public static final int sel_preflightAndReturnError_1 = sel_registerName("preflightAndReturnError:");
+public static final int sel_setObservationInfo_1 = sel_registerName("setObservationInfo:");
+public static final int sel_currentCommand = sel_registerName("currentCommand");
+public static final int sel_processInfo = sel_registerName("processInfo");
+public static final int sel_appendString_1 = sel_registerName("appendString:");
+public static final int sel_setShowsHelp_1 = sel_registerName("setShowsHelp:");
+public static final int sel_datePickerStyle = sel_registerName("datePickerStyle");
+public static final int sel_addFileWrapper_1 = sel_registerName("addFileWrapper:");
+public static final int sel_bitmapImageRepForCachingDisplayInRect_1 = sel_registerName("bitmapImageRepForCachingDisplayInRect:");
+public static final int sel_initWithFileAtPath_1 = sel_registerName("initWithFileAtPath:");
+public static final int sel_cellClass = sel_registerName("cellClass");
+public static final int sel_imageRepsWithContentsOfFile_1 = sel_registerName("imageRepsWithContentsOfFile:");
+public static final int sel_localizedScannerWithString_1 = sel_registerName("localizedScannerWithString:");
+public static final int sel_isExpandable_1 = sel_registerName("isExpandable:");
+public static final int sel_isLoaded = sel_registerName("isLoaded");
+public static final int sel_browser_1acceptDrop_1atRow_1column_1dropOperation_1 = sel_registerName("browser:acceptDrop:atRow:column:dropOperation:");
+public static final int sel_panel_1directoryDidChange_1 = sel_registerName("panel:directoryDidChange:");
+public static final int sel_publicID = sel_registerName("publicID");
+public static final int sel_contentMaxSize = sel_registerName("contentMaxSize");
+public static final int sel_menuDidClose_1 = sel_registerName("menuDidClose:");
+public static final int sel_setPrinter_1 = sel_registerName("setPrinter:");
+public static final int sel_keywordForDescriptorAtIndex_1 = sel_registerName("keywordForDescriptorAtIndex:");
+public static final int sel_notANumberSymbol = sel_registerName("notANumberSymbol");
+public static final int sel_minimumLineHeight = sel_registerName("minimumLineHeight");
+public static final int sel_setContentBorderThickness_1forEdge_1 = sel_registerName("setContentBorderThickness:forEdge:");
+public static final int sel_titleFrameOfColumn_1 = sel_registerName("titleFrameOfColumn:");
+public static final int sel_dateValue = sel_registerName("dateValue");
+public static final int sel_numberOfRows = sel_registerName("numberOfRows");
+public static final int sel_isReadableFileAtPath_1 = sel_registerName("isReadableFileAtPath:");
+public static final int sel_canInsertChild = sel_registerName("canInsertChild");
+public static final int sel_stringByReplacingOccurrencesOfString_1withString_1options_1range_1 = sel_registerName("stringByReplacingOccurrencesOfString:withString:options:range:");
+public static final int sel_ok_1 = sel_registerName("ok:");
+public static final int sel_hourOfDay = sel_registerName("hourOfDay");
+public static final int sel_paragraphRangeForRange_1 = sel_registerName("paragraphRangeForRange:");
+public static final int sel_focusStack = sel_registerName("focusStack");
+public static final int sel_setUsesThreadedAnimation_1 = sel_registerName("setUsesThreadedAnimation:");
+public static final int sel_dataForType_1 = sel_registerName("dataForType:");
+public static final int sel_isByref = sel_registerName("isByref");
+public static final int sel_initWithResponse_1data_1userInfo_1storagePolicy_1 = sel_registerName("initWithResponse:data:userInfo:storagePolicy:");
+public static final int sel_initWithSerializedRepresentation_1 = sel_registerName("initWithSerializedRepresentation:");
+public static final int sel_openDocument_1 = sel_registerName("openDocument:");
+public static final int sel_translateRectsNeedingDisplayInRect_1by_1 = sel_registerName("translateRectsNeedingDisplayInRect:by:");
+public static final int sel_highlightsBy = sel_registerName("highlightsBy");
+public static final int sel_openHandCursor = sel_registerName("openHandCursor");
+public static final int sel_lineFragmentRectForProposedRect_1remainingRect_1 = sel_registerName("lineFragmentRectForProposedRect:remainingRect:");
+public static final int sel_selectedNodes = sel_registerName("selectedNodes");
+public static final int sel_replaceObjectAtIndex_1withObject_1 = sel_registerName("replaceObjectAtIndex:withObject:");
+public static final int sel_indexOfItemAtPoint_1 = sel_registerName("indexOfItemAtPoint:");
+public static final int sel_setCriteria_1andDisplayValues_1forRowAtIndex_1 = sel_registerName("setCriteria:andDisplayValues:forRowAtIndex:");
+public static final int sel_textStorage_1edited_1range_1changeInLength_1invalidatedRange_1 = sel_registerName("textStorage:edited:range:changeInLength:invalidatedRange:");
+public static final int sel_synchronizeWindowTitleWithDocumentName = sel_registerName("synchronizeWindowTitleWithDocumentName");
+public static final int sel_fileHandleWithNullDevice = sel_registerName("fileHandleWithNullDevice");
+public static final int sel_descriptorWithTypeCode_1 = sel_registerName("descriptorWithTypeCode:");
+public static final int sel_initWithDocFormat_1documentAttributes_1 = sel_registerName("initWithDocFormat:documentAttributes:");
+public static final int sel_setAutoresizingMask_1 = sel_registerName("setAutoresizingMask:");
+public static final int sel_methodReturnLength = sel_registerName("methodReturnLength");
+public static final int sel_recentDocumentURLs = sel_registerName("recentDocumentURLs");
+public static final int sel_setCurrentDirectoryPath_1 = sel_registerName("setCurrentDirectoryPath:");
+public static final int sel_characterSetWithRange_1 = sel_registerName("characterSetWithRange:");
+public static final int sel_resizeUpCursor = sel_registerName("resizeUpCursor");
+public static final int sel_rect = sel_registerName("rect");
+public static final int sel_removeCharactersInRange_1 = sel_registerName("removeCharactersInRange:");
+public static final int sel_performSelectorOnMainThread_1withObject_1waitUntilDone_1 = sel_registerName("performSelectorOnMainThread:withObject:waitUntilDone:");
+public static final int sel_elementAtIndex_1associatedPoints_1 = sel_registerName("elementAtIndex:associatedPoints:");
+public static final int sel_dataForKey_1 = sel_registerName("dataForKey:");
+public static final int sel_defaultDepthLimit = sel_registerName("defaultDepthLimit");
+public static final int sel_rulersVisible = sel_registerName("rulersVisible");
+public static final int sel_generalPasteboard = sel_registerName("generalPasteboard");
+public static final int sel_setAllowsTickMarkValuesOnly_1 = sel_registerName("setAllowsTickMarkValuesOnly:");
+public static final int sel_stateImageOffset = sel_registerName("stateImageOffset");
+public static final int sel_isBordered = sel_registerName("isBordered");
+public static final int sel_insertPointer_1atIndex_1 = sel_registerName("insertPointer:atIndex:");
+public static final int sel_keyForFileWrapper_1 = sel_registerName("keyForFileWrapper:");
+public static final int sel_renewGState = sel_registerName("renewGState");
+public static final int sel_autovalidates = sel_registerName("autovalidates");
+public static final int sel_localizedNameForFamily_1face_1 = sel_registerName("localizedNameForFamily:face:");
+public static final int sel_setAltIncrementValue_1 = sel_registerName("setAltIncrementValue:");
+public static final int sel_sortUsingFunction_1context_1 = sel_registerName("sortUsingFunction:context:");
+public static final int sel_fileNameExtensionWasHiddenInLastRunSavePanel = sel_registerName("fileNameExtensionWasHiddenInLastRunSavePanel");
+public static final int sel_endSheet_1returnCode_1 = sel_registerName("endSheet:returnCode:");
+public static final int sel_insertObjects_1atIndexes_1 = sel_registerName("insertObjects:atIndexes:");
+public static final int sel_standaloneMonthSymbols = sel_registerName("standaloneMonthSymbols");
+public static final int sel_prefersAllColumnUserResizing = sel_registerName("prefersAllColumnUserResizing");
+public static final int sel_separatesColumns = sel_registerName("separatesColumns");
+public static final int sel_moveToBeginningOfDocument_1 = sel_registerName("moveToBeginningOfDocument:");
+public static final int sel_objectZone = sel_registerName("objectZone");
+public static final int sel_initWithURL_1MIMEType_1expectedContentLength_1textEncodingName_1 = sel_registerName("initWithURL:MIMEType:expectedContentLength:textEncodingName:");
+public static final int sel_gotoEnd_1 = sel_registerName("gotoEnd:");
+public static final int sel_superscriptRange_1 = sel_registerName("superscriptRange:");
+public static final int sel_readInBackgroundAndNotifyForModes_1 = sel_registerName("readInBackgroundAndNotifyForModes:");
+public static final int sel_initWithObjects_1forKeys_1 = sel_registerName("initWithObjects:forKeys:");
+public static final int sel_cancel = sel_registerName("cancel");
+public static final int sel_suiteName = sel_registerName("suiteName");
+public static final int sel_sortedArrayUsingFunction_1context_1hint_1 = sel_registerName("sortedArrayUsingFunction:context:hint:");
+public static final int sel_countWordsInString_1language_1 = sel_registerName("countWordsInString:language:");
+public static final int sel_prepareWithInvocationTarget_1 = sel_registerName("prepareWithInvocationTarget:");
+public static final int sel_statusItemWithLength_1 = sel_registerName("statusItemWithLength:");
+public static final int sel_tableView_1shouldEditTableColumn_1row_1 = sel_registerName("tableView:shouldEditTableColumn:row:");
+public static final int sel_appendBezierPathWithRect_1 = sel_registerName("appendBezierPathWithRect:");
+public static final int sel_scrollColumnsRightBy_1 = sel_registerName("scrollColumnsRightBy:");
+public static final int sel_negativeInfinitySymbol = sel_registerName("negativeInfinitySymbol");
+public static final int sel_firstLineHeadIndent = sel_registerName("firstLineHeadIndent");
+public static final int sel_generateGlyphsForGlyphStorage_1desiredNumberOfCharacters_1glyphIndex_1characterIndex_1 = sel_registerName("generateGlyphsForGlyphStorage:desiredNumberOfCharacters:glyphIndex:characterIndex:");
+public static final int sel_dateWithTimeIntervalSinceReferenceDate_1 = sel_registerName("dateWithTimeIntervalSinceReferenceDate:");
+public static final int sel_menu_1updateItem_1atIndex_1shouldCancel_1 = sel_registerName("menu:updateItem:atIndex:shouldCancel:");
+public static final int sel_connection_1willSendRequest_1redirectResponse_1 = sel_registerName("connection:willSendRequest:redirectResponse:");
+public static final int sel_attemptRecoveryFromError_1optionIndex_1delegate_1didRecoverSelector_1contextInfo_1 = sel_registerName("attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:");
+public static final int sel_cursorUpdate_1 = sel_registerName("cursorUpdate:");
+public static final int sel_initWithMachPort_1options_1 = sel_registerName("initWithMachPort:options:");
+public static final int sel_applyFontTraits_1range_1 = sel_registerName("applyFontTraits:range:");
+public static final int sel_noteHeightOfRowsWithIndexesChanged_1 = sel_registerName("noteHeightOfRowsWithIndexesChanged:");
+public static final int sel_orderFrontTablePanel_1 = sel_registerName("orderFrontTablePanel:");
+public static final int sel_arrayWithObjects_1 = sel_registerName("arrayWithObjects:");
+public static final int sel_enableFlushWindow = sel_registerName("enableFlushWindow");
+public static final int sel_minimum = sel_registerName("minimum");
+public static final int sel_stopListening = sel_registerName("stopListening");
+public static final int sel_endParagraph = sel_registerName("endParagraph");
+public static final int sel_sharingType = sel_registerName("sharingType");
+public static final int sel_backgroundLayoutEnabled = sel_registerName("backgroundLayoutEnabled");
+public static final int sel_yellowColor = sel_registerName("yellowColor");
+public static final int sel_columnIndexesInRect_1 = sel_registerName("columnIndexesInRect:");
+public static final int sel_compositingOperation = sel_registerName("compositingOperation");
+public static final int sel_stopModalWithCode_1 = sel_registerName("stopModalWithCode:");
+public static final int sel_smallSystemFontSize = sel_registerName("smallSystemFontSize");
+public static final int sel_nonretainedObjectValue = sel_registerName("nonretainedObjectValue");
+public static final int sel_encodeBytes_1length_1forKey_1 = sel_registerName("encodeBytes:length:forKey:");
+public static final int sel_objectValues = sel_registerName("objectValues");
+public static final int sel_destroyContext = sel_registerName("destroyContext");
+public static final int sel_setFileModificationDate_1 = sel_registerName("setFileModificationDate:");
+public static final int sel_rightMouseDragged_1 = sel_registerName("rightMouseDragged:");
+public static final int sel_systemStatusBar = sel_registerName("systemStatusBar");
+public static final int sel_executableArchitectures = sel_registerName("executableArchitectures");
+public static final int sel_recentSearches = sel_registerName("recentSearches");
+public static final int sel_getWhite_1alpha_1 = sel_registerName("getWhite:alpha:");
+public static final int sel_readDataToEndOfFile = sel_registerName("readDataToEndOfFile");
+public static final int sel_setHour_1 = sel_registerName("setHour:");
+public static final int sel_titleBarFontOfSize_1 = sel_registerName("titleBarFontOfSize:");
+public static final int sel_canDragRowsWithIndexes_1atPoint_1 = sel_registerName("canDragRowsWithIndexes:atPoint:");
+public static final int sel_acceptsArrowKeys = sel_registerName("acceptsArrowKeys");
+public static final int sel_availableColorLists = sel_registerName("availableColorLists");
+public static final int sel_setUsesLazyFetching_1 = sel_registerName("setUsesLazyFetching:");
+public static final int sel_convertAttributes_1 = sel_registerName("convertAttributes:");
+public static final int sel_isWritableFileAtPath_1 = sel_registerName("isWritableFileAtPath:");
+public static final int sel_timerWithTimeInterval_1target_1selector_1userInfo_1repeats_1 = sel_registerName("timerWithTimeInterval:target:selector:userInfo:repeats:");
+public static final int sel_windowDidChangeScreen_1 = sel_registerName("windowDidChangeScreen:");
+public static final int sel_insertTextContainer_1atIndex_1 = sel_registerName("insertTextContainer:atIndex:");
+public static final int sel_weightOfFont_1 = sel_registerName("weightOfFont:");
+public static final int sel_temporaryAttributesAtCharacterIndex_1longestEffectiveRange_1inRange_1 = sel_registerName("temporaryAttributesAtCharacterIndex:longestEffectiveRange:inRange:");
+public static final int sel_trackWithEvent_1 = sel_registerName("trackWithEvent:");
+public static final int sel_selectRowIndexes_1byExtendingSelection_1 = sel_registerName("selectRowIndexes:byExtendingSelection:");
+public static final int sel_charactersToBeSkipped = sel_registerName("charactersToBeSkipped");
+public static final int sel_names = sel_registerName("names");
+public static final int sel_setAllowsCutCopyPaste_1 = sel_registerName("setAllowsCutCopyPaste:");
+public static final int sel_setDuration_1 = sel_registerName("setDuration:");
+public static final int sel_sleepForTimeInterval_1 = sel_registerName("sleepForTimeInterval:");
+public static final int sel_removeChildAtIndex_1 = sel_registerName("removeChildAtIndex:");
+public static final int sel_tokenFieldCell_1writeRepresentedObjects_1toPasteboard_1 = sel_registerName("tokenFieldCell:writeRepresentedObjects:toPasteboard:");
+public static final int sel_backgroundStyle = sel_registerName("backgroundStyle");
+public static final int sel_open_1 = sel_registerName("open:");
+public static final int sel_indexGreaterThanOrEqualToIndex_1 = sel_registerName("indexGreaterThanOrEqualToIndex:");
+public static final int sel_isAbsolutePath = sel_registerName("isAbsolutePath");
+public static final int sel_paletteLabel = sel_registerName("paletteLabel");
+public static final int sel_setQuarterSymbols_1 = sel_registerName("setQuarterSymbols:");
+public static final int sel_suppressionButton = sel_registerName("suppressionButton");
+public static final int sel_undo = sel_registerName("undo");
+public static final int sel_rangeOfString_1options_1range_1locale_1 = sel_registerName("rangeOfString:options:range:locale:");
+public static final int sel_localizedName_1locale_1 = sel_registerName("localizedName:locale:");
+public static final int sel_setTableView_1 = sel_registerName("setTableView:");
+public static final int sel_isExecutableFileAtPath_1 = sel_registerName("isExecutableFileAtPath:");
+public static final int sel_standaloneQuarterSymbols = sel_registerName("standaloneQuarterSymbols");
+public static final int sel_textView_1shouldSetSpellingState_1range_1 = sel_registerName("textView:shouldSetSpellingState:range:");
+public static final int sel_newObject = sel_registerName("newObject");
+public static final int sel_setDocumentEdited_1 = sel_registerName("setDocumentEdited:");
+public static final int sel_setRelativePosition_1 = sel_registerName("setRelativePosition:");
+public static final int sel_allConnections = sel_registerName("allConnections");
+public static final int sel_isLessThanOrEqualTo_1 = sel_registerName("isLessThanOrEqualTo:");
+public static final int sel_attributeWithName_1stringValue_1 = sel_registerName("attributeWithName:stringValue:");
+public static final int sel_floatForKey_1 = sel_registerName("floatForKey:");
+public static final int sel_initWithDomain_1type_1name_1port_1 = sel_registerName("initWithDomain:type:name:port:");
+public static final int sel_setShadowOffset_1 = sel_registerName("setShadowOffset:");
+public static final int sel_tabViewItems = sel_registerName("tabViewItems");
+public static final int sel_appleEventCodeForReturnType = sel_registerName("appleEventCodeForReturnType");
+public static final int sel_createFileAtPath_1contents_1attributes_1 = sel_registerName("createFileAtPath:contents:attributes:");
+public static final int sel_ruleEditor_1predicatePartsForCriterion_1withDisplayValue_1inRow_1 = sel_registerName("ruleEditor:predicatePartsForCriterion:withDisplayValue:inRow:");
+public static final int sel_evaluateWithObject_1 = sel_registerName("evaluateWithObject:");
+public static final int sel_pathComponents = sel_registerName("pathComponents");
+public static final int sel_setTarget_1 = sel_registerName("setTarget:");
+public static final int sel_fileCreationDate = sel_registerName("fileCreationDate");
+public static final int sel_port = sel_registerName("port");
+public static final int sel_publish = sel_registerName("publish");
+public static final int sel_downloadDidFinish_1 = sel_registerName("downloadDidFinish:");
+public static final int sel_endEditing_1 = sel_registerName("endEditing:");
+public static final int sel_expectedResourceDataSize = sel_registerName("expectedResourceDataSize");
+public static final int sel_paddingCharacter = sel_registerName("paddingCharacter");
+public static final int sel_convertPoint_1fromView_1 = sel_registerName("convertPoint:fromView:");
+public static final int sel_setIntValue_1 = sel_registerName("setIntValue:");
+public static final int sel_appendBezierPathWithArcFromPoint_1toPoint_1radius_1 = sel_registerName("appendBezierPathWithArcFromPoint:toPoint:radius:");
+public static final int sel_currentFontAction = sel_registerName("currentFontAction");
+public static final int sel_expressionForFunction_1arguments_1 = sel_registerName("expressionForFunction:arguments:");
+public static final int sel_minimumDaysInFirstWeek = sel_registerName("minimumDaysInFirstWeek");
+public static final int sel_setDeletesFileUponFailure_1 = sel_registerName("setDeletesFileUponFailure:");
+public static final int sel_pageCount = sel_registerName("pageCount");
+public static final int sel_imageAlignment = sel_registerName("imageAlignment");
+public static final int sel_URLProtocol_1didCancelAuthenticationChallenge_1 = sel_registerName("URLProtocol:didCancelAuthenticationChallenge:");
+public static final int sel_localizedPaperName = sel_registerName("localizedPaperName");
+public static final int sel_setAllowsBranchSelection_1 = sel_registerName("setAllowsBranchSelection:");
+public static final int sel_symbolicLinkDestination = sel_registerName("symbolicLinkDestination");
+public static final int sel_prepareSavePanel_1 = sel_registerName("prepareSavePanel:");
+public static final int sel_enableMultipleThreads = sel_registerName("enableMultipleThreads");
+public static final int sel_configurePersistentStoreCoordinatorForURL_1ofType_1modelConfiguration_1storeOptions_1error_1 = sel_registerName("configurePersistentStoreCoordinatorForURL:ofType:modelConfiguration:storeOptions:error:");
+public static final int sel_backgroundLoadDidFailWithReason_1 = sel_registerName("backgroundLoadDidFailWithReason:");
+public static final int sel_copyAttributesFromContext_1withMask_1 = sel_registerName("copyAttributesFromContext:withMask:");
+public static final int sel_isVertical = sel_registerName("isVertical");
+public static final int sel_wait = sel_registerName("wait");
+public static final int sel_firstObjectCommonWithArray_1 = sel_registerName("firstObjectCommonWithArray:");
+public static final int sel_hideOtherApplications_1 = sel_registerName("hideOtherApplications:");
+public static final int sel_startSpeakingString_1 = sel_registerName("startSpeakingString:");
+public static final int sel_makeKeyAndOrderFront_1 = sel_registerName("makeKeyAndOrderFront:");
+public static final int sel_drawCellAtIndex_1 = sel_registerName("drawCellAtIndex:");
+public static final int sel_headerToolTip = sel_registerName("headerToolTip");
+public static final int sel_readRTFDFromFile_1 = sel_registerName("readRTFDFromFile:");
+public static final int sel_knownTimeZoneNames = sel_registerName("knownTimeZoneNames");
+public static final int sel_toOneRelationshipKeys = sel_registerName("toOneRelationshipKeys");
+public static final int sel_replyTimeout = sel_registerName("replyTimeout");
+public static final int sel_setDelegate_1 = sel_registerName("setDelegate:");
+public static final int sel_initWithTarget_1protocol_1 = sel_registerName("initWithTarget:protocol:");
+public static final int sel_setShowsPrintPanel_1 = sel_registerName("setShowsPrintPanel:");
+public static final int sel_trackingNumber = sel_registerName("trackingNumber");
+public static final int sel_initWithDecimal_1 = sel_registerName("initWithDecimal:");
+public static final int sel_proxyWithTarget_1connection_1 = sel_registerName("proxyWithTarget:connection:");
+public static final int sel_setCompositingFilter_1 = sel_registerName("setCompositingFilter:");
+public static final int sel_systemFontSizeForControlSize_1 = sel_registerName("systemFontSizeForControlSize:");
+public static final int sel_registerDefaults_1 = sel_registerName("registerDefaults:");
+public static final int sel_veryShortStandaloneMonthSymbols = sel_registerName("veryShortStandaloneMonthSymbols");
+public static final int sel_setPlusSign_1 = sel_registerName("setPlusSign:");
+public static final int sel_colorRenderingIntent = sel_registerName("colorRenderingIntent");
+public static final int sel_thicknessRequiredInRuler = sel_registerName("thicknessRequiredInRuler");
+public static final int sel_setAlertStyle_1 = sel_registerName("setAlertStyle:");
+public static final int sel_searchScopes = sel_registerName("searchScopes");
+public static final int sel_tag = sel_registerName("tag");
+public static final int sel_autosavingDelay = sel_registerName("autosavingDelay");
+public static final int sel_setDateStyle_1 = sel_registerName("setDateStyle:");
+public static final int sel_setIcon_1forFile_1options_1 = sel_registerName("setIcon:forFile:options:");
+public static final int sel_internationalCurrencySymbol = sel_registerName("internationalCurrencySymbol");
+public static final int sel_netService_1didUpdateTXTRecordData_1 = sel_registerName("netService:didUpdateTXTRecordData:");
+public static final int sel_setOnMouseEntered_1 = sel_registerName("setOnMouseEntered:");
+public static final int sel_setTextBaseWritingDirection_1 = sel_registerName("setTextBaseWritingDirection:");
+public static final int sel_startSpecifier = sel_registerName("startSpecifier");
+public static final int sel_setExcludedFromWindowsMenu_1 = sel_registerName("setExcludedFromWindowsMenu:");
+public static final int sel_operatingSystemName = sel_registerName("operatingSystemName");
+public static final int sel_isConcurrent = sel_registerName("isConcurrent");
+public static final int sel_enableRelease_1 = sel_registerName("enableRelease:");
+public static final int sel_getValues_1forAttribute_1forVirtualScreen_1 = sel_registerName("getValues:forAttribute:forVirtualScreen:");
+public static final int sel_interrupt = sel_registerName("interrupt");
+public static final int sel_whiteComponent = sel_registerName("whiteComponent");
+public static final int sel_keyEquivalentRectForBounds_1 = sel_registerName("keyEquivalentRectForBounds:");
+public static final int sel_numberOfVisibleColumns = sel_registerName("numberOfVisibleColumns");
+public static final int sel_windowNibName = sel_registerName("windowNibName");
+public static final int sel_parser_1foundIgnorableWhitespace_1 = sel_registerName("parser:foundIgnorableWhitespace:");
+public static final int sel_menuItemCellForItemAtIndex_1 = sel_registerName("menuItemCellForItemAtIndex:");
+public static final int sel_addTrackingArea_1 = sel_registerName("addTrackingArea:");
+public static final int sel_arrangedObjects = sel_registerName("arrangedObjects");
+public static final int sel_timeStyle = sel_registerName("timeStyle");
+public static final int sel_indexPathWithIndexes_1length_1 = sel_registerName("indexPathWithIndexes:length:");
+public static final int sel_addNamespace_1 = sel_registerName("addNamespace:");
+public static final int sel_setDisplayValuesKeyPath_1 = sel_registerName("setDisplayValuesKeyPath:");
+public static final int sel_notificationBatchingInterval = sel_registerName("notificationBatchingInterval");
+public static final int sel_MIMEType = sel_registerName("MIMEType");
+public static final int sel_drawerWillClose_1 = sel_registerName("drawerWillClose:");
+public static final int sel_sortedArrayHint = sel_registerName("sortedArrayHint");
+public static final int sel_shortQuarterSymbols = sel_registerName("shortQuarterSymbols");
+public static final int sel_usesAlternatingRowBackgroundColors = sel_registerName("usesAlternatingRowBackgroundColors");
+public static final int sel_colorWithKey_1 = sel_registerName("colorWithKey:");
+public static final int sel_rangeForUserCompletion = sel_registerName("rangeForUserCompletion");
+public static final int sel_boolValue = sel_registerName("boolValue");
+public static final int sel_autosaveName = sel_registerName("autosaveName");
+public static final int sel_childWindows = sel_registerName("childWindows");
+public static final int sel_mapTableWithStrongToWeakObjects = sel_registerName("mapTableWithStrongToWeakObjects");
+public static final int sel_unhide = sel_registerName("unhide");
+public static final int sel_setRowClass_1 = sel_registerName("setRowClass:");
+public static final int sel_endSubelementIndex = sel_registerName("endSubelementIndex");
+public static final int sel_preferredLocalizations = sel_registerName("preferredLocalizations");
+public static final int sel_fileSystemChanged = sel_registerName("fileSystemChanged");
+public static final int sel_secondOfMinute = sel_registerName("secondOfMinute");
+public static final int sel_scrollWheel_1 = sel_registerName("scrollWheel:");
+public static final int sel_characterIndexForGlyphAtIndex_1 = sel_registerName("characterIndexForGlyphAtIndex:");
+public static final int sel_drawRepresentation_1inRect_1 = sel_registerName("drawRepresentation:inRect:");
+public static final int sel_setByAddingObject_1 = sel_registerName("setByAddingObject:");
+public static final int sel_rotateByAngle_1 = sel_registerName("rotateByAngle:");
+public static final int sel_allValues = sel_registerName("allValues");
+public static final int sel_addItemWithObjectValue_1 = sel_registerName("addItemWithObjectValue:");
+public static final int sel_tabViewItemAtIndex_1 = sel_registerName("tabViewItemAtIndex:");
+public static final int sel_servicePortWithName_1 = sel_registerName("servicePortWithName:");
+public static final int sel_multiplier = sel_registerName("multiplier");
+public static final int sel_setSelectionGranularity_1 = sel_registerName("setSelectionGranularity:");
+public static final int sel_setViewsNeedDisplay_1 = sel_registerName("setViewsNeedDisplay:");
+public static final int sel_object = sel_registerName("object");
+public static final int sel_writeFileWrapper_1 = sel_registerName("writeFileWrapper:");
+public static final int sel_authenticationMethod = sel_registerName("authenticationMethod");
+public static final int sel_frameLength = sel_registerName("frameLength");
+public static final int sel_nextNode = sel_registerName("nextNode");
+public static final int sel_characterSetWithCharactersInString_1 = sel_registerName("characterSetWithCharactersInString:");
+public static final int sel_messageText = sel_registerName("messageText");
+public static final int sel_setArguments_1 = sel_registerName("setArguments:");
+public static final int sel_getBytes_1length_1 = sel_registerName("getBytes:length:");
+public static final int sel_setDropItem_1dropChildIndex_1 = sel_registerName("setDropItem:dropChildIndex:");
+public static final int sel_expressionForVariable_1 = sel_registerName("expressionForVariable:");
+public static final int sel_rectPreservedDuringLiveResize = sel_registerName("rectPreservedDuringLiveResize");
+public static final int sel_isMuted = sel_registerName("isMuted");
+public static final int sel_allowsColumnResizing = sel_registerName("allowsColumnResizing");
+public static final int sel_readFileWrapper = sel_registerName("readFileWrapper");
+public static final int sel_undoNestedGroup = sel_registerName("undoNestedGroup");
+public static final int sel_setIncludedKeys_1 = sel_registerName("setIncludedKeys:");
+public static final int sel_textWithStringValue_1 = sel_registerName("textWithStringValue:");
+public static final int sel_ruleEditorRowsDidChange_1 = sel_registerName("ruleEditorRowsDidChange:");
+public static final int sel_handleMouseEvent_1 = sel_registerName("handleMouseEvent:");
+public static final int sel_browser_1canDragRowsWithIndexes_1inColumn_1withEvent_1 = sel_registerName("browser:canDragRowsWithIndexes:inColumn:withEvent:");
+public static final int sel_drawPageBorderWithSize_1 = sel_registerName("drawPageBorderWithSize:");
+public static final int sel_valueWithBytes_1objCType_1 = sel_registerName("valueWithBytes:objCType:");
+public static final int sel_subpathsAtPath_1 = sel_registerName("subpathsAtPath:");
+public static final int sel_mnemonicLocation = sel_registerName("mnemonicLocation");
+public static final int sel_dockTile = sel_registerName("dockTile");
+public static final int sel_setFirstLineHeadIndent_1 = sel_registerName("setFirstLineHeadIndent:");
+public static final int sel_isAutomaticQuoteSubstitutionEnabled = sel_registerName("isAutomaticQuoteSubstitutionEnabled");
+public static final int sel_allowsReverseTransformation = sel_registerName("allowsReverseTransformation");
+public static final int sel_moveNodes_1toIndexPath_1 = sel_registerName("moveNodes:toIndexPath:");
+public static final int sel_seekToFileOffset_1 = sel_registerName("seekToFileOffset:");
+public static final int sel_scriptingBeginsWith_1 = sel_registerName("scriptingBeginsWith:");
+public static final int sel_setInformativeText_1 = sel_registerName("setInformativeText:");
+public static final int sel_initWithIndexSet_1 = sel_registerName("initWithIndexSet:");
+public static final int sel_write_1maxLength_1 = sel_registerName("write:maxLength:");
+public static final int sel_canInitWithRequest_1 = sel_registerName("canInitWithRequest:");
+public static final int sel_enqueueNotification_1postingStyle_1 = sel_registerName("enqueueNotification:postingStyle:");
+public static final int sel_setShouldResolveExternalEntities_1 = sel_registerName("setShouldResolveExternalEntities:");
+public static final int sel_usesFindPanel = sel_registerName("usesFindPanel");
+public static final int sel_perMillSymbol = sel_registerName("perMillSymbol");
+public static final int sel_setClearsFilterPredicateOnInsertion_1 = sel_registerName("setClearsFilterPredicateOnInsertion:");
+public static final int sel_currentLocale = sel_registerName("currentLocale");
+public static final int sel_pasteboardByFilteringData_1ofType_1 = sel_registerName("pasteboardByFilteringData:ofType:");
+public static final int sel_isSheet = sel_registerName("isSheet");
+public static final int sel_hasWritablePropertyForKey_1 = sel_registerName("hasWritablePropertyForKey:");
+public static final int sel_drawDividerInRect_1 = sel_registerName("drawDividerInRect:");
+public static final int sel_sharedUserDefaultsController = sel_registerName("sharedUserDefaultsController");
+public static final int sel_preferredFontNames = sel_registerName("preferredFontNames");
+public static final int sel_menuBarFontOfSize_1 = sel_registerName("menuBarFontOfSize:");
+public static final int sel_sharedColorPanelExists = sel_registerName("sharedColorPanelExists");
+public static final int sel_reshape = sel_registerName("reshape");
+public static final int sel_initWithLong_1 = sel_registerName("initWithLong:");
+public static final int sel_reservedThicknessForAccessoryView = sel_registerName("reservedThicknessForAccessoryView");
+public static final int sel_setTitleCell_1 = sel_registerName("setTitleCell:");
+public static final int sel_sharedSpellCheckerExists = sel_registerName("sharedSpellCheckerExists");
+public static final int sel_locationForSubmenu_1 = sel_registerName("locationForSubmenu:");
+public static final int sel_nodesForXPath_1error_1 = sel_registerName("nodesForXPath:error:");
+public static final int sel_setHasVerticalRuler_1 = sel_registerName("setHasVerticalRuler:");
+public static final int sel_controlHighlightColor = sel_registerName("controlHighlightColor");
+public static final int sel_rowSpan = sel_registerName("rowSpan");
+public static final int sel_decodeObject = sel_registerName("decodeObject");
+public static final int sel_fileHandleForReadingAtPath_1 = sel_registerName("fileHandleForReadingAtPath:");
+public static final int sel_didLoadBytes_1loadComplete_1 = sel_registerName("didLoadBytes:loadComplete:");
+public static final int sel_renewRows_1columns_1 = sel_registerName("renewRows:columns:");
+public static final int sel_performKeyEquivalent_1 = sel_registerName("performKeyEquivalent:");
+public static final int sel_windowDidResignKey_1 = sel_registerName("windowDidResignKey:");
+public static final int sel_typeForKey_1 = sel_registerName("typeForKey:");
+public static final int sel_selectedObjects = sel_registerName("selectedObjects");
+public static final int sel_defaultPrinter = sel_registerName("defaultPrinter");
+public static final int sel_colorWithPatternImage_1 = sel_registerName("colorWithPatternImage:");
+public static final int sel_setAttributedAlternateTitle_1 = sel_registerName("setAttributedAlternateTitle:");
+public static final int sel_setValue_1forKey_1 = sel_registerName("setValue:forKey:");
+public static final int sel_drawInteriorWithFrame_1inView_1 = sel_registerName("drawInteriorWithFrame:inView:");
+public static final int sel_copy_1 = sel_registerName("copy:");
+public static final int sel_scanString_1intoString_1 = sel_registerName("scanString:intoString:");
+public static final int sel_fileManager_1shouldProceedAfterError_1 = sel_registerName("fileManager:shouldProceedAfterError:");
+public static final int sel_fileManager_1shouldRemoveItemAtPath_1 = sel_registerName("fileManager:shouldRemoveItemAtPath:");
+public static final int sel_removeSavedColumnsWithAutosaveName_1 = sel_registerName("removeSavedColumnsWithAutosaveName:");
+public static final int sel_numberWithUnsignedInteger_1 = sel_registerName("numberWithUnsignedInteger:");
+public static final int sel_rulerMarkersForTextView_1paragraphStyle_1ruler_1 = sel_registerName("rulerMarkersForTextView:paragraphStyle:ruler:");
+public static final int sel_layoutRectForTextBlock_1atIndex_1effectiveRange_1 = sel_registerName("layoutRectForTextBlock:atIndex:effectiveRange:");
+public static final int sel_maxPossiblePositionOfDividerAtIndex_1 = sel_registerName("maxPossiblePositionOfDividerAtIndex:");
+public static final int sel_removePort_1forMode_1 = sel_registerName("removePort:forMode:");
+public static final int sel_drawHashMarksAndLabelsInRect_1 = sel_registerName("drawHashMarksAndLabelsInRect:");
+public static final int sel_control_1textView_1doCommandBySelector_1 = sel_registerName("control:textView:doCommandBySelector:");
+public static final int sel_getLineFragmentRect_1usedRect_1remainingRect_1forStartingGlyphAtIndex_1proposedRect_1lineSpacing_1paragraphSpacingBefore_1paragraphSpacingAfter_1 = sel_registerName("getLineFragmentRect:usedRect:remainingRect:forStartingGlyphAtIndex:proposedRect:lineSpacing:paragraphSpacingBefore:paragraphSpacingAfter:");
+public static final int sel_textContainerInset = sel_registerName("textContainerInset");
+public static final int sel_positionsForCompositeSequence_1numberOfGlyphs_1pointArray_1 = sel_registerName("positionsForCompositeSequence:numberOfGlyphs:pointArray:");
+public static final int sel_stringByAppendingPathComponent_1 = sel_registerName("stringByAppendingPathComponent:");
+public static final int sel_application_1printFiles_1 = sel_registerName("application:printFiles:");
+public static final int sel_scanInt_1 = sel_registerName("scanInt:");
+public static final int sel_operators = sel_registerName("operators");
+public static final int sel_fireDate = sel_registerName("fireDate");
+public static final int sel_isExternal = sel_registerName("isExternal");
+public static final int sel_setImagePosition_1 = sel_registerName("setImagePosition:");
+public static final int sel_predicateWithFormat_1arguments_1 = sel_registerName("predicateWithFormat:arguments:");
+public static final int sel_stopSpeaking = sel_registerName("stopSpeaking");
+public static final int sel_contentWidthValueType = sel_registerName("contentWidthValueType");
+public static final int sel_paddingPosition = sel_registerName("paddingPosition");
+public static final int sel_removeLastObject = sel_registerName("removeLastObject");
+public static final int sel_stringByReplacingCharactersInRange_1withString_1 = sel_registerName("stringByReplacingCharactersInRange:withString:");
+public static final int sel_pointerValue = sel_registerName("pointerValue");
+public static final int sel_setTruncatesLastVisibleLine_1 = sel_registerName("setTruncatesLastVisibleLine:");
+public static final int sel_URLHandleResourceDidBeginLoading_1 = sel_registerName("URLHandleResourceDidBeginLoading:");
+public static final int sel_valueForKeyPath_1 = sel_registerName("valueForKeyPath:");
+public static final int sel_setPeriodicDelay_1interval_1 = sel_registerName("setPeriodicDelay:interval:");
+public static final int sel_imageRepWithCIImage_1 = sel_registerName("imageRepWithCIImage:");
+public static final int sel_wantsNotificationForMarkedText = sel_registerName("wantsNotificationForMarkedText");
+public static final int sel_rectForPart_1 = sel_registerName("rectForPart:");
+public static final int sel_setWeekday_1 = sel_registerName("setWeekday:");
+public static final int sel_streamStatus = sel_registerName("streamStatus");
+public static final int sel_containsPoint_1 = sel_registerName("containsPoint:");
+public static final int sel_underlineThickness = sel_registerName("underlineThickness");
+public static final int sel_allObjects = sel_registerName("allObjects");
+public static final int sel_characters = sel_registerName("characters");
+public static final int sel_outlineViewSelectionIsChanging_1 = sel_registerName("outlineViewSelectionIsChanging:");
+public static final int sel_netServiceBrowser_1didNotSearch_1 = sel_registerName("netServiceBrowser:didNotSearch:");
+public static final int sel_poolCountHighWaterMark = sel_registerName("poolCountHighWaterMark");
+public static final int sel_setColorSpaceName_1 = sel_registerName("setColorSpaceName:");
+public static final int sel_graphicsPort = sel_registerName("graphicsPort");
+public static final int sel_fontDescriptorWithName_1matrix_1 = sel_registerName("fontDescriptorWithName:matrix:");
+public static final int sel_setSelectable_1 = sel_registerName("setSelectable:");
+public static final int sel_scriptErrorOffendingObjectDescriptor = sel_registerName("scriptErrorOffendingObjectDescriptor");
+public static final int sel_resizingMask = sel_registerName("resizingMask");
+public static final int sel_canHandleRequest_1 = sel_registerName("canHandleRequest:");
+public static final int sel_imageRepWithPasteboard_1 = sel_registerName("imageRepWithPasteboard:");
+public static final int sel_stopQuery = sel_registerName("stopQuery");
+public static final int sel_dataWithBytes_1length_1 = sel_registerName("dataWithBytes:length:");
+public static final int sel_setCachesBezierPath_1 = sel_registerName("setCachesBezierPath:");
+public static final int sel_arrayForKey_1 = sel_registerName("arrayForKey:");
+public static final int sel_cell = sel_registerName("cell");
+public static final int sel_dealloc = sel_registerName("dealloc");
+public static final int sel_constrainScrollPoint_1 = sel_registerName("constrainScrollPoint:");
+public static final int sel_printSettings = sel_registerName("printSettings");
+public static final int sel_autoresizesOutlineColumn = sel_registerName("autoresizesOutlineColumn");
+public static final int sel_setFont_1range_1 = sel_registerName("setFont:range:");
+public static final int sel_limitDateForMode_1 = sel_registerName("limitDateForMode:");
+public static final int sel_stroke = sel_registerName("stroke");
+public static final int sel_parser_1parseErrorOccurred_1 = sel_registerName("parser:parseErrorOccurred:");
+public static final int sel_sendsActionOnEndEditing = sel_registerName("sendsActionOnEndEditing");
+public static final int sel_toggleGrammarChecking_1 = sel_registerName("toggleGrammarChecking:");
+public static final int sel_acceptsBinary = sel_registerName("acceptsBinary");
+public static final int sel_indexLessThanIndex_1 = sel_registerName("indexLessThanIndex:");
+public static final int sel_setCollapsesBorders_1 = sel_registerName("setCollapsesBorders:");
+public static final int sel_setTimeoutInterval_1 = sel_registerName("setTimeoutInterval:");
+public static final int sel_setNeedsDisplayInRect_1avoidAdditionalLayout_1 = sel_registerName("setNeedsDisplayInRect:avoidAdditionalLayout:");
+public static final int sel_encodeWithCoder_1 = sel_registerName("encodeWithCoder:");
+public static final int sel_compositeToPoint_1operation_1 = sel_registerName("compositeToPoint:operation:");
+public static final int sel_textView_1doubleClickedOnCell_1inRect_1atIndex_1 = sel_registerName("textView:doubleClickedOnCell:inRect:atIndex:");
+public static final int sel_setAlternateTitleWithMnemonic_1 = sel_registerName("setAlternateTitleWithMnemonic:");
+public static final int sel_minimumSignificantDigits = sel_registerName("minimumSignificantDigits");
+public static final int sel_stackSize = sel_registerName("stackSize");
+public static final int sel_setLayoutManager_1 = sel_registerName("setLayoutManager:");
+public static final int sel_image_1didLoadRepresentationHeader_1 = sel_registerName("image:didLoadRepresentationHeader:");
+public static final int sel_depth = sel_registerName("depth");
+public static final int sel_setTypesetter_1 = sel_registerName("setTypesetter:");
+public static final int sel_isSessionOnly = sel_registerName("isSessionOnly");
+public static final int sel_performFindPanelAction_1 = sel_registerName("performFindPanelAction:");
+public static final int sel_fileManager_1shouldProceedAfterError_1removingItemAtPath_1 = sel_registerName("fileManager:shouldProceedAfterError:removingItemAtPath:");
+public static final int sel_paperSize = sel_registerName("paperSize");
+public static final int sel_changeColor_1 = sel_registerName("changeColor:");
+public static final int sel_unarchiverDidFinish_1 = sel_registerName("unarchiverDidFinish:");
+public static final int sel_initWithObjectsAndKeys_1 = sel_registerName("initWithObjectsAndKeys:");
+public static final int sel_notationDeclarationForName_1 = sel_registerName("notationDeclarationForName:");
+public static final int sel_maximumSignificantDigits = sel_registerName("maximumSignificantDigits");
+public static final int sel_receivesCredentialSecurely = sel_registerName("receivesCredentialSecurely");
+public static final int sel_setObjectBeingTested_1 = sel_registerName("setObjectBeingTested:");
+public static final int sel_cacheDepthMatchesImageDepth = sel_registerName("cacheDepthMatchesImageDepth");
+public static final int sel_hasPropertyForKey_1 = sel_registerName("hasPropertyForKey:");
+public static final int sel_draggingDestinationWindow = sel_registerName("draggingDestinationWindow");
+public static final int sel_typeCodeValue = sel_registerName("typeCodeValue");
+public static final int sel_portForName_1 = sel_registerName("portForName:");
+public static final int sel_getCString_1maxLength_1encoding_1 = sel_registerName("getCString:maxLength:encoding:");
+public static final int sel_attributedString = sel_registerName("attributedString");
+public static final int sel_fileExistsAtPath_1isDirectory_1 = sel_registerName("fileExistsAtPath:isDirectory:");
+public static final int sel_updateRuler = sel_registerName("updateRuler");
+public static final int sel_print_1 = sel_registerName("print:");
+public static final int sel_setFrameSize_1 = sel_registerName("setFrameSize:");
+public static final int sel_dataFromPropertyList_1format_1errorDescription_1 = sel_registerName("dataFromPropertyList:format:errorDescription:");
+public static final int sel_initWithContentsOfURL_1ofType_1 = sel_registerName("initWithContentsOfURL:ofType:");
+public static final int sel_replaceValueAtIndex_1inPropertyWithKey_1withValue_1 = sel_registerName("replaceValueAtIndex:inPropertyWithKey:withValue:");
+public static final int sel_formIntersectionWithCharacterSet_1 = sel_registerName("formIntersectionWithCharacterSet:");
+public static final int sel_renderingMode = sel_registerName("renderingMode");
+public static final int sel_viewsNeedDisplay = sel_registerName("viewsNeedDisplay");
+public static final int sel_lineFragmentRectForProposedRect_1sweepDirection_1movementDirection_1remainingRect_1 = sel_registerName("lineFragmentRectForProposedRect:sweepDirection:movementDirection:remainingRect:");
+public static final int sel_rulerAccessoryViewForTextView_1paragraphStyle_1ruler_1enabled_1 = sel_registerName("rulerAccessoryViewForTextView:paragraphStyle:ruler:enabled:");
+public static final int sel_initWithArray_1copyItems_1 = sel_registerName("initWithArray:copyItems:");
+public static final int sel_ensureLayoutForGlyphRange_1 = sel_registerName("ensureLayoutForGlyphRange:");
+public static final int sel_availableLocaleIdentifiers = sel_registerName("availableLocaleIdentifiers");
+public static final int sel_viewDidHide = sel_registerName("viewDidHide");
+public static final int sel_setShouldReportNamespacePrefixes_1 = sel_registerName("setShouldReportNamespacePrefixes:");
+public static final int sel_runToolbarCustomizationPalette_1 = sel_registerName("runToolbarCustomizationPalette:");
+public static final int sel_roundingBehavior = sel_registerName("roundingBehavior");
+public static final int sel_expressionForEvaluatedObject = sel_registerName("expressionForEvaluatedObject");
+public static final int sel_rulerView_1handleMouseDown_1 = sel_registerName("rulerView:handleMouseDown:");
+public static final int sel_scanCharactersFromSet_1intoString_1 = sel_registerName("scanCharactersFromSet:intoString:");
+public static final int sel_applicationDidChangeScreenParameters_1 = sel_registerName("applicationDidChangeScreenParameters:");
+public static final int sel_textView_1clickedOnCell_1inRect_1 = sel_registerName("textView:clickedOnCell:inRect:");
+public static final int sel_decodeDoubleForKey_1 = sel_registerName("decodeDoubleForKey:");
+public static final int sel_URLHandle_1resourceDidFailLoadingWithReason_1 = sel_registerName("URLHandle:resourceDidFailLoadingWithReason:");
+public static final int sel_setCountKeyPath_1 = sel_registerName("setCountKeyPath:");
+public static final int sel_showContextHelpForObject_1locationHint_1 = sel_registerName("showContextHelpForObject:locationHint:");
+public static final int sel_setData_1forType_1 = sel_registerName("setData:forType:");
+public static final int sel_setPixel_1atX_1y_1 = sel_registerName("setPixel:atX:y:");
+public static final int sel_setReceiversSpecifier_1 = sel_registerName("setReceiversSpecifier:");
+public static final int sel_postNotificationName_1object_1userInfo_1 = sel_registerName("postNotificationName:object:userInfo:");
+public static final int sel_rowForItem_1 = sel_registerName("rowForItem:");
+public static final int sel_fetch_1 = sel_registerName("fetch:");
+public static final int sel_propertyList_1isValidForFormat_1 = sel_registerName("propertyList:isValidForFormat:");
+public static final int sel_configureAsServer = sel_registerName("configureAsServer");
+public static final int sel_setAllowsColumnReordering_1 = sel_registerName("setAllowsColumnReordering:");
+public static final int sel_charValue = sel_registerName("charValue");
+public static final int sel_setInsertionClassDescription_1 = sel_registerName("setInsertionClassDescription:");
+public static final int sel_cyanColor = sel_registerName("cyanColor");
+public static final int sel_lockWhenCondition_1 = sel_registerName("lockWhenCondition:");
+public static final int sel_cacheImageInRect_1 = sel_registerName("cacheImageInRect:");
+public static final int sel_keyboardFocusIndicatorColor = sel_registerName("keyboardFocusIndicatorColor");
+public static final int sel_hasUndoManager = sel_registerName("hasUndoManager");
+public static final int sel_drawInBezierPath_1relativeCenterPosition_1 = sel_registerName("drawInBezierPath:relativeCenterPosition:");
+public static final int sel_decimalNumberByAdding_1 = sel_registerName("decimalNumberByAdding:");
+public static final int sel_initWithDescriptorType_1data_1 = sel_registerName("initWithDescriptorType:data:");
+public static final int sel_isUndoing = sel_registerName("isUndoing");
+public static final int sel_boolForKey_1 = sel_registerName("boolForKey:");
+public static final int sel_localizedCatalogNameComponent = sel_registerName("localizedCatalogNameComponent");
+public static final int sel_representations = sel_registerName("representations");
+public static final int sel_expressionValueWithObject_1context_1 = sel_registerName("expressionValueWithObject:context:");
+public static final int sel_viewWillMoveToSuperview_1 = sel_registerName("viewWillMoveToSuperview:");
+public static final int sel_alphaValue = sel_registerName("alphaValue");
+public static final int sel_learnWord_1 = sel_registerName("learnWord:");
+public static final int sel_releaseGlobally = sel_registerName("releaseGlobally");
+public static final int sel_defaultCompletionDelay = sel_registerName("defaultCompletionDelay");
+public static final int sel_control_1textShouldEndEditing_1 = sel_registerName("control:textShouldEndEditing:");
+public static final int sel_alertWithMessageText_1defaultButton_1alternateButton_1otherButton_1informativeTextWithFormat_1 = sel_registerName("alertWithMessageText:defaultButton:alternateButton:otherButton:informativeTextWithFormat:");
+public static final int sel_control_1textShouldBeginEditing_1 = sel_registerName("control:textShouldBeginEditing:");
+public static final int sel_sizeMode = sel_registerName("sizeMode");
+public static final int sel_representedURL = sel_registerName("representedURL");
+public static final int sel_fileHFSCreatorCode = sel_registerName("fileHFSCreatorCode");
+public static final int sel_removeDependency_1 = sel_registerName("removeDependency:");
+public static final int sel_parentForItem_1 = sel_registerName("parentForItem:");
+public static final int sel_adjustPageHeightNew_1top_1bottom_1limit_1 = sel_registerName("adjustPageHeightNew:top:bottom:limit:");
+public static final int sel_showPanels = sel_registerName("showPanels");
+public static final int sel_alwaysUsesMultipleValuesMarker = sel_registerName("alwaysUsesMultipleValuesMarker");
+public static final int sel_setUpFieldEditorAttributes_1 = sel_registerName("setUpFieldEditorAttributes:");
+public static final int sel_comboBoxCell_1completedString_1 = sel_registerName("comboBoxCell:completedString:");
+public static final int sel_null = sel_registerName("null");
+public static final int sel_setTextAttributesForNil_1 = sel_registerName("setTextAttributesForNil:");
+public static final int sel_currencyGroupingSeparator = sel_registerName("currencyGroupingSeparator");
+public static final int sel_toolbarSelectableItemIdentifiers_1 = sel_registerName("toolbarSelectableItemIdentifiers:");
+public static final int sel_size = sel_registerName("size");
+public static final int sel_fileModificationDate = sel_registerName("fileModificationDate");
+public static final int sel_timestamp = sel_registerName("timestamp");
+public static final int sel_canonicalRequestForRequest_1 = sel_registerName("canonicalRequestForRequest:");
+public static final int sel_moveBackwardAndModifySelection_1 = sel_registerName("moveBackwardAndModifySelection:");
+public static final int sel_frameOfColumn_1 = sel_registerName("frameOfColumn:");
+public static final int sel_setRefusesFirstResponder_1 = sel_registerName("setRefusesFirstResponder:");
+public static final int sel_hasDynamicDepthLimit = sel_registerName("hasDynamicDepthLimit");
+public static final int sel_decodeIntForKey_1 = sel_registerName("decodeIntForKey:");
+public static final int sel_autoupdatingCurrentLocale = sel_registerName("autoupdatingCurrentLocale");
+public static final int sel_transformBezierPath_1 = sel_registerName("transformBezierPath:");
+public static final int sel_registerPort_1name_1nameServerPortNumber_1 = sel_registerName("registerPort:name:nameServerPortNumber:");
+public static final int sel_contentWidth = sel_registerName("contentWidth");
+public static final int sel_noteUserDefaultsChanged = sel_registerName("noteUserDefaultsChanged");
+public static final int sel_orangeColor = sel_registerName("orangeColor");
+public static final int sel_lastItem = sel_registerName("lastItem");
+public static final int sel_setButtonType_1 = sel_registerName("setButtonType:");
+public static final int sel_initWithContentsOfURL_1ofType_1error_1 = sel_registerName("initWithContentsOfURL:ofType:error:");
+public static final int sel_rowTemplates = sel_registerName("rowTemplates");
+public static final int sel_setEnabled_1forSegment_1 = sel_registerName("setEnabled:forSegment:");
+public static final int sel_avoidsEmptySelection = sel_registerName("avoidsEmptySelection");
+public static final int sel_encodeInt_1forKey_1 = sel_registerName("encodeInt:forKey:");
+public static final int sel_dictionaryWithValuesForKeys_1 = sel_registerName("dictionaryWithValuesForKeys:");
+public static final int sel_start_1 = sel_registerName("start:");
+public static final int sel_sortUsingDescriptors_1 = sel_registerName("sortUsingDescriptors:");
+public static final int sel_currentParagraphStyle = sel_registerName("currentParagraphStyle");
+public static final int sel_treeNodeWithRepresentedObject_1 = sel_registerName("treeNodeWithRepresentedObject:");
+public static final int sel_tableColumnWithIdentifier_1 = sel_registerName("tableColumnWithIdentifier:");
+public static final int sel_attributedTitle = sel_registerName("attributedTitle");
+public static final int sel_setEntryType_1 = sel_registerName("setEntryType:");
+public static final int sel_pixelFormat = sel_registerName("pixelFormat");
+public static final int sel_temporaryAttribute_1atCharacterIndex_1longestEffectiveRange_1inRange_1 = sel_registerName("temporaryAttribute:atCharacterIndex:longestEffectiveRange:inRange:");
+public static final int sel_treatsFilePackagesAsDirectories = sel_registerName("treatsFilePackagesAsDirectories");
+public static final int sel_glyphAtIndex_1 = sel_registerName("glyphAtIndex:");
+public static final int sel_titleWidth_1 = sel_registerName("titleWidth:");
+public static final int sel_setWords_1 = sel_registerName("setWords:");
+public static final int sel_glyphIndexForPoint_1inTextContainer_1 = sel_registerName("glyphIndexForPoint:inTextContainer:");
+public static final int sel_alternateSelectedControlColor = sel_registerName("alternateSelectedControlColor");
+public static final int sel_sizeToCells = sel_registerName("sizeToCells");
+public static final int sel_flushWindow = sel_registerName("flushWindow");
+public static final int sel_URLAtIndex_1effectiveRange_1 = sel_registerName("URLAtIndex:effectiveRange:");
+public static final int sel_isSimpleRectangularTextContainer = sel_registerName("isSimpleRectangularTextContainer");
+public static final int sel_dragImageForRowsWithIndexes_1tableColumns_1event_1offset_1 = sel_registerName("dragImageForRowsWithIndexes:tableColumns:event:offset:");
+public static final int sel_takeDoubleValueFrom_1 = sel_registerName("takeDoubleValueFrom:");
+public static final int sel_selectItem_1 = sel_registerName("selectItem:");
+public static final int sel_isMultiple = sel_registerName("isMultiple");
+public static final int sel_arrangeInFront_1 = sel_registerName("arrangeInFront:");
+public static final int sel_defaultFocusRingType = sel_registerName("defaultFocusRingType");
+public static final int sel_componentsSeparatedByString_1 = sel_registerName("componentsSeparatedByString:");
+public static final int sel_calendar = sel_registerName("calendar");
+public static final int sel_openFile_1withApplication_1 = sel_registerName("openFile:withApplication:");
+public static final int sel_moveWordBackward_1 = sel_registerName("moveWordBackward:");
+public static final int sel_getCharacters_1 = sel_registerName("getCharacters:");
+public static final int sel_initWithInt_1 = sel_registerName("initWithInt:");
+public static final int sel_initWithReceivePort_1sendPort_1components_1 = sel_registerName("initWithReceivePort:sendPort:components:");
+public static final int sel_setBool_1forKey_1 = sel_registerName("setBool:forKey:");
+public static final int sel_keyPathsForValuesAffectingValueForKey_1 = sel_registerName("keyPathsForValuesAffectingValueForKey:");
+public static final int sel_saveDocumentTo_1 = sel_registerName("saveDocumentTo:");
+public static final int sel_knobRectFlipped_1 = sel_registerName("knobRectFlipped:");
+public static final int sel_isEqualToAttributedString_1 = sel_registerName("isEqualToAttributedString:");
+public static final int sel_indexOfResult_1 = sel_registerName("indexOfResult:");
+public static final int sel_attributesForVoice_1 = sel_registerName("attributesForVoice:");
+public static final int sel_encodeConditionalObject_1 = sel_registerName("encodeConditionalObject:");
+public static final int sel_pixelBufferCubeMapFace = sel_registerName("pixelBufferCubeMapFace");
+public static final int sel_index = sel_registerName("index");
+public static final int sel_transactionID = sel_registerName("transactionID");
+public static final int sel_displayRectIgnoringOpacity_1 = sel_registerName("displayRectIgnoringOpacity:");
+public static final int sel_setKeyboardFocusRingNeedsDisplayInRect_1 = sel_registerName("setKeyboardFocusRingNeedsDisplayInRect:");
+public static final int sel_invalidateLayoutForCharacterRange_1isSoft_1actualCharacterRange_1 = sel_registerName("invalidateLayoutForCharacterRange:isSoft:actualCharacterRange:");
+public static final int sel_contentsEqualAtPath_1andPath_1 = sel_registerName("contentsEqualAtPath:andPath:");
+public static final int sel_cancelOperation_1 = sel_registerName("cancelOperation:");
+public static final int sel_accessibilityAttributeValue_1 = sel_registerName("accessibilityAttributeValue:");
+public static final int sel_windowNibPath = sel_registerName("windowNibPath");
+public static final int sel_saveToFile_1saveOperation_1delegate_1didSaveSelector_1contextInfo_1 = sel_registerName("saveToFile:saveOperation:delegate:didSaveSelector:contextInfo:");
+public static final int sel_setMixedStateImage_1 = sel_registerName("setMixedStateImage:");
+public static final int sel_predicateWithFormat_1 = sel_registerName("predicateWithFormat:");
+public static final int sel_initWithSendPort_1receivePort_1components_1 = sel_registerName("initWithSendPort:receivePort:components:");
+public static final int sel_setRecentsAutosaveName_1 = sel_registerName("setRecentsAutosaveName:");
+public static final int sel_autosavesConfiguration = sel_registerName("autosavesConfiguration");
+public static final int sel_setSubitems_1 = sel_registerName("setSubitems:");
+public static final int sel_setPathStyle_1 = sel_registerName("setPathStyle:");
+public static final int sel_startAnimation_1 = sel_registerName("startAnimation:");
+public static final int sel_bezierPath = sel_registerName("bezierPath");
+public static final int sel_archiver_1willEncodeObject_1 = sel_registerName("archiver:willEncodeObject:");
+public static final int sel_acceptInputForMode_1beforeDate_1 = sel_registerName("acceptInputForMode:beforeDate:");
+public static final int sel_setTearOffMenuRepresentation_1 = sel_registerName("setTearOffMenuRepresentation:");
+public static final int sel_writableTypes = sel_registerName("writableTypes");
+public static final int sel_domain = sel_registerName("domain");
+public static final int sel_removeDocument_1 = sel_registerName("removeDocument:");
+public static final int sel_showsBaselineSeparator = sel_registerName("showsBaselineSeparator");
+public static final int sel_dragImageForRows_1event_1dragImageOffset_1 = sel_registerName("dragImageForRows:event:dragImageOffset:");
+public static final int sel_table = sel_registerName("table");
+public static final int sel_initRegularFileWithContents_1 = sel_registerName("initRegularFileWithContents:");
+public static final int sel_add_1 = sel_registerName("add:");
+public static final int sel_stateImageWidth = sel_registerName("stateImageWidth");
+public static final int sel_URLProtocol_1didReceiveAuthenticationChallenge_1 = sel_registerName("URLProtocol:didReceiveAuthenticationChallenge:");
+public static final int sel_imageAndTitleWidth = sel_registerName("imageAndTitleWidth");
+public static final int sel_trackingAreas = sel_registerName("trackingAreas");
+public static final int sel_initRecordDescriptor = sel_registerName("initRecordDescriptor");
+public static final int sel_itemIdentifier = sel_registerName("itemIdentifier");
+public static final int sel_doubleClickAtIndex_1 = sel_registerName("doubleClickAtIndex:");
+public static final int sel_fixesAttributesLazily = sel_registerName("fixesAttributesLazily");
+public static final int sel_netServiceBrowserWillSearch_1 = sel_registerName("netServiceBrowserWillSearch:");
+public static final int sel_textureInternalFormat = sel_registerName("textureInternalFormat");
+public static final int sel_valueWithSize_1 = sel_registerName("valueWithSize:");
+public static final int sel_setVerticalScroller_1 = sel_registerName("setVerticalScroller:");
+public static final int sel_absolutePathForAppBundleWithIdentifier_1 = sel_registerName("absolutePathForAppBundleWithIdentifier:");
+public static final int sel_contentMinSize = sel_registerName("contentMinSize");
+public static final int sel_persistentDomainForName_1 = sel_registerName("persistentDomainForName:");
+public static final int sel_cellAtIndex_1 = sel_registerName("cellAtIndex:");
+public static final int sel_setWithArray_1 = sel_registerName("setWithArray:");
+public static final int sel_resetCursorRects = sel_registerName("resetCursorRects");
+public static final int sel_imageRepClassForFileType_1 = sel_registerName("imageRepClassForFileType:");
+public static final int sel_setContainerIsObjectBeingTested_1 = sel_registerName("setContainerIsObjectBeingTested:");
+public static final int sel_removeProgressMark_1 = sel_registerName("removeProgressMark:");
+public static final int sel_hitTestForEvent_1inRect_1ofView_1 = sel_registerName("hitTestForEvent:inRect:ofView:");
+public static final int sel_listDescriptor = sel_registerName("listDescriptor");
+public static final int sel_rangeOfUnit_1startDate_1interval_1forDate_1 = sel_registerName("rangeOfUnit:startDate:interval:forDate:");
+public static final int sel_checkSpaceForParts = sel_registerName("checkSpaceForParts");
+public static final int sel_availableVoices = sel_registerName("availableVoices");
+public static final int sel_PMPrintSettings = sel_registerName("PMPrintSettings");
+public static final int sel_nonBaseCharacterSet = sel_registerName("nonBaseCharacterSet");
+public static final int sel_launchedTaskWithLaunchPath_1arguments_1 = sel_registerName("launchedTaskWithLaunchPath:arguments:");
+public static final int sel_clearCurrentContext = sel_registerName("clearCurrentContext");
+public static final int sel_applicationWillUpdate_1 = sel_registerName("applicationWillUpdate:");
+public static final int sel_addFontTrait_1 = sel_registerName("addFontTrait:");
+public static final int sel_arrayByAddingObjectsFromArray_1 = sel_registerName("arrayByAddingObjectsFromArray:");
+public static final int sel_abortParsing = sel_registerName("abortParsing");
+public static final int sel_subviews = sel_registerName("subviews");
+public static final int sel_initWithContainerClassDescription_1containerSpecifier_1key_1uniqueID_1 = sel_registerName("initWithContainerClassDescription:containerSpecifier:key:uniqueID:");
+public static final int sel_acceptableDragTypes = sel_registerName("acceptableDragTypes");
+public static final int sel_managedObjectContext = sel_registerName("managedObjectContext");
+public static final int sel_resizeWithMagnification_1 = sel_registerName("resizeWithMagnification:");
+public static final int sel_setUsesFindPanel_1 = sel_registerName("setUsesFindPanel:");
+public static final int sel_application_1printFiles_1withSettings_1showPrintPanels_1 = sel_registerName("application:printFiles:withSettings:showPrintPanels:");
+public static final int sel_loadAndReturnError_1 = sel_registerName("loadAndReturnError:");
+public static final int sel_initWithLeftExpressions_1rightExpressions_1modifier_1operators_1options_1 = sel_registerName("initWithLeftExpressions:rightExpressions:modifier:operators:options:");
+public static final int sel_addSelectionIndexes_1 = sel_registerName("addSelectionIndexes:");
+public static final int sel_initWithBitmapDataPlanes_1pixelsWide_1pixelsHigh_1bitsPerSample_1samplesPerPixel_1hasAlpha_1isPlanar_1colorSpaceName_1bitmapFormat_1bytesPerRow_1bitsPerPixel_1 = sel_registerName("initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel:");
+public static final int sel_initToFileAtPath_1append_1 = sel_registerName("initToFileAtPath:append:");
+public static final int sel_currencyDecimalSeparator = sel_registerName("currencyDecimalSeparator");
+public static final int sel_expansionFrameWithFrame_1inView_1 = sel_registerName("expansionFrameWithFrame:inView:");
+public static final int sel_HTTPShouldHandleCookies = sel_registerName("HTTPShouldHandleCookies");
+public static final int sel_rearrangeObjects = sel_registerName("rearrangeObjects");
+public static final int sel_graphicsContextWithWindow_1 = sel_registerName("graphicsContextWithWindow:");
+public static final int sel_stringWithCapacity_1 = sel_registerName("stringWithCapacity:");
+public static final int sel_results = sel_registerName("results");
+public static final int sel_loadFileWrapperRepresentation_1ofType_1 = sel_registerName("loadFileWrapperRepresentation:ofType:");
+public static final int sel_secondsFromGMTForDate_1 = sel_registerName("secondsFromGMTForDate:");
+public static final int sel_clearStopAnimation = sel_registerName("clearStopAnimation");
+public static final int sel_numberWithShort_1 = sel_registerName("numberWithShort:");
+public static final int sel_setHorizontallyCentered_1 = sel_registerName("setHorizontallyCentered:");
+public static final int sel_setNeedsDisplayInRect_1 = sel_registerName("setNeedsDisplayInRect:");
+public static final int sel_objectDidBeginEditing_1 = sel_registerName("objectDidBeginEditing:");
+public static final int sel_rightMouseDown_1 = sel_registerName("rightMouseDown:");
+public static final int sel_data2 = sel_registerName("data2");
+public static final int sel_initWithCalendarIdentifier_1 = sel_registerName("initWithCalendarIdentifier:");
+public static final int sel_containsValueForKey_1 = sel_registerName("containsValueForKey:");
+public static final int sel_result = sel_registerName("result");
+public static final int sel_printDocument_1 = sel_registerName("printDocument:");
+public static final int sel_addSuiteNamed_1 = sel_registerName("addSuiteNamed:");
+public static final int sel_deleteCookie_1 = sel_registerName("deleteCookie:");
+public static final int sel_isLocationRequiredToCreateForKey_1 = sel_registerName("isLocationRequiredToCreateForKey:");
+public static final int sel_saveGraphicsState = sel_registerName("saveGraphicsState");
+public static final int sel_getInfoForFile_1application_1type_1 = sel_registerName("getInfoForFile:application:type:");
+public static final int sel_HTTPBodyStream = sel_registerName("HTTPBodyStream");
+public static final int sel_accessibilityParameterizedAttributeNames = sel_registerName("accessibilityParameterizedAttributeNames");
+public static final int sel_objectForKey_1 = sel_registerName("objectForKey:");
+public static final int sel_classForArchiver = sel_registerName("classForArchiver");
+public static final int sel_allBundles = sel_registerName("allBundles");
+public static final int sel_rangeOfComposedCharacterSequenceAtIndex_1 = sel_registerName("rangeOfComposedCharacterSequenceAtIndex:");
+public static final int sel_allowsDuplicatesInToolbar = sel_registerName("allowsDuplicatesInToolbar");
+public static final int sel_speechSynthesizer_1didEncounterSyncMessage_1 = sel_registerName("speechSynthesizer:didEncounterSyncMessage:");
+public static final int sel_performSelector_1withObject_1afterDelay_1inModes_1 = sel_registerName("performSelector:withObject:afterDelay:inModes:");
+public static final int sel_setScalesWhenResized_1 = sel_registerName("setScalesWhenResized:");
+public static final int sel_fileWrappers = sel_registerName("fileWrappers");
+public static final int sel_setSubmenu_1 = sel_registerName("setSubmenu:");
+public static final int sel_setSendsSearchStringImmediately_1 = sel_registerName("setSendsSearchStringImmediately:");
+public static final int sel_movieUnfilteredPasteboardTypes = sel_registerName("movieUnfilteredPasteboardTypes");
+public static final int sel_browser_1willDisplayCell_1atRow_1column_1 = sel_registerName("browser:willDisplayCell:atRow:column:");
+public static final int sel_valueOfAttribute_1forResultAtIndex_1 = sel_registerName("valueOfAttribute:forResultAtIndex:");
+public static final int sel_rightExpression = sel_registerName("rightExpression");
+public static final int sel_moveNode_1toIndexPath_1 = sel_registerName("moveNode:toIndexPath:");
+public static final int sel_insertionKey = sel_registerName("insertionKey");
+public static final int sel_columnsAutosaveName = sel_registerName("columnsAutosaveName");
+public static final int sel_connection_1didReceiveResponse_1 = sel_registerName("connection:didReceiveResponse:");
+public static final int sel_delegate = sel_registerName("delegate");
+public static final int sel_valueForHTTPHeaderField_1 = sel_registerName("valueForHTTPHeaderField:");
+public static final int sel_requiredThickness = sel_registerName("requiredThickness");
+public static final int sel_selectedCells = sel_registerName("selectedCells");
+public static final int sel_setResizable_1 = sel_registerName("setResizable:");
+public static final int sel_resizeRightCursor = sel_registerName("resizeRightCursor");
+public static final int sel_arrayWithContentsOfURL_1 = sel_registerName("arrayWithContentsOfURL:");
+public static final int sel_setEchosBullets_1 = sel_registerName("setEchosBullets:");
+public static final int sel_outlineViewItemDidCollapse_1 = sel_registerName("outlineViewItemDidCollapse:");
+public static final int sel_mutableSetValueForKey_1 = sel_registerName("mutableSetValueForKey:");
+public static final int sel_initWithObjects_1forKeys_1count_1 = sel_registerName("initWithObjects:forKeys:count:");
+public static final int sel_canBeDisabled = sel_registerName("canBeDisabled");
+public static final int sel_selectTabViewItemWithIdentifier_1 = sel_registerName("selectTabViewItemWithIdentifier:");
+public static final int sel_setLongEraSymbols_1 = sel_registerName("setLongEraSymbols:");
+public static final int sel_displayRect_1 = sel_registerName("displayRect:");
+public static final int sel_initRemoteWithProtocolFamily_1socketType_1protocol_1address_1 = sel_registerName("initRemoteWithProtocolFamily:socketType:protocol:address:");
+public static final int sel_setQueuePriority_1 = sel_registerName("setQueuePriority:");
+public static final int sel_initWithFileDescriptor_1closeOnDealloc_1 = sel_registerName("initWithFileDescriptor:closeOnDealloc:");
+public static final int sel_comboBoxWillDismiss_1 = sel_registerName("comboBoxWillDismiss:");
+public static final int sel_setMatchesOnMultipleResolution_1 = sel_registerName("setMatchesOnMultipleResolution:");
+public static final int sel_connection = sel_registerName("connection");
+public static final int sel_includedKeys = sel_registerName("includedKeys");
+public static final int sel_writeToURL_1options_1error_1 = sel_registerName("writeToURL:options:error:");
+public static final int sel_activeProcessorCount = sel_registerName("activeProcessorCount");
+public static final int sel_countByEnumeratingWithState_1objects_1count_1 = sel_registerName("countByEnumeratingWithState:objects:count:");
+public static final int sel_setTransformStruct_1 = sel_registerName("setTransformStruct:");
+public static final int sel_setVeryShortWeekdaySymbols_1 = sel_registerName("setVeryShortWeekdaySymbols:");
+public static final int sel_markerLocation = sel_registerName("markerLocation");
+public static final int sel_widthForLayer_1edge_1 = sel_registerName("widthForLayer:edge:");
+public static final int sel_transform = sel_registerName("transform");
+public static final int sel_addSelectionIndexPaths_1 = sel_registerName("addSelectionIndexPaths:");
+public static final int sel_removeRequestMode_1 = sel_registerName("removeRequestMode:");
+public static final int sel_indexOfObject_1inRange_1 = sel_registerName("indexOfObject:inRange:");
+public static final int sel_awakeAfterUsingCoder_1 = sel_registerName("awakeAfterUsingCoder:");
+public static final int sel_setKnobProportion_1 = sel_registerName("setKnobProportion:");
+public static final int sel_setAllowsUserCustomization_1 = sel_registerName("setAllowsUserCustomization:");
+public static final int sel_setCurrentOperation_1 = sel_registerName("setCurrentOperation:");
+public static final int sel_outlineView_1isGroupItem_1 = sel_registerName("outlineView:isGroupItem:");
+public static final int sel_deleteGlyphsInRange_1 = sel_registerName("deleteGlyphsInRange:");
+public static final int sel_setSelectedObjects_1 = sel_registerName("setSelectedObjects:");
+public static final int sel_pathComponentCellAtPoint_1withFrame_1inView_1 = sel_registerName("pathComponentCellAtPoint:withFrame:inView:");
+public static final int sel_outlineView_1acceptDrop_1item_1childIndex_1 = sel_registerName("outlineView:acceptDrop:item:childIndex:");
+public static final int sel_setBackgroundColor_1 = sel_registerName("setBackgroundColor:");
+public static final int sel_canSelectNext = sel_registerName("canSelectNext");
+public static final int sel_encodeRect_1forKey_1 = sel_registerName("encodeRect:forKey:");
+public static final int sel_resetCursorRect_1inView_1 = sel_registerName("resetCursorRect:inView:");
+public static final int sel_resumeData = sel_registerName("resumeData");
+public static final int sel_levelsOfUndo = sel_registerName("levelsOfUndo");
+public static final int sel_objectIsForcedForKey_1 = sel_registerName("objectIsForcedForKey:");
+public static final int sel_minSize = sel_registerName("minSize");
+public static final int sel_indentationPerLevel = sel_registerName("indentationPerLevel");
+public static final int sel_browserColumnConfigurationDidChange_1 = sel_registerName("browserColumnConfigurationDidChange:");
+public static final int sel_startAnimation = sel_registerName("startAnimation");
+public static final int sel_outlineView_1namesOfPromisedFilesDroppedAtDestination_1forDraggedItems_1 = sel_registerName("outlineView:namesOfPromisedFilesDroppedAtDestination:forDraggedItems:");
+public static final int sel_setAlignment_1range_1 = sel_registerName("setAlignment:range:");
+public static final int sel_zeroSymbol = sel_registerName("zeroSymbol");
+public static final int sel_draggedImage_1beganAt_1 = sel_registerName("draggedImage:beganAt:");
+public static final int sel_buttonMask = sel_registerName("buttonMask");
+public static final int sel_frame = sel_registerName("frame");
+public static final int sel_markers = sel_registerName("markers");
+public static final int sel_initWithObjects_1count_1 = sel_registerName("initWithObjects:count:");
+public static final int sel_unload = sel_registerName("unload");
+public static final int sel_initForReadingWithData_1 = sel_registerName("initForReadingWithData:");
+public static final int sel_year = sel_registerName("year");
+public static final int sel_ruleEditor_1child_1forCriterion_1withRowType_1 = sel_registerName("ruleEditor:child:forCriterion:withRowType:");
+public static final int sel_dayOfMonth = sel_registerName("dayOfMonth");
+public static final int sel_colorUsingColorSpaceName_1 = sel_registerName("colorUsingColorSpaceName:");
+public static final int sel_registerCoercer_1selector_1toConvertFromClass_1toClass_1 = sel_registerName("registerCoercer:selector:toConvertFromClass:toClass:");
+public static final int sel_removeObject_1inRange_1 = sel_registerName("removeObject:inRange:");
+public static final int sel_setFrameFromString_1 = sel_registerName("setFrameFromString:");
+public static final int sel_canAdd = sel_registerName("canAdd");
+public static final int sel_era = sel_registerName("era");
+public static final int sel_expressionForSubquery_1usingIteratorVariable_1predicate_1 = sel_registerName("expressionForSubquery:usingIteratorVariable:predicate:");
+public static final int sel_setAMSymbol_1 = sel_registerName("setAMSymbol:");
+public static final int sel_groupedResults = sel_registerName("groupedResults");
+public static final int sel_attributedStringValue = sel_registerName("attributedStringValue");
+public static final int sel_enclosingScrollView = sel_registerName("enclosingScrollView");
+public static final int sel_isEqualToNumber_1 = sel_registerName("isEqualToNumber:");
+public static final int sel_mainBundle = sel_registerName("mainBundle");
+public static final int sel_textContainerForGlyphAtIndex_1effectiveRange_1 = sel_registerName("textContainerForGlyphAtIndex:effectiveRange:");
+public static final int sel_setUsesGroupingSeparator_1 = sel_registerName("setUsesGroupingSeparator:");
+public static final int sel_pointerAtIndex_1 = sel_registerName("pointerAtIndex:");
+public static final int sel_arrowsPosition = sel_registerName("arrowsPosition");
+public static final int sel_panel_1compareFilename_1with_1caseSensitive_1 = sel_registerName("panel:compareFilename:with:caseSensitive:");
+public static final int sel_drawSeparatorItemWithFrame_1inView_1 = sel_registerName("drawSeparatorItemWithFrame:inView:");
+public static final int sel_objectsByEvaluatingWithContainers_1 = sel_registerName("objectsByEvaluatingWithContainers:");
+public static final int sel_textTabForGlyphLocation_1writingDirection_1maxLocation_1 = sel_registerName("textTabForGlyphLocation:writingDirection:maxLocation:");
+public static final int sel_fontDescriptor = sel_registerName("fontDescriptor");
+public static final int sel_validAttributesForMarkedText = sel_registerName("validAttributesForMarkedText");
+public static final int sel_scriptingEndsWith_1 = sel_registerName("scriptingEndsWith:");
+public static final int sel_scrollViaScroller_1 = sel_registerName("scrollViaScroller:");
+public static final int sel_setAlwaysUsesMultipleValuesMarker_1 = sel_registerName("setAlwaysUsesMultipleValuesMarker:");
+public static final int sel_attributeKeys = sel_registerName("attributeKeys");
+public static final int sel_darkGrayColor = sel_registerName("darkGrayColor");
+public static final int sel_setExtensionHidden_1 = sel_registerName("setExtensionHidden:");
+public static final int sel_drawInRect_1withAttributes_1 = sel_registerName("drawInRect:withAttributes:");
+public static final int sel_selectTabViewItemAtIndex_1 = sel_registerName("selectTabViewItemAtIndex:");
+public static final int sel_contentRectForFrameRect_1 = sel_registerName("contentRectForFrameRect:");
+public static final int sel_setParagraphSpacingBefore_1 = sel_registerName("setParagraphSpacingBefore:");
+public static final int sel_minDate = sel_registerName("minDate");
+public static final int sel_isARepeat = sel_registerName("isARepeat");
+public static final int sel_selectedTabViewItem = sel_registerName("selectedTabViewItem");
+public static final int sel_minusHashTable_1 = sel_registerName("minusHashTable:");
+public static final int sel_preferredLocalizationsFromArray_1forPreferences_1 = sel_registerName("preferredLocalizationsFromArray:forPreferences:");
+public static final int sel_setTextBlocks_1 = sel_registerName("setTextBlocks:");
+public static final int sel_writePrintInfo = sel_registerName("writePrintInfo");
+public static final int sel_paperName = sel_registerName("paperName");
+public static final int sel_pauseSpeakingAtBoundary_1 = sel_registerName("pauseSpeakingAtBoundary:");
+public static final int sel_markedTextAbandoned_1 = sel_registerName("markedTextAbandoned:");
+public static final int sel_setTitled_1 = sel_registerName("setTitled:");
+public static final int sel_hidesOnDeactivate = sel_registerName("hidesOnDeactivate");
+public static final int sel_selectedRange = sel_registerName("selectedRange");
+public static final int sel_reportException_1 = sel_registerName("reportException:");
+public static final int sel_drawBezelWithFrame_1inView_1 = sel_registerName("drawBezelWithFrame:inView:");
+public static final int sel_relativeMoveToPoint_1 = sel_registerName("relativeMoveToPoint:");
+public static final int sel_printingAdjustmentInLayoutManager_1forNominallySpacedGlyphRange_1packedGlyphs_1count_1 = sel_registerName("printingAdjustmentInLayoutManager:forNominallySpacedGlyphRange:packedGlyphs:count:");
+public static final int sel_longValue = sel_registerName("longValue");
+public static final int sel_setMaxNumberOfColumns_1 = sel_registerName("setMaxNumberOfColumns:");
+public static final int sel_textView_1draggedCell_1inRect_1event_1atIndex_1 = sel_registerName("textView:draggedCell:inRect:event:atIndex:");
+public static final int sel_isRemovable = sel_registerName("isRemovable");
+public static final int sel_handleCloseScriptCommand_1 = sel_registerName("handleCloseScriptCommand:");
+public static final int sel_layoutManager_1shouldUseTemporaryAttributes_1forDrawingToScreen_1atCharacterIndex_1effectiveRange_1 = sel_registerName("layoutManager:shouldUseTemporaryAttributes:forDrawingToScreen:atCharacterIndex:effectiveRange:");
+public static final int sel_expressionForKeyPath_1 = sel_registerName("expressionForKeyPath:");
+public static final int sel_bezierPathWithOvalInRect_1 = sel_registerName("bezierPathWithOvalInRect:");
+public static final int sel_deselectSelectedCell = sel_registerName("deselectSelectedCell");
+public static final int sel_defaultSubcontainerAttributeKey = sel_registerName("defaultSubcontainerAttributeKey");
+public static final int sel_yank_1 = sel_registerName("yank:");
+public static final int sel_changeSpelling_1 = sel_registerName("changeSpelling:");
+public static final int sel_totalAutoreleasedObjects = sel_registerName("totalAutoreleasedObjects");
+public static final int sel_loops = sel_registerName("loops");
+public static final int sel_boundsRectForTextBlock_1atIndex_1effectiveRange_1 = sel_registerName("boundsRectForTextBlock:atIndex:effectiveRange:");
+public static final int sel_resignMainWindow = sel_registerName("resignMainWindow");
+public static final int sel_availableLanguages = sel_registerName("availableLanguages");
+public static final int sel_initWithMarkerFormat_1options_1 = sel_registerName("initWithMarkerFormat:options:");
+public static final int sel_runInNewThread = sel_registerName("runInNewThread");
+public static final int sel_tableView_1selectionIndexesForProposedSelection_1 = sel_registerName("tableView:selectionIndexesForProposedSelection:");
+public static final int sel_fetchWithRequest_1merge_1error_1 = sel_registerName("fetchWithRequest:merge:error:");
+public static final int sel_endSubelementIdentifier = sel_registerName("endSubelementIdentifier");
+public static final int sel_implementationClassName = sel_registerName("implementationClassName");
+public static final int sel_eventNumber = sel_registerName("eventNumber");
+public static final int sel_requestTimeout = sel_registerName("requestTimeout");
+public static final int sel_boldSystemFontOfSize_1 = sel_registerName("boldSystemFontOfSize:");
+public static final int sel_setPixelsWide_1 = sel_registerName("setPixelsWide:");
+public static final int sel_labelForSegment_1 = sel_registerName("labelForSegment:");
+public static final int sel_setAlternateTitle_1 = sel_registerName("setAlternateTitle:");
+public static final int sel_shouldBreakLineByWordBeforeCharacterAtIndex_1 = sel_registerName("shouldBreakLineByWordBeforeCharacterAtIndex:");
+public static final int sel_lockFocusIfCanDraw = sel_registerName("lockFocusIfCanDraw");
+public static final int sel_setFormat_1 = sel_registerName("setFormat:");
+public static final int sel_setSegmentCount_1 = sel_registerName("setSegmentCount:");
+public static final int sel_accessInstanceVariablesDirectly = sel_registerName("accessInstanceVariablesDirectly");
+public static final int sel_comboBox_1completedString_1 = sel_registerName("comboBox:completedString:");
+public static final int sel_moveToBeginningOfParagraph_1 = sel_registerName("moveToBeginningOfParagraph:");
+public static final int sel_defaultParagraphStyle = sel_registerName("defaultParagraphStyle");
+public static final int sel_availableTypeFromArray_1 = sel_registerName("availableTypeFromArray:");
+public static final int sel_setGregorianStartDate_1 = sel_registerName("setGregorianStartDate:");
+public static final int sel_dateWithTimeIntervalSince1970_1 = sel_registerName("dateWithTimeIntervalSince1970:");
+public static final int sel_imagePasteboardTypes = sel_registerName("imagePasteboardTypes");
+public static final int sel_laterDate_1 = sel_registerName("laterDate:");
+public static final int sel_setBounds_1 = sel_registerName("setBounds:");
+public static final int sel_HTTPMethod = sel_registerName("HTTPMethod");
+public static final int sel_getGlyphsInRange_1glyphs_1characterIndexes_1glyphInscriptions_1elasticBits_1bidiLevels_1 = sel_registerName("getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:bidiLevels:");
+public static final int sel_rectArrayForCharacterRange_1withinSelectedCharacterRange_1inTextContainer_1rectCount_1 = sel_registerName("rectArrayForCharacterRange:withinSelectedCharacterRange:inTextContainer:rectCount:");
+public static final int sel_drawGridInClipRect_1 = sel_registerName("drawGridInClipRect:");
+public static final int sel_isStarted = sel_registerName("isStarted");
+public static final int sel_descriptorType = sel_registerName("descriptorType");
+public static final int sel_ISOCurrencyCodes = sel_registerName("ISOCurrencyCodes");
+public static final int sel_resetCancelButtonCell = sel_registerName("resetCancelButtonCell");
+public static final int sel_positiveInfinitySymbol = sel_registerName("positiveInfinitySymbol");
+public static final int sel_sendsActionOnArrowKeys = sel_registerName("sendsActionOnArrowKeys");
+public static final int sel_delete_1 = sel_registerName("delete:");
+public static final int sel_toolbarWillAddItem_1 = sel_registerName("toolbarWillAddItem:");
+public static final int sel_updateCellInside_1 = sel_registerName("updateCellInside:");
+public static final int sel_inputClientResignActive_1 = sel_registerName("inputClientResignActive:");
+public static final int sel_initWithEventClass_1eventID_1targetDescriptor_1returnID_1transactionID_1 = sel_registerName("initWithEventClass:eventID:targetDescriptor:returnID:transactionID:");
+public static final int sel_decimalNumberByDividingBy_1withBehavior_1 = sel_registerName("decimalNumberByDividingBy:withBehavior:");
+public static final int sel_spellServer_1suggestCompletionsForPartialWordRange_1inString_1language_1 = sel_registerName("spellServer:suggestCompletionsForPartialWordRange:inString:language:");
+public static final int sel_arrayWithObjects_1count_1 = sel_registerName("arrayWithObjects:count:");
+public static final int sel_connectionWithRegisteredName_1host_1 = sel_registerName("connectionWithRegisteredName:host:");
+public static final int sel_initWithFormat_1 = sel_registerName("initWithFormat:");
+public static final int sel_sharedURLCache = sel_registerName("sharedURLCache");
+public static final int sel_edited_1range_1changeInLength_1 = sel_registerName("edited:range:changeInLength:");
+public static final int sel_prepareContent = sel_registerName("prepareContent");
+public static final int sel_stringWithCString_1encoding_1 = sel_registerName("stringWithCString:encoding:");
+public static final int sel_postNotificationName_1object_1userInfo_1deliverImmediately_1 = sel_registerName("postNotificationName:object:userInfo:deliverImmediately:");
+public static final int sel_coerceToDescriptorType_1 = sel_registerName("coerceToDescriptorType:");
+public static final int sel_selectionIndex = sel_registerName("selectionIndex");
+public static final int sel_setContentMaxSize_1 = sel_registerName("setContentMaxSize:");
+public static final int sel_setColor_1atX_1y_1 = sel_registerName("setColor:atX:y:");
+public static final int sel_graphicsContext = sel_registerName("graphicsContext");
+public static final int sel_hostWithName_1 = sel_registerName("hostWithName:");
+public static final int sel_toggleRuler_1 = sel_registerName("toggleRuler:");
+public static final int sel_glyphInfoWithGlyph_1forFont_1baseString_1 = sel_registerName("glyphInfoWithGlyph:forFont:baseString:");
+public static final int sel_panel_1willExpand_1 = sel_registerName("panel:willExpand:");
+public static final int sel_selectText_1 = sel_registerName("selectText:");
+public static final int sel_setShortMonthSymbols_1 = sel_registerName("setShortMonthSymbols:");
+public static final int sel_setBorderType_1 = sel_registerName("setBorderType:");
+public static final int sel_rangeOfString_1 = sel_registerName("rangeOfString:");
+public static final int sel_invalidateGlyphsOnLayoutInvalidationForGlyphRange_1 = sel_registerName("invalidateGlyphsOnLayoutInvalidationForGlyphRange:");
+public static final int sel_availableMembersOfFontFamily_1 = sel_registerName("availableMembersOfFontFamily:");
+public static final int sel_XPath = sel_registerName("XPath");
+public static final int sel_contentsOfDirectoryAtPath_1error_1 = sel_registerName("contentsOfDirectoryAtPath:error:");
+public static final int sel_newItemForRepresentedObject_1 = sel_registerName("newItemForRepresentedObject:");
+public static final int sel_setMatrixClass_1 = sel_registerName("setMatrixClass:");
+public static final int sel_compositeToPoint_1operation_1fraction_1 = sel_registerName("compositeToPoint:operation:fraction:");
+public static final int sel_setHorizontallyResizable_1 = sel_registerName("setHorizontallyResizable:");
+public static final int sel_mapTableWithStrongToStrongObjects = sel_registerName("mapTableWithStrongToStrongObjects");
+public static final int sel_colorSpaceModel = sel_registerName("colorSpaceModel");
+public static final int sel_setCriticalValue_1 = sel_registerName("setCriticalValue:");
+public static final int sel_allowsToolTipsWhenApplicationIsInactive = sel_registerName("allowsToolTipsWhenApplicationIsInactive");
+public static final int sel_transformUsingAffineTransform_1 = sel_registerName("transformUsingAffineTransform:");
+public static final int sel_initWithInvocation_1 = sel_registerName("initWithInvocation:");
+public static final int sel_containerClassDescription = sel_registerName("containerClassDescription");
+public static final int sel_parser_1resolveExternalEntityName_1systemID_1 = sel_registerName("parser:resolveExternalEntityName:systemID:");
+public static final int sel_mouseLocationOutsideOfEventStream = sel_registerName("mouseLocationOutsideOfEventStream");
+public static final int sel_detach = sel_registerName("detach");
+public static final int sel_setPickerMask_1 = sel_registerName("setPickerMask:");
+public static final int sel_tokenStyle = sel_registerName("tokenStyle");
+public static final int sel_setOptions_1 = sel_registerName("setOptions:");
+public static final int sel_PDFOperationWithView_1insideRect_1toPath_1printInfo_1 = sel_registerName("PDFOperationWithView:insideRect:toPath:printInfo:");
+public static final int sel_parser_1didStartElement_1namespaceURI_1qualifiedName_1attributes_1 = sel_registerName("parser:didStartElement:namespaceURI:qualifiedName:attributes:");
+public static final int sel_availableFontNamesMatchingFontDescriptor_1 = sel_registerName("availableFontNamesMatchingFontDescriptor:");
+public static final int sel_relativePath = sel_registerName("relativePath");
+public static final int sel_moveWordForwardAndModifySelection_1 = sel_registerName("moveWordForwardAndModifySelection:");
+public static final int sel_currentTime = sel_registerName("currentTime");
+public static final int sel_slideDraggedImageTo_1 = sel_registerName("slideDraggedImageTo:");
+public static final int sel_application_1printFile_1 = sel_registerName("application:printFile:");
+public static final int sel_punctuationCharacterSet = sel_registerName("punctuationCharacterSet");
+public static final int sel_allKeysForObject_1 = sel_registerName("allKeysForObject:");
+public static final int sel_pathStyle = sel_registerName("pathStyle");
+public static final int sel_allowsEditingTextAttributes = sel_registerName("allowsEditingTextAttributes");
+public static final int sel_lineSpacingAfterGlyphAtIndex_1withProposedLineFragmentRect_1 = sel_registerName("lineSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:");
+public static final int sel_initWithContentsOfMappedFile_1 = sel_registerName("initWithContentsOfMappedFile:");
+public static final int sel_initWithFrame_1pullsDown_1 = sel_registerName("initWithFrame:pullsDown:");
+public static final int sel_setView_1 = sel_registerName("setView:");
+public static final int sel_outlineViewSelectionDidChange_1 = sel_registerName("outlineViewSelectionDidChange:");
+public static final int sel_widthValueTypeForLayer_1edge_1 = sel_registerName("widthValueTypeForLayer:edge:");
+public static final int sel_dateWithTimeIntervalSinceNow_1 = sel_registerName("dateWithTimeIntervalSinceNow:");
+public static final int sel_display = sel_registerName("display");
+public static final int sel_setRoundingBehavior_1 = sel_registerName("setRoundingBehavior:");
+public static final int sel_valueWithPoint_1 = sel_registerName("valueWithPoint:");
+public static final int sel_tickMarkValueAtIndex_1 = sel_registerName("tickMarkValueAtIndex:");
+public static final int sel_addColumnWithCells_1 = sel_registerName("addColumnWithCells:");
+public static final int sel_exposeBinding_1 = sel_registerName("exposeBinding:");
+public static final int sel_weekdayOrdinal = sel_registerName("weekdayOrdinal");
+public static final int sel_canAddChild = sel_registerName("canAddChild");
+public static final int sel_hitTest_1 = sel_registerName("hitTest:");
+public static final int sel_nibBundle = sel_registerName("nibBundle");
+public static final int sel_resumeExecutionWithResult_1 = sel_registerName("resumeExecutionWithResult:");
+public static final int sel_setMonthSymbols_1 = sel_registerName("setMonthSymbols:");
+public static final int sel_hitPart = sel_registerName("hitPart");
+public static final int sel_download_1didCancelAuthenticationChallenge_1 = sel_registerName("download:didCancelAuthenticationChallenge:");
+public static final int sel_descriptionWithCalendarFormat_1 = sel_registerName("descriptionWithCalendarFormat:");
+public static final int sel_setProtocolSpecificInformation_1 = sel_registerName("setProtocolSpecificInformation:");
+public static final int sel_tokenField_1shouldAddObjects_1atIndex_1 = sel_registerName("tokenField:shouldAddObjects:atIndex:");
+public static final int sel_popUpContextMenu_1withEvent_1forView_1 = sel_registerName("popUpContextMenu:withEvent:forView:");
+public static final int sel_stopPeriodicEvents = sel_registerName("stopPeriodicEvents");
+public static final int sel_setDTD_1 = sel_registerName("setDTD:");
+public static final int sel_glyphAtIndex_1isValidIndex_1 = sel_registerName("glyphAtIndex:isValidIndex:");
+public static final int sel_encodeSize_1 = sel_registerName("encodeSize:");
+public static final int sel_windowForSheet = sel_registerName("windowForSheet");
+public static final int sel_displayMode = sel_registerName("displayMode");
+public static final int sel_revertDocumentToSaved_1 = sel_registerName("revertDocumentToSaved:");
+public static final int sel_tableView_1objectValueForTableColumn_1row_1 = sel_registerName("tableView:objectValueForTableColumn:row:");
+public static final int sel_setBackingType_1 = sel_registerName("setBackingType:");
+public static final int sel_scanUpToCharactersFromSet_1intoString_1 = sel_registerName("scanUpToCharactersFromSet:intoString:");
+public static final int sel_nextValidKeyView = sel_registerName("nextValidKeyView");
+public static final int sel_arrayWithObject_1 = sel_registerName("arrayWithObject:");
+public static final int sel_flushBuffer = sel_registerName("flushBuffer");
+public static final int sel_hasValidObjectValue = sel_registerName("hasValidObjectValue");
+public static final int sel_numberWithUnsignedLong_1 = sel_registerName("numberWithUnsignedLong:");
+public static final int sel_collectExhaustively = sel_registerName("collectExhaustively");
+public static final int sel_setImageInterpolation_1 = sel_registerName("setImageInterpolation:");
+public static final int sel_setSystemID_1 = sel_registerName("setSystemID:");
+public static final int sel_setCornerView_1 = sel_registerName("setCornerView:");
+public static final int sel_initWithDouble_1 = sel_registerName("initWithDouble:");
+public static final int sel_sortedArrayUsingDescriptors_1 = sel_registerName("sortedArrayUsingDescriptors:");
+public static final int sel_removeTextContainerAtIndex_1 = sel_registerName("removeTextContainerAtIndex:");
+public static final int sel_whitespaceCharacterSet = sel_registerName("whitespaceCharacterSet");
+public static final int sel_classDescriptionForClass_1 = sel_registerName("classDescriptionForClass:");
+public static final int sel_setAttributedString_1 = sel_registerName("setAttributedString:");
+public static final int sel_setPixelsHigh_1 = sel_registerName("setPixelsHigh:");
+public static final int sel_setDynamicDepthLimit_1 = sel_registerName("setDynamicDepthLimit:");
+public static final int sel_sharedApplication = sel_registerName("sharedApplication");
+public static final int sel_sound_1didFinishPlaying_1 = sel_registerName("sound:didFinishPlaying:");
+public static final int sel_defaultBehavior = sel_registerName("defaultBehavior");
+public static final int sel_beginSheetForDirectory_1file_1types_1modalForWindow_1modalDelegate_1didEndSelector_1contextInfo_1 = sel_registerName("beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector:contextInfo:");
+public static final int sel_orderFrontFontPanel_1 = sel_registerName("orderFrontFontPanel:");
+public static final int sel_searchForBrowsableDomains = sel_registerName("searchForBrowsableDomains");
+public static final int sel_toggleAutomaticQuoteSubstitution_1 = sel_registerName("toggleAutomaticQuoteSubstitution:");
+public static final int sel_textView_1willChangeSelectionFromCharacterRanges_1toCharacterRanges_1 = sel_registerName("textView:willChangeSelectionFromCharacterRanges:toCharacterRanges:");
+public static final int sel_alignRight_1 = sel_registerName("alignRight:");
+public static final int sel_getBytes_1maxLength_1usedLength_1encoding_1options_1range_1remainingRange_1 = sel_registerName("getBytes:maxLength:usedLength:encoding:options:range:remainingRange:");
+public static final int sel_keyPointerFunctions = sel_registerName("keyPointerFunctions");
+public static final int sel_mouseDownFlags = sel_registerName("mouseDownFlags");
+public static final int sel_expandItem_1 = sel_registerName("expandItem:");
+public static final int sel_bezierPathWithRect_1 = sel_registerName("bezierPathWithRect:");
+public static final int sel_setGradientType_1 = sel_registerName("setGradientType:");
+public static final int sel_alphanumericCharacterSet = sel_registerName("alphanumericCharacterSet");
+public static final int sel_deleteWordForward_1 = sel_registerName("deleteWordForward:");
+public static final int sel_cStringUsingEncoding_1 = sel_registerName("cStringUsingEncoding:");
+public static final int sel_storedValueForKey_1 = sel_registerName("storedValueForKey:");
+public static final int sel_fileSize = sel_registerName("fileSize");
+public static final int sel_elementWithName_1URI_1 = sel_registerName("elementWithName:URI:");
+public static final int sel_pointSize = sel_registerName("pointSize");
+public static final int sel_veryShortMonthSymbols = sel_registerName("veryShortMonthSymbols");
+public static final int sel_transformSize_1 = sel_registerName("transformSize:");
+public static final int sel_titleWidth = sel_registerName("titleWidth");
+public static final int sel_setTextContainerInset_1 = sel_registerName("setTextContainerInset:");
+public static final int sel_supportedWindowDepths = sel_registerName("supportedWindowDepths");
+public static final int sel_appleEvent = sel_registerName("appleEvent");
+public static final int sel_valueClassForBinding_1 = sel_registerName("valueClassForBinding:");
+public static final int sel_setFullScreen = sel_registerName("setFullScreen");
+public static final int sel_encodeObject_1forKey_1 = sel_registerName("encodeObject:forKey:");
+public static final int sel_setSpellingState_1range_1 = sel_registerName("setSpellingState:range:");
+public static final int sel_greenComponent = sel_registerName("greenComponent");
+public static final int sel_textBackgroundColor = sel_registerName("textBackgroundColor");
+public static final int sel_currentEditor = sel_registerName("currentEditor");
+public static final int sel_attachedSheet = sel_registerName("attachedSheet");
+public static final int sel_new = sel_registerName("new");
+public static final int sel_setChildren_1 = sel_registerName("setChildren:");
+public static final int sel_options = sel_registerName("options");
+public static final int sel_setObjectClass_1 = sel_registerName("setObjectClass:");
+public static final int sel_borderWidth = sel_registerName("borderWidth");
+public static final int sel_secondarySelectedControlColor = sel_registerName("secondarySelectedControlColor");
+public static final int sel_scrollItemAtIndexToVisible_1 = sel_registerName("scrollItemAtIndexToVisible:");
+public static final int sel_wantsLayer = sel_registerName("wantsLayer");
+public static final int sel_setPath_1 = sel_registerName("setPath:");
+public static final int sel_setKeys_1triggerChangeNotificationsForDependentKey_1 = sel_registerName("setKeys:triggerChangeNotificationsForDependentKey:");
+public static final int sel_verticalAlignment = sel_registerName("verticalAlignment");
+public static final int sel_selectionGranularity = sel_registerName("selectionGranularity");
+public static final int sel_minimumIntegerDigits = sel_registerName("minimumIntegerDigits");
+public static final int sel_canCreateDirectories = sel_registerName("canCreateDirectories");
+public static final int sel_fixAttributesInRange_1 = sel_registerName("fixAttributesInRange:");
+public static final int sel_URLWithString_1 = sel_registerName("URLWithString:");
+public static final int sel_setFrameFromContentFrame_1 = sel_registerName("setFrameFromContentFrame:");
+public static final int sel_setFillColor_1 = sel_registerName("setFillColor:");
+public static final int sel_dictionaryWithCapacity_1 = sel_registerName("dictionaryWithCapacity:");
+public static final int sel_updateFromPath_1 = sel_registerName("updateFromPath:");
+public static final int sel_netServiceDidResolveAddress_1 = sel_registerName("netServiceDidResolveAddress:");
+public static final int sel_usesLazyFetching = sel_registerName("usesLazyFetching");
+public static final int sel_setMenuBarVisible_1 = sel_registerName("setMenuBarVisible:");
+public static final int sel_windowDidBecomeKey_1 = sel_registerName("windowDidBecomeKey:");
+public static final int sel_menuChanged_1 = sel_registerName("menuChanged:");
+public static final int sel_itemObjectValueAtIndex_1 = sel_registerName("itemObjectValueAtIndex:");
+public static final int sel_setClassName_1forClass_1 = sel_registerName("setClassName:forClass:");
+public static final int sel_setShowsToolbarButton_1 = sel_registerName("setShowsToolbarButton:");
+public static final int sel_plusSign = sel_registerName("plusSign");
+public static final int sel_sharedSpellChecker = sel_registerName("sharedSpellChecker");
+public static final int sel_getNumberOfRows_1columns_1 = sel_registerName("getNumberOfRows:columns:");
+public static final int sel_valueTransformerNames = sel_registerName("valueTransformerNames");
+public static final int sel_interpolatedColorAtLocation_1 = sel_registerName("interpolatedColorAtLocation:");
+public static final int sel_updateSpellingPanelWithMisspelledWord_1 = sel_registerName("updateSpellingPanelWithMisspelledWord:");
+public static final int sel_yellowComponent = sel_registerName("yellowComponent");
+public static final int sel_acceptsFirstResponder = sel_registerName("acceptsFirstResponder");
+public static final int sel_valueWithRect_1 = sel_registerName("valueWithRect:");
+public static final int sel_frameOfCellAtColumn_1row_1 = sel_registerName("frameOfCellAtColumn:row:");
+public static final int sel_makeWindowsPerform_1inOrder_1 = sel_registerName("makeWindowsPerform:inOrder:");
+public static final int sel_lastIndex = sel_registerName("lastIndex");
+public static final int sel_initWithCharacters_1length_1 = sel_registerName("initWithCharacters:length:");
+public static final int sel_initWithIdentifier_1 = sel_registerName("initWithIdentifier:");
+public static final int sel_proxyWithLocal_1connection_1 = sel_registerName("proxyWithLocal:connection:");
+public static final int sel_scrollColumnToVisible_1 = sel_registerName("scrollColumnToVisible:");
+public static final int sel_descriptor = sel_registerName("descriptor");
+public static final int sel_ISOCountryCodes = sel_registerName("ISOCountryCodes");
+public static final int sel_setStandardInput_1 = sel_registerName("setStandardInput:");
+public static final int sel_getAdvancements_1forGlyphs_1count_1 = sel_registerName("getAdvancements:forGlyphs:count:");
+public static final int sel_displayColumn_1 = sel_registerName("displayColumn:");
+public static final int sel_setAltersStateOfSelectedItem_1 = sel_registerName("setAltersStateOfSelectedItem:");
+public static final int sel_setFrameRotation_1 = sel_registerName("setFrameRotation:");
+public static final int sel_clickedOnLink_1atIndex_1 = sel_registerName("clickedOnLink:atIndex:");
+public static final int sel_addAttribute_1 = sel_registerName("addAttribute:");
+public static final int sel_readPrintInfo = sel_registerName("readPrintInfo");
+public static final int sel_setCurrentContext_1 = sel_registerName("setCurrentContext:");
+public static final int sel_setVerticalLineScroll_1 = sel_registerName("setVerticalLineScroll:");
+public static final int sel_commands = sel_registerName("commands");
+public static final int sel_setNamespaces_1 = sel_registerName("setNamespaces:");
+public static final int sel_removeEntryAtIndex_1 = sel_registerName("removeEntryAtIndex:");
+public static final int sel_setAllowsColumnResizing_1 = sel_registerName("setAllowsColumnResizing:");
+public static final int sel_colorWithDeviceCyan_1magenta_1yellow_1black_1alpha_1 = sel_registerName("colorWithDeviceCyan:magenta:yellow:black:alpha:");
+public static final int sel_textView_1shouldChangeTypingAttributes_1toAttributes_1 = sel_registerName("textView:shouldChangeTypingAttributes:toAttributes:");
+public static final int sel_usesFeedbackWindow = sel_registerName("usesFeedbackWindow");
+public static final int sel_setCookie_1 = sel_registerName("setCookie:");
+public static final int sel_keyWindow = sel_registerName("keyWindow");
+public static final int sel_headIndent = sel_registerName("headIndent");
+public static final int sel_removeObjectIdenticalTo_1inRange_1 = sel_registerName("removeObjectIdenticalTo:inRange:");
+public static final int sel_applicationWillUnhide_1 = sel_registerName("applicationWillUnhide:");
+public static final int sel_currentPage = sel_registerName("currentPage");
+public static final int sel_setOffStateImage_1 = sel_registerName("setOffStateImage:");
+public static final int sel_addRowWithCells_1 = sel_registerName("addRowWithCells:");
+public static final int sel_setInterlineSpacing_1 = sel_registerName("setInterlineSpacing:");
+public static final int sel_imageFileTypes = sel_registerName("imageFileTypes");
+public static final int sel_setArray_1 = sel_registerName("setArray:");
+public static final int sel_addLayoutManager_1 = sel_registerName("addLayoutManager:");
+public static final int sel_outputStreamToFileAtPath_1append_1 = sel_registerName("outputStreamToFileAtPath:append:");
+public static final int sel_registeredDraggedTypes = sel_registerName("registeredDraggedTypes");
+public static final int sel_colorWithCalibratedRed_1green_1blue_1alpha_1 = sel_registerName("colorWithCalibratedRed:green:blue:alpha:");
+public static final int sel_invalidateClassDescriptionCache = sel_registerName("invalidateClassDescriptionCache");
+public static final int sel_URLProtocolDidFinishLoading_1 = sel_registerName("URLProtocolDidFinishLoading:");
+public static final int sel_didChangeArrangementCriteria = sel_registerName("didChangeArrangementCriteria");
+public static final int sel_ICCProfileData = sel_registerName("ICCProfileData");
+public static final int sel_availableResourceData = sel_registerName("availableResourceData");
+public static final int sel_glyphIndexForPoint_1inTextContainer_1fractionOfDistanceThroughGlyph_1 = sel_registerName("glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:");
+public static final int sel_moveToEndOfParagraph_1 = sel_registerName("moveToEndOfParagraph:");
+public static final int sel_enterFullScreenMode_1withOptions_1 = sel_registerName("enterFullScreenMode:withOptions:");
+public static final int sel_fieldEditor_1forObject_1 = sel_registerName("fieldEditor:forObject:");
+public static final int sel_setTreatsFilePackagesAsDirectories_1 = sel_registerName("setTreatsFilePackagesAsDirectories:");
+public static final int sel_setLevelIndicatorStyle_1 = sel_registerName("setLevelIndicatorStyle:");
+public static final int sel_minimumDecimalNumber = sel_registerName("minimumDecimalNumber");
+public static final int sel_hasSpaceAvailable = sel_registerName("hasSpaceAvailable");
+public static final int sel_widthOfString_1 = sel_registerName("widthOfString:");
+public static final int sel_setLocale_1 = sel_registerName("setLocale:");
+public static final int sel_setPreferredEdge_1 = sel_registerName("setPreferredEdge:");
+public static final int sel_setRichText_1 = sel_registerName("setRichText:");
+public static final int sel_rangesForUserCharacterAttributeChange = sel_registerName("rangesForUserCharacterAttributeChange");
+public static final int sel_rectForPage_1 = sel_registerName("rectForPage:");
+public static final int sel_rowHeight = sel_registerName("rowHeight");
+public static final int sel_windowDidChangeScreenProfile_1 = sel_registerName("windowDidChangeScreenProfile:");
+public static final int sel_setCachePolicy_1 = sel_registerName("setCachePolicy:");
+public static final int sel_parser_1didEndMappingPrefix_1 = sel_registerName("parser:didEndMappingPrefix:");
+public static final int sel_cleanUpAfterDragOperation = sel_registerName("cleanUpAfterDragOperation");
+public static final int sel_browser_1typeSelectStringForRow_1inColumn_1 = sel_registerName("browser:typeSelectStringForRow:inColumn:");
+public static final int sel_canInitWithPasteboard_1 = sel_registerName("canInitWithPasteboard:");
+public static final int sel_startListening = sel_registerName("startListening");
+public static final int sel_setExcludedKeys_1 = sel_registerName("setExcludedKeys:");
+public static final int sel_readFromFile_1ofType_1 = sel_registerName("readFromFile:ofType:");
+public static final int sel_setReservedThicknessForMarkers_1 = sel_registerName("setReservedThicknessForMarkers:");
+public static final int sel_windowRef = sel_registerName("windowRef");
+public static final int sel_browser_1selectRow_1inColumn_1 = sel_registerName("browser:selectRow:inColumn:");
+public static final int sel_isOpaque = sel_registerName("isOpaque");
+public static final int sel_fontDescriptorWithFamily_1 = sel_registerName("fontDescriptorWithFamily:");
+public static final int sel_itemTitleAtIndex_1 = sel_registerName("itemTitleAtIndex:");
+public static final int sel_boundingBox = sel_registerName("boundingBox");
+public static final int sel_moveColumn_1toColumn_1 = sel_registerName("moveColumn:toColumn:");
+public static final int sel_badgeLabel = sel_registerName("badgeLabel");
+public static final int sel_outline_1 = sel_registerName("outline:");
+public static final int sel_characterIndexForInsertionAtPoint_1 = sel_registerName("characterIndexForInsertionAtPoint:");
+public static final int sel_URLHandleClassForURL_1 = sel_registerName("URLHandleClassForURL:");
+public static final int sel_selectKeyViewFollowingView_1 = sel_registerName("selectKeyViewFollowingView:");
+public static final int sel_fullPathForApplication_1 = sel_registerName("fullPathForApplication:");
+public static final int sel_outlineView_1willDisplayOutlineCell_1forTableColumn_1item_1 = sel_registerName("outlineView:willDisplayOutlineCell:forTableColumn:item:");
+public static final int sel_encodePropertyList_1 = sel_registerName("encodePropertyList:");
+public static final int sel_generatesDecimalNumbers = sel_registerName("generatesDecimalNumbers");
+public static final int sel_appendAttributedString_1 = sel_registerName("appendAttributedString:");
+public static final int sel_persistentDomainNames = sel_registerName("persistentDomainNames");
+public static final int sel_setUserFont_1 = sel_registerName("setUserFont:");
+public static final int sel_initWithProperties_1 = sel_registerName("initWithProperties:");
+public static final int sel_loadResourceDataNotifyingClient_1usingCache_1 = sel_registerName("loadResourceDataNotifyingClient:usingCache:");
+public static final int sel_closeFile = sel_registerName("closeFile");
+public static final int sel_allHeaderFields = sel_registerName("allHeaderFields");
+public static final int sel_unlearnWord_1 = sel_registerName("unlearnWord:");
+public static final int sel_drawsCellBackground = sel_registerName("drawsCellBackground");
+public static final int sel_PICTRepresentation = sel_registerName("PICTRepresentation");
+public static final int sel_imageScaling = sel_registerName("imageScaling");
+public static final int sel_scanUpToString_1intoString_1 = sel_registerName("scanUpToString:intoString:");
+public static final int sel_scrollBarColor = sel_registerName("scrollBarColor");
+public static final int sel_initWithDelegate_1name_1 = sel_registerName("initWithDelegate:name:");
+public static final int sel_setDateValue_1 = sel_registerName("setDateValue:");
+public static final int sel_dividerStyle = sel_registerName("dividerStyle");
+public static final int sel_scrollPageDown_1 = sel_registerName("scrollPageDown:");
+public static final int sel_removeLayoutManager_1 = sel_registerName("removeLayoutManager:");
+public static final int sel_textAttributesForNegativeValues = sel_registerName("textAttributesForNegativeValues");
+public static final int sel_attachment = sel_registerName("attachment");
+public static final int sel_reset = sel_registerName("reset");
+public static final int sel_initWithAttributes_1 = sel_registerName("initWithAttributes:");
+public static final int sel_allowsMixedState = sel_registerName("allowsMixedState");
+public static final int sel_addPort_1forMode_1 = sel_registerName("addPort:forMode:");
+public static final int sel_windowDidDeminiaturize_1 = sel_registerName("windowDidDeminiaturize:");
+public static final int sel_setRowHeight_1 = sel_registerName("setRowHeight:");
+public static final int sel_setGraphicsState_1 = sel_registerName("setGraphicsState:");
+public static final int sel_replaceCharactersInRange_1withAttributedString_1 = sel_registerName("replaceCharactersInRange:withAttributedString:");
+public static final int sel_setAttributedStringValue_1 = sel_registerName("setAttributedStringValue:");
+public static final int sel_criteriaKeyPath = sel_registerName("criteriaKeyPath");
+public static final int sel_standardInput = sel_registerName("standardInput");
+public static final int sel_isFontAvailable_1 = sel_registerName("isFontAvailable:");
+public static final int sel_setAllowsTypeSelect_1 = sel_registerName("setAllowsTypeSelect:");
+public static final int sel_portWithMachPort_1 = sel_registerName("portWithMachPort:");
+public static final int sel_panel_1isValidFilename_1 = sel_registerName("panel:isValidFilename:");
+public static final int sel_imageablePageBounds = sel_registerName("imageablePageBounds");
+public static final int sel_notificationWithName_1object_1 = sel_registerName("notificationWithName:object:");
+public static final int sel_sharedFontPanelExists = sel_registerName("sharedFontPanelExists");
+public static final int sel_blackColor = sel_registerName("blackColor");
+public static final int sel_removeDescriptorAtIndex_1 = sel_registerName("removeDescriptorAtIndex:");
+public static final int sel_dataUsingEncoding_1allowLossyConversion_1 = sel_registerName("dataUsingEncoding:allowLossyConversion:");
+public static final int sel_propertyForKey_1inRequest_1 = sel_registerName("propertyForKey:inRequest:");
+public static final int sel_setHeaderLevel_1 = sel_registerName("setHeaderLevel:");
+public static final int sel_jobTitle = sel_registerName("jobTitle");
+public static final int sel_removePersistentDomainForName_1 = sel_registerName("removePersistentDomainForName:");
+public static final int sel_contentResizeIncrements = sel_registerName("contentResizeIncrements");
+public static final int sel_textFileTypes = sel_registerName("textFileTypes");
+public static final int sel_setAction_1 = sel_registerName("setAction:");
+public static final int sel_knobProportion = sel_registerName("knobProportion");
+public static final int sel_numberOfArguments = sel_registerName("numberOfArguments");
+public static final int sel_setScrollsDynamically_1 = sel_registerName("setScrollsDynamically:");
+public static final int sel_setTextColor_1range_1 = sel_registerName("setTextColor:range:");
+public static final int sel_setBoundsSize_1 = sel_registerName("setBoundsSize:");
+public static final int sel_setVolume_1 = sel_registerName("setVolume:");
+public static final int sel_windowControllers = sel_registerName("windowControllers");
+public static final int sel_insertAttributedString_1atIndex_1 = sel_registerName("insertAttributedString:atIndex:");
+public static final int sel_eventWithEventRef_1 = sel_registerName("eventWithEventRef:");
+public static final int sel_initByReferencingFile_1 = sel_registerName("initByReferencingFile:");
+public static final int sel_fire = sel_registerName("fire");
+public static final int sel_writeToPasteboard_1 = sel_registerName("writeToPasteboard:");
+public static final int sel_connectionForProxy = sel_registerName("connectionForProxy");
+public static final int sel_outlineView_1mouseDownInHeaderOfTableColumn_1 = sel_registerName("outlineView:mouseDownInHeaderOfTableColumn:");
+public static final int sel_mutableArrayValueForKeyPath_1 = sel_registerName("mutableArrayValueForKeyPath:");
+public static final int sel_validRequestorForSendType_1returnType_1 = sel_registerName("validRequestorForSendType:returnType:");
+public static final int sel_isRichText = sel_registerName("isRichText");
+public static final int sel_moveWordLeft_1 = sel_registerName("moveWordLeft:");
+public static final int sel_indexSetWithIndex_1 = sel_registerName("indexSetWithIndex:");
+public static final int sel_setContextMenuRepresentation_1 = sel_registerName("setContextMenuRepresentation:");
+public static final int sel_updateTrackingAreas = sel_registerName("updateTrackingAreas");
+public static final int sel_defaultCollector = sel_registerName("defaultCollector");
+public static final int sel_orderedIndex = sel_registerName("orderedIndex");
+public static final int sel_relativeCurveToPoint_1controlPoint1_1controlPoint2_1 = sel_registerName("relativeCurveToPoint:controlPoint1:controlPoint2:");
+public static final int sel_setShowsApplicationBadge_1 = sel_registerName("setShowsApplicationBadge:");
+public static final int sel_setValue_1 = sel_registerName("setValue:");
+public static final int sel_attributeDeclarationForName_1elementName_1 = sel_registerName("attributeDeclarationForName:elementName:");
+public static final int sel_setWidth_1type_1forLayer_1 = sel_registerName("setWidth:type:forLayer:");
+public static final int sel_decodePoint = sel_registerName("decodePoint");
+public static final int sel_makeWindowControllers = sel_registerName("makeWindowControllers");
+public static final int sel_userFontOfSize_1 = sel_registerName("userFontOfSize:");
+public static final int sel_dependencies = sel_registerName("dependencies");
+public static final int sel_setAttributes_1 = sel_registerName("setAttributes:");
+public static final int sel_setFrameCenterRotation_1 = sel_registerName("setFrameCenterRotation:");
+public static final int sel_nilSymbol = sel_registerName("nilSymbol");
+public static final int sel_scalesWhenResized = sel_registerName("scalesWhenResized");
+public static final int sel_setMinusSign_1 = sel_registerName("setMinusSign:");
+public static final int sel_predicateOperatorType = sel_registerName("predicateOperatorType");
+public static final int sel_replyWithException_1 = sel_registerName("replyWithException:");
+public static final int sel_fileName = sel_registerName("fileName");
+public static final int sel_indexPathByRemovingLastIndex = sel_registerName("indexPathByRemovingLastIndex");
+public static final int sel_openHelpAnchor_1inBook_1 = sel_registerName("openHelpAnchor:inBook:");
+public static final int sel_initWithBytes_1objCType_1 = sel_registerName("initWithBytes:objCType:");
+public static final int sel_removeObject_1 = sel_registerName("removeObject:");
+public static final int sel_colorNameComponent = sel_registerName("colorNameComponent");
+public static final int sel_setCellBackgroundColor_1 = sel_registerName("setCellBackgroundColor:");
+public static final int sel_getLineDash_1count_1phase_1 = sel_registerName("getLineDash:count:phase:");
+public static final int sel_scriptingContains_1 = sel_registerName("scriptingContains:");
+public static final int sel_setDefaultWindingRule_1 = sel_registerName("setDefaultWindingRule:");
+public static final int sel_outputStreamToBuffer_1capacity_1 = sel_registerName("outputStreamToBuffer:capacity:");
+public static final int sel_defaultButtonTitle = sel_registerName("defaultButtonTitle");
+public static final int sel_draggingSourceOperationMask = sel_registerName("draggingSourceOperationMask");
+public static final int sel_textDidChange_1 = sel_registerName("textDidChange:");
+public static final int sel_drawSheetBorderWithSize_1 = sel_registerName("drawSheetBorderWithSize:");
+public static final int sel_integerForKey_1 = sel_registerName("integerForKey:");
+public static final int sel_setDefaultNameServerPortNumber_1 = sel_registerName("setDefaultNameServerPortNumber:");
+public static final int sel_previousNode = sel_registerName("previousNode");
+public static final int sel_trackingArea = sel_registerName("trackingArea");
+public static final int sel_highlightWithLevel_1 = sel_registerName("highlightWithLevel:");
+public static final int sel_trackMouse_1inRect_1ofView_1atCharacterIndex_1untilMouseUp_1 = sel_registerName("trackMouse:inRect:ofView:atCharacterIndex:untilMouseUp:");
+public static final int sel_signatureWithObjCTypes_1 = sel_registerName("signatureWithObjCTypes:");
+public static final int sel_saveToURL_1ofType_1forSaveOperation_1error_1 = sel_registerName("saveToURL:ofType:forSaveOperation:error:");
+public static final int sel_dataWithBytesNoCopy_1length_1freeWhenDone_1 = sel_registerName("dataWithBytesNoCopy:length:freeWhenDone:");
+public static final int sel_encodeInteger_1forKey_1 = sel_registerName("encodeInteger:forKey:");
+public static final int sel_removeFromSuperview = sel_registerName("removeFromSuperview");
+public static final int sel_dataWithBytesNoCopy_1length_1 = sel_registerName("dataWithBytesNoCopy:length:");
+public static final int sel_initWithIndexesInRange_1 = sel_registerName("initWithIndexesInRange:");
+public static final int sel_initWithKeyPointerFunctions_1valuePointerFunctions_1capacity_1 = sel_registerName("initWithKeyPointerFunctions:valuePointerFunctions:capacity:");
+public static final int sel_tilt = sel_registerName("tilt");
+public static final int sel_setHidden_1 = sel_registerName("setHidden:");
+public static final int sel_setMenuFormRepresentation_1 = sel_registerName("setMenuFormRepresentation:");
+public static final int sel_setCanChooseDirectories_1 = sel_registerName("setCanChooseDirectories:");
+public static final int sel_usedRectForTextContainer_1 = sel_registerName("usedRectForTextContainer:");
+public static final int sel_allowsColumnSelection = sel_registerName("allowsColumnSelection");
+public static final int sel_orderOut_1 = sel_registerName("orderOut:");
+public static final int sel_filterUsingPredicate_1 = sel_registerName("filterUsingPredicate:");
+public static final int sel_setTest_1 = sel_registerName("setTest:");
+public static final int sel_setAllowedTypes_1 = sel_registerName("setAllowedTypes:");
+public static final int sel_registerForDraggedTypes_1 = sel_registerName("registerForDraggedTypes:");
+public static final int sel_objectEnumerator = sel_registerName("objectEnumerator");
+public static final int sel_setWindowController_1 = sel_registerName("setWindowController:");
+public static final int sel_setDestination_1 = sel_registerName("setDestination:");
+public static final int sel_addRepresentation_1 = sel_registerName("addRepresentation:");
+public static final int sel_isEqual_1 = sel_registerName("isEqual:");
+public static final int sel_glyphRangeForTextContainer_1 = sel_registerName("glyphRangeForTextContainer:");
+public static final int sel_setStandaloneWeekdaySymbols_1 = sel_registerName("setStandaloneWeekdaySymbols:");
+public static final int sel_setIgnoresAlpha_1 = sel_registerName("setIgnoresAlpha:");
+public static final int sel_drawBarInside_1flipped_1 = sel_registerName("drawBarInside:flipped:");
+public static final int sel_doesNotRecognizeSelector_1 = sel_registerName("doesNotRecognizeSelector:");
+public static final int sel_windowDidResignMain_1 = sel_registerName("windowDidResignMain:");
+public static final int sel_scrollItemAtIndexToTop_1 = sel_registerName("scrollItemAtIndexToTop:");
+public static final int sel_makePreviousSegmentKey = sel_registerName("makePreviousSegmentKey");
+public static final int sel_download_1shouldDecodeSourceDataOfMIMEType_1 = sel_registerName("download:shouldDecodeSourceDataOfMIMEType:");
+public static final int sel_compareObject_1toObject_1 = sel_registerName("compareObject:toObject:");
+public static final int sel_widthTracksTextView = sel_registerName("widthTracksTextView");
+public static final int sel_subpredicates = sel_registerName("subpredicates");
+public static final int sel_relativeLineToPoint_1 = sel_registerName("relativeLineToPoint:");
+public static final int sel_gridStyleMask = sel_registerName("gridStyleMask");
+public static final int sel_initWithCString_1 = sel_registerName("initWithCString:");
+public static final int sel_imageScalingForSegment_1 = sel_registerName("imageScalingForSegment:");
+public static final int sel_editWithFrame_1inView_1editor_1delegate_1event_1 = sel_registerName("editWithFrame:inView:editor:delegate:event:");
+public static final int sel_glyphPacking = sel_registerName("glyphPacking");
+public static final int sel_resolveWithTimeout_1 = sel_registerName("resolveWithTimeout:");
+public static final int sel_hasEditedDocuments = sel_registerName("hasEditedDocuments");
+public static final int sel_getLineFragmentRect_1usedRect_1forParagraphSeparatorGlyphRange_1atProposedOrigin_1 = sel_registerName("getLineFragmentRect:usedRect:forParagraphSeparatorGlyphRange:atProposedOrigin:");
+public static final int sel_autosaveDocumentWithDelegate_1didAutosaveSelector_1contextInfo_1 = sel_registerName("autosaveDocumentWithDelegate:didAutosaveSelector:contextInfo:");
+public static final int sel_readSelectionFromPasteboard_1type_1 = sel_registerName("readSelectionFromPasteboard:type:");
+public static final int sel_spellServer_1suggestGuessesForWord_1inLanguage_1 = sel_registerName("spellServer:suggestGuessesForWord:inLanguage:");
+public static final int sel_initWithTimeIntervalSinceNow_1 = sel_registerName("initWithTimeIntervalSinceNow:");
+public static final int sel_setMaxWidth_1 = sel_registerName("setMaxWidth:");
+public static final int sel_userDefaultsChanged = sel_registerName("userDefaultsChanged");
+public static final int sel_setWidth_1 = sel_registerName("setWidth:");
+public static final int sel_setPrintPanel_1 = sel_registerName("setPrintPanel:");
+public static final int sel_setCurrentPage_1 = sel_registerName("setCurrentPage:");
+public static final int sel_resizeIncrements = sel_registerName("resizeIncrements");
+public static final int sel_selectWithFrame_1inView_1editor_1delegate_1start_1length_1 = sel_registerName("selectWithFrame:inView:editor:delegate:start:length:");
+public static final int sel_sRGBColorSpace = sel_registerName("sRGBColorSpace");
+public static final int sel_scriptErrorExpectedTypeDescriptor = sel_registerName("scriptErrorExpectedTypeDescriptor");
+public static final int sel_setHasHorizontalRuler_1 = sel_registerName("setHasHorizontalRuler:");
+public static final int sel_initialFirstResponder = sel_registerName("initialFirstResponder");
+public static final int sel_stringForObjectValue_1 = sel_registerName("stringForObjectValue:");
+public static final int sel_pageRange = sel_registerName("pageRange");
+public static final int sel_printOperationWithView_1 = sel_registerName("printOperationWithView:");
+public static final int sel_initWithFrame_1pixelFormat_1 = sel_registerName("initWithFrame:pixelFormat:");
+public static final int sel_fileWrapperOfType_1error_1 = sel_registerName("fileWrapperOfType:error:");
+public static final int sel_doesContain_1 = sel_registerName("doesContain:");
+public static final int sel_mutableSetValueForKeyPath_1 = sel_registerName("mutableSetValueForKeyPath:");
+public static final int sel_initWithURL_1cached_1 = sel_registerName("initWithURL:cached:");
+public static final int sel_controlAlternatingRowBackgroundColors = sel_registerName("controlAlternatingRowBackgroundColors");
+public static final int sel_pathComponentCellClass = sel_registerName("pathComponentCellClass");
+public static final int sel_arrayWithCapacity_1 = sel_registerName("arrayWithCapacity:");
+public static final int sel_types = sel_registerName("types");
+public static final int sel_setPrintInfo_1 = sel_registerName("setPrintInfo:");
+public static final int sel_indexOfTabViewItemWithIdentifier_1 = sel_registerName("indexOfTabViewItemWithIdentifier:");
+public static final int sel_isEnabled = sel_registerName("isEnabled");
+public static final int sel_setHeaderView_1 = sel_registerName("setHeaderView:");
+public static final int sel_accessibilityHitTest_1 = sel_registerName("accessibilityHitTest:");
+public static final int sel_removeMarker_1 = sel_registerName("removeMarker:");
+public static final int sel_showContextHelp_1 = sel_registerName("showContextHelp:");
+public static final int sel_selectsInsertedObjects = sel_registerName("selectsInsertedObjects");
+public static final int sel_selectedRowInColumn_1 = sel_registerName("selectedRowInColumn:");
+public static final int sel_noteNewRecentDocument_1 = sel_registerName("noteNewRecentDocument:");
+public static final int sel_setAttachment_1 = sel_registerName("setAttachment:");
+public static final int sel_localeIdentifier = sel_registerName("localeIdentifier");
+public static final int sel_scrollLineUp_1 = sel_registerName("scrollLineUp:");
+public static final int sel_setCalendarFormat_1 = sel_registerName("setCalendarFormat:");
+public static final int sel_setAssociatedPoints_1atIndex_1 = sel_registerName("setAssociatedPoints:atIndex:");
+public static final int sel_resourceData = sel_registerName("resourceData");
+public static final int sel_setVeryShortStandaloneMonthSymbols_1 = sel_registerName("setVeryShortStandaloneMonthSymbols:");
+public static final int sel_windowDidUpdate_1 = sel_registerName("windowDidUpdate:");
+public static final int sel_moveLeft_1 = sel_registerName("moveLeft:");
+public static final int sel_showsBorderOnlyWhileMouseInside = sel_registerName("showsBorderOnlyWhileMouseInside");
+public static final int sel_valueForKey_1 = sel_registerName("valueForKey:");
+public static final int sel_setContentResizeIncrements_1 = sel_registerName("setContentResizeIncrements:");
+public static final int sel_drain = sel_registerName("drain");
+public static final int sel_concat = sel_registerName("concat");
+public static final int sel_scrollerWidthForControlSize_1 = sel_registerName("scrollerWidthForControlSize:");
+public static final int sel_insertItemWithTitle_1action_1keyEquivalent_1atIndex_1 = sel_registerName("insertItemWithTitle:action:keyEquivalent:atIndex:");
+public static final int sel_doubleValue = sel_registerName("doubleValue");
+public static final int sel_dividerThickness = sel_registerName("dividerThickness");
+public static final int sel_rowAtPoint_1 = sel_registerName("rowAtPoint:");
+public static final int sel_updateWindowsItem_1 = sel_registerName("updateWindowsItem:");
+public static final int sel_calendarDate = sel_registerName("calendarDate");
+public static final int sel_fixAttachmentAttributeInRange_1 = sel_registerName("fixAttachmentAttributeInRange:");
+public static final int sel_mapTableWithWeakToWeakObjects = sel_registerName("mapTableWithWeakToWeakObjects");
+public static final int sel_setClip = sel_registerName("setClip");
+public static final int sel_evaluationErrorNumber = sel_registerName("evaluationErrorNumber");
+public static final int sel_revertToSavedFromURL_1ofType_1 = sel_registerName("revertToSavedFromURL:ofType:");
+public static final int sel_autorecalculatesContentBorderThicknessForEdge_1 = sel_registerName("autorecalculatesContentBorderThicknessForEdge:");
+public static final int sel_lineToPoint_1 = sel_registerName("lineToPoint:");
+public static final int sel_insertionReplaces = sel_registerName("insertionReplaces");
+public static final int sel_smallestEncoding = sel_registerName("smallestEncoding");
+public static final int sel_elementAtIndex_1 = sel_registerName("elementAtIndex:");
+public static final int sel_getReturnValue_1 = sel_registerName("getReturnValue:");
+public static final int sel_regularFileContents = sel_registerName("regularFileContents");
+public static final int sel_recache = sel_registerName("recache");
+public static final int sel_setTextAttributesForNegativeInfinity_1 = sel_registerName("setTextAttributesForNegativeInfinity:");
+public static final int sel_horizontalRulerView = sel_registerName("horizontalRulerView");
+public static final int sel_initToMemory = sel_registerName("initToMemory");
+public static final int sel_shouldCreateUI = sel_registerName("shouldCreateUI");
+public static final int sel_scheme = sel_registerName("scheme");
+public static final int sel_raiseBaseline_1 = sel_registerName("raiseBaseline:");
+public static final int sel_initWithArray_1 = sel_registerName("initWithArray:");
+public static final int sel_displayNameForKey_1value_1 = sel_registerName("displayNameForKey:value:");
+public static final int sel_centerScanRect_1 = sel_registerName("centerScanRect:");
+public static final int sel_memoryCapacity = sel_registerName("memoryCapacity");
+public static final int sel_setBackgroundLayoutEnabled_1 = sel_registerName("setBackgroundLayoutEnabled:");
+public static final int sel_machPort = sel_registerName("machPort");
+public static final int sel_selectedFont = sel_registerName("selectedFont");
+public static final int sel_tableColumns = sel_registerName("tableColumns");
+public static final int sel_removeObjectAtIndex_1 = sel_registerName("removeObjectAtIndex:");
+public static final int sel_insertNewButtonImage_1in_1 = sel_registerName("insertNewButtonImage:in:");
+public static final int sel_stringWithContentsOfURL_1encoding_1error_1 = sel_registerName("stringWithContentsOfURL:encoding:error:");
+public static final int sel_menuChangedMessagesEnabled = sel_registerName("menuChangedMessagesEnabled");
+public static final int sel_initWithShort_1 = sel_registerName("initWithShort:");
+public static final int sel_setColorRenderingIntent_1 = sel_registerName("setColorRenderingIntent:");
+public static final int sel_descriptionWithCalendarFormat_1locale_1 = sel_registerName("descriptionWithCalendarFormat:locale:");
+public static final int sel_resourceSpecifier = sel_registerName("resourceSpecifier");
+public static final int sel_pasteboardByFilteringFile_1 = sel_registerName("pasteboardByFilteringFile:");
+public static final int sel_dragColor_1withEvent_1fromView_1 = sel_registerName("dragColor:withEvent:fromView:");
+public static final int sel_setStroke = sel_registerName("setStroke");
+public static final int sel_isControllerVisible = sel_registerName("isControllerVisible");
+public static final int sel_putCell_1atRow_1column_1 = sel_registerName("putCell:atRow:column:");
+public static final int sel_firstIndex = sel_registerName("firstIndex");
+public static final int sel_setFontManagerFactory_1 = sel_registerName("setFontManagerFactory:");
+public static final int sel_exponentSymbol = sel_registerName("exponentSymbol");
+public static final int sel_stringValue = sel_registerName("stringValue");
+public static final int sel_getObjects_1range_1 = sel_registerName("getObjects:range:");
+public static final int sel_scriptingProperties = sel_registerName("scriptingProperties");
+public static final int sel_query = sel_registerName("query");
+public static final int sel_eventClass = sel_registerName("eventClass");
+public static final int sel_dateWithNaturalLanguageString_1 = sel_registerName("dateWithNaturalLanguageString:");
+public static final int sel_datePickerMode = sel_registerName("datePickerMode");
+public static final int sel_setAlternateMnemonicLocation_1 = sel_registerName("setAlternateMnemonicLocation:");
+public static final int sel_stringByDeletingLastPathComponent = sel_registerName("stringByDeletingLastPathComponent");
+public static final int sel_encodeObject_1 = sel_registerName("encodeObject:");
+public static final int sel_unarchiveObjectWithData_1 = sel_registerName("unarchiveObjectWithData:");
+public static final int sel_destination = sel_registerName("destination");
+public static final int sel_ensureLayoutForCharacterRange_1 = sel_registerName("ensureLayoutForCharacterRange:");
+public static final int sel_tabView_1didSelectTabViewItem_1 = sel_registerName("tabView:didSelectTabViewItem:");
+public static final int sel_removeContextHelpForObject_1 = sel_registerName("removeContextHelpForObject:");
+public static final int sel_ensureGlyphsForCharacterRange_1 = sel_registerName("ensureGlyphsForCharacterRange:");
+public static final int sel_setMinimumFractionDigits_1 = sel_registerName("setMinimumFractionDigits:");
+public static final int sel_boundsRotation = sel_registerName("boundsRotation");
+public static final int sel_invalidateDisplayForGlyphRange_1 = sel_registerName("invalidateDisplayForGlyphRange:");
+public static final int sel_rectForBlock_1layoutAtPoint_1inRect_1textContainer_1characterRange_1 = sel_registerName("rectForBlock:layoutAtPoint:inRect:textContainer:characterRange:");
+public static final int sel_pasteFont_1 = sel_registerName("pasteFont:");
+public static final int sel_backgroundColor = sel_registerName("backgroundColor");
+public static final int sel_stringFromNumber_1 = sel_registerName("stringFromNumber:");
+public static final int sel_expiresDate = sel_registerName("expiresDate");
+public static final int sel_initWithWindowRef_1 = sel_registerName("initWithWindowRef:");
+public static final int sel_toggleToolbarShown_1 = sel_registerName("toggleToolbarShown:");
+public static final int sel_outlineViewItemDidExpand_1 = sel_registerName("outlineViewItemDidExpand:");
+public static final int sel_TIFFRepresentationOfImageRepsInArray_1usingCompression_1factor_1 = sel_registerName("TIFFRepresentationOfImageRepsInArray:usingCompression:factor:");
+public static final int sel_variable = sel_registerName("variable");
+public static final int sel_objectsForKeys_1notFoundMarker_1 = sel_registerName("objectsForKeys:notFoundMarker:");
+public static final int sel_controlColor = sel_registerName("controlColor");
+public static final int sel_unarchiverWillFinish_1 = sel_registerName("unarchiverWillFinish:");
+public static final int sel_proposedCredential = sel_registerName("proposedCredential");
+public static final int sel_isPaneSplitter = sel_registerName("isPaneSplitter");
+public static final int sel_endUndoGrouping = sel_registerName("endUndoGrouping");
+public static final int sel_setFrameRate_1 = sel_registerName("setFrameRate:");
+public static final int sel_completionDelay = sel_registerName("completionDelay");
+public static final int sel_setUserFixedPitchFont_1 = sel_registerName("setUserFixedPitchFont:");
+public static final int sel_isIndeterminate = sel_registerName("isIndeterminate");
+public static final int sel_menuItem = sel_registerName("menuItem");
+public static final int sel_setNumberStyle_1 = sel_registerName("setNumberStyle:");
+public static final int sel_takeIntegerValueFrom_1 = sel_registerName("takeIntegerValueFrom:");
+public static final int sel_setIndentationMarkerFollowsCell_1 = sel_registerName("setIndentationMarkerFollowsCell:");
+public static final int sel_tile = sel_registerName("tile");
+public static final int sel_cancelButtonRectForBounds_1 = sel_registerName("cancelButtonRectForBounds:");
+public static final int sel_deselectRow_1 = sel_registerName("deselectRow:");
+public static final int sel_setMouseCoalescingEnabled_1 = sel_registerName("setMouseCoalescingEnabled:");
+public static final int sel_removeWindowController_1 = sel_registerName("removeWindowController:");
+public static final int sel_warningValue = sel_registerName("warningValue");
+public static final int sel_isVerticallyResizable = sel_registerName("isVerticallyResizable");
+public static final int sel_defaultFetchRequest = sel_registerName("defaultFetchRequest");
+public static final int sel_netServiceWillResolve_1 = sel_registerName("netServiceWillResolve:");
+public static final int sel_addProgressMark_1 = sel_registerName("addProgressMark:");
+public static final int sel_recentsAutosaveName = sel_registerName("recentsAutosaveName");
+public static final int sel_commitEditing = sel_registerName("commitEditing");
+public static final int sel_attributesOfItemAtPath_1error_1 = sel_registerName("attributesOfItemAtPath:error:");
+public static final int sel_download_1willSendRequest_1redirectResponse_1 = sel_registerName("download:willSendRequest:redirectResponse:");
+public static final int sel_canBeCompressedUsing_1 = sel_registerName("canBeCompressedUsing:");
+public static final int sel_strokeRect_1 = sel_registerName("strokeRect:");
+public static final int sel_descriptionWithLocale_1indent_1 = sel_registerName("descriptionWithLocale:indent:");
+public static final int sel_applicationDockMenu_1 = sel_registerName("applicationDockMenu:");
+public static final int sel_initWithCString_1length_1 = sel_registerName("initWithCString:length:");
+public static final int sel_runPageLayout_1 = sel_registerName("runPageLayout:");
+public static final int sel_toolbar_1itemForItemIdentifier_1willBeInsertedIntoToolbar_1 = sel_registerName("toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar:");
+public static final int sel_setSelectsInsertedObjects_1 = sel_registerName("setSelectsInsertedObjects:");
+public static final int sel_alternateSelectedControlTextColor = sel_registerName("alternateSelectedControlTextColor");
+public static final int sel_isValidGlyphIndex_1 = sel_registerName("isValidGlyphIndex:");
+public static final int sel_stringForKey_1inTable_1 = sel_registerName("stringForKey:inTable:");
+public static final int sel_cellSizeForBounds_1 = sel_registerName("cellSizeForBounds:");
+public static final int sel_beginSheetForDirectory_1file_1modalForWindow_1modalDelegate_1didEndSelector_1contextInfo_1 = sel_registerName("beginSheetForDirectory:file:modalForWindow:modalDelegate:didEndSelector:contextInfo:");
+public static final int sel_invalidateLayoutForCharacterRange_1actualCharacterRange_1 = sel_registerName("invalidateLayoutForCharacterRange:actualCharacterRange:");
+public static final int sel_initAsTearOff = sel_registerName("initAsTearOff");
+public static final int sel_allowsOtherFileTypes = sel_registerName("allowsOtherFileTypes");
+public static final int sel_mouseMoved_1 = sel_registerName("mouseMoved:");
+public static final int sel_deleteCharactersInRange_1 = sel_registerName("deleteCharactersInRange:");
+public static final int sel_setTitleFont_1 = sel_registerName("setTitleFont:");
+public static final int sel_showsApplicationBadge = sel_registerName("showsApplicationBadge");
+public static final int sel_initWithLeftExpression_1rightExpression_1modifier_1type_1options_1 = sel_registerName("initWithLeftExpression:rightExpression:modifier:type:options:");
+public static final int sel_distantPast = sel_registerName("distantPast");
+public static final int sel_isReady = sel_registerName("isReady");
+public static final int sel_draggedImage_1movedTo_1 = sel_registerName("draggedImage:movedTo:");
+public static final int sel_resetTotalAutoreleasedObjects = sel_registerName("resetTotalAutoreleasedObjects");
+public static final int sel_setGlyphGenerator_1 = sel_registerName("setGlyphGenerator:");
+public static final int sel_groupsByEvent = sel_registerName("groupsByEvent");
+public static final int sel_shortMonthSymbols = sel_registerName("shortMonthSymbols");
+public static final int sel_setDescriptor_1forKeyword_1 = sel_registerName("setDescriptor:forKeyword:");
+public static final int sel_description = sel_registerName("description");
+public static final int sel_replaceOccurrencesOfString_1withString_1options_1range_1 = sel_registerName("replaceOccurrencesOfString:withString:options:range:");
+public static final int sel_boundsRectForContentRect_1inRect_1textContainer_1characterRange_1 = sel_registerName("boundsRectForContentRect:inRect:textContainer:characterRange:");
+public static final int sel_authenticationDataForComponents_1 = sel_registerName("authenticationDataForComponents:");
+public static final int sel_isExecuting = sel_registerName("isExecuting");
+public static final int sel_branchImage = sel_registerName("branchImage");
+public static final int sel_decodeRectForKey_1 = sel_registerName("decodeRectForKey:");
+public static final int sel_rectValue = sel_registerName("rectValue");
+public static final int sel_setFrameTopLeftPoint_1 = sel_registerName("setFrameTopLeftPoint:");
+public static final int sel_initWithFileDescriptor_1 = sel_registerName("initWithFileDescriptor:");
+public static final int sel_removePointerAtIndex_1 = sel_registerName("removePointerAtIndex:");
+public static final int sel_executeAndReturnError_1 = sel_registerName("executeAndReturnError:");
+public static final int sel_changeCaseOfLetter_1 = sel_registerName("changeCaseOfLetter:");
+public static final int sel_appendBezierPathWithArcWithCenter_1radius_1startAngle_1endAngle_1clockwise_1 = sel_registerName("appendBezierPathWithArcWithCenter:radius:startAngle:endAngle:clockwise:");
+public static final int sel_insertNewlineIgnoringFieldEditor_1 = sel_registerName("insertNewlineIgnoringFieldEditor:");
+public static final int sel_attributeDescriptorForKeyword_1 = sel_registerName("attributeDescriptorForKeyword:");
+public static final int sel_decimalNumberWithMantissa_1exponent_1isNegative_1 = sel_registerName("decimalNumberWithMantissa:exponent:isNegative:");
+public static final int sel_activeConversationWillChange_1fromOldConversation_1 = sel_registerName("activeConversationWillChange:fromOldConversation:");
+public static final int sel_layoutAlgorithm = sel_registerName("layoutAlgorithm");
+public static final int sel_itemNumberInTextList_1atIndex_1 = sel_registerName("itemNumberInTextList:atIndex:");
+public static final int sel_initWithImage_1hotSpot_1 = sel_registerName("initWithImage:hotSpot:");
+public static final int sel_setStackSize_1 = sel_registerName("setStackSize:");
+public static final int sel_matrixInColumn_1 = sel_registerName("matrixInColumn:");
+public static final int sel_performSelector_1withObject_1 = sel_registerName("performSelector:withObject:");
+public static final int sel_setSound_1 = sel_registerName("setSound:");
+public static final int sel_accessibilityPerformAction_1 = sel_registerName("accessibilityPerformAction:");
+public static final int sel_comment = sel_registerName("comment");
+public static final int sel_rangeOfNominallySpacedGlyphsContainingIndex_1 = sel_registerName("rangeOfNominallySpacedGlyphsContainingIndex:");
+public static final int sel_showAttachmentCell_1inRect_1characterIndex_1 = sel_registerName("showAttachmentCell:inRect:characterIndex:");
+public static final int sel_isDisplayedWhenStopped = sel_registerName("isDisplayedWhenStopped");
+public static final int sel_addCollection_1options_1 = sel_registerName("addCollection:options:");
+public static final int sel_drawInRect_1angle_1 = sel_registerName("drawInRect:angle:");
+public static final int sel_initWithFrame_1mode_1prototype_1numberOfRows_1numberOfColumns_1 = sel_registerName("initWithFrame:mode:prototype:numberOfRows:numberOfColumns:");
+public static final int sel_sharedCredentialStorage = sel_registerName("sharedCredentialStorage");
+public static final int sel_colorWithDeviceWhite_1alpha_1 = sel_registerName("colorWithDeviceWhite:alpha:");
+public static final int sel_setMainDocumentURL_1 = sel_registerName("setMainDocumentURL:");
+public static final int sel_interpretKeyEvents_1 = sel_registerName("interpretKeyEvents:");
+public static final int sel_readFromData_1ofType_1error_1 = sel_registerName("readFromData:ofType:error:");
+public static final int sel_tokenFieldCell_1menuForRepresentedObject_1 = sel_registerName("tokenFieldCell:menuForRepresentedObject:");
+public static final int sel_setEventHandler_1andSelector_1forEventClass_1andEventID_1 = sel_registerName("setEventHandler:andSelector:forEventClass:andEventID:");
+public static final int sel_addAttribute_1value_1range_1 = sel_registerName("addAttribute:value:range:");
+public static final int sel_outlineView_1writeItems_1toPasteboard_1 = sel_registerName("outlineView:writeItems:toPasteboard:");
+public static final int sel_initWithCString_1encoding_1 = sel_registerName("initWithCString:encoding:");
+public static final int sel_setTypesetterBehavior_1 = sel_registerName("setTypesetterBehavior:");
+public static final int sel_removeObjectAtArrangedObjectIndex_1 = sel_registerName("removeObjectAtArrangedObjectIndex:");
+public static final int sel_redo = sel_registerName("redo");
+public static final int sel_addMarker_1 = sel_registerName("addMarker:");
+public static final int sel_backgroundColors = sel_registerName("backgroundColors");
+public static final int sel_leafKeyPath = sel_registerName("leafKeyPath");
+public static final int sel_setMinimumIntegerDigits_1 = sel_registerName("setMinimumIntegerDigits:");
+public static final int sel_waitForDataInBackgroundAndNotify = sel_registerName("waitForDataInBackgroundAndNotify");
+public static final int sel_setPreservesContentDuringLiveResize_1 = sel_registerName("setPreservesContentDuringLiveResize:");
+public static final int sel_setRootElement_1 = sel_registerName("setRootElement:");
+public static final int sel_dataWithEPSInsideRect_1 = sel_registerName("dataWithEPSInsideRect:");
+public static final int sel_valuesForKeys_1 = sel_registerName("valuesForKeys:");
+public static final int sel_imageOrigin = sel_registerName("imageOrigin");
+public static final int sel_writePDFInsideRect_1toPasteboard_1 = sel_registerName("writePDFInsideRect:toPasteboard:");
+public static final int sel_sortIndicatorRectForBounds_1 = sel_registerName("sortIndicatorRectForBounds:");
+public static final int sel_predefinedNamespaceForPrefix_1 = sel_registerName("predefinedNamespaceForPrefix:");
+public static final int sel_viewWillStartLiveResize = sel_registerName("viewWillStartLiveResize");
+public static final int sel_becomeKeyWindow = sel_registerName("becomeKeyWindow");
+public static final int sel_isHighlighted = sel_registerName("isHighlighted");
+public static final int sel_initWithPickerMask_1colorPanel_1 = sel_registerName("initWithPickerMask:colorPanel:");
+public static final int sel_systemFontOfSize_1 = sel_registerName("systemFontOfSize:");
+public static final int sel_decimalNumberBySubtracting_1withBehavior_1 = sel_registerName("decimalNumberBySubtracting:withBehavior:");
+public static final int sel_hide_1 = sel_registerName("hide:");
+public static final int sel_resetSearchButtonCell = sel_registerName("resetSearchButtonCell");
+public static final int sel_runModalForDirectory_1file_1types_1 = sel_registerName("runModalForDirectory:file:types:");
+public static final int sel_pathForImageResource_1 = sel_registerName("pathForImageResource:");
+public static final int sel_setFilterPredicate_1 = sel_registerName("setFilterPredicate:");
+public static final int sel_validateEditing = sel_registerName("validateEditing");
+public static final int sel_makeDocumentForURL_1withContentsOfURL_1ofType_1error_1 = sel_registerName("makeDocumentForURL:withContentsOfURL:ofType:error:");
+public static final int sel_localizedCompare_1 = sel_registerName("localizedCompare:");
+public static final int sel_sharedWorkspace = sel_registerName("sharedWorkspace");
+public static final int sel_deliverResult = sel_registerName("deliverResult");
+public static final int sel_aspectRatio = sel_registerName("aspectRatio");
+public static final int sel_keyEventWithType_1location_1modifierFlags_1timestamp_1windowNumber_1context_1characters_1charactersIgnoringModifiers_1isARepeat_1keyCode_1 = sel_registerName("keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:");
+public static final int sel_soundUnfilteredPasteboardTypes = sel_registerName("soundUnfilteredPasteboardTypes");
+public static final int sel_dateByAddingComponents_1toDate_1options_1 = sel_registerName("dateByAddingComponents:toDate:options:");
+public static final int sel_indentationMarkerFollowsCell = sel_registerName("indentationMarkerFollowsCell");
+public static final int sel_typesetter = sel_registerName("typesetter");
+public static final int sel_childCount = sel_registerName("childCount");
+public static final int sel_borderRect = sel_registerName("borderRect");
+public static final int sel_setPageOrder_1 = sel_registerName("setPageOrder:");
+public static final int sel_currentThread = sel_registerName("currentThread");
+public static final int sel_textViewDidChangeSelection_1 = sel_registerName("textViewDidChangeSelection:");
+public static final int sel_setBaseWritingDirection_1 = sel_registerName("setBaseWritingDirection:");
+public static final int sel_attributedSubstringForProposedRange_1actualRange_1 = sel_registerName("attributedSubstringForProposedRange:actualRange:");
+public static final int sel_pop = sel_registerName("pop");
+public static final int sel_animator = sel_registerName("animator");
+public static final int sel_allowsEmptySelection = sel_registerName("allowsEmptySelection");
+public static final int sel_scriptingIsGreaterThanOrEqualTo_1 = sel_registerName("scriptingIsGreaterThanOrEqualTo:");
+public static final int sel_numberOfSelectedRows = sel_registerName("numberOfSelectedRows");
+public static final int sel_imageDidNotDraw_1inRect_1 = sel_registerName("imageDidNotDraw:inRect:");
+public static final int sel_topLevelObject = sel_registerName("topLevelObject");
+public static final int sel_openDocumentWithContentsOfURL_1display_1 = sel_registerName("openDocumentWithContentsOfURL:display:");
+public static final int sel_valueListAttributes = sel_registerName("valueListAttributes");
+public static final int sel_enableFreedObjectCheck_1 = sel_registerName("enableFreedObjectCheck:");
+public static final int sel_moveForward_1 = sel_registerName("moveForward:");
+public static final int sel_setSendsActionOnArrowKeys_1 = sel_registerName("setSendsActionOnArrowKeys:");
+public static final int sel_versionForClassName_1 = sel_registerName("versionForClassName:");
+public static final int sel_coerceValue_1forKey_1 = sel_registerName("coerceValue:forKey:");
+public static final int sel_operatingSystem = sel_registerName("operatingSystem");
+public static final int sel_characterEncoding = sel_registerName("characterEncoding");
+public static final int sel_blendedColorWithFraction_1ofColor_1 = sel_registerName("blendedColorWithFraction:ofColor:");
+public static final int sel_panel_1userEnteredFilename_1confirmed_1 = sel_registerName("panel:userEnteredFilename:confirmed:");
+public static final int sel_addSelectedObjects_1 = sel_registerName("addSelectedObjects:");
+public static final int sel_pointingDeviceID = sel_registerName("pointingDeviceID");
+public static final int sel_children = sel_registerName("children");
+public static final int sel_takeObjectValueFrom_1 = sel_registerName("takeObjectValueFrom:");
+public static final int sel_indexSet = sel_registerName("indexSet");
+public static final int sel_setMovie_1 = sel_registerName("setMovie:");
+public static final int sel_setKeyEquivalentModifierMask_1 = sel_registerName("setKeyEquivalentModifierMask:");
+public static final int sel_allowsKeyedCoding = sel_registerName("allowsKeyedCoding");
+public static final int sel_rotateByDegrees_1 = sel_registerName("rotateByDegrees:");
+public static final int sel_compoundTypes = sel_registerName("compoundTypes");
+public static final int sel_setShortStandaloneWeekdaySymbols_1 = sel_registerName("setShortStandaloneWeekdaySymbols:");
+public static final int sel_removeWindowsItem_1 = sel_registerName("removeWindowsItem:");
+public static final int sel_stringArrayForKey_1 = sel_registerName("stringArrayForKey:");
+public static final int sel_outlineView_1typeSelectStringForTableColumn_1item_1 = sel_registerName("outlineView:typeSelectStringForTableColumn:item:");
+public static final int sel_initWithWindow_1 = sel_registerName("initWithWindow:");
+public static final int sel_accessibilityIsAttributeSettable_1 = sel_registerName("accessibilityIsAttributeSettable:");
+public static final int sel_rangeForUserCharacterAttributeChange = sel_registerName("rangeForUserCharacterAttributeChange");
+public static final int sel_setCalendar_1 = sel_registerName("setCalendar:");
+public static final int sel_beginEditing = sel_registerName("beginEditing");
+public static final int sel_enableUpdates = sel_registerName("enableUpdates");
+public static final int sel_setPrefersAllColumnUserResizing_1 = sel_registerName("setPrefersAllColumnUserResizing:");
+public static final int sel_isTornOff = sel_registerName("isTornOff");
+public static final int sel_checkSpellingOfString_1startingAt_1 = sel_registerName("checkSpellingOfString:startingAt:");
+public static final int sel_drawPackedGlyphs_1atPoint_1 = sel_registerName("drawPackedGlyphs:atPoint:");
+public static final int sel_graphicsContextWithAttributes_1 = sel_registerName("graphicsContextWithAttributes:");
+public static final int sel_textView_1completions_1forPartialWordRange_1indexOfSelectedItem_1 = sel_registerName("textView:completions:forPartialWordRange:indexOfSelectedItem:");
+public static final int sel_outlineView_1shouldExpandItem_1 = sel_registerName("outlineView:shouldExpandItem:");
+public static final int sel_isInFullScreenMode = sel_registerName("isInFullScreenMode");
+public static final int sel_userKeyEquivalent = sel_registerName("userKeyEquivalent");
+public static final int sel_menuBarHeight = sel_registerName("menuBarHeight");
+public static final int sel_initWithSize_1depth_1separate_1alpha_1 = sel_registerName("initWithSize:depth:separate:alpha:");
+public static final int sel_criticalValue = sel_registerName("criticalValue");
+public static final int sel_tableView_1didClickTableColumn_1 = sel_registerName("tableView:didClickTableColumn:");
+public static final int sel_addChildWindow_1ordered_1 = sel_registerName("addChildWindow:ordered:");
+public static final int sel_autoscroll_1 = sel_registerName("autoscroll:");
+public static final int sel_infoDictionary = sel_registerName("infoDictionary");
+public static final int sel_printOperationWithSettings_1error_1 = sel_registerName("printOperationWithSettings:error:");
+public static final int sel_translateOriginToPoint_1 = sel_registerName("translateOriginToPoint:");
+public static final int sel_takeStoredValue_1forKey_1 = sel_registerName("takeStoredValue:forKey:");
+public static final int sel_mouseUp_1 = sel_registerName("mouseUp:");
+public static final int sel_setNotationName_1 = sel_registerName("setNotationName:");
+public static final int sel_setArgument_1atIndex_1 = sel_registerName("setArgument:atIndex:");
+public static final int sel_setSelectedAttributes_1isMultiple_1 = sel_registerName("setSelectedAttributes:isMultiple:");
+public static final int sel_dayOfCommonEra = sel_registerName("dayOfCommonEra");
+public static final int sel_greenColor = sel_registerName("greenColor");
+public static final int sel_initWithProtocolFamily_1socketType_1protocol_1address_1 = sel_registerName("initWithProtocolFamily:socketType:protocol:address:");
+public static final int sel_setAttachmentCell_1 = sel_registerName("setAttachmentCell:");
+public static final int sel_previousFailureCount = sel_registerName("previousFailureCount");
+public static final int sel_currentOperation = sel_registerName("currentOperation");
+public static final int sel_tokenField_1completionsForSubstring_1indexOfToken_1indexOfSelectedItem_1 = sel_registerName("tokenField:completionsForSubstring:indexOfToken:indexOfSelectedItem:");
+public static final int sel_positionOfGlyph_1struckOverGlyph_1metricsExist_1 = sel_registerName("positionOfGlyph:struckOverGlyph:metricsExist:");
+public static final int sel_setMarkedTextAttributes_1 = sel_registerName("setMarkedTextAttributes:");
+public static final int sel_validateToolbarItem_1 = sel_registerName("validateToolbarItem:");
+public static final int sel_startingColumn = sel_registerName("startingColumn");
+public static final int sel_setSelectedRanges_1 = sel_registerName("setSelectedRanges:");
+public static final int sel_addItemWithTitle_1action_1keyEquivalent_1 = sel_registerName("addItemWithTitle:action:keyEquivalent:");
+public static final int sel_postNotificationName_1object_1 = sel_registerName("postNotificationName:object:");
+public static final int sel_replacementObjectForKeyedArchiver_1 = sel_registerName("replacementObjectForKeyedArchiver:");
+public static final int sel_deletesFileUponFailure = sel_registerName("deletesFileUponFailure");
+public static final int sel_speechRecognizer_1didRecognizeCommand_1 = sel_registerName("speechRecognizer:didRecognizeCommand:");
+public static final int sel_columnSpan = sel_registerName("columnSpan");
+public static final int sel_animationBlockingMode = sel_registerName("animationBlockingMode");
+public static final int sel_drawParts = sel_registerName("drawParts");
+public static final int sel_style = sel_registerName("style");
+public static final int sel_makeUntitledDocumentOfType_1error_1 = sel_registerName("makeUntitledDocumentOfType:error:");
+public static final int sel_filteredArrayUsingPredicate_1 = sel_registerName("filteredArrayUsingPredicate:");
+public static final int sel_wantsDefaultClipping = sel_registerName("wantsDefaultClipping");
+public static final int sel_one = sel_registerName("one");
+public static final int sel_persistentStoreTypeForFileType_1 = sel_registerName("persistentStoreTypeForFileType:");
+public static final int sel_pixelsHigh = sel_registerName("pixelsHigh");
+public static final int sel_rulerView_1shouldMoveMarker_1 = sel_registerName("rulerView:shouldMoveMarker:");
+public static final int sel_sizeWithAttributes_1 = sel_registerName("sizeWithAttributes:");
+public static final int sel_drawTitleOfColumn_1inRect_1 = sel_registerName("drawTitleOfColumn:inRect:");
+public static final int sel_setLevelsOfUndo_1 = sel_registerName("setLevelsOfUndo:");
+public static final int sel_invoke = sel_registerName("invoke");
+public static final int sel_keyEnumerator = sel_registerName("keyEnumerator");
+public static final int sel_convertFont_1toSize_1 = sel_registerName("convertFont:toSize:");
+public static final int sel_mouseExited_1withFrame_1inView_1 = sel_registerName("mouseExited:withFrame:inView:");
+public static final int sel_widthAdjustLimit = sel_registerName("widthAdjustLimit");
+public static final int sel_animationResizeTime_1 = sel_registerName("animationResizeTime:");
+public static final int sel_ensureLayoutForBoundingRect_1inTextContainer_1 = sel_registerName("ensureLayoutForBoundingRect:inTextContainer:");
+public static final int sel_initWithExpressionType_1 = sel_registerName("initWithExpressionType:");
+public static final int sel_numberWithUnsignedChar_1 = sel_registerName("numberWithUnsignedChar:");
+public static final int sel_directory = sel_registerName("directory");
+public static final int sel_address = sel_registerName("address");
+public static final int sel_defaultPixelFormat = sel_registerName("defaultPixelFormat");
+public static final int sel_deleteBackwardByDecomposingPreviousCharacter_1 = sel_registerName("deleteBackwardByDecomposingPreviousCharacter:");
+public static final int sel_clickCount = sel_registerName("clickCount");
+public static final int sel_trackMarker_1withMouseEvent_1 = sel_registerName("trackMarker:withMouseEvent:");
+public static final int sel_URL_1resourceDataDidBecomeAvailable_1 = sel_registerName("URL:resourceDataDidBecomeAvailable:");
+public static final int sel_outlineView_1setObjectValue_1forTableColumn_1byItem_1 = sel_registerName("outlineView:setObjectValue:forTableColumn:byItem:");
+public static final int sel_insert_1 = sel_registerName("insert:");
+public static final int sel_methodForSelector_1 = sel_registerName("methodForSelector:");
+public static final int sel_insertGlyph_1atGlyphIndex_1characterIndex_1 = sel_registerName("insertGlyph:atGlyphIndex:characterIndex:");
+public static final int sel_readFromFileWrapper_1ofType_1error_1 = sel_registerName("readFromFileWrapper:ofType:error:");
+public static final int sel_selectedControlColor = sel_registerName("selectedControlColor");
+public static final int sel_selectedRow = sel_registerName("selectedRow");
+public static final int sel_control_1isValidObject_1 = sel_registerName("control:isValidObject:");
+public static final int sel_setUniqueID_1 = sel_registerName("setUniqueID:");
+public static final int sel_initWithName_1fromFile_1 = sel_registerName("initWithName:fromFile:");
+public static final int sel_sizeOfLabel_1 = sel_registerName("sizeOfLabel:");
+public static final int sel_credentialsForProtectionSpace_1 = sel_registerName("credentialsForProtectionSpace:");
+public static final int sel_anyObject = sel_registerName("anyObject");
+public static final int sel_runLoopModesForAnimating = sel_registerName("runLoopModesForAnimating");
+public static final int sel_setSortDescriptors_1 = sel_registerName("setSortDescriptors:");
+public static final int sel_convertSize_1toView_1 = sel_registerName("convertSize:toView:");
+public static final int sel_setLineFragmentRect_1forGlyphRange_1usedRect_1 = sel_registerName("setLineFragmentRect:forGlyphRange:usedRect:");
+public static final int sel_discardEditing = sel_registerName("discardEditing");
+public static final int sel_isAutodisplay = sel_registerName("isAutodisplay");
+public static final int sel_matchesOnMultipleResolution = sel_registerName("matchesOnMultipleResolution");
+public static final int sel_multipleThreadsEnabled = sel_registerName("multipleThreadsEnabled");
+public static final int sel_positionOfGlyph_1forCharacter_1struckOverRect_1 = sel_registerName("positionOfGlyph:forCharacter:struckOverRect:");
+public static final int sel_boundsRectForBlock_1contentRect_1inRect_1textContainer_1characterRange_1 = sel_registerName("boundsRectForBlock:contentRect:inRect:textContainer:characterRange:");
+public static final int sel_outlineView_1objectValueForTableColumn_1byItem_1 = sel_registerName("outlineView:objectValueForTableColumn:byItem:");
+public static final int sel_transformPoint_1 = sel_registerName("transformPoint:");
+public static final int sel_createClassDescription = sel_registerName("createClassDescription");
+public static final int sel_inputStreamWithFileAtPath_1 = sel_registerName("inputStreamWithFileAtPath:");
+public static final int sel_menuForEvent_1inRect_1ofView_1 = sel_registerName("menuForEvent:inRect:ofView:");
+public static final int sel_setRowTypeKeyPath_1 = sel_registerName("setRowTypeKeyPath:");
+public static final int sel_infoForBinding_1 = sel_registerName("infoForBinding:");
+public static final int sel_setDataRetained_1 = sel_registerName("setDataRetained:");
+public static final int sel_revertToContentsOfURL_1ofType_1error_1 = sel_registerName("revertToContentsOfURL:ofType:error:");
+public static final int sel_currentControlTint = sel_registerName("currentControlTint");
+public static final int sel_selection = sel_registerName("selection");
+public static final int sel_array = sel_registerName("array");
+public static final int sel_setStyle_1 = sel_registerName("setStyle:");
+public static final int sel_setPredicate_1 = sel_registerName("setPredicate:");
+public static final int sel_endEditing = sel_registerName("endEditing");
+public static final int sel_doClick_1 = sel_registerName("doClick:");
+public static final int sel_toManyRelationshipKeys = sel_registerName("toManyRelationshipKeys");
+public static final int sel_selectedKnobColor = sel_registerName("selectedKnobColor");
+public static final int sel_setOrderedIndex_1 = sel_registerName("setOrderedIndex:");
+public static final int sel_initWithSet_1 = sel_registerName("initWithSet:");
+public static final int sel_drawSelector = sel_registerName("drawSelector");
+public static final int sel_requestWithURL_1 = sel_registerName("requestWithURL:");
+public static final int sel_imageNamed_1 = sel_registerName("imageNamed:");
+public static final int sel_hyphenationFactorForGlyphAtIndex_1 = sel_registerName("hyphenationFactorForGlyphAtIndex:");
+public static final int sel_miniwindowTitle = sel_registerName("miniwindowTitle");
+public static final int sel_isFileURL = sel_registerName("isFileURL");
+public static final int sel_selectedSegment = sel_registerName("selectedSegment");
+public static final int sel_applicationDidResignActive_1 = sel_registerName("applicationDidResignActive:");
+public static final int sel_initWithString_1calendarFormat_1 = sel_registerName("initWithString:calendarFormat:");
+public static final int sel_initWithProtectionSpace_1proposedCredential_1previousFailureCount_1failureResponse_1error_1sender_1 = sel_registerName("initWithProtectionSpace:proposedCredential:previousFailureCount:failureResponse:error:sender:");
+public static final int sel_menuHasKeyEquivalent_1forEvent_1target_1action_1 = sel_registerName("menuHasKeyEquivalent:forEvent:target:action:");
+public static final int sel_minPossiblePositionOfDividerAtIndex_1 = sel_registerName("minPossiblePositionOfDividerAtIndex:");
+public static final int sel_abbreviationForDate_1 = sel_registerName("abbreviationForDate:");
+public static final int sel_absoluteX = sel_registerName("absoluteX");
+public static final int sel_scriptErrorNumber = sel_registerName("scriptErrorNumber");
+public static final int sel_previousValidKeyView = sel_registerName("previousValidKeyView");
+public static final int sel_valueWithRange_1 = sel_registerName("valueWithRange:");
+public static final int sel_initWithDefaults_1initialValues_1 = sel_registerName("initWithDefaults:initialValues:");
+public static final int sel_initNotTestWithTest_1 = sel_registerName("initNotTestWithTest:");
+public static final int sel_abortModal = sel_registerName("abortModal");
+public static final int sel_isSuspended = sel_registerName("isSuspended");
+public static final int sel_isFilePackageAtPath_1 = sel_registerName("isFilePackageAtPath:");
+public static final int sel_useCredential_1forAuthenticationChallenge_1 = sel_registerName("useCredential:forAuthenticationChallenge:");
+public static final int sel_draggingSequenceNumber = sel_registerName("draggingSequenceNumber");
+public static final int sel_lastColumn = sel_registerName("lastColumn");
+public static final int sel_distantFuture = sel_registerName("distantFuture");
+public static final int sel_download_1didReceiveResponse_1 = sel_registerName("download:didReceiveResponse:");
+public static final int sel_textTransform = sel_registerName("textTransform");
+public static final int sel_hasHorizontalScroller = sel_registerName("hasHorizontalScroller");
+public static final int sel_shadowBlurRadius = sel_registerName("shadowBlurRadius");
+public static final int sel_pointingDeviceType = sel_registerName("pointingDeviceType");
+public static final int sel_setMenuView_1 = sel_registerName("setMenuView:");
+public static final int sel_setWindingRule_1 = sel_registerName("setWindingRule:");
+public static final int sel_imageForSegment_1 = sel_registerName("imageForSegment:");
+public static final int sel_bytes = sel_registerName("bytes");
+public static final int sel_propertyListFromStringsFileFormat = sel_registerName("propertyListFromStringsFileFormat");
+public static final int sel_setParagraphStyle_1 = sel_registerName("setParagraphStyle:");
+public static final int sel_highlightMode = sel_registerName("highlightMode");
+public static final int sel_voice = sel_registerName("voice");
+public static final int sel_hostName = sel_registerName("hostName");
+public static final int sel_removeAccessoryController_1 = sel_registerName("removeAccessoryController:");
+public static final int sel_rowsInRect_1 = sel_registerName("rowsInRect:");
+public static final int sel_registerImageRepClass_1 = sel_registerName("registerImageRepClass:");
+public static final int sel_value_1withObjCType_1 = sel_registerName("value:withObjCType:");
+public static final int sel_enclosingMenuItem = sel_registerName("enclosingMenuItem");
+public static final int sel_exposedBindings = sel_registerName("exposedBindings");
+public static final int sel_setSharedScriptSuiteRegistry_1 = sel_registerName("setSharedScriptSuiteRegistry:");
+public static final int sel_readablePasteboardTypes = sel_registerName("readablePasteboardTypes");
+public static final int sel_drawViewBackgroundInRect_1 = sel_registerName("drawViewBackgroundInRect:");
+public static final int sel_setDataCell_1 = sel_registerName("setDataCell:");
+public static final int sel_dataRepresentationOfType_1 = sel_registerName("dataRepresentationOfType:");
+public static final int sel_setOrientation_1 = sel_registerName("setOrientation:");
+public static final int sel_setFileWrapper_1 = sel_registerName("setFileWrapper:");
+public static final int sel_runModalOpenPanel_1forTypes_1 = sel_registerName("runModalOpenPanel:forTypes:");
+public static final int sel_adjustSubviews = sel_registerName("adjustSubviews");
+public static final int sel_setCurrencyDecimalSeparator_1 = sel_registerName("setCurrencyDecimalSeparator:");
+public static final int sel_needsDisplay = sel_registerName("needsDisplay");
+public static final int sel_insertValue_1atIndex_1inPropertyWithKey_1 = sel_registerName("insertValue:atIndex:inPropertyWithKey:");
+public static final int sel_setTextStorage_1 = sel_registerName("setTextStorage:");
+public static final int sel_isAlternate = sel_registerName("isAlternate");
+public static final int sel_setOutputFormat_1 = sel_registerName("setOutputFormat:");
+public static final int sel_comboBoxWillPopUp_1 = sel_registerName("comboBoxWillPopUp:");
+public static final int sel_insertChild_1 = sel_registerName("insertChild:");
+public static final int sel_initWithCommandDescription_1 = sel_registerName("initWithCommandDescription:");
+public static final int sel_setLineDash_1count_1phase_1 = sel_registerName("setLineDash:count:phase:");
+public static final int sel_setHardInvalidation_1forGlyphRange_1 = sel_registerName("setHardInvalidation:forGlyphRange:");
+public static final int sel_setAllowsToolTipsWhenApplicationIsInactive_1 = sel_registerName("setAllowsToolTipsWhenApplicationIsInactive:");
+public static final int sel_tableView_1namesOfPromisedFilesDroppedAtDestination_1forDraggedRowsWithIndexes_1 = sel_registerName("tableView:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:");
+public static final int sel_highlightedItemIndex = sel_registerName("highlightedItemIndex");
+public static final int sel_trailingOffset = sel_registerName("trailingOffset");
+public static final int sel_layer = sel_registerName("layer");
+public static final int sel_isDeletableFileAtPath_1 = sel_registerName("isDeletableFileAtPath:");
+public static final int sel_textUnfilteredTypes = sel_registerName("textUnfilteredTypes");
+public static final int sel_gregorianStartDate = sel_registerName("gregorianStartDate");
+public static final int sel_isDocumentEdited = sel_registerName("isDocumentEdited");
+public static final int sel_colorWithCalibratedWhite_1alpha_1 = sel_registerName("colorWithCalibratedWhite:alpha:");
+public static final int sel_shouldRunSavePanelWithAccessoryView = sel_registerName("shouldRunSavePanelWithAccessoryView");
+public static final int sel_finishEncoding = sel_registerName("finishEncoding");
+public static final int sel_setKeyCell_1 = sel_registerName("setKeyCell:");
+public static final int sel_isPartialStringValid_1newEditingString_1errorDescription_1 = sel_registerName("isPartialStringValid:newEditingString:errorDescription:");
+public static final int sel_setRangeContainerObject_1 = sel_registerName("setRangeContainerObject:");
+public static final int sel_typeOfFile_1error_1 = sel_registerName("typeOfFile:error:");
+public static final int sel_disappearingItemCursor = sel_registerName("disappearingItemCursor");
+public static final int sel_textureMaxMipMapLevel = sel_registerName("textureMaxMipMapLevel");
+public static final int sel_setEraSymbols_1 = sel_registerName("setEraSymbols:");
+public static final int sel_setBordered_1 = sel_registerName("setBordered:");
+public static final int sel_precomposedStringWithCanonicalMapping = sel_registerName("precomposedStringWithCanonicalMapping");
+public static final int sel_setEnabled_1 = sel_registerName("setEnabled:");
+public static final int sel_setChildrenKeyPath_1 = sel_registerName("setChildrenKeyPath:");
+public static final int sel_applicationDidBecomeActive_1 = sel_registerName("applicationDidBecomeActive:");
+public static final int sel_setCancelButtonCell_1 = sel_registerName("setCancelButtonCell:");
+public static final int sel_backgroundFilters = sel_registerName("backgroundFilters");
+public static final int sel_indexOfCellWithTag_1 = sel_registerName("indexOfCellWithTag:");
+public static final int sel_UTF8String = sel_registerName("UTF8String");
+public static final int sel_horizontalPagination = sel_registerName("horizontalPagination");
+public static final int sel_allowedInputSourceLocales = sel_registerName("allowedInputSourceLocales");
+public static final int sel_toolbar = sel_registerName("toolbar");
+public static final int sel_setGeneratesDecimalNumbers_1 = sel_registerName("setGeneratesDecimalNumbers:");
+public static final int sel_highlight_1withFrame_1inView_1 = sel_registerName("highlight:withFrame:inView:");
+public static final int sel_rotation = sel_registerName("rotation");
+public static final int sel_colorForControlTint_1 = sel_registerName("colorForControlTint:");
+public static final int sel_mutableString = sel_registerName("mutableString");
+public static final int sel_shadowWithLevel_1 = sel_registerName("shadowWithLevel:");
+public static final int sel_frameRectForContentRect_1styleMask_1 = sel_registerName("frameRectForContentRect:styleMask:");
+public static final int sel_numberOfColorComponents = sel_registerName("numberOfColorComponents");
+public static final int sel_alternateImage = sel_registerName("alternateImage");
+public static final int sel_initWithString_1relativeToURL_1 = sel_registerName("initWithString:relativeToURL:");
+public static final int sel_pageOrder = sel_registerName("pageOrder");
+public static final int sel_cancel_1 = sel_registerName("cancel:");
+public static final int sel_declareTypes_1owner_1 = sel_registerName("declareTypes:owner:");
+public static final int sel_lastObject = sel_registerName("lastObject");
+public static final int sel_type_1conformsToType_1 = sel_registerName("type:conformsToType:");
+public static final int sel_mutableArrayValueForKey_1 = sel_registerName("mutableArrayValueForKey:");
+public static final int sel_initWithName_1host_1 = sel_registerName("initWithName:host:");
+public static final int sel_keyEquivalentWidth = sel_registerName("keyEquivalentWidth");
+public static final int sel_modifier = sel_registerName("modifier");
+public static final int sel_setPerMillSymbol_1 = sel_registerName("setPerMillSymbol:");
+public static final int sel_setToolbar_1 = sel_registerName("setToolbar:");
+public static final int sel_changeAttributes_1 = sel_registerName("changeAttributes:");
+public static final int sel_removeItemWithTitle_1 = sel_registerName("removeItemWithTitle:");
+public static final int sel_setAspectRatio_1 = sel_registerName("setAspectRatio:");
+public static final int sel_undoManagerForTextView_1 = sel_registerName("undoManagerForTextView:");
+public static final int sel_clickedPathComponentCell = sel_registerName("clickedPathComponentCell");
+public static final int sel_commentWithStringValue_1 = sel_registerName("commentWithStringValue:");
+public static final int sel_initWithContainerSpecifier_1key_1 = sel_registerName("initWithContainerSpecifier:key:");
+public static final int sel_windowWillReturnUndoManager_1 = sel_registerName("windowWillReturnUndoManager:");
+public static final int sel_imageAndTitleOffset = sel_registerName("imageAndTitleOffset");
+public static final int sel_initialize = sel_registerName("initialize");
+public static final int sel_truncatesLastVisibleLine = sel_registerName("truncatesLastVisibleLine");
+public static final int sel_setExponentSymbol_1 = sel_registerName("setExponentSymbol:");
+public static final int sel_setCurrentProgress_1 = sel_registerName("setCurrentProgress:");
+public static final int sel_initWithContentsOfFile_1options_1error_1 = sel_registerName("initWithContentsOfFile:options:error:");
+public static final int sel_titleCell = sel_registerName("titleCell");
+public static final int sel_setCurrencySymbol_1 = sel_registerName("setCurrencySymbol:");
+public static final int sel_usesScreenFonts = sel_registerName("usesScreenFonts");
+public static final int sel_propertyList = sel_registerName("propertyList");
+public static final int sel_subgroups = sel_registerName("subgroups");
+public static final int sel_setFloatValue_1knobProportion_1 = sel_registerName("setFloatValue:knobProportion:");
+public static final int sel_componentsJoinedByString_1 = sel_registerName("componentsJoinedByString:");
+public static final int sel_initWithICCProfileData_1 = sel_registerName("initWithICCProfileData:");
+public static final int sel_setNextKeyView_1 = sel_registerName("setNextKeyView:");
+public static final int sel_setAnimationCurve_1 = sel_registerName("setAnimationCurve:");
+public static final int sel_tokenFieldCell_1completionsForSubstring_1indexOfToken_1indexOfSelectedItem_1 = sel_registerName("tokenFieldCell:completionsForSubstring:indexOfToken:indexOfSelectedItem:");
+public static final int sel_takeValuesFromDictionary_1 = sel_registerName("takeValuesFromDictionary:");
+public static final int sel_imageRepClassForPasteboardType_1 = sel_registerName("imageRepClassForPasteboardType:");
+public static final int sel_setPlaybackDeviceIdentifier_1 = sel_registerName("setPlaybackDeviceIdentifier:");
+public static final int sel_globallyUniqueString = sel_registerName("globallyUniqueString");
+public static final int sel_setLineWidth_1 = sel_registerName("setLineWidth:");
+public static final int sel_selectedColumnIndexes = sel_registerName("selectedColumnIndexes");
+public static final int sel_addWindowsItem_1title_1filename_1 = sel_registerName("addWindowsItem:title:filename:");
+public static final int sel_truncateFileAtOffset_1 = sel_registerName("truncateFileAtOffset:");
+public static final int sel_setStandardOutput_1 = sel_registerName("setStandardOutput:");
+public static final int sel_encodeInt32_1forKey_1 = sel_registerName("encodeInt32:forKey:");
+public static final int sel_baselineDeltaForCharacterAtIndex_1 = sel_registerName("baselineDeltaForCharacterAtIndex:");
+public static final int sel_setValueWraps_1 = sel_registerName("setValueWraps:");
+public static final int sel_addOperation_1 = sel_registerName("addOperation:");
+public static final int sel_resignKeyWindow = sel_registerName("resignKeyWindow");
+public static final int sel_insertNewline_1 = sel_registerName("insertNewline:");
+public static final int sel_saveFrameUsingName_1 = sel_registerName("saveFrameUsingName:");
+public static final int sel_setWithObjects_1 = sel_registerName("setWithObjects:");
+public static final int sel_indexOfItemWithTarget_1andAction_1 = sel_registerName("indexOfItemWithTarget:andAction:");
+public static final int sel_processEditing = sel_registerName("processEditing");
+public static final int sel_removeValueAtIndex_1fromPropertyWithKey_1 = sel_registerName("removeValueAtIndex:fromPropertyWithKey:");
+public static final int sel_setShouldCascadeWindows_1 = sel_registerName("setShouldCascadeWindows:");
+public static final int sel_stepBack_1 = sel_registerName("stepBack:");
+public static final int sel_lockWhenCondition_1beforeDate_1 = sel_registerName("lockWhenCondition:beforeDate:");
+public static final int sel_realm = sel_registerName("realm");
+public static final int sel_appendBezierPathWithPackedGlyphs_1 = sel_registerName("appendBezierPathWithPackedGlyphs:");
+public static final int sel_inputStreamWithData_1 = sel_registerName("inputStreamWithData:");
+public static final int sel_clickedRow = sel_registerName("clickedRow");
+public static final int sel_animationShouldStart_1 = sel_registerName("animationShouldStart:");
+public static final int sel_appleEventCodeForKey_1 = sel_registerName("appleEventCodeForKey:");
+public static final int sel_sendAction_1to_1forAllCells_1 = sel_registerName("sendAction:to:forAllCells:");
+public static final int sel_writableTypesForSaveOperation_1 = sel_registerName("writableTypesForSaveOperation:");
+public static final int sel_drawWellInside_1 = sel_registerName("drawWellInside:");
+public static final int sel_intersectsSet_1 = sel_registerName("intersectsSet:");
+public static final int sel_runOperationModalForWindow_1delegate_1didRunSelector_1contextInfo_1 = sel_registerName("runOperationModalForWindow:delegate:didRunSelector:contextInfo:");
+public static final int sel_setAllowsEmptySelection_1 = sel_registerName("setAllowsEmptySelection:");
+public static final int sel_tighteningFactorForTruncation = sel_registerName("tighteningFactorForTruncation");
+public static final int sel_insertDescriptor_1atIndex_1 = sel_registerName("insertDescriptor:atIndex:");
+public static final int sel_setDefaultBehavior_1 = sel_registerName("setDefaultBehavior:");
+public static final int sel_allowsFloats = sel_registerName("allowsFloats");
+public static final int sel_representedObject = sel_registerName("representedObject");
+public static final int sel_isFlipped = sel_registerName("isFlipped");
+public static final int sel_rectOfColumn_1 = sel_registerName("rectOfColumn:");
+public static final int sel_setFrame_1display_1 = sel_registerName("setFrame:display:");
+public static final int sel_setTextAttributesForPositiveInfinity_1 = sel_registerName("setTextAttributesForPositiveInfinity:");
+public static final int sel_textUnfilteredFileTypes = sel_registerName("textUnfilteredFileTypes");
+public static final int sel_bezierPathByFlatteningPath = sel_registerName("bezierPathByFlatteningPath");
+public static final int sel_week = sel_registerName("week");
+public static final int sel_takeIntValueFrom_1 = sel_registerName("takeIntValueFrom:");
+public static final int sel_setWantsNotificationForMarkedText_1 = sel_registerName("setWantsNotificationForMarkedText:");
+public static final int sel_stringByPaddingToLength_1withString_1startingAtIndex_1 = sel_registerName("stringByPaddingToLength:withString:startingAtIndex:");
+public static final int sel_stopModal = sel_registerName("stopModal");
+public static final int sel_veryShortWeekdaySymbols = sel_registerName("veryShortWeekdaySymbols");
+public static final int sel_user = sel_registerName("user");
+public static final int sel_animation_1didReachProgressMark_1 = sel_registerName("animation:didReachProgressMark:");
+public static final int sel_fontWithName_1size_1 = sel_registerName("fontWithName:size:");
+public static final int sel_selectWord_1 = sel_registerName("selectWord:");
+public static final int sel_initWithDuration_1animationCurve_1 = sel_registerName("initWithDuration:animationCurve:");
+public static final int sel_afmDictionary = sel_registerName("afmDictionary");
+public static final int sel_canChooseFiles = sel_registerName("canChooseFiles");
+public static final int sel_defaultLineWidth = sel_registerName("defaultLineWidth");
+public static final int sel_childAtIndex_1 = sel_registerName("childAtIndex:");
+public static final int sel_pathForResource_1ofType_1inDirectory_1 = sel_registerName("pathForResource:ofType:inDirectory:");
+public static final int sel_outlineView_1heightOfRowByItem_1 = sel_registerName("outlineView:heightOfRowByItem:");
+public static final int sel_PMSymbol = sel_registerName("PMSymbol");
+public static final int sel_setBackgroundStyle_1 = sel_registerName("setBackgroundStyle:");
+public static final int sel_decimalSeparator = sel_registerName("decimalSeparator");
+public static final int sel_knobThickness = sel_registerName("knobThickness");
+public static final int sel_request = sel_registerName("request");
+public static final int sel_indicesOfObjectsByEvaluatingWithContainer_1count_1 = sel_registerName("indicesOfObjectsByEvaluatingWithContainer:count:");
+public static final int sel_objectByApplyingXSLTString_1arguments_1error_1 = sel_registerName("objectByApplyingXSLTString:arguments:error:");
+public static final int sel_colorizeByMappingGray_1toColor_1blackMapping_1whiteMapping_1 = sel_registerName("colorizeByMappingGray:toColor:blackMapping:whiteMapping:");
+public static final int sel_minusSet_1 = sel_registerName("minusSet:");
+public static final int sel_setAutomaticallyRearrangesObjects_1 = sel_registerName("setAutomaticallyRearrangesObjects:");
+public static final int sel_fixFontAttributeInRange_1 = sel_registerName("fixFontAttributeInRange:");
+public static final int sel_frameRotation = sel_registerName("frameRotation");
+public static final int sel_addObserver_1forKeyPath_1options_1context_1 = sel_registerName("addObserver:forKeyPath:options:context:");
+public static final int sel_collectionNames = sel_registerName("collectionNames");
+public static final int sel_titleOfColumn_1 = sel_registerName("titleOfColumn:");
+public static final int sel_characterIdentifier = sel_registerName("characterIdentifier");
+public static final int sel_setPanelFont_1isMultiple_1 = sel_registerName("setPanelFont:isMultiple:");
+public static final int sel_ruleThickness = sel_registerName("ruleThickness");
+public static final int sel_customSelector = sel_registerName("customSelector");
+public static final int sel_startSpeakingString_1toURL_1 = sel_registerName("startSpeakingString:toURL:");
+public static final int sel_language = sel_registerName("language");
+public static final int sel_draggedImage_1endedAt_1operation_1 = sel_registerName("draggedImage:endedAt:operation:");
+public static final int sel_removeSelectionIndexPaths_1 = sel_registerName("removeSelectionIndexPaths:");
+public static final int sel_TIFFRepresentationOfImageRepsInArray_1 = sel_registerName("TIFFRepresentationOfImageRepsInArray:");
+public static final int sel_setSet_1 = sel_registerName("setSet:");
+public static final int sel_stringWithCString_1length_1 = sel_registerName("stringWithCString:length:");
+public static final int sel_objectsByEvaluatingSpecifier = sel_registerName("objectsByEvaluatingSpecifier");
+public static final int sel_subarrayWithRange_1 = sel_registerName("subarrayWithRange:");
+public static final int sel_collectIfNeeded = sel_registerName("collectIfNeeded");
+public static final int sel_pathWithComponents_1 = sel_registerName("pathWithComponents:");
+public static final int sel_autoreleasedObjectCount = sel_registerName("autoreleasedObjectCount");
+public static final int sel_addCharactersInString_1 = sel_registerName("addCharactersInString:");
+public static final int sel_setTemplate_1 = sel_registerName("setTemplate:");
+public static final int sel_indexOfObjectIdenticalTo_1 = sel_registerName("indexOfObjectIdenticalTo:");
+public static final int sel_setRepresentation = sel_registerName("setRepresentation");
+public static final int sel_URLResourceDidFinishLoading_1 = sel_registerName("URLResourceDidFinishLoading:");
+public static final int sel_type = sel_registerName("type");
+public static final int sel_setMarkedText_1selectedRange_1 = sel_registerName("setMarkedText:selectedRange:");
+public static final int sel_dictionaryWithObjects_1forKeys_1 = sel_registerName("dictionaryWithObjects:forKeys:");
+public static final int sel_wantsToDelayTextChangeNotifications = sel_registerName("wantsToDelayTextChangeNotifications");
+public static final int sel_setCompletes_1 = sel_registerName("setCompletes:");
+public static final int sel_releaseGState = sel_registerName("releaseGState");
+public static final int sel_descriptorWithEnumCode_1 = sel_registerName("descriptorWithEnumCode:");
+public static final int sel_label = sel_registerName("label");
+public static final int sel_run = sel_registerName("run");
+public static final int sel_hasHorizontalRuler = sel_registerName("hasHorizontalRuler");
+public static final int sel_rowClass = sel_registerName("rowClass");
+public static final int sel_automaticRearrangementKeyPaths = sel_registerName("automaticRearrangementKeyPaths");
+public static final int sel_fileManager_1shouldProceedAfterError_1movingItemAtPath_1toPath_1 = sel_registerName("fileManager:shouldProceedAfterError:movingItemAtPath:toPath:");
+public static final int sel_writeToURL_1atomically_1encoding_1error_1 = sel_registerName("writeToURL:atomically:encoding:error:");
+public static final int sel_deviceID = sel_registerName("deviceID");
+public static final int sel_descriptorWithInt32_1 = sel_registerName("descriptorWithInt32:");
+public static final int sel_encodeInt64_1forKey_1 = sel_registerName("encodeInt64:forKey:");
+public static final int sel_insertEntry_1atIndex_1 = sel_registerName("insertEntry:atIndex:");
+public static final int sel_leftMargin = sel_registerName("leftMargin");
+public static final int sel_setKeyEquivalentFont_1size_1 = sel_registerName("setKeyEquivalentFont:size:");
+public static final int sel_colorWithDeviceHue_1saturation_1brightness_1alpha_1 = sel_registerName("colorWithDeviceHue:saturation:brightness:alpha:");
+public static final int sel_nextState = sel_registerName("nextState");
+public static final int sel_scanHexInt_1 = sel_registerName("scanHexInt:");
+public static final int sel_lineSpacing = sel_registerName("lineSpacing");
+public static final int sel_textureTarget = sel_registerName("textureTarget");
+public static final int sel_miniaturize_1 = sel_registerName("miniaturize:");
+public static final int sel_browser_1namesOfPromisedFilesDroppedAtDestination_1forDraggedRowsWithIndexes_1inColumn_1 = sel_registerName("browser:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:inColumn:");
+public static final int sel_localizedNameForTIFFCompressionType_1 = sel_registerName("localizedNameForTIFFCompressionType:");
+public static final int sel_acceptConnectionInBackgroundAndNotifyForModes_1 = sel_registerName("acceptConnectionInBackgroundAndNotifyForModes:");
+public static final int sel_setCanBecomeVisibleWithoutLogin_1 = sel_registerName("setCanBecomeVisibleWithoutLogin:");
+public static final int sel_dictionaryWithObjectsAndKeys_1 = sel_registerName("dictionaryWithObjectsAndKeys:");
+public static final int sel_ensureGlyphsForGlyphRange_1 = sel_registerName("ensureGlyphsForGlyphRange:");
+public static final int sel_indexOfTickMarkAtPoint_1 = sel_registerName("indexOfTickMarkAtPoint:");
+public static final int sel_dayOfWeek = sel_registerName("dayOfWeek");
+public static final int sel_glyphRangeForCharacterRange_1actualCharacterRange_1 = sel_registerName("glyphRangeForCharacterRange:actualCharacterRange:");
+public static final int sel_enableCollectorForPointer_1 = sel_registerName("enableCollectorForPointer:");
+public static final int sel_rulerView_1willMoveMarker_1toLocation_1 = sel_registerName("rulerView:willMoveMarker:toLocation:");
+public static final int sel_comboBoxCell_1objectValueForItemAtIndex_1 = sel_registerName("comboBoxCell:objectValueForItemAtIndex:");
+public static final int sel_setValidateSize_1 = sel_registerName("setValidateSize:");
+public static final int sel_controlTint = sel_registerName("controlTint");
+public static final int sel_deselectItemAtIndex_1 = sel_registerName("deselectItemAtIndex:");
+public static final int sel_defaultWindingRule = sel_registerName("defaultWindingRule");
+public static final int sel_setMaxValue_1 = sel_registerName("setMaxValue:");
+public static final int sel_longEraSymbols = sel_registerName("longEraSymbols");
+public static final int sel_canRedo = sel_registerName("canRedo");
+public static final int sel_arguments = sel_registerName("arguments");
+public static final int sel_windows = sel_registerName("windows");
+public static final int sel_downloadDidBegin_1 = sel_registerName("downloadDidBegin:");
+public static final int sel_pasteboard_1provideDataForType_1 = sel_registerName("pasteboard:provideDataForType:");
+public static final int sel_length = sel_registerName("length");
+public static final int sel_imagePosition = sel_registerName("imagePosition");
+public static final int sel_setAllowedFileTypes_1 = sel_registerName("setAllowedFileTypes:");
+public static final int sel_moveForwardAndModifySelection_1 = sel_registerName("moveForwardAndModifySelection:");
+public static final int sel_filename = sel_registerName("filename");
+public static final int sel_mountedLocalVolumePaths = sel_registerName("mountedLocalVolumePaths");
+public static final int sel_sharedFontManager = sel_registerName("sharedFontManager");
+public static final int sel_dictionaryWithObjects_1forKeys_1count_1 = sel_registerName("dictionaryWithObjects:forKeys:count:");
+public static final int sel_transpose_1 = sel_registerName("transpose:");
+public static final int sel_drawTitleWithFrame_1inView_1 = sel_registerName("drawTitleWithFrame:inView:");
+public static final int sel_worksWhenModal = sel_registerName("worksWhenModal");
+public static final int sel_registerClassDescription_1 = sel_registerName("registerClassDescription:");
+public static final int sel_setAllowsTruncatedLabels_1 = sel_registerName("setAllowsTruncatedLabels:");
+public static final int sel_bezierPathWithRoundedRect_1xRadius_1yRadius_1 = sel_registerName("bezierPathWithRoundedRect:xRadius:yRadius:");
+public static final int sel_prefix = sel_registerName("prefix");
+public static final int sel_usesStrongWriteBarrier = sel_registerName("usesStrongWriteBarrier");
+public static final int sel_argumentNames = sel_registerName("argumentNames");
+public static final int sel_setCaseSensitive_1 = sel_registerName("setCaseSensitive:");
+public static final int sel_outlineView_1didClickTableColumn_1 = sel_registerName("outlineView:didClickTableColumn:");
+public static final int sel_textDidBeginEditing_1 = sel_registerName("textDidBeginEditing:");
+public static final int sel_visibleRect = sel_registerName("visibleRect");
+public static final int sel_isSubviewCollapsed_1 = sel_registerName("isSubviewCollapsed:");
+public static final int sel_completionsForPartialWordRange_1indexOfSelectedItem_1 = sel_registerName("completionsForPartialWordRange:indexOfSelectedItem:");
+public static final int sel_setMinDate_1 = sel_registerName("setMinDate:");
+public static final int sel_colorFromPasteboard_1 = sel_registerName("colorFromPasteboard:");
+public static final int sel_instanceMethodSignatureForSelector_1 = sel_registerName("instanceMethodSignatureForSelector:");
+public static final int sel_makeCellAtRow_1column_1 = sel_registerName("makeCellAtRow:column:");
+public static final int sel_pasteAsPlainText_1 = sel_registerName("pasteAsPlainText:");
+public static final int sel_willRemoveSubview_1 = sel_registerName("willRemoveSubview:");
+public static final int sel_beginSheet_1modalForWindow_1modalDelegate_1didEndSelector_1contextInfo_1 = sel_registerName("beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:");
+public static final int sel_notificationCenterForType_1 = sel_registerName("notificationCenterForType:");
+public static final int sel_isDaylightSavingTimeForDate_1 = sel_registerName("isDaylightSavingTimeForDate:");
+public static final int sel_load = sel_registerName("load");
+public static final int sel_menuForSegment_1 = sel_registerName("menuForSegment:");
+public static final int sel_scheduledTimerWithTimeInterval_1invocation_1repeats_1 = sel_registerName("scheduledTimerWithTimeInterval:invocation:repeats:");
+public static final int sel_unregisterClass_1 = sel_registerName("unregisterClass:");
+public static final int sel_setByAddingObjectsFromSet_1 = sel_registerName("setByAddingObjectsFromSet:");
+public static final int sel_setDepthLimit_1 = sel_registerName("setDepthLimit:");
+public static final int sel_setVeryShortMonthSymbols_1 = sel_registerName("setVeryShortMonthSymbols:");
+public static final int sel_writeToURL_1ofType_1forSaveOperation_1originalContentsURL_1error_1 = sel_registerName("writeToURL:ofType:forSaveOperation:originalContentsURL:error:");
+public static final int sel_directoryAttributes = sel_registerName("directoryAttributes");
+public static final int sel_otherMouseDown_1 = sel_registerName("otherMouseDown:");
+public static final int sel_unhideWithoutActivation = sel_registerName("unhideWithoutActivation");
+public static final int sel_initWithContainerClassDescription_1containerSpecifier_1key_1startSpecifier_1endSpecifier_1 = sel_registerName("initWithContainerClassDescription:containerSpecifier:key:startSpecifier:endSpecifier:");
+public static final int sel_setHasHorizontalScroller_1 = sel_registerName("setHasHorizontalScroller:");
+public static final int sel_trackMouse_1adding_1 = sel_registerName("trackMouse:adding:");
+public static final int sel_substituteGlyphsInRange_1withGlyphs_1 = sel_registerName("substituteGlyphsInRange:withGlyphs:");
+public static final int sel_drawCell_1 = sel_registerName("drawCell:");
+public static final int sel_currentCursor = sel_registerName("currentCursor");
+public static final int sel_maxSize = sel_registerName("maxSize");
+public static final int sel_cookiesWithResponseHeaderFields_1forURL_1 = sel_registerName("cookiesWithResponseHeaderFields:forURL:");
+public static final int sel_isBycopy = sel_registerName("isBycopy");
+public static final int sel_addCursorRect_1cursor_1 = sel_registerName("addCursorRect:cursor:");
+public static final int sel_accessibilityActionNames = sel_registerName("accessibilityActionNames");
+public static final int sel_openDocumentWithContentsOfURL_1display_1error_1 = sel_registerName("openDocumentWithContentsOfURL:display:error:");
+public static final int sel_templateViews = sel_registerName("templateViews");
+public static final int sel_keyPath = sel_registerName("keyPath");
+public static final int sel_minValue = sel_registerName("minValue");
+public static final int sel_setImageDimsWhenDisabled_1 = sel_registerName("setImageDimsWhenDisabled:");
+public static final int sel_appendData_1 = sel_registerName("appendData:");
+public static final int sel_netServiceBrowser_1didFindDomain_1moreComing_1 = sel_registerName("netServiceBrowser:didFindDomain:moreComing:");
+public static final int sel_initWithDescriptorType_1bytes_1length_1 = sel_registerName("initWithDescriptorType:bytes:length:");
+public static final int sel_hasReadablePropertyForKey_1 = sel_registerName("hasReadablePropertyForKey:");
+public static final int sel_stopWhenAnimation_1reachesProgress_1 = sel_registerName("stopWhenAnimation:reachesProgress:");
+public static final int sel_setWorksWhenModal_1 = sel_registerName("setWorksWhenModal:");
+public static final int sel_localizedInputManagerName = sel_registerName("localizedInputManagerName");
+public static final int sel_knobColor = sel_registerName("knobColor");
+public static final int sel_screens = sel_registerName("screens");
+public static final int sel_deminiaturize_1 = sel_registerName("deminiaturize:");
+public static final int sel_bundleIdentifier = sel_registerName("bundleIdentifier");
+public static final int sel_setLoopMode_1 = sel_registerName("setLoopMode:");
+public static final int sel_expandItem_1expandChildren_1 = sel_registerName("expandItem:expandChildren:");
+public static final int sel_dataWithContentsOfFile_1options_1error_1 = sel_registerName("dataWithContentsOfFile:options:error:");
+public static final int sel_lineBreakBeforeIndex_1withinRange_1 = sel_registerName("lineBreakBeforeIndex:withinRange:");
+public static final int sel_fileOwnerAccountName = sel_registerName("fileOwnerAccountName");
+public static final int sel_insertColumn_1withCells_1 = sel_registerName("insertColumn:withCells:");
+public static final int sel_windowLevel = sel_registerName("windowLevel");
+public static final int sel_setGrammarCheckingEnabled_1 = sel_registerName("setGrammarCheckingEnabled:");
+public static final int sel_shortStandaloneWeekdaySymbols = sel_registerName("shortStandaloneWeekdaySymbols");
+public static final int sel_push = sel_registerName("push");
+public static final int sel_initWithContentsOfFile_1ofType_1 = sel_registerName("initWithContentsOfFile:ofType:");
+public static final int sel_removePortForName_1 = sel_registerName("removePortForName:");
+public static final int sel_setMaximumRecents_1 = sel_registerName("setMaximumRecents:");
+public static final int sel_supermenu = sel_registerName("supermenu");
+public static final int sel_setWidth_1type_1forLayer_1edge_1 = sel_registerName("setWidth:type:forLayer:edge:");
+public static final int sel_itemRemoved_1 = sel_registerName("itemRemoved:");
+public static final int sel_initWithBytesNoCopy_1length_1 = sel_registerName("initWithBytesNoCopy:length:");
+public static final int sel_printer = sel_registerName("printer");
+public static final int sel_compact = sel_registerName("compact");
+public static final int sel_setDefaultLineWidth_1 = sel_registerName("setDefaultLineWidth:");
+public static final int sel_CGLPixelFormatObj = sel_registerName("CGLPixelFormatObj");
+public static final int sel_initWithDictionary_1copyItems_1 = sel_registerName("initWithDictionary:copyItems:");
+public static final int sel_tableView_1didDragTableColumn_1 = sel_registerName("tableView:didDragTableColumn:");
+public static final int sel_formattingStringsFilename = sel_registerName("formattingStringsFilename");
+public static final int sel_setScrollView_1 = sel_registerName("setScrollView:");
+public static final int sel_value = sel_registerName("value");
+public static final int sel_editedMask = sel_registerName("editedMask");
+public static final int sel_ruleEditor_1displayValueForCriterion_1inRow_1 = sel_registerName("ruleEditor:displayValueForCriterion:inRow:");
+public static final int sel_leading = sel_registerName("leading");
+public static final int sel_titleRect = sel_registerName("titleRect");
+public static final int sel_setColumnsAutosaveName_1 = sel_registerName("setColumnsAutosaveName:");
+public static final int sel_stop_1 = sel_registerName("stop:");
+public static final int sel_titleColor = sel_registerName("titleColor");
+public static final int sel_initWithContainerClassDescription_1containerSpecifier_1key_1test_1 = sel_registerName("initWithContainerClassDescription:containerSpecifier:key:test:");
+public static final int sel_bytesPerPlane = sel_registerName("bytesPerPlane");
+public static final int sel_pageScroll = sel_registerName("pageScroll");
+public static final int sel_groupingAttributes = sel_registerName("groupingAttributes");
+public static final int sel_setAutomaticLinkDetectionEnabled_1 = sel_registerName("setAutomaticLinkDetectionEnabled:");
+public static final int sel_tableView_1mouseDownInHeaderOfTableColumn_1 = sel_registerName("tableView:mouseDownInHeaderOfTableColumn:");
+public static final int sel_representationOfImageRepsInArray_1usingType_1properties_1 = sel_registerName("representationOfImageRepsInArray:usingType:properties:");
+public static final int sel_attributeRuns = sel_registerName("attributeRuns");
+public static final int sel_decodeRect = sel_registerName("decodeRect");
+public static final int sel_drawerDidOpen_1 = sel_registerName("drawerDidOpen:");
+public static final int sel_scrollerWidth = sel_registerName("scrollerWidth");
+public static final int sel_defaultMenu = sel_registerName("defaultMenu");
+public static final int sel_URLProtocol_1didLoadData_1 = sel_registerName("URLProtocol:didLoadData:");
+public static final int sel_allKeys = sel_registerName("allKeys");
+public static final int sel_startPeriodicEventsAfterDelay_1withPeriod_1 = sel_registerName("startPeriodicEventsAfterDelay:withPeriod:");
+public static final int sel_tableViewSelectionDidChange_1 = sel_registerName("tableViewSelectionDidChange:");
+public static final int sel_setStandalone_1 = sel_registerName("setStandalone:");
+public static final int sel_makeMainWindow = sel_registerName("makeMainWindow");
+public static final int sel_moveLeftAndModifySelection_1 = sel_registerName("moveLeftAndModifySelection:");
+public static final int sel_pasteboardWithUniqueName = sel_registerName("pasteboardWithUniqueName");
+public static final int sel_fileSystemFileNumber = sel_registerName("fileSystemFileNumber");
+public static final int sel_jobDisposition = sel_registerName("jobDisposition");
+public static final int sel_setCurrentVirtualScreen_1 = sel_registerName("setCurrentVirtualScreen:");
+public static final int sel_setHasThousandSeparators_1 = sel_registerName("setHasThousandSeparators:");
+public static final int sel_alternateMnemonicLocation = sel_registerName("alternateMnemonicLocation");
+public static final int sel_characterSetWithBitmapRepresentation_1 = sel_registerName("characterSetWithBitmapRepresentation:");
+public static final int sel_startLoading = sel_registerName("startLoading");
+public static final int sel_member_1 = sel_registerName("member:");
+public static final int sel_setSelectedFont_1isMultiple_1 = sel_registerName("setSelectedFont:isMultiple:");
+public static final int sel_monthOfYear = sel_registerName("monthOfYear");
+public static final int sel_restoreCachedImage = sel_registerName("restoreCachedImage");
+public static final int sel_image_1didLoadPartOfRepresentation_1withValidRows_1 = sel_registerName("image:didLoadPartOfRepresentation:withValidRows:");
+public static final int sel_mouseEventWithType_1location_1modifierFlags_1timestamp_1windowNumber_1context_1eventNumber_1clickCount_1pressure_1 = sel_registerName("mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:");
+public static final int sel_setInternationalCurrencySymbol_1 = sel_registerName("setInternationalCurrencySymbol:");
+public static final int sel_mainThread = sel_registerName("mainThread");
+public static final int sel_lineCapStyle = sel_registerName("lineCapStyle");
+public static final int sel_setDefaultParagraphStyle_1 = sel_registerName("setDefaultParagraphStyle:");
+public static final int sel_cellFrameForTextContainer_1proposedLineFragment_1glyphPosition_1characterIndex_1 = sel_registerName("cellFrameForTextContainer:proposedLineFragment:glyphPosition:characterIndex:");
+public static final int sel_resolveInstanceMethod_1 = sel_registerName("resolveInstanceMethod:");
+public static final int sel_illegalCharacterSet = sel_registerName("illegalCharacterSet");
+public static final int sel_setKnobThickness_1 = sel_registerName("setKnobThickness:");
+public static final int sel_runModalPageLayoutWithPrintInfo_1 = sel_registerName("runModalPageLayoutWithPrintInfo:");
+public static final int sel_popUpContextMenu_1withEvent_1forView_1withFont_1 = sel_registerName("popUpContextMenu:withEvent:forView:withFont:");
+public static final int sel_modalWindow = sel_registerName("modalWindow");
+public static final int sel_autorelease = sel_registerName("autorelease");
+public static final int sel_draggingEntered_1 = sel_registerName("draggingEntered:");
+public static final int sel_allowsTruncatedLabels = sel_registerName("allowsTruncatedLabels");
+public static final int sel_fileDescriptor = sel_registerName("fileDescriptor");
+public static final int sel_ISOLanguageCodes = sel_registerName("ISOLanguageCodes");
+public static final int sel_onStateImage = sel_registerName("onStateImage");
+public static final int sel_imageFrameStyle = sel_registerName("imageFrameStyle");
+public static final int sel_setFloatValue_1 = sel_registerName("setFloatValue:");
+public static final int sel_initWithColors_1atLocations_1colorSpace_1 = sel_registerName("initWithColors:atLocations:colorSpace:");
+public static final int sel_descriptorWithString_1 = sel_registerName("descriptorWithString:");
+public static final int sel_setPoolCountHighWaterMark_1 = sel_registerName("setPoolCountHighWaterMark:");
+public static final int sel_veryShortStandaloneWeekdaySymbols = sel_registerName("veryShortStandaloneWeekdaySymbols");
+public static final int sel_addTypes_1owner_1 = sel_registerName("addTypes:owner:");
+public static final int sel_numberWithLongLong_1 = sel_registerName("numberWithLongLong:");
+public static final int sel_setDay_1 = sel_registerName("setDay:");
+public static final int sel_initWithHTML_1documentAttributes_1 = sel_registerName("initWithHTML:documentAttributes:");
+public static final int sel_replaceSubview_1with_1 = sel_registerName("replaceSubview:with:");
+public static final int sel_makeObjectsPerformSelector_1 = sel_registerName("makeObjectsPerformSelector:");
+public static final int sel_setRunLoopModes_1 = sel_registerName("setRunLoopModes:");
+public static final int sel_getFileSystemRepresentation_1maxLength_1 = sel_registerName("getFileSystemRepresentation:maxLength:");
+public static final int sel_scale = sel_registerName("scale");
+public static final int sel_draggedImageLocation = sel_registerName("draggedImageLocation");
+public static final int sel_setFocusStack_1 = sel_registerName("setFocusStack:");
+public static final int sel_isReadOnlyKey_1 = sel_registerName("isReadOnlyKey:");
+public static final int sel_shadowOffset = sel_registerName("shadowOffset");
+public static final int sel_URLHandleUsingCache_1 = sel_registerName("URLHandleUsingCache:");
+public static final int sel_isWellFormed = sel_registerName("isWellFormed");
+public static final int sel_tokenField_1editingStringForRepresentedObject_1 = sel_registerName("tokenField:editingStringForRepresentedObject:");
+public static final int sel_setGroupsByEvent_1 = sel_registerName("setGroupsByEvent:");
+public static final int sel_parser_1foundComment_1 = sel_registerName("parser:foundComment:");
+public static final int sel_initWithHTML_1baseURL_1documentAttributes_1 = sel_registerName("initWithHTML:baseURL:documentAttributes:");
+public static final int sel_uppercaseWord_1 = sel_registerName("uppercaseWord:");
+public static final int sel_testPart_1 = sel_registerName("testPart:");
+public static final int sel_dataSource = sel_registerName("dataSource");
+public static final int sel_lineRangeForRange_1 = sel_registerName("lineRangeForRange:");
+public static final int sel_hostWithAddress_1 = sel_registerName("hostWithAddress:");
+public static final int sel_removeRunLoop_1 = sel_registerName("removeRunLoop:");
+public static final int sel_fileHandleWithStandardInput = sel_registerName("fileHandleWithStandardInput");
+public static final int sel_itemArray = sel_registerName("itemArray");
+public static final int sel_rectOfPathComponentCell_1withFrame_1inView_1 = sel_registerName("rectOfPathComponentCell:withFrame:inView:");
+public static final int sel_TIFFRepresentation = sel_registerName("TIFFRepresentation");
+public static final int sel_archiver_1willReplaceObject_1withObject_1 = sel_registerName("archiver:willReplaceObject:withObject:");
+public static final int sel_currentVirtualScreen = sel_registerName("currentVirtualScreen");
+public static final int sel_gridColor = sel_registerName("gridColor");
+public static final int sel_boundingRectForGlyph_1 = sel_registerName("boundingRectForGlyph:");
+public static final int sel_setDataSource_1 = sel_registerName("setDataSource:");
+public static final int sel_setDefaultLineJoinStyle_1 = sel_registerName("setDefaultLineJoinStyle:");
+public static final int sel_textBlocks = sel_registerName("textBlocks");
+public static final int sel_drawerDidClose_1 = sel_registerName("drawerDidClose:");
+public static final int sel_valueWithName_1inPropertyWithKey_1 = sel_registerName("valueWithName:inPropertyWithKey:");
+public static final int sel_managedObjectModel = sel_registerName("managedObjectModel");
+public static final int sel_outlineView_1persistentObjectForItem_1 = sel_registerName("outlineView:persistentObjectForItem:");
+public static final int sel_setSelectedRange_1 = sel_registerName("setSelectedRange:");
+public static final int sel_magentaComponent = sel_registerName("magentaComponent");
+public static final int sel_setIncrement_1 = sel_registerName("setIncrement:");
+public static final int sel_editingStringForObjectValue_1 = sel_registerName("editingStringForObjectValue:");
+public static final int sel_addClip = sel_registerName("addClip");
+public static final int sel_setSelectionIndex_1 = sel_registerName("setSelectionIndex:");
+public static final int sel_replyAppleEventForSuspensionID_1 = sel_registerName("replyAppleEventForSuspensionID:");
+public static final int sel_URLProtocol_1didFailWithError_1 = sel_registerName("URLProtocol:didFailWithError:");
+public static final int sel_ignoresMouseEvents = sel_registerName("ignoresMouseEvents");
+public static final int sel_dateWithNaturalLanguageString_1locale_1 = sel_registerName("dateWithNaturalLanguageString:locale:");
+public static final int sel_recordDescriptor = sel_registerName("recordDescriptor");
+public static final int sel_makeCurrentContext = sel_registerName("makeCurrentContext");
+public static final int sel_excludedKeys = sel_registerName("excludedKeys");
+public static final int sel_fileManager_1shouldProceedAfterError_1linkingItemAtPath_1toPath_1 = sel_registerName("fileManager:shouldProceedAfterError:linkingItemAtPath:toPath:");
+public static final int sel_set = sel_registerName("set");
+public static final int sel_mainScreen = sel_registerName("mainScreen");
+public static final int sel_setVersion_1 = sel_registerName("setVersion:");
+public static final int sel_displayRectIgnoringOpacity_1inContext_1 = sel_registerName("displayRectIgnoringOpacity:inContext:");
+public static final int sel_setNumberOfTickMarks_1 = sel_registerName("setNumberOfTickMarks:");
+public static final int sel_showsHelp = sel_registerName("showsHelp");
+public static final int sel_takeColorFrom_1 = sel_registerName("takeColorFrom:");
+public static final int sel_horizontalPageScroll = sel_registerName("horizontalPageScroll");
+public static final int sel_pointingHandCursor = sel_registerName("pointingHandCursor");
+public static final int sel_vendorID = sel_registerName("vendorID");
+public static final int sel_setSelectedRanges_1affinity_1stillSelecting_1 = sel_registerName("setSelectedRanges:affinity:stillSelecting:");
+public static final int sel_setHTTPShouldHandleCookies_1 = sel_registerName("setHTTPShouldHandleCookies:");
+public static final int sel_initWithType_1location_1 = sel_registerName("initWithType:location:");
+public static final int sel_stringByResolvingSymlinksInPath = sel_registerName("stringByResolvingSymlinksInPath");
+public static final int sel_tryLock = sel_registerName("tryLock");
+public static final int sel_convertSizeFromBase_1 = sel_registerName("convertSizeFromBase:");
+public static final int sel_setCacheMode_1 = sel_registerName("setCacheMode:");
+public static final int sel_entityName = sel_registerName("entityName");
+public static final int sel_takeFloatValueFrom_1 = sel_registerName("takeFloatValueFrom:");
+public static final int sel_showsStateBy = sel_registerName("showsStateBy");
+public static final int sel_highlightedItem = sel_registerName("highlightedItem");
+public static final int sel_superclassDescription = sel_registerName("superclassDescription");
+public static final int sel_flagsChanged_1 = sel_registerName("flagsChanged:");
+public static final int sel_alloc = sel_registerName("alloc");
+public static final int sel_setDisplaysWhenScreenProfileChanges_1 = sel_registerName("setDisplaysWhenScreenProfileChanges:");
+public static final int sel_CIImage = sel_registerName("CIImage");
+public static final int sel_setSupermenu_1 = sel_registerName("setSupermenu:");
+public static final int sel_setSharedURLCache_1 = sel_registerName("setSharedURLCache:");
+public static final int sel_pathCell_1willPopUpMenu_1 = sel_registerName("pathCell:willPopUpMenu:");
+public static final int sel_setAttributes_1ofItemAtPath_1error_1 = sel_registerName("setAttributes:ofItemAtPath:error:");
+public static final int sel_tableView_1typeSelectStringForTableColumn_1row_1 = sel_registerName("tableView:typeSelectStringForTableColumn:row:");
+public static final int sel_moveWordLeftAndModifySelection_1 = sel_registerName("moveWordLeftAndModifySelection:");
+public static final int sel_whitespaceAndNewlineCharacterSet = sel_registerName("whitespaceAndNewlineCharacterSet");
+public static final int sel_pathControl_1validateDrop_1 = sel_registerName("pathControl:validateDrop:");
+public static final int sel_createCommandInstanceWithZone_1 = sel_registerName("createCommandInstanceWithZone:");
+public static final int sel_configurationDictionary = sel_registerName("configurationDictionary");
+public static final int sel_classFallbacksForKeyedArchiver = sel_registerName("classFallbacksForKeyedArchiver");
+public static final int sel_DTDKind = sel_registerName("DTDKind");
+public static final int sel_initWithPath_1documentAttributes_1 = sel_registerName("initWithPath:documentAttributes:");
+public static final int sel_addObjectsFromArray_1 = sel_registerName("addObjectsFromArray:");
+public static final int sel_tokenField_1displayStringForRepresentedObject_1 = sel_registerName("tokenField:displayStringForRepresentedObject:");
+public static final int sel_firstVisibleColumn = sel_registerName("firstVisibleColumn");
+public static final int sel_gradientType = sel_registerName("gradientType");
+public static final int sel_familyName = sel_registerName("familyName");
+public static final int sel_uniqueID = sel_registerName("uniqueID");
+public static final int sel_setFormatterBehavior_1 = sel_registerName("setFormatterBehavior:");
+public static final int sel_tokenFieldCell_1hasMenuForRepresentedObject_1 = sel_registerName("tokenFieldCell:hasMenuForRepresentedObject:");
+public static final int sel_fileManager_1shouldCopyItemAtPath_1toPath_1 = sel_registerName("fileManager:shouldCopyItemAtPath:toPath:");
+public static final int sel_keySpecifier = sel_registerName("keySpecifier");
+public static final int sel_copyItemAtPath_1toPath_1error_1 = sel_registerName("copyItemAtPath:toPath:error:");
+public static final int sel_setLength_1 = sel_registerName("setLength:");
+public static final int sel_reloadItem_1 = sel_registerName("reloadItem:");
+public static final int sel_removeObjectsAtArrangedObjectIndexes_1 = sel_registerName("removeObjectsAtArrangedObjectIndexes:");
+public static final int sel_setVisibilityPriority_1 = sel_registerName("setVisibilityPriority:");
+public static final int sel_insertItemWithObjectValue_1atIndex_1 = sel_registerName("insertItemWithObjectValue:atIndex:");
+public static final int sel_searchButtonCell = sel_registerName("searchButtonCell");
+public static final int sel_getCString_1maxLength_1range_1remainingRange_1 = sel_registerName("getCString:maxLength:range:remainingRange:");
+public static final int sel_outlineView_1child_1ofItem_1 = sel_registerName("outlineView:child:ofItem:");
+public static final int sel_numberOfComponents = sel_registerName("numberOfComponents");
+public static final int sel_isKindOfClass_1 = sel_registerName("isKindOfClass:");
+public static final int sel_processorCount = sel_registerName("processorCount");
+public static final int sel_lineJoinStyle = sel_registerName("lineJoinStyle");
+public static final int sel_collectionBehavior = sel_registerName("collectionBehavior");
+public static final int sel_setApplicationIconImage_1 = sel_registerName("setApplicationIconImage:");
+public static final int sel_setLaunchPath_1 = sel_registerName("setLaunchPath:");
+public static final int sel_initFileURLWithPath_1 = sel_registerName("initFileURLWithPath:");
+public static final int sel_selectItemAtIndex_1 = sel_registerName("selectItemAtIndex:");
+public static final int sel_IBeamCursor = sel_registerName("IBeamCursor");
+public static final int sel_isColor = sel_registerName("isColor");
+public static final int sel_cancelAuthenticationChallenge_1 = sel_registerName("cancelAuthenticationChallenge:");
+public static final int sel_echosBullets = sel_registerName("echosBullets");
+public static final int sel_setHasUndoManager_1 = sel_registerName("setHasUndoManager:");
+public static final int sel_RTFDFileWrapperFromRange_1documentAttributes_1 = sel_registerName("RTFDFileWrapperFromRange:documentAttributes:");
+public static final int sel_highlightCell_1atRow_1column_1 = sel_registerName("highlightCell:atRow:column:");
+public static final int sel_currentHost = sel_registerName("currentHost");
+public static final int sel_setURI_1 = sel_registerName("setURI:");
+public static final int sel_suiteNames = sel_registerName("suiteNames");
+public static final int sel_genericGrayColorSpace = sel_registerName("genericGrayColorSpace");
+public static final int sel_volatileDomainForName_1 = sel_registerName("volatileDomainForName:");
+public static final int sel_tokenizingCharacterSet = sel_registerName("tokenizingCharacterSet");
+public static final int sel_initWithXMLString_1 = sel_registerName("initWithXMLString:");
+public static final int sel_function = sel_registerName("function");
+public static final int sel_sizeForMagnification_1 = sel_registerName("sizeForMagnification:");
+public static final int sel_commitEditingWithDelegate_1didCommitSelector_1contextInfo_1 = sel_registerName("commitEditingWithDelegate:didCommitSelector:contextInfo:");
+public static final int sel_writeToFile_1 = sel_registerName("writeToFile:");
+public static final int sel_displayIfNeededInRect_1 = sel_registerName("displayIfNeededInRect:");
+public static final int sel_optionDescriptionsForBinding_1 = sel_registerName("optionDescriptionsForBinding:");
+public static final int sel_initWithSize_1 = sel_registerName("initWithSize:");
+public static final int sel_cornerView = sel_registerName("cornerView");
+public static final int sel_redoActionName = sel_registerName("redoActionName");
+public static final int sel_setLocation_1forStartOfGlyphRange_1 = sel_registerName("setLocation:forStartOfGlyphRange:");
+public static final int sel_setAllowedInputSourceLocales_1 = sel_registerName("setAllowedInputSourceLocales:");
+public static final int sel_convertRect_1toView_1 = sel_registerName("convertRect:toView:");
+public static final int sel_preferredFilenameExtensionForType_1 = sel_registerName("preferredFilenameExtensionForType:");
+public static final int sel_tableView_1writeRows_1toPasteboard_1 = sel_registerName("tableView:writeRows:toPasteboard:");
+public static final int sel_rootObject = sel_registerName("rootObject");
+public static final int sel_isEqualToHashTable_1 = sel_registerName("isEqualToHashTable:");
+public static final int sel_indent_1 = sel_registerName("indent:");
+public static final int sel_removeIndexesInRange_1 = sel_registerName("removeIndexesInRange:");
+public static final int sel_numberWithBool_1 = sel_registerName("numberWithBool:");
+public static final int sel_setPersistentDomain_1forName_1 = sel_registerName("setPersistentDomain:forName:");
+public static final int sel_netServiceBrowser_1didRemoveService_1moreComing_1 = sel_registerName("netServiceBrowser:didRemoveService:moreComing:");
+public static final int sel_timeZoneWithName_1data_1 = sel_registerName("timeZoneWithName:data:");
+public static final int sel_drawImage_1withFrame_1inView_1 = sel_registerName("drawImage:withFrame:inView:");
+public static final int sel_buttonToolTip = sel_registerName("buttonToolTip");
+public static final int sel_enableCursorRects = sel_registerName("enableCursorRects");
+public static final int sel_rulerAttributesInRange_1 = sel_registerName("rulerAttributesInRange:");
+public static final int sel_setMemoryCapacity_1 = sel_registerName("setMemoryCapacity:");
+public static final int sel_isSeparatorItem = sel_registerName("isSeparatorItem");
+public static final int sel_save_1 = sel_registerName("save:");
+public static final int sel_documentView = sel_registerName("documentView");
+public static final int sel_setHostCacheEnabled_1 = sel_registerName("setHostCacheEnabled:");
+public static final int sel_setDatePickerElements_1 = sel_registerName("setDatePickerElements:");
+public static final int sel_mixedStateImage = sel_registerName("mixedStateImage");
+public static final int sel_setAcceptsMouseMovedEvents_1 = sel_registerName("setAcceptsMouseMovedEvents:");
+public static final int sel_numberOfTabViewItems = sel_registerName("numberOfTabViewItems");
+public static final int sel_portForName_1host_1nameServerPortNumber_1 = sel_registerName("portForName:host:nameServerPortNumber:");
+public static final int sel_printerWithName_1domain_1includeUnavailable_1 = sel_registerName("printerWithName:domain:includeUnavailable:");
+public static final int sel_insertObjects_1atArrangedObjectIndexPaths_1 = sel_registerName("insertObjects:atArrangedObjectIndexPaths:");
+public static final int sel_browser_1shouldTypeSelectForEvent_1withCurrentSearchString_1 = sel_registerName("browser:shouldTypeSelectForEvent:withCurrentSearchString:");
+public static final int sel_defaultTabInterval = sel_registerName("defaultTabInterval");
+public static final int sel_initWithTitle_1 = sel_registerName("initWithTitle:");
+public static final int sel_timeZoneForSecondsFromGMT_1 = sel_registerName("timeZoneForSecondsFromGMT:");
+public static final int sel_initWithPasteboard_1 = sel_registerName("initWithPasteboard:");
+public static final int sel_subscriptRange_1 = sel_registerName("subscriptRange:");
+public static final int sel_highlightColorWithFrame_1inView_1 = sel_registerName("highlightColorWithFrame:inView:");
+public static final int sel_didChangeText = sel_registerName("didChangeText");
+public static final int sel_storagePolicy = sel_registerName("storagePolicy");
+public static final int sel_respondsToSelector_1 = sel_registerName("respondsToSelector:");
+public static final int sel_namesOfPromisedFilesDroppedAtDestination_1 = sel_registerName("namesOfPromisedFilesDroppedAtDestination:");
+public static final int sel_unsignedShortValue = sel_registerName("unsignedShortValue");
+public static final int sel_setZeroSymbol_1 = sel_registerName("setZeroSymbol:");
+public static final int sel_resourcePath = sel_registerName("resourcePath");
+public static final int sel_markerFormat = sel_registerName("markerFormat");
+public static final int sel_hotSpot = sel_registerName("hotSpot");
+public static final int sel_imageUnfilteredPasteboardTypes = sel_registerName("imageUnfilteredPasteboardTypes");
+public static final int sel_editedRange = sel_registerName("editedRange");
+public static final int sel_setMenuChangedMessagesEnabled_1 = sel_registerName("setMenuChangedMessagesEnabled:");
+public static final int sel_tailIndent = sel_registerName("tailIndent");
+public static final int sel_release = sel_registerName("release");
+public static final int sel_readFromURL_1options_1documentAttributes_1 = sel_registerName("readFromURL:options:documentAttributes:");
+public static final int sel_underlinePosition = sel_registerName("underlinePosition");
+public static final int sel_setMinItemSize_1 = sel_registerName("setMinItemSize:");
+public static final int sel_initWithImage_1foregroundColorHint_1backgroundColorHint_1hotSpot_1 = sel_registerName("initWithImage:foregroundColorHint:backgroundColorHint:hotSpot:");
+public static final int sel_setPlaceholderString_1 = sel_registerName("setPlaceholderString:");
+public static final int sel_createDirectoryAtPath_1withIntermediateDirectories_1attributes_1error_1 = sel_registerName("createDirectoryAtPath:withIntermediateDirectories:attributes:error:");
+public static final int sel_setDefaultTabInterval_1 = sel_registerName("setDefaultTabInterval:");
+public static final int sel_invertedSet = sel_registerName("invertedSet");
+public static final int sel_iconForFile_1 = sel_registerName("iconForFile:");
+public static final int sel_modifyFont_1 = sel_registerName("modifyFont:");
+public static final int sel_setProcessName_1 = sel_registerName("setProcessName:");
+public static final int sel_addObserver_1toObjectsAtIndexes_1forKeyPath_1options_1context_1 = sel_registerName("addObserver:toObjectsAtIndexes:forKeyPath:options:context:");
+public static final int sel_resolve = sel_registerName("resolve");
+public static final int sel_namespaces = sel_registerName("namespaces");
+public static final int sel_drawInBezierPath_1angle_1 = sel_registerName("drawInBezierPath:angle:");
+public static final int sel_setPixelFormat_1 = sel_registerName("setPixelFormat:");
+public static final int sel_resizeUpDownCursor = sel_registerName("resizeUpDownCursor");
+public static final int sel_daylightSavingTimeOffsetForDate_1 = sel_registerName("daylightSavingTimeOffsetForDate:");
+public static final int sel_setCanSpawnSeparateThread_1 = sel_registerName("setCanSpawnSeparateThread:");
+public static final int sel_setTitleBaseWritingDirection_1 = sel_registerName("setTitleBaseWritingDirection:");
+public static final int sel_subscript_1 = sel_registerName("subscript:");
+public static final int sel_URL = sel_registerName("URL");
+public static final int sel_headerColor = sel_registerName("headerColor");
+public static final int sel_stringByAddingPercentEscapesUsingEncoding_1 = sel_registerName("stringByAddingPercentEscapesUsingEncoding:");
+public static final int sel_draggingExited_1 = sel_registerName("draggingExited:");
+public static final int sel_ignoreModifierKeysWhileDragging = sel_registerName("ignoreModifierKeysWhileDragging");
+public static final int sel_componentsToDisplayForPath_1 = sel_registerName("componentsToDisplayForPath:");
+public static final int sel_glyphRangeForBoundingRectWithoutAdditionalLayout_1inTextContainer_1 = sel_registerName("glyphRangeForBoundingRectWithoutAdditionalLayout:inTextContainer:");
+public static final int sel_removeTrackingRect_1 = sel_registerName("removeTrackingRect:");
+public static final int sel_handlePrintScriptCommand_1 = sel_registerName("handlePrintScriptCommand:");
+public static final int sel_viewDidMoveToWindow = sel_registerName("viewDidMoveToWindow");
+public static final int sel_allocateGState = sel_registerName("allocateGState");
+public static final int sel_availableStringEncodings = sel_registerName("availableStringEncodings");
+public static final int sel_instantiateNibWithExternalNameTable_1 = sel_registerName("instantiateNibWithExternalNameTable:");
+public static final int sel_setWeekdayOrdinal_1 = sel_registerName("setWeekdayOrdinal:");
+public static final int sel_setWithCapacity_1 = sel_registerName("setWithCapacity:");
+public static final int sel_setCurrentAppleEventAndReplyEventWithSuspensionID_1 = sel_registerName("setCurrentAppleEventAndReplyEventWithSuspensionID:");
+public static final int sel_convertFont_1toNotHaveTrait_1 = sel_registerName("convertFont:toNotHaveTrait:");
+public static final int sel_performSelector_1withObject_1withObject_1 = sel_registerName("performSelector:withObject:withObject:");
+public static final int sel_removeIndexes_1 = sel_registerName("removeIndexes:");
+public static final int sel_objectSpecifierWithDescriptor_1 = sel_registerName("objectSpecifierWithDescriptor:");
+public static final int sel_objectValue = sel_registerName("objectValue");
+public static final int sel_timeZone = sel_registerName("timeZone");
+public static final int sel_viewSizeChanged_1 = sel_registerName("viewSizeChanged:");
+public static final int sel_clearDrawable = sel_registerName("clearDrawable");
+public static final int sel_parentRowForRow_1 = sel_registerName("parentRowForRow:");
+public static final int sel_trackingMode = sel_registerName("trackingMode");
+public static final int sel_selectedRanges = sel_registerName("selectedRanges");
+public static final int sel_suspendExecution = sel_registerName("suspendExecution");
+public static final int sel_setDefaultPrinter_1 = sel_registerName("setDefaultPrinter:");
+public static final int sel_loadDataRepresentation_1ofType_1 = sel_registerName("loadDataRepresentation:ofType:");
+public static final int sel_closestTickMarkValueToValue_1 = sel_registerName("closestTickMarkValueToValue:");
+public static final int sel_removeFromRunLoop_1forMode_1 = sel_registerName("removeFromRunLoop:forMode:");
+public static final int sel_cancelUserAttentionRequest_1 = sel_registerName("cancelUserAttentionRequest:");
+public static final int sel_dictionaryWithObject_1forKey_1 = sel_registerName("dictionaryWithObject:forKey:");
+public static final int sel_isDataRetained = sel_registerName("isDataRetained");
+public static final int sel_setLoops_1 = sel_registerName("setLoops:");
+public static final int sel_hashTableWithWeakObjects = sel_registerName("hashTableWithWeakObjects");
+public static final int sel_documentForURL_1 = sel_registerName("documentForURL:");
+public static final int sel_removeRepresentation_1 = sel_registerName("removeRepresentation:");
+public static final int sel_keyClassDescription = sel_registerName("keyClassDescription");
+public static final int sel_noResponderFor_1 = sel_registerName("noResponderFor:");
+public static final int sel_setBidiLevels_1forGlyphRange_1 = sel_registerName("setBidiLevels:forGlyphRange:");
+public static final int sel_cancelIncrementalLoad = sel_registerName("cancelIncrementalLoad");
+public static final int sel_highlightedBranchImage = sel_registerName("highlightedBranchImage");
+public static final int sel_setAttributedStringForZero_1 = sel_registerName("setAttributedStringForZero:");
+public static final int sel_drawAtPoint_1fromRect_1operation_1fraction_1 = sel_registerName("drawAtPoint:fromRect:operation:fraction:");
+public static final int sel_fileHFSTypeCode = sel_registerName("fileHFSTypeCode");
+public static final int sel_maximumRecents = sel_registerName("maximumRecents");
+public static final int sel_useFont_1 = sel_registerName("useFont:");
+public static final int sel_selectKeyViewPrecedingView_1 = sel_registerName("selectKeyViewPrecedingView:");
+public static final int sel_attributedStringForNil = sel_registerName("attributedStringForNil");
+public static final int sel_isGrammarCheckingEnabled = sel_registerName("isGrammarCheckingEnabled");
+public static final int sel_owner = sel_registerName("owner");
+public static final int sel_searchForServicesOfType_1inDomain_1 = sel_registerName("searchForServicesOfType:inDomain:");
+public static final int sel_frameAutosaveName = sel_registerName("frameAutosaveName");
+public static final int sel_setCommands_1 = sel_registerName("setCommands:");
+public static final int sel_URLResourceDidCancelLoading_1 = sel_registerName("URLResourceDidCancelLoading:");
+public static final int sel_uniqueSpellDocumentTag = sel_registerName("uniqueSpellDocumentTag");
+public static final int sel_needsToBeUpdatedFromPath_1 = sel_registerName("needsToBeUpdatedFromPath:");
+public static final int sel_bounds = sel_registerName("bounds");
+public static final int sel_contextHelpForKey_1 = sel_registerName("contextHelpForKey:");
+public static final int sel_setSendsActionOnEndEditing_1 = sel_registerName("setSendsActionOnEndEditing:");
+public static final int sel_scanDouble_1 = sel_registerName("scanDouble:");
+public static final int sel_download_1willResumeWithResponse_1fromByte_1 = sel_registerName("download:willResumeWithResponse:fromByte:");
+public static final int sel_drawFromCenter_1radius_1toCenter_1radius_1options_1 = sel_registerName("drawFromCenter:radius:toCenter:radius:options:");
+public static final int sel_defaultFlatness = sel_registerName("defaultFlatness");
+public static final int sel_keepBackupFile = sel_registerName("keepBackupFile");
+public static final int sel_willChangeValueForKey_1 = sel_registerName("willChangeValueForKey:");
+public static final int sel_initWithDateFormat_1allowNaturalLanguage_1 = sel_registerName("initWithDateFormat:allowNaturalLanguage:");
+public static final int sel_textView_1writablePasteboardTypesForCell_1atIndex_1 = sel_registerName("textView:writablePasteboardTypesForCell:atIndex:");
+public static final int sel_getTIFFCompressionTypes_1count_1 = sel_registerName("getTIFFCompressionTypes:count:");
+public static final int sel_decodePropertyList = sel_registerName("decodePropertyList");
+public static final int sel_saveDocumentWithDelegate_1didSaveSelector_1contextInfo_1 = sel_registerName("saveDocumentWithDelegate:didSaveSelector:contextInfo:");
+public static final int sel_encodePoint_1 = sel_registerName("encodePoint:");
+public static final int sel_selectRow_1byExtendingSelection_1 = sel_registerName("selectRow:byExtendingSelection:");
+public static final int sel_preservesContentDuringLiveResize = sel_registerName("preservesContentDuringLiveResize");
+public static final int sel_registerUndoWithTarget_1selector_1object_1 = sel_registerName("registerUndoWithTarget:selector:object:");
+public static final int sel_removeCollection_1 = sel_registerName("removeCollection:");
+public static final int sel_nextEventMatchingMask_1 = sel_registerName("nextEventMatchingMask:");
+public static final int sel_getObjects_1andKeys_1 = sel_registerName("getObjects:andKeys:");
+public static final int sel_EPSRepresentation = sel_registerName("EPSRepresentation");
+public static final int sel_isModalPanel = sel_registerName("isModalPanel");
+public static final int sel_statusCode = sel_registerName("statusCode");
+public static final int sel_setCopiesOnScroll_1 = sel_registerName("setCopiesOnScroll:");
+public static final int sel_setHorizontalPagination_1 = sel_registerName("setHorizontalPagination:");
+public static final int sel_removeAllIndexes = sel_registerName("removeAllIndexes");
+public static final int sel_download_1didFailWithError_1 = sel_registerName("download:didFailWithError:");
+public static final int sel_modifierFlags = sel_registerName("modifierFlags");
+public static final int sel_draggedColumn = sel_registerName("draggedColumn");
+public static final int sel_initWithUser_1 = sel_registerName("initWithUser:");
+public static final int sel_setLayoutRect_1forTextBlock_1glyphRange_1 = sel_registerName("setLayoutRect:forTextBlock:glyphRange:");
+public static final int sel_selectionAffinity = sel_registerName("selectionAffinity");
+public static final int sel_beginParagraph = sel_registerName("beginParagraph");
+public static final int sel_runModalForTypes_1 = sel_registerName("runModalForTypes:");
+public static final int sel_reloadCriteria = sel_registerName("reloadCriteria");
+public static final int sel_PDFOperationWithView_1insideRect_1toData_1printInfo_1 = sel_registerName("PDFOperationWithView:insideRect:toData:printInfo:");
+public static final int sel_cellAtRow_1column_1 = sel_registerName("cellAtRow:column:");
+public static final int sel_selectColumn_1byExtendingSelection_1 = sel_registerName("selectColumn:byExtendingSelection:");
+public static final int sel_addresses = sel_registerName("addresses");
+public static final int sel_setCanBeVisibleOnAllSpaces_1 = sel_registerName("setCanBeVisibleOnAllSpaces:");
+public static final int sel_bundleForSuite_1 = sel_registerName("bundleForSuite:");
+public static final int sel_stringWithCharacters_1length_1 = sel_registerName("stringWithCharacters:length:");
+public static final int sel_dataWithContentsOfURL_1options_1error_1 = sel_registerName("dataWithContentsOfURL:options:error:");
+public static final int sel_isExpanded = sel_registerName("isExpanded");
+public static final int sel_rectForLayoutAtPoint_1inRect_1textContainer_1characterRange_1 = sel_registerName("rectForLayoutAtPoint:inRect:textContainer:characterRange:");
+public static final int sel_initWithXMLString_1options_1error_1 = sel_registerName("initWithXMLString:options:error:");
+public static final int sel_datePickerCell_1validateProposedDateValue_1timeInterval_1 = sel_registerName("datePickerCell:validateProposedDateValue:timeInterval:");
+public static final int sel_replaceCharactersInRange_1withRTFD_1 = sel_registerName("replaceCharactersInRange:withRTFD:");
+public static final int sel_setNeedsDisplay_1 = sel_registerName("setNeedsDisplay:");
+public static final int sel_tableViewColumnDidMove_1 = sel_registerName("tableViewColumnDidMove:");
+public static final int sel_printOperationWithView_1printInfo_1 = sel_registerName("printOperationWithView:printInfo:");
+public static final int sel_parserDidStartDocument_1 = sel_registerName("parserDidStartDocument:");
+public static final int sel_privateFrameworksPath = sel_registerName("privateFrameworksPath");
+public static final int sel_informativeText = sel_registerName("informativeText");
+public static final int sel_attributesAtIndex_1effectiveRange_1 = sel_registerName("attributesAtIndex:effectiveRange:");
+public static final int sel_rectArrayForGlyphRange_1withinSelectedGlyphRange_1inTextContainer_1rectCount_1 = sel_registerName("rectArrayForGlyphRange:withinSelectedGlyphRange:inTextContainer:rectCount:");
+public static final int sel_swapWithMark_1 = sel_registerName("swapWithMark:");
+public static final int sel_setDrawsGrid_1 = sel_registerName("setDrawsGrid:");
+public static final int sel_highlight_1 = sel_registerName("highlight:");
+public static final int sel_maximumLineHeight = sel_registerName("maximumLineHeight");
+public static final int sel_phonemesFromText_1 = sel_registerName("phonemesFromText:");
+public static final int sel_convertSize_1fromView_1 = sel_registerName("convertSize:fromView:");
+public static final int sel_setProperty_1withValue_1 = sel_registerName("setProperty:withValue:");
+public static final int sel_cookieAcceptPolicy = sel_registerName("cookieAcceptPolicy");
+public static final int sel_hasThousandSeparators = sel_registerName("hasThousandSeparators");
+public static final int sel_setTighteningFactorForTruncation_1 = sel_registerName("setTighteningFactorForTruncation:");
+public static final int sel_contextMenuRepresentation = sel_registerName("contextMenuRepresentation");
+public static final int sel_precomposedStringWithCompatibilityMapping = sel_registerName("precomposedStringWithCompatibilityMapping");
+public static final int sel_threadDictionary = sel_registerName("threadDictionary");
+public static final int sel_redoMenuTitleForUndoActionName_1 = sel_registerName("redoMenuTitleForUndoActionName:");
+public static final int sel_setNumberOfVisibleItems_1 = sel_registerName("setNumberOfVisibleItems:");
+public static final int sel_preferredLanguages = sel_registerName("preferredLanguages");
+public static final int sel_mouseDraggedOnCharacterIndex_1atCoordinate_1withModifier_1client_1 = sel_registerName("mouseDraggedOnCharacterIndex:atCoordinate:withModifier:client:");
+public static final int sel_setMultiplier_1 = sel_registerName("setMultiplier:");
+public static final int sel_sortedArrayUsingSelector_1 = sel_registerName("sortedArrayUsingSelector:");
+public static final int sel_drawInRect_1 = sel_registerName("drawInRect:");
+public static final int sel_reversedSortDescriptor = sel_registerName("reversedSortDescriptor");
+public static final int sel_setIdentifier_1 = sel_registerName("setIdentifier:");
+public static final int sel_systemLocale = sel_registerName("systemLocale");
+public static final int sel_rulerView_1didMoveMarker_1 = sel_registerName("rulerView:didMoveMarker:");
+public static final int sel_serviceConnectionWithName_1rootObject_1 = sel_registerName("serviceConnectionWithName:rootObject:");
+public static final int sel_mouseDownCanMoveWindow = sel_registerName("mouseDownCanMoveWindow");
+public static final int sel_setMode_1 = sel_registerName("setMode:");
+public static final int sel_rectOfTickMarkAtIndex_1 = sel_registerName("rectOfTickMarkAtIndex:");
+public static final int sel_rangeOfCharacterFromSet_1 = sel_registerName("rangeOfCharacterFromSet:");
+public static final int sel_pageUp_1 = sel_registerName("pageUp:");
+public static final int sel_sendsWholeSearchString = sel_registerName("sendsWholeSearchString");
+public static final int sel_selectColumnIndexes_1byExtendingSelection_1 = sel_registerName("selectColumnIndexes:byExtendingSelection:");
+public static final int sel_localizedCaseInsensitiveCompare_1 = sel_registerName("localizedCaseInsensitiveCompare:");
+public static final int sel_isEqualToString_1 = sel_registerName("isEqualToString:");
+public static final int sel_invalidateHashMarks = sel_registerName("invalidateHashMarks");
+public static final int sel_setInitialKey_1 = sel_registerName("setInitialKey:");
+public static final int sel_setDividerStyle_1 = sel_registerName("setDividerStyle:");
+public static final int sel_expressionForMinusSet_1with_1 = sel_registerName("expressionForMinusSet:with:");
+public static final int sel_netService_1didNotPublish_1 = sel_registerName("netService:didNotPublish:");
+public static final int sel_evaluatedReceivers = sel_registerName("evaluatedReceivers");
+public static final int sel_removeTabViewItem_1 = sel_registerName("removeTabViewItem:");
+public static final int sel_initWithContainerClassDescription_1containerSpecifier_1key_1index_1 = sel_registerName("initWithContainerClassDescription:containerSpecifier:key:index:");
+public static final int sel_predicateWithLeftExpression_1rightExpression_1customSelector_1 = sel_registerName("predicateWithLeftExpression:rightExpression:customSelector:");
+public static final int sel_brownColor = sel_registerName("brownColor");
+public static final int sel_leafKeyPathForNode_1 = sel_registerName("leafKeyPathForNode:");
+public static final int sel_drawBackgroundForGlyphRange_1atPoint_1 = sel_registerName("drawBackgroundForGlyphRange:atPoint:");
+public static final int sel_rulerView_1willSetClientView_1 = sel_registerName("rulerView:willSetClientView:");
+public static final int sel_className = sel_registerName("className");
+public static final int sel_runMode_1beforeDate_1 = sel_registerName("runMode:beforeDate:");
+public static final int sel_applicationShouldTerminateAfterLastWindowClosed_1 = sel_registerName("applicationShouldTerminateAfterLastWindowClosed:");
+public static final int sel_newDocument_1 = sel_registerName("newDocument:");
+public static final int sel_arrayByAddingObject_1 = sel_registerName("arrayByAddingObject:");
+public static final int sel_savePanel = sel_registerName("savePanel");
+public static final int sel_prefersTrackingUntilMouseUp = sel_registerName("prefersTrackingUntilMouseUp");
+public static final int sel_setLocations_1startingGlyphIndexes_1count_1forGlyphRange_1 = sel_registerName("setLocations:startingGlyphIndexes:count:forGlyphRange:");
+public static final int sel_setListensInForegroundOnly_1 = sel_registerName("setListensInForegroundOnly:");
+public static final int sel_initWithUnsignedShort_1 = sel_registerName("initWithUnsignedShort:");
+public static final int sel_letterCharacterSet = sel_registerName("letterCharacterSet");
+public static final int sel_listensInForegroundOnly = sel_registerName("listensInForegroundOnly");
+public static final int sel_menu_1willHighlightItem_1 = sel_registerName("menu:willHighlightItem:");
+public static final int sel_charactersIgnoringModifiers = sel_registerName("charactersIgnoringModifiers");
+public static final int sel_insertionContainer = sel_registerName("insertionContainer");
+public static final int sel_searchButtonRectForBounds_1 = sel_registerName("searchButtonRectForBounds:");
+public static final int sel_accessibilitySetValue_1forAttribute_1 = sel_registerName("accessibilitySetValue:forAttribute:");
+public static final int sel_setPathSeparator_1 = sel_registerName("setPathSeparator:");
+public static final int sel_applicationWillResignActive_1 = sel_registerName("applicationWillResignActive:");
+public static final int sel_scriptingIsLessThanOrEqualTo_1 = sel_registerName("scriptingIsLessThanOrEqualTo:");
+public static final int sel_decodeValuesOfObjCTypes_1 = sel_registerName("decodeValuesOfObjCTypes:");
+public static final int sel_setIntercellSpacing_1 = sel_registerName("setIntercellSpacing:");
+public static final int sel_sharedSystemTypesetterForBehavior_1 = sel_registerName("sharedSystemTypesetterForBehavior:");
+public static final int sel_drawFromPoint_1toPoint_1options_1 = sel_registerName("drawFromPoint:toPoint:options:");
+public static final int sel_windowDidMove_1 = sel_registerName("windowDidMove:");
+public static final int sel_setVisible_1 = sel_registerName("setVisible:");
+public static final int sel_credentialWithUser_1password_1persistence_1 = sel_registerName("credentialWithUser:password:persistence:");
+public static final int sel_decomposedStringWithCanonicalMapping = sel_registerName("decomposedStringWithCanonicalMapping");
+public static final int sel_openFile_1withApplication_1andDeactivate_1 = sel_registerName("openFile:withApplication:andDeactivate:");
+public static final int sel_convertRectToBase_1 = sel_registerName("convertRectToBase:");
+public static final int sel_outputStreamToMemory = sel_registerName("outputStreamToMemory");
+public static final int sel_autorepeat = sel_registerName("autorepeat");
+public static final int sel_servicesMenu = sel_registerName("servicesMenu");
+public static final int sel_beginGrouping = sel_registerName("beginGrouping");
+public static final int sel_setNilValueForKey_1 = sel_registerName("setNilValueForKey:");
+public static final int sel_usesFontLeading = sel_registerName("usesFontLeading");
+public static final int sel_lineFragmentRectForGlyphAtIndex_1effectiveRange_1 = sel_registerName("lineFragmentRectForGlyphAtIndex:effectiveRange:");
+public static final int sel_takeStringValueFrom_1 = sel_registerName("takeStringValueFrom:");
+public static final int sel_fontDescriptorByAddingAttributes_1 = sel_registerName("fontDescriptorByAddingAttributes:");
+public static final int sel_startTrackingAt_1inView_1 = sel_registerName("startTrackingAt:inView:");
+public static final int sel_application_1delegateHandlesKey_1 = sel_registerName("application:delegateHandlesKey:");
+public static final int sel_stringByExpandingTildeInPath = sel_registerName("stringByExpandingTildeInPath");
+public static final int sel_menu = sel_registerName("menu");
+public static final int sel_setMinute_1 = sel_registerName("setMinute:");
+public static final int sel_startSubelementIdentifier = sel_registerName("startSubelementIdentifier");
+public static final int sel_waitForDataInBackgroundAndNotifyForModes_1 = sel_registerName("waitForDataInBackgroundAndNotifyForModes:");
+public static final int sel_removeCachedResponseForRequest_1 = sel_registerName("removeCachedResponseForRequest:");
+public static final int sel_attributeForLocalName_1URI_1 = sel_registerName("attributeForLocalName:URI:");
+public static final int sel_saveDocumentAs_1 = sel_registerName("saveDocumentAs:");
+public static final int sel_containerIsObjectBeingTested = sel_registerName("containerIsObjectBeingTested");
+public static final int sel_mouseDownOnCharacterIndex_1atCoordinate_1withModifier_1client_1 = sel_registerName("mouseDownOnCharacterIndex:atCoordinate:withModifier:client:");
+public static final int sel_setPosition_1ofDividerAtIndex_1 = sel_registerName("setPosition:ofDividerAtIndex:");
+public static final int sel_terminationStatus = sel_registerName("terminationStatus");
+public static final int sel_imageWidth = sel_registerName("imageWidth");
+public static final int sel_accessoryView = sel_registerName("accessoryView");
+public static final int sel_outlineView_1shouldTrackCell_1forTableColumn_1item_1 = sel_registerName("outlineView:shouldTrackCell:forTableColumn:item:");
+public static final int sel_initWithLevelIndicatorStyle_1 = sel_registerName("initWithLevelIndicatorStyle:");
+public static final int sel_deltaX = sel_registerName("deltaX");
+public static final int sel_valueForUndefinedKey_1 = sel_registerName("valueForUndefinedKey:");
+public static final int sel_mainDocumentURL = sel_registerName("mainDocumentURL");
+public static final int sel_position = sel_registerName("position");
+public static final int sel_animates = sel_registerName("animates");
+public static final int sel_addTabViewItem_1 = sel_registerName("addTabViewItem:");
+public static final int sel_unlockFocus = sel_registerName("unlockFocus");
+public static final int sel_download_1didCreateDestination_1 = sel_registerName("download:didCreateDestination:");
+public static final int sel_defaults = sel_registerName("defaults");
+public static final int sel_viewWillDraw = sel_registerName("viewWillDraw");
+public static final int sel_findApplications = sel_registerName("findApplications");
+public static final int sel_unbind_1 = sel_registerName("unbind:");
+public static final int sel_positionOfGlyph_1withRelation_1toBaseGlyph_1totalAdvancement_1metricsExist_1 = sel_registerName("positionOfGlyph:withRelation:toBaseGlyph:totalAdvancement:metricsExist:");
+public static final int sel_isGreaterThan_1 = sel_registerName("isGreaterThan:");
+public static final int sel_dataWithPDFInsideRect_1 = sel_registerName("dataWithPDFInsideRect:");
+public static final int sel_setAttributedTitle_1 = sel_registerName("setAttributedTitle:");
+public static final int sel_expressionType = sel_registerName("expressionType");
+public static final int sel_tokenFieldCell_1shouldAddObjects_1atIndex_1 = sel_registerName("tokenFieldCell:shouldAddObjects:atIndex:");
+public static final int sel_removeEventHandlerForEventClass_1andEventID_1 = sel_registerName("removeEventHandlerForEventClass:andEventID:");
+public static final int sel_postNotification_1 = sel_registerName("postNotification:");
+public static final int sel_indexOfTabViewItem_1 = sel_registerName("indexOfTabViewItem:");
+public static final int sel_outlineView_1shouldSelectItem_1 = sel_registerName("outlineView:shouldSelectItem:");
+public static final int sel_setSegmentStyle_1 = sel_registerName("setSegmentStyle:");
+public static final int sel_stateImageRectForBounds_1 = sel_registerName("stateImageRectForBounds:");
+public static final int sel_setContentAspectRatio_1 = sel_registerName("setContentAspectRatio:");
+public static final int sel_instantiateNibWithOwner_1topLevelObjects_1 = sel_registerName("instantiateNibWithOwner:topLevelObjects:");
+public static final int sel_setPrototype_1 = sel_registerName("setPrototype:");
+public static final int sel_allowsMultipleSelection = sel_registerName("allowsMultipleSelection");
+public static final int sel_setRecentSearches_1 = sel_registerName("setRecentSearches:");
+public static final int sel_setTypingAttributes_1 = sel_registerName("setTypingAttributes:");
+public static final int sel_observeValueForKeyPath_1ofObject_1change_1context_1 = sel_registerName("observeValueForKeyPath:ofObject:change:context:");
+public static final int sel_performDragOperation_1 = sel_registerName("performDragOperation:");
+public static final int sel_processingInstructionWithName_1stringValue_1 = sel_registerName("processingInstructionWithName:stringValue:");
+public static final int sel_initWithKind_1options_1 = sel_registerName("initWithKind:options:");
+public static final int sel_instancesRespondToSelector_1 = sel_registerName("instancesRespondToSelector:");
+public static final int sel_keyEquivalentFont = sel_registerName("keyEquivalentFont");
+public static final int sel_calendarIdentifier = sel_registerName("calendarIdentifier");
+public static final int sel_source = sel_registerName("source");
+public static final int sel_shouldBeTreatedAsInkEvent_1 = sel_registerName("shouldBeTreatedAsInkEvent:");
+public static final int sel_queuePriority = sel_registerName("queuePriority");
+public static final int sel_autoresizesAllColumnsToFit = sel_registerName("autoresizesAllColumnsToFit");
+public static final int sel_outlineView_1shouldCollapseItem_1 = sel_registerName("outlineView:shouldCollapseItem:");
+public static final int sel_dragImage_1at_1offset_1event_1pasteboard_1source_1slideBack_1 = sel_registerName("dragImage:at:offset:event:pasteboard:source:slideBack:");
+public static final int sel_sender = sel_registerName("sender");
+public static final int sel_numberOfColumns = sel_registerName("numberOfColumns");
+public static final int sel_indexPathWithIndex_1 = sel_registerName("indexPathWithIndex:");
+public static final int sel_setPreferredFontNames_1 = sel_registerName("setPreferredFontNames:");
+public static final int sel_windowDidEndSheet_1 = sel_registerName("windowDidEndSheet:");
+public static final int sel_capHeight = sel_registerName("capHeight");
+public static final int sel_matchingFontDescriptorWithMandatoryKeys_1 = sel_registerName("matchingFontDescriptorWithMandatoryKeys:");
+public static final int sel_finalize = sel_registerName("finalize");
+public static final int sel_prepareForDragOperation_1 = sel_registerName("prepareForDragOperation:");
+public static final int sel_setCellAttribute_1to_1 = sel_registerName("setCellAttribute:to:");
+public static final int sel_metadataQuery_1replacementValueForAttribute_1value_1 = sel_registerName("metadataQuery:replacementValueForAttribute:value:");
+public static final int sel_hueComponent = sel_registerName("hueComponent");
+public static final int sel_maxValue = sel_registerName("maxValue");
+public static final int sel_soundUnfilteredTypes = sel_registerName("soundUnfilteredTypes");
+public static final int sel_setFileAttributes_1 = sel_registerName("setFileAttributes:");
+public static final int sel_valueLists = sel_registerName("valueLists");
+public static final int sel_breakLock = sel_registerName("breakLock");
+public static final int sel_selectCellWithTag_1 = sel_registerName("selectCellWithTag:");
+public static final int sel_setMovable_1 = sel_registerName("setMovable:");
+public static final int sel_synchronizeFile = sel_registerName("synchronizeFile");
+public static final int sel_setVerticallyResizable_1 = sel_registerName("setVerticallyResizable:");
+public static final int sel_setButtonBordered_1 = sel_registerName("setButtonBordered:");
+public static final int sel_useOptimizedDrawing_1 = sel_registerName("useOptimizedDrawing:");
+public static final int sel_tryLockWhenCondition_1 = sel_registerName("tryLockWhenCondition:");
+public static final int sel_textContainer = sel_registerName("textContainer");
+public static final int sel_setValueListAttributes_1 = sel_registerName("setValueListAttributes:");
+public static final int sel_rangeOfCharacterFromSet_1options_1 = sel_registerName("rangeOfCharacterFromSet:options:");
+public static final int sel_dragFile_1fromRect_1slideBack_1event_1 = sel_registerName("dragFile:fromRect:slideBack:event:");
+public static final int sel_tickMarkPosition = sel_registerName("tickMarkPosition");
+public static final int sel_addRunLoop_1 = sel_registerName("addRunLoop:");
+public static final int sel_dataWithCapacity_1 = sel_registerName("dataWithCapacity:");
+public static final int sel_removeVolatileDomainForName_1 = sel_registerName("removeVolatileDomainForName:");
+public static final int sel_signal = sel_registerName("signal");
+public static final int sel_progressMarks = sel_registerName("progressMarks");
+public static final int sel_unhide_1 = sel_registerName("unhide:");
+public static final int sel_provideNewButtonImage = sel_registerName("provideNewButtonImage");
+public static final int sel_connectionWithRegisteredName_1host_1usingNameServer_1 = sel_registerName("connectionWithRegisteredName:host:usingNameServer:");
+public static final int sel_localizesFormat = sel_registerName("localizesFormat");
+public static final int sel_lineScroll = sel_registerName("lineScroll");
+public static final int sel_initDirectoryWithFileWrappers_1 = sel_registerName("initDirectoryWithFileWrappers:");
+public static final int sel_wantsToInterpretAllKeystrokes = sel_registerName("wantsToInterpretAllKeystrokes");
+public static final int sel_convertPointToBase_1 = sel_registerName("convertPointToBase:");
+public static final int sel_keyWithAppleEventCode_1 = sel_registerName("keyWithAppleEventCode:");
+public static final int sel_loadSuiteWithDictionary_1fromBundle_1 = sel_registerName("loadSuiteWithDictionary:fromBundle:");
+public static final int sel_automaticallyPreparesContent = sel_registerName("automaticallyPreparesContent");
+public static final int sel_cornerRadius = sel_registerName("cornerRadius");
+public static final int sel_sharedScriptExecutionContext = sel_registerName("sharedScriptExecutionContext");
+public static final int sel_setPoolCountHighWaterResolution_1 = sel_registerName("setPoolCountHighWaterResolution:");
+public static final int sel_appendBezierPath_1 = sel_registerName("appendBezierPath:");
+public static final int sel_appleEventClassCode = sel_registerName("appleEventClassCode");
+public static final int sel_initTextCell_1pullsDown_1 = sel_registerName("initTextCell:pullsDown:");
+public static final int sel_numberOfTickMarks = sel_registerName("numberOfTickMarks");
+public static final int sel_setIndependentConversationQueueing_1 = sel_registerName("setIndependentConversationQueueing:");
+public static final int sel_extendPowerOffBy_1 = sel_registerName("extendPowerOffBy:");
+public static final int sel_isCollecting = sel_registerName("isCollecting");
+public static final int sel_canInsert = sel_registerName("canInsert");
+public static final int sel_valuePointerFunctions = sel_registerName("valuePointerFunctions");
+public static final int sel_sizeValue = sel_registerName("sizeValue");
+public static final int sel_openOnEdge_1 = sel_registerName("openOnEdge:");
+public static final int sel_rectOfItemAtIndex_1 = sel_registerName("rectOfItemAtIndex:");
+public static final int sel_booleanForKey_1inTable_1 = sel_registerName("booleanForKey:inTable:");
+public static final int sel_showHelp_1 = sel_registerName("showHelp:");
+public static final int sel_heightTracksTextView = sel_registerName("heightTracksTextView");
+public static final int sel_hasTitleBar = sel_registerName("hasTitleBar");
+public static final int sel_setViewAnimations_1 = sel_registerName("setViewAnimations:");
+public static final int sel_updateSpellingPanelWithGrammarString_1detail_1 = sel_registerName("updateSpellingPanelWithGrammarString:detail:");
+public static final int sel_showsToolbarButton = sel_registerName("showsToolbarButton");
+public static final int sel_environment = sel_registerName("environment");
+public static final int sel_matchesAppleEventCode_1 = sel_registerName("matchesAppleEventCode:");
+public static final int sel_hasPrefix_1 = sel_registerName("hasPrefix:");
+public static final int sel_hasUnappliedChanges = sel_registerName("hasUnappliedChanges");
+public static final int sel_setName_1 = sel_registerName("setName:");
+public static final int sel_isMovableByWindowBackground = sel_registerName("isMovableByWindowBackground");
+public static final int sel_printerNames = sel_registerName("printerNames");
+public static final int sel_initWithDictionary_1 = sel_registerName("initWithDictionary:");
+public static final int sel_stringByStandardizingPath = sel_registerName("stringByStandardizingPath");
+public static final int sel_usesUserKeyEquivalents = sel_registerName("usesUserKeyEquivalents");
+public static final int sel_drawStateImageWithFrame_1inView_1 = sel_registerName("drawStateImageWithFrame:inView:");
+public static final int sel_openUntitledDocumentAndDisplay_1error_1 = sel_registerName("openUntitledDocumentAndDisplay:error:");
+public static final int sel_lastVisibleColumn = sel_registerName("lastVisibleColumn");
+public static final int sel_paste_1 = sel_registerName("paste:");
+public static final int sel_indexOfItemWithRepresentedObject_1 = sel_registerName("indexOfItemWithRepresentedObject:");
+public static final int sel_supportsCommand_1 = sel_registerName("supportsCommand:");
+public static final int sel_scrollPageUp_1 = sel_registerName("scrollPageUp:");
+public static final int sel_draggedImage_1endedAt_1deposited_1 = sel_registerName("draggedImage:endedAt:deposited:");
+public static final int sel_setPositiveInfinitySymbol_1 = sel_registerName("setPositiveInfinitySymbol:");
+public static final int sel_noteFileSystemChanged_1 = sel_registerName("noteFileSystemChanged:");
+public static final int sel_moveRight_1 = sel_registerName("moveRight:");
+public static final int sel_arrowPosition = sel_registerName("arrowPosition");
+public static final int sel_setMenuRepresentation_1 = sel_registerName("setMenuRepresentation:");
+public static final int sel_endLoadInBackground = sel_registerName("endLoadInBackground");
+public static final int sel_smartInsertBeforeStringForString_1replacingRange_1 = sel_registerName("smartInsertBeforeStringForString:replacingRange:");
+public static final int sel_openUntitledDocumentOfType_1display_1 = sel_registerName("openUntitledDocumentOfType:display:");
+public static final int sel_scriptingValueForSpecifier_1 = sel_registerName("scriptingValueForSpecifier:");
+public static final int sel_setShowsSuppressionButton_1 = sel_registerName("setShowsSuppressionButton:");
+public static final int sel_resizeLeftCursor = sel_registerName("resizeLeftCursor");
+public static final int sel_setDefaultCredential_1forProtectionSpace_1 = sel_registerName("setDefaultCredential:forProtectionSpace:");
+public static final int sel_systemTabletID = sel_registerName("systemTabletID");
+public static final int sel_unlock = sel_registerName("unlock");
+public static final int sel_mostCompatibleStringEncoding = sel_registerName("mostCompatibleStringEncoding");
+public static final int sel_glyphName = sel_registerName("glyphName");
+public static final int sel_center = sel_registerName("center");
+public static final int sel_setJobTitle_1 = sel_registerName("setJobTitle:");
+public static final int sel_cancelButtonCell = sel_registerName("cancelButtonCell");
+public static final int sel_namespaceForPrefix_1 = sel_registerName("namespaceForPrefix:");
+public static final int sel_browserWillScroll_1 = sel_registerName("browserWillScroll:");
+public static final int sel_initWithCompoundTypes_1 = sel_registerName("initWithCompoundTypes:");
+public static final int sel_setPaddingCharacter_1 = sel_registerName("setPaddingCharacter:");
+public static final int sel_image_1willLoadRepresentation_1 = sel_registerName("image:willLoadRepresentation:");
+public static final int sel_pasteRuler_1 = sel_registerName("pasteRuler:");
+public static final int sel_drawGlyphsForGlyphRange_1atPoint_1 = sel_registerName("drawGlyphsForGlyphRange:atPoint:");
+public static final int sel_PMPrintSession = sel_registerName("PMPrintSession");
+public static final int sel_setDefaultButtonCell_1 = sel_registerName("setDefaultButtonCell:");
+public static final int sel_printerTypes = sel_registerName("printerTypes");
+public static final int sel_findString_1inBook_1 = sel_registerName("findString:inBook:");
+public static final int sel_executablePath = sel_registerName("executablePath");
+public static final int sel_components_1fromDate_1toDate_1options_1 = sel_registerName("components:fromDate:toDate:options:");
+public static final int sel_displayValuesForRow_1 = sel_registerName("displayValuesForRow:");
+public static final int sel_pageLayout = sel_registerName("pageLayout");
+public static final int sel_resizeFlags = sel_registerName("resizeFlags");
+public static final int sel_DTDNodeWithXMLString_1 = sel_registerName("DTDNodeWithXMLString:");
+public static final int sel_replyToOpenOrPrint_1 = sel_registerName("replyToOpenOrPrint:");
+public static final int sel_insertTab_1 = sel_registerName("insertTab:");
+public static final int sel_documents = sel_registerName("documents");
+public static final int sel_tagForSegment_1 = sel_registerName("tagForSegment:");
+public static final int sel_initForURL_1withContentsOfURL_1ofType_1error_1 = sel_registerName("initForURL:withContentsOfURL:ofType:error:");
+public static final int sel_initWithRoundingMode_1scale_1raiseOnExactness_1raiseOnOverflow_1raiseOnUnderflow_1raiseOnDivideByZero_1 = sel_registerName("initWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero:");
+public static final int sel_addIndexes_1 = sel_registerName("addIndexes:");
+public static final int sel_setAttributeRuns_1 = sel_registerName("setAttributeRuns:");
+public static final int sel_splitView_1additionalEffectiveRectOfDividerAtIndex_1 = sel_registerName("splitView:additionalEffectiveRectOfDividerAtIndex:");
+public static final int sel_writeSelectionToPasteboard_1type_1 = sel_registerName("writeSelectionToPasteboard:type:");
+public static final int sel_day = sel_registerName("day");
+public static final int sel_numberOfRowsInTableView_1 = sel_registerName("numberOfRowsInTableView:");
+public static final int sel_insertCompletion_1forPartialWordRange_1movement_1isFinal_1 = sel_registerName("insertCompletion:forPartialWordRange:movement:isFinal:");
+public static final int sel_notPredicateWithSubpredicate_1 = sel_registerName("notPredicateWithSubpredicate:");
+public static final int sel_rootProxyForConnectionWithRegisteredName_1host_1 = sel_registerName("rootProxyForConnectionWithRegisteredName:host:");
+public static final int sel_stopSpeakingAtBoundary_1 = sel_registerName("stopSpeakingAtBoundary:");
+public static final int sel_pathsMatchingExtensions_1 = sel_registerName("pathsMatchingExtensions:");
+public static final int sel_caseInsensitiveCompare_1 = sel_registerName("caseInsensitiveCompare:");
+public static final int sel_labelFontOfSize_1 = sel_registerName("labelFontOfSize:");
+public static final int sel_createDirectoryAtPath_1attributes_1 = sel_registerName("createDirectoryAtPath:attributes:");
+public static final int sel_initListDescriptor = sel_registerName("initListDescriptor");
+public static final int sel_setParagraphSpacing_1 = sel_registerName("setParagraphSpacing:");
+public static final int sel_getColor_1location_1atIndex_1 = sel_registerName("getColor:location:atIndex:");
+public static final int sel_pointerArrayWithOptions_1 = sel_registerName("pointerArrayWithOptions:");
+public static final int sel_guessesForWord_1 = sel_registerName("guessesForWord:");
+public static final int sel_searchTextRectForBounds_1 = sel_registerName("searchTextRectForBounds:");
+public static final int sel_allowsColumnReordering = sel_registerName("allowsColumnReordering");
+public static final int sel_isMainThread = sel_registerName("isMainThread");
+public static final int sel_accessibilityAttributeNames = sel_registerName("accessibilityAttributeNames");
+public static final int sel_saveOptions = sel_registerName("saveOptions");
+public static final int sel_setAutomaticallyPreparesContent_1 = sel_registerName("setAutomaticallyPreparesContent:");
+public static final int sel_setGridColor_1 = sel_registerName("setGridColor:");
+public static final int sel_textAttributesForNegativeInfinity = sel_registerName("textAttributesForNegativeInfinity");
+public static final int sel_decimalDigitCharacterSet = sel_registerName("decimalDigitCharacterSet");
+public static final int sel_removeObserver_1name_1object_1 = sel_registerName("removeObserver:name:object:");
+public static final int sel_columnContentWidthForColumnWidth_1 = sel_registerName("columnContentWidthForColumnWidth:");
+public static final int sel_wraps = sel_registerName("wraps");
+public static final int sel_getIndexes_1maxCount_1inIndexRange_1 = sel_registerName("getIndexes:maxCount:inIndexRange:");
+public static final int sel_doubleAction = sel_registerName("doubleAction");
+public static final int sel_layoutParagraphAtPoint_1 = sel_registerName("layoutParagraphAtPoint:");
+public static final int sel_cacheDisplayInRect_1toBitmapImageRep_1 = sel_registerName("cacheDisplayInRect:toBitmapImageRep:");
+public static final int sel_setUsesItemFromMenu_1 = sel_registerName("setUsesItemFromMenu:");
+public static final int sel_parserError = sel_registerName("parserError");
+public static final int sel_numberOfMajorTickMarks = sel_registerName("numberOfMajorTickMarks");
+public static final int sel_changeFont_1 = sel_registerName("changeFont:");
+public static final int sel_displaysWhenScreenProfileChanges = sel_registerName("displaysWhenScreenProfileChanges");
+public static final int sel_titleBaseWritingDirection = sel_registerName("titleBaseWritingDirection");
+public static final int sel_columnAtPoint_1 = sel_registerName("columnAtPoint:");
+public static final int sel_setAppliesImmediately_1 = sel_registerName("setAppliesImmediately:");
+public static final int sel_addAccessoryController_1 = sel_registerName("addAccessoryController:");
+public static final int sel_setEditable_1 = sel_registerName("setEditable:");
+public static final int sel_moveRulerlineFromLocation_1toLocation_1 = sel_registerName("moveRulerlineFromLocation:toLocation:");
+public static final int sel_runModal = sel_registerName("runModal");
+public static final int sel_selectionShouldChangeInTableView_1 = sel_registerName("selectionShouldChangeInTableView:");
+public static final int sel_dragSelectionWithEvent_1offset_1slideBack_1 = sel_registerName("dragSelectionWithEvent:offset:slideBack:");
+public static final int sel_rootProxy = sel_registerName("rootProxy");
+public static final int sel_brightnessComponent = sel_registerName("brightnessComponent");
+public static final int sel_setLabel_1forSegment_1 = sel_registerName("setLabel:forSegment:");
+public static final int sel_copy = sel_registerName("copy");
+public static final int sel_helpRequested_1 = sel_registerName("helpRequested:");
+public static final int sel_setThreadPriority_1 = sel_registerName("setThreadPriority:");
+public static final int sel_minContentSize = sel_registerName("minContentSize");
+public static final int sel_setShowsProgressPanel_1 = sel_registerName("setShowsProgressPanel:");
+public static final int sel_setMessageText_1 = sel_registerName("setMessageText:");
+public static final int sel_setLayoutAlgorithm_1 = sel_registerName("setLayoutAlgorithm:");
+public static final int sel_setInContext_1 = sel_registerName("setInContext:");
+public static final int sel_resultCount = sel_registerName("resultCount");
+public static final int sel_usesDataSource = sel_registerName("usesDataSource");
+public static final int sel_textLists = sel_registerName("textLists");
+public static final int sel_setSelectedRange_1affinity_1stillSelecting_1 = sel_registerName("setSelectedRange:affinity:stillSelecting:");
+public static final int sel_shouldResolveExternalEntities = sel_registerName("shouldResolveExternalEntities");
+public static final int sel_clientView = sel_registerName("clientView");
+public static final int sel_styleMask = sel_registerName("styleMask");
+public static final int sel_setCurrencyCode_1 = sel_registerName("setCurrencyCode:");
+public static final int sel_methodReturnType = sel_registerName("methodReturnType");
+public static final int sel_dataUsingEncoding_1 = sel_registerName("dataUsingEncoding:");
+public static final int sel_removeTabStop_1 = sel_registerName("removeTabStop:");
+public static final int sel_reloadItem_1reloadChildren_1 = sel_registerName("reloadItem:reloadChildren:");
+public static final int sel_ancestorSharedWithView_1 = sel_registerName("ancestorSharedWithView:");
+public static final int sel_indexLessThanOrEqualToIndex_1 = sel_registerName("indexLessThanOrEqualToIndex:");
+public static final int sel_removeAllActionsWithTarget_1 = sel_registerName("removeAllActionsWithTarget:");
+public static final int sel_subtype = sel_registerName("subtype");
+public static final int sel_imageRectForPaper_1 = sel_registerName("imageRectForPaper:");
+public static final int sel_initWithWindow_1rect_1 = sel_registerName("initWithWindow:rect:");
+public static final int sel_enable = sel_registerName("enable");
+public static final int sel_scanInteger_1 = sel_registerName("scanInteger:");
+public static final int sel_initWithContentsOfURL_1encoding_1error_1 = sel_registerName("initWithContentsOfURL:encoding:error:");
+public static final int sel_removeObjectIdenticalTo_1 = sel_registerName("removeObjectIdenticalTo:");
+public static final int sel_createTexture_1fromView_1internalFormat_1 = sel_registerName("createTexture:fromView:internalFormat:");
+public static final int sel_decimalNumberByRaisingToPower_1withBehavior_1 = sel_registerName("decimalNumberByRaisingToPower:withBehavior:");
+public static final int sel_appendBezierPathWithArcWithCenter_1radius_1startAngle_1endAngle_1 = sel_registerName("appendBezierPathWithArcWithCenter:radius:startAngle:endAngle:");
+public static final int sel_fontPanel_1 = sel_registerName("fontPanel:");
+public static final int sel_predicateWithSubpredicates_1 = sel_registerName("predicateWithSubpredicates:");
+public static final int sel_layoutGlyphsInLayoutManager_1startingAtGlyphIndex_1maxNumberOfLineFragments_1nextGlyphIndex_1 = sel_registerName("layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:");
+public static final int sel_attributes = sel_registerName("attributes");
+public static final int sel_EPSOperationWithView_1insideRect_1toData_1 = sel_registerName("EPSOperationWithView:insideRect:toData:");
+public static final int sel_listOptions = sel_registerName("listOptions");
+public static final int sel_windowWillLoad = sel_registerName("windowWillLoad");
+public static final int sel_alwaysShowsDecimalSeparator = sel_registerName("alwaysShowsDecimalSeparator");
+public static final int sel_replyToApplicationShouldTerminate_1 = sel_registerName("replyToApplicationShouldTerminate:");
+public static final int sel_setThousandSeparator_1 = sel_registerName("setThousandSeparator:");
+public static final int sel_insertObject_1atArrangedObjectIndexPath_1 = sel_registerName("insertObject:atArrangedObjectIndexPath:");
+public static final int sel_cleanUpOperation = sel_registerName("cleanUpOperation");
+public static final int sel_trackMouse_1inRect_1ofView_1untilMouseUp_1 = sel_registerName("trackMouse:inRect:ofView:untilMouseUp:");
+public static final int sel_replaceLayoutManager_1 = sel_registerName("replaceLayoutManager:");
+public static final int sel_isPartialStringValid_1proposedSelectedRange_1originalString_1originalSelectedRange_1errorDescription_1 = sel_registerName("isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:");
+public static final int sel_setNegativeFormat_1 = sel_registerName("setNegativeFormat:");
+public static final int sel_copyFont_1 = sel_registerName("copyFont:");
+public static final int sel_outlineView_1sortDescriptorsDidChange_1 = sel_registerName("outlineView:sortDescriptorsDidChange:");
+public static final int sel_stringWithString_1 = sel_registerName("stringWithString:");
+public static final int sel_valueWithUniqueID_1inPropertyWithKey_1 = sel_registerName("valueWithUniqueID:inPropertyWithKey:");
+public static final int sel_setHighlightsBy_1 = sel_registerName("setHighlightsBy:");
+public static final int sel_setContinuousSpellCheckingEnabled_1 = sel_registerName("setContinuousSpellCheckingEnabled:");
+public static final int sel_isMouseCoalescingEnabled = sel_registerName("isMouseCoalescingEnabled");
+public static final int sel_numberOfSelectedColumns = sel_registerName("numberOfSelectedColumns");
+public static final int sel_spellServer_1findMisspelledWordInString_1language_1wordCount_1countOnly_1 = sel_registerName("spellServer:findMisspelledWordInString:language:wordCount:countOnly:");
+public static final int sel_PMPageFormat = sel_registerName("PMPageFormat");
+public static final int sel_insertText_1client_1 = sel_registerName("insertText:client:");
+public static final int sel_numberWithFloat_1 = sel_registerName("numberWithFloat:");
+public static final int sel_compositeToPoint_1fromRect_1operation_1 = sel_registerName("compositeToPoint:fromRect:operation:");
+public static final int sel_numberOfPlanes = sel_registerName("numberOfPlanes");
+public static final int sel_childrenKeyPath = sel_registerName("childrenKeyPath");
+public static final int sel_countForObject_1 = sel_registerName("countForObject:");
+public static final int sel_fontWithName_1matrix_1 = sel_registerName("fontWithName:matrix:");
+public static final int sel_toolbarAllowedItemIdentifiers_1 = sel_registerName("toolbarAllowedItemIdentifiers:");
+public static final int sel_makeDocumentWithContentsOfURL_1ofType_1 = sel_registerName("makeDocumentWithContentsOfURL:ofType:");
+public static final int sel_initWithHTML_1options_1documentAttributes_1 = sel_registerName("initWithHTML:options:documentAttributes:");
+public static final int sel_fileSystemRepresentation = sel_registerName("fileSystemRepresentation");
+public static final int sel_viewAnimations = sel_registerName("viewAnimations");
+public static final int sel_tabletProximity_1 = sel_registerName("tabletProximity:");
+public static final int sel_replacementClassForClass_1 = sel_registerName("replacementClassForClass:");
+public static final int sel_columnWidthForColumnContentWidth_1 = sel_registerName("columnWidthForColumnContentWidth:");
+public static final int sel_undoMenuItemTitle = sel_registerName("undoMenuItemTitle");
+public static final int sel_expressionForAggregate_1 = sel_registerName("expressionForAggregate:");
+public static final int sel_useStoredAccessor = sel_registerName("useStoredAccessor");
+public static final int sel_ensureAttributesAreFixedInRange_1 = sel_registerName("ensureAttributesAreFixedInRange:");
+public static final int sel_stringForType_1 = sel_registerName("stringForType:");
+public static final int sel_setLeaf_1 = sel_registerName("setLeaf:");
+public static final int sel_URLFromPasteboard_1 = sel_registerName("URLFromPasteboard:");
+public static final int sel_initWithURL_1byReference_1 = sel_registerName("initWithURL:byReference:");
+public static final int sel_readToEndOfFileInBackgroundAndNotify = sel_registerName("readToEndOfFileInBackgroundAndNotify");
+public static final int sel_application_1openFileWithoutUI_1 = sel_registerName("application:openFileWithoutUI:");
+public static final int sel_performClick_1 = sel_registerName("performClick:");
+public static final int sel_completes = sel_registerName("completes");
+public static final int sel_setRulersVisible_1 = sel_registerName("setRulersVisible:");
+public static final int sel_minimumSize = sel_registerName("minimumSize");
+public static final int sel_setProperty_1forKey_1inRequest_1 = sel_registerName("setProperty:forKey:inRequest:");
+public static final int sel_isCopyingOperation = sel_registerName("isCopyingOperation");
+public static final int sel_allowsTickMarkValuesOnly = sel_registerName("allowsTickMarkValuesOnly");
+public static final int sel_insertGlyphs_1length_1forStartingGlyphAtIndex_1characterIndex_1 = sel_registerName("insertGlyphs:length:forStartingGlyphAtIndex:characterIndex:");
+public static final int sel_convertFont_1 = sel_registerName("convertFont:");
+public static final int sel_setNegativePrefix_1 = sel_registerName("setNegativePrefix:");
+public static final int sel_dispatch = sel_registerName("dispatch");
+public static final int sel_makeNewConnection_1sender_1 = sel_registerName("makeNewConnection:sender:");
+public static final int sel_writeToFile_1atomically_1encoding_1error_1 = sel_registerName("writeToFile:atomically:encoding:error:");
+public static final int sel_isHiddenOrHasHiddenAncestor = sel_registerName("isHiddenOrHasHiddenAncestor");
+public static final int sel_endEditingFor_1 = sel_registerName("endEditingFor:");
+public static final int sel_acceptConnectionInBackgroundAndNotify = sel_registerName("acceptConnectionInBackgroundAndNotify");
+public static final int sel_setValue_1forHTTPHeaderField_1 = sel_registerName("setValue:forHTTPHeaderField:");
+public static final int sel_intersectSet_1 = sel_registerName("intersectSet:");
+public static final int sel_tabView_1shouldSelectTabViewItem_1 = sel_registerName("tabView:shouldSelectTabViewItem:");
+public static final int sel_mouseDragged_1 = sel_registerName("mouseDragged:");
+public static final int sel_dataFromRange_1documentAttributes_1error_1 = sel_registerName("dataFromRange:documentAttributes:error:");
+public static final int sel_sharedFrameworksPath = sel_registerName("sharedFrameworksPath");
+public static final int sel_tableView_1writeRowsWithIndexes_1toPasteboard_1 = sel_registerName("tableView:writeRowsWithIndexes:toPasteboard:");
+public static final int sel_setWindowFrameForAttachingToRect_1onScreen_1preferredEdge_1popUpSelectedItem_1 = sel_registerName("setWindowFrameForAttachingToRect:onScreen:preferredEdge:popUpSelectedItem:");
+public static final int sel_valueAtIndex_1inPropertyWithKey_1 = sel_registerName("valueAtIndex:inPropertyWithKey:");
+public static final int sel_setDisplaysLinkToolTips_1 = sel_registerName("setDisplaysLinkToolTips:");
+public static final int sel_removeObserver_1forKeyPath_1 = sel_registerName("removeObserver:forKeyPath:");
+public static final int sel_hasAlpha = sel_registerName("hasAlpha");
+public static final int sel_scrollCellToVisibleAtRow_1column_1 = sel_registerName("scrollCellToVisibleAtRow:column:");
+public static final int sel_activateIgnoringOtherApps_1 = sel_registerName("activateIgnoringOtherApps:");
+public static final int sel_getArgumentTypeAtIndex_1 = sel_registerName("getArgumentTypeAtIndex:");
+public static final int sel_textShouldEndEditing_1 = sel_registerName("textShouldEndEditing:");
+public static final int sel_nextEventMatchingMask_1untilDate_1inMode_1dequeue_1 = sel_registerName("nextEventMatchingMask:untilDate:inMode:dequeue:");
+public static final int sel_timeIntervalSince1970 = sel_registerName("timeIntervalSince1970");
+public static final int sel_decimalNumberBySubtracting_1 = sel_registerName("decimalNumberBySubtracting:");
+public static final int sel_sendBeforeDate_1 = sel_registerName("sendBeforeDate:");
+public static final int sel_autohidesScrollers = sel_registerName("autohidesScrollers");
+public static final int sel_controlPointBounds = sel_registerName("controlPointBounds");
+public static final int sel_setMinimumSignificantDigits_1 = sel_registerName("setMinimumSignificantDigits:");
+public static final int sel_setDestination_1allowOverwrite_1 = sel_registerName("setDestination:allowOverwrite:");
+public static final int sel_setTransparent_1 = sel_registerName("setTransparent:");
+public static final int sel_decodeArrayOfObjCType_1count_1at_1 = sel_registerName("decodeArrayOfObjCType:count:at:");
+public static final int sel_isMiniaturized = sel_registerName("isMiniaturized");
+public static final int sel_setAlignment_1 = sel_registerName("setAlignment:");
+public static final int sel_setCornerRadius_1 = sel_registerName("setCornerRadius:");
+public static final int sel_foregroundColor = sel_registerName("foregroundColor");
+public static final int sel_lineFragmentUsedRectForGlyphAtIndex_1effectiveRange_1 = sel_registerName("lineFragmentUsedRectForGlyphAtIndex:effectiveRange:");
+public static final int sel_attributedSubstringFromRange_1 = sel_registerName("attributedSubstringFromRange:");
+public static final int sel_isSubsetOfSet_1 = sel_registerName("isSubsetOfSet:");
+public static final int sel_iconForFileType_1 = sel_registerName("iconForFileType:");
+public static final int sel_readFromURL_1ofType_1 = sel_registerName("readFromURL:ofType:");
+public static final int sel_decodeBytesForKey_1returnedLength_1 = sel_registerName("decodeBytesForKey:returnedLength:");
+public static final int sel_parser_1foundInternalEntityDeclarationWithName_1value_1 = sel_registerName("parser:foundInternalEntityDeclarationWithName:value:");
+public static final int sel_commonPrefixWithString_1options_1 = sel_registerName("commonPrefixWithString:options:");
+public static final int sel_tableView_1setObjectValue_1forTableColumn_1row_1 = sel_registerName("tableView:setObjectValue:forTableColumn:row:");
+public static final int sel_fileWrapperRepresentationOfType_1 = sel_registerName("fileWrapperRepresentationOfType:");
+public static final int sel_representedFilename = sel_registerName("representedFilename");
+public static final int sel_eventWithCGEvent_1 = sel_registerName("eventWithCGEvent:");
+public static final int sel_setFileURL_1 = sel_registerName("setFileURL:");
+public static final int sel_loadWindow = sel_registerName("loadWindow");
+public static final int sel_defaultLineJoinStyle = sel_registerName("defaultLineJoinStyle");
+public static final int sel_backingLocation = sel_registerName("backingLocation");
+public static final int sel_matrix = sel_registerName("matrix");
+public static final int sel_isEqualToTimeZone_1 = sel_registerName("isEqualToTimeZone:");
+public static final int sel_statistics = sel_registerName("statistics");
+public static final int sel_launchAppWithBundleIdentifier_1options_1additionalEventParamDescriptor_1launchIdentifier_1 = sel_registerName("launchAppWithBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifier:");
+public static final int sel_isHorizontal = sel_registerName("isHorizontal");
+public static final int sel_launchPath = sel_registerName("launchPath");
+public static final int sel_setTextAlignment_1 = sel_registerName("setTextAlignment:");
+public static final int sel_initWithBitmapDataPlanes_1pixelsWide_1pixelsHigh_1bitsPerSample_1samplesPerPixel_1hasAlpha_1isPlanar_1colorSpaceName_1bytesPerRow_1bitsPerPixel_1 = sel_registerName("initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bytesPerRow:bitsPerPixel:");
+public static final int sel_setPatternPhase_1 = sel_registerName("setPatternPhase:");
+public static final int sel_mouseEntered_1withFrame_1inView_1 = sel_registerName("mouseEntered:withFrame:inView:");
+public static final int sel_matchingFontDescriptorsWithMandatoryKeys_1 = sel_registerName("matchingFontDescriptorsWithMandatoryKeys:");
+public static final int sel_objectDidEndEditing_1 = sel_registerName("objectDidEndEditing:");
+public static final int sel_setMaximum_1 = sel_registerName("setMaximum:");
+public static final int sel_initWithIndexes_1length_1 = sel_registerName("initWithIndexes:length:");
+public static final int sel_tableView_1shouldShowCellExpansionForTableColumn_1row_1 = sel_registerName("tableView:shouldShowCellExpansionForTableColumn:row:");
+public static final int sel_moveToPoint_1 = sel_registerName("moveToPoint:");
+public static final int sel_setGridStyleMask_1 = sel_registerName("setGridStyleMask:");
+public static final int sel_firstUnlaidGlyphIndex = sel_registerName("firstUnlaidGlyphIndex");
+public static final int sel_isProxy = sel_registerName("isProxy");
+public static final int sel_takeValue_1forKeyPath_1 = sel_registerName("takeValue:forKeyPath:");
+public static final int sel_drawCellAtRow_1column_1 = sel_registerName("drawCellAtRow:column:");
+public static final int sel_setRulerViewClass_1 = sel_registerName("setRulerViewClass:");
+public static final int sel_objectByApplyingXSLT_1arguments_1error_1 = sel_registerName("objectByApplyingXSLT:arguments:error:");
+public static final int sel_setArrowPosition_1 = sel_registerName("setArrowPosition:");
+public static final int sel_setCharacterIndex_1forGlyphAtIndex_1 = sel_registerName("setCharacterIndex:forGlyphAtIndex:");
+public static final int sel_willChangeValueForKey_1withSetMutation_1usingObjects_1 = sel_registerName("willChangeValueForKey:withSetMutation:usingObjects:");
+public static final int sel_setVerticalRulerView_1 = sel_registerName("setVerticalRulerView:");
+public static final int sel_suspendCurrentAppleEvent = sel_registerName("suspendCurrentAppleEvent");
+public static final int sel_drawStatusBarBackgroundInRect_1withHighlight_1 = sel_registerName("drawStatusBarBackgroundInRect:withHighlight:");
+public static final int sel_performClickWithFrame_1inView_1 = sel_registerName("performClickWithFrame:inView:");
+public static final int sel_coveredCharacterSet = sel_registerName("coveredCharacterSet");
+public static final int sel_browser_1numberOfRowsInColumn_1 = sel_registerName("browser:numberOfRowsInColumn:");
+public static final int sel_isLike_1 = sel_registerName("isLike:");
+public static final int sel_blackComponent = sel_registerName("blackComponent");
+public static final int sel_appendBezierPathWithGlyph_1inFont_1 = sel_registerName("appendBezierPathWithGlyph:inFont:");
+public static final int sel_validateMenuItem_1 = sel_registerName("validateMenuItem:");
+public static final int sel_isEqualToIndexSet_1 = sel_registerName("isEqualToIndexSet:");
+public static final int sel_setBezelStyle_1 = sel_registerName("setBezelStyle:");
+public static final int sel_scaleUnitSquareToSize_1 = sel_registerName("scaleUnitSquareToSize:");
+public static final int sel_setStartSubelementIndex_1 = sel_registerName("setStartSubelementIndex:");
+public static final int sel_frameOfInsideOfColumn_1 = sel_registerName("frameOfInsideOfColumn:");
+public static final int sel_setBlocksOtherRecognizers_1 = sel_registerName("setBlocksOtherRecognizers:");
+public static final int sel_setMinSize_1 = sel_registerName("setMinSize:");
+public static final int sel_setEndSubelementIndex_1 = sel_registerName("setEndSubelementIndex:");
+public static final int sel_cStringLength = sel_registerName("cStringLength");
+public static final int sel_writeWithBackupToFile_1ofType_1saveOperation_1 = sel_registerName("writeWithBackupToFile:ofType:saveOperation:");
+public static final int sel_setDefaultButtonTitle_1 = sel_registerName("setDefaultButtonTitle:");
+public static final int sel_setMinContentSize_1 = sel_registerName("setMinContentSize:");
+public static final int sel_setFormattingDictionary_1 = sel_registerName("setFormattingDictionary:");
+public static final int sel_boundingRectForFont = sel_registerName("boundingRectForFont");
+public static final int sel_postsBoundsChangedNotifications = sel_registerName("postsBoundsChangedNotifications");
+public static final int sel_setParagraphs_1 = sel_registerName("setParagraphs:");
+public static final int sel_setShowsControlCharacters_1 = sel_registerName("setShowsControlCharacters:");
+public static final int sel_writeSafelyToURL_1ofType_1forSaveOperation_1error_1 = sel_registerName("writeSafelyToURL:ofType:forSaveOperation:error:");
+public static final int sel_controlLightHighlightColor = sel_registerName("controlLightHighlightColor");
+public static final int sel_objectSpecifier = sel_registerName("objectSpecifier");
+public static final int sel_dictionaryWithContentsOfURL_1 = sel_registerName("dictionaryWithContentsOfURL:");
+public static final int sel_performSelector_1onThread_1withObject_1waitUntilDone_1modes_1 = sel_registerName("performSelector:onThread:withObject:waitUntilDone:modes:");
+public static final int sel_setJobStyleHint_1 = sel_registerName("setJobStyleHint:");
+public static final int sel_sortedArrayUsingFunction_1context_1 = sel_registerName("sortedArrayUsingFunction:context:");
+public static final int sel_setBoundsRect_1forTextBlock_1glyphRange_1 = sel_registerName("setBoundsRect:forTextBlock:glyphRange:");
+public static final int sel_hasShadow = sel_registerName("hasShadow");
+public static final int sel_windowShouldClose_1 = sel_registerName("windowShouldClose:");
+public static final int sel_defaultTokenizingCharacterSet = sel_registerName("defaultTokenizingCharacterSet");
+public static final int sel_isRulerVisible = sel_registerName("isRulerVisible");
+public static final int sel_setSubrowsKeyPath_1 = sel_registerName("setSubrowsKeyPath:");
+public static final int sel_animationDelay = sel_registerName("animationDelay");
+public static final int sel_selectAll_1 = sel_registerName("selectAll:");
+public static final int sel_parser_1foundNotationDeclarationWithName_1publicID_1systemID_1 = sel_registerName("parser:foundNotationDeclarationWithName:publicID:systemID:");
+public static final int sel_readSelectionFromPasteboard_1 = sel_registerName("readSelectionFromPasteboard:");
+public static final int sel_validateAndReturnError_1 = sel_registerName("validateAndReturnError:");
+public static final int sel_setScriptErrorOffendingObjectDescriptor_1 = sel_registerName("setScriptErrorOffendingObjectDescriptor:");
+public static final int sel_makeKeyWindow = sel_registerName("makeKeyWindow");
+public static final int sel_itemAtIndex_1 = sel_registerName("itemAtIndex:");
+public static final int sel_objectAtIndex_1 = sel_registerName("objectAtIndex:");
+public static final int sel_protectionSpace = sel_registerName("protectionSpace");
+public static final int sel_getCString_1 = sel_registerName("getCString:");
+public static final int sel_initSymbolicLinkWithDestination_1 = sel_registerName("initSymbolicLinkWithDestination:");
+public static final int sel_daylightSavingTimeOffset = sel_registerName("daylightSavingTimeOffset");
+public static final int sel_rangeOfTextList_1atIndex_1 = sel_registerName("rangeOfTextList:atIndex:");
+public static final int sel_currentDirectory = sel_registerName("currentDirectory");
+public static final int sel_windowControllerDidLoadNib_1 = sel_registerName("windowControllerDidLoadNib:");
+public static final int sel_setGroupingSize_1 = sel_registerName("setGroupingSize:");
+public static final int sel_subitems = sel_registerName("subitems");
+public static final int sel_initWithFileWrapper_1 = sel_registerName("initWithFileWrapper:");
+public static final int sel_documentVisibleRect = sel_registerName("documentVisibleRect");
+public static final int sel_setCount_1 = sel_registerName("setCount:");
+public static final int sel_setScriptErrorExpectedTypeDescriptor_1 = sel_registerName("setScriptErrorExpectedTypeDescriptor:");
+public static final int sel_setReleasedWhenClosed_1 = sel_registerName("setReleasedWhenClosed:");
+public static final int sel_imageUnfilteredTypes = sel_registerName("imageUnfilteredTypes");
+public static final int sel_writeToFile_1options_1error_1 = sel_registerName("writeToFile:options:error:");
+public static final int sel_controlContentFontOfSize_1 = sel_registerName("controlContentFontOfSize:");
+public static final int sel_insertRow_1withCells_1 = sel_registerName("insertRow:withCells:");
+public static final int sel_temporaryAttributesAtCharacterIndex_1effectiveRange_1 = sel_registerName("temporaryAttributesAtCharacterIndex:effectiveRange:");
+public static final int sel_stepForward_1 = sel_registerName("stepForward:");
+public static final int sel_convertScreenToBase_1 = sel_registerName("convertScreenToBase:");
+public static final int sel_printerWithType_1 = sel_registerName("printerWithType:");
+public static final int sel_setSliderType_1 = sel_registerName("setSliderType:");
+public static final int sel_applicationShouldHandleReopen_1hasVisibleWindows_1 = sel_registerName("applicationShouldHandleReopen:hasVisibleWindows:");
+public static final int sel_selectedTextAttributes = sel_registerName("selectedTextAttributes");
+public static final int sel_setStandardError_1 = sel_registerName("setStandardError:");
+public static final int sel_drawRect_1 = sel_registerName("drawRect:");
+public static final int sel_URLs = sel_registerName("URLs");
+public static final int sel_animationForKey_1 = sel_registerName("animationForKey:");
+public static final int sel_setSubviews_1 = sel_registerName("setSubviews:");
+public static final int sel_setString_1 = sel_registerName("setString:");
+public static final int sel_openFile_1fromImage_1at_1inView_1 = sel_registerName("openFile:fromImage:at:inView:");
+public static final int sel_draggedImage = sel_registerName("draggedImage");
+public static final int sel_numberOfGlyphs = sel_registerName("numberOfGlyphs");
+public static final int sel_itemAtRow_1 = sel_registerName("itemAtRow:");
+public static final int sel_drawKnob = sel_registerName("drawKnob");
+public static final int sel_imageRepsWithData_1 = sel_registerName("imageRepsWithData:");
+public static final int sel_dragOperationForDraggingInfo_1type_1 = sel_registerName("dragOperationForDraggingInfo:type:");
+public static final int sel_initWithRTF_1documentAttributes_1 = sel_registerName("initWithRTF:documentAttributes:");
+public static final int sel_pathsForResourcesOfType_1inDirectory_1 = sel_registerName("pathsForResourcesOfType:inDirectory:");
+public static final int sel_fontName = sel_registerName("fontName");
+public static final int sel_layoutManagers = sel_registerName("layoutManagers");
+public static final int sel_error = sel_registerName("error");
+public static final int sel_parentWindow = sel_registerName("parentWindow");
+public static final int sel_registerClass_1 = sel_registerName("registerClass:");
+public static final int sel_hideOtherApplications = sel_registerName("hideOtherApplications");
+public static final int sel_alphaComponent = sel_registerName("alphaComponent");
+public static final int sel_setPrefersColorMatch_1 = sel_registerName("setPrefersColorMatch:");
+public static final int sel_stopAnimation_1 = sel_registerName("stopAnimation:");
+public static final int sel_glyphIndexForCharacterAtIndex_1 = sel_registerName("glyphIndexForCharacterAtIndex:");
+public static final int sel_rulerView_1shouldAddMarker_1 = sel_registerName("rulerView:shouldAddMarker:");
+public static final int sel_initWithFrame_1 = sel_registerName("initWithFrame:");
+public static final int sel_init = sel_registerName("init");
+public static final int sel_selectedColumnEnumerator = sel_registerName("selectedColumnEnumerator");
+public static final int sel_viewWithTag_1 = sel_registerName("viewWithTag:");
+public static final int sel_classForKeyedUnarchiver = sel_registerName("classForKeyedUnarchiver");
+public static final int sel_addRow_1 = sel_registerName("addRow:");
+public static final int sel_contextHelpForObject_1 = sel_registerName("contextHelpForObject:");
+public static final int sel_server = sel_registerName("server");
+public static final int sel_colorUsingColorSpaceName_1device_1 = sel_registerName("colorUsingColorSpaceName:device:");
+public static final int sel_valueTransformerForName_1 = sel_registerName("valueTransformerForName:");
+public static final int sel_soundUnfilteredFileTypes = sel_registerName("soundUnfilteredFileTypes");
+public static final int sel_setSelectedTextAttributes_1 = sel_registerName("setSelectedTextAttributes:");
+public static final int sel_setLeadingOffset_1 = sel_registerName("setLeadingOffset:");
+public static final int sel_scrollToPoint_1 = sel_registerName("scrollToPoint:");
+public static final int sel_lastPathComponent = sel_registerName("lastPathComponent");
+public static final int sel_lossyCString = sel_registerName("lossyCString");
+public static final int sel_registerServicesMenuSendTypes_1returnTypes_1 = sel_registerName("registerServicesMenuSendTypes:returnTypes:");
+public static final int sel_keyDown_1 = sel_registerName("keyDown:");
+public static final int sel_setWidthTracksTextView_1 = sel_registerName("setWidthTracksTextView:");
+public static final int sel_incrementBy_1 = sel_registerName("incrementBy:");
+public static final int sel_moveWordForward_1 = sel_registerName("moveWordForward:");
+public static final int sel_dataWithContentsOfMappedFile_1 = sel_registerName("dataWithContentsOfMappedFile:");
+public static final int sel_socket = sel_registerName("socket");
+public static final int sel_EPSOperationWithView_1insideRect_1toData_1printInfo_1 = sel_registerName("EPSOperationWithView:insideRect:toData:printInfo:");
+public static final int sel_width = sel_registerName("width");
+public static final int sel_capabilityMask = sel_registerName("capabilityMask");
+public static final int sel_setBezeled_1 = sel_registerName("setBezeled:");
+public static final int sel_currentMode = sel_registerName("currentMode");
+public static final int sel_sliderType = sel_registerName("sliderType");
+public static final int sel_fileIsAppendOnly = sel_registerName("fileIsAppendOnly");
+public static final int sel_isAutomaticLinkDetectionEnabled = sel_registerName("isAutomaticLinkDetectionEnabled");
+public static final int sel_setBoundsOrigin_1 = sel_registerName("setBoundsOrigin:");
+public static final int sel_selectionHighlightStyle = sel_registerName("selectionHighlightStyle");
+public static final int sel_registerName_1 = sel_registerName("registerName:");
+public static final int sel_moveWordRightAndModifySelection_1 = sel_registerName("moveWordRightAndModifySelection:");
+public static final int sel_setCharacters_1 = sel_registerName("setCharacters:");
+public static final int sel_setWordFieldStringValue_1 = sel_registerName("setWordFieldStringValue:");
+public static final int sel_reverseObjectEnumerator = sel_registerName("reverseObjectEnumerator");
+public static final int sel_encodeByrefObject_1 = sel_registerName("encodeByrefObject:");
+public static final int sel_defaultDecimalNumberHandler = sel_registerName("defaultDecimalNumberHandler");
+public static final int sel_isEntryAcceptable_1 = sel_registerName("isEntryAcceptable:");
+public static final int sel_orderWindow_1relativeTo_1 = sel_registerName("orderWindow:relativeTo:");
+public static final int sel_writablePasteboardTypes = sel_registerName("writablePasteboardTypes");
+public static final int sel_addTrackingRect_1owner_1userData_1assumeInside_1 = sel_registerName("addTrackingRect:owner:userData:assumeInside:");
+public static final int sel_setPathComponentCells_1 = sel_registerName("setPathComponentCells:");
+public static final int sel_timeZoneWithName_1 = sel_registerName("timeZoneWithName:");
+public static final int sel_setAutosaveTableColumns_1 = sel_registerName("setAutosaveTableColumns:");
+public static final int sel_orPredicateWithSubpredicates_1 = sel_registerName("orPredicateWithSubpredicates:");
+public static final int sel_isEqualToDictionary_1 = sel_registerName("isEqualToDictionary:");
+public static final int sel_bottomMargin = sel_registerName("bottomMargin");
+public static final int sel_initWithYear_1month_1day_1hour_1minute_1second_1timeZone_1 = sel_registerName("initWithYear:month:day:hour:minute:second:timeZone:");
+public static final int sel_scrollColumnsLeftBy_1 = sel_registerName("scrollColumnsLeftBy:");
+public static final int sel_initWithContentsOfURL_1error_1 = sel_registerName("initWithContentsOfURL:error:");
+public static final int sel_setTabViewType_1 = sel_registerName("setTabViewType:");
+public static final int sel_initWithFloat_1 = sel_registerName("initWithFloat:");
+public static final int sel_attributedStringForObjectValue_1withDefaultAttributes_1 = sel_registerName("attributedStringForObjectValue:withDefaultAttributes:");
+public static final int sel_sharedGlyphGenerator = sel_registerName("sharedGlyphGenerator");
+public static final int sel_maximumRangeOfUnit_1 = sel_registerName("maximumRangeOfUnit:");
+public static final int sel_docFormatFromRange_1documentAttributes_1 = sel_registerName("docFormatFromRange:documentAttributes:");
+public static final int sel_initWithBitmapImageRep_1 = sel_registerName("initWithBitmapImageRep:");
+public static final int sel_mnemonic = sel_registerName("mnemonic");
+public static final int sel_prefersColorMatch = sel_registerName("prefersColorMatch");
+public static final int sel_fileSystemAttributesAtPath_1 = sel_registerName("fileSystemAttributesAtPath:");
+public static final int sel_rotateByRadians_1 = sel_registerName("rotateByRadians:");
+public static final int sel_createConversationForConnection_1 = sel_registerName("createConversationForConnection:");
+public static final int sel_setWindow_1 = sel_registerName("setWindow:");
+public static final int sel_addFontDescriptors_1toCollection_1 = sel_registerName("addFontDescriptors:toCollection:");
+public static final int sel_setMark_1 = sel_registerName("setMark:");
+public static final int sel_terminate = sel_registerName("terminate");
+public static final int sel_setTickMarkPosition_1 = sel_registerName("setTickMarkPosition:");
+public static final int sel_setIgnoresMouseEvents_1 = sel_registerName("setIgnoresMouseEvents:");
+public static final int sel_pointerArrayWithStrongObjects = sel_registerName("pointerArrayWithStrongObjects");
+public static final int sel_intersectsHashTable_1 = sel_registerName("intersectsHashTable:");
+public static final int sel_initWithTransform_1 = sel_registerName("initWithTransform:");
+public static final int sel_deviceRGBColorSpace = sel_registerName("deviceRGBColorSpace");
+public static final int sel_currentDiskUsage = sel_registerName("currentDiskUsage");
+public static final int sel_writeToFile_1ofType_1 = sel_registerName("writeToFile:ofType:");
+public static final int sel_unionSet_1 = sel_registerName("unionSet:");
+public static final int sel_bitmapFormat = sel_registerName("bitmapFormat");
+public static final int sel_moveItemAtPath_1toPath_1error_1 = sel_registerName("moveItemAtPath:toPath:error:");
+public static final int sel_tableView = sel_registerName("tableView");
+public static final int sel_performSelectorOnMainThread_1withObject_1waitUntilDone_1modes_1 = sel_registerName("performSelectorOnMainThread:withObject:waitUntilDone:modes:");
+public static final int sel_initAndTestWithTests_1 = sel_registerName("initAndTestWithTests:");
+public static final int sel_setVerticalMotionCanBeginDrag_1 = sel_registerName("setVerticalMotionCanBeginDrag:");
+public static final int sel_documentClassNames = sel_registerName("documentClassNames");
+public static final int sel_setShadow_1 = sel_registerName("setShadow:");
+public static final int sel_beginLineWithGlyphAtIndex_1 = sel_registerName("beginLineWithGlyphAtIndex:");
+public static final int sel_predicateWithSubstitutionVariables_1 = sel_registerName("predicateWithSubstitutionVariables:");
+public static final int sel_EPSOperationWithView_1insideRect_1toPath_1printInfo_1 = sel_registerName("EPSOperationWithView:insideRect:toPath:printInfo:");
+public static final int sel_startSubelementIndex = sel_registerName("startSubelementIndex");
+public static final int sel_sleepUntilDate_1 = sel_registerName("sleepUntilDate:");
+public static final int sel_menuForEvent_1 = sel_registerName("menuForEvent:");
+public static final int sel_disabledControlTextColor = sel_registerName("disabledControlTextColor");
+public static final int sel_addRegularFileWithContents_1preferredFilename_1 = sel_registerName("addRegularFileWithContents:preferredFilename:");
+public static final int sel_setTakesTitleFromPreviousColumn_1 = sel_registerName("setTakesTitleFromPreviousColumn:");
+public static final int sel_removeSelectionIndexes_1 = sel_registerName("removeSelectionIndexes:");
+public static final int sel_resizedColumn = sel_registerName("resizedColumn");
+public static final int sel_host = sel_registerName("host");
+public static final int sel_setDefaultAttachmentScaling_1 = sel_registerName("setDefaultAttachmentScaling:");
+public static final int sel_boundingRectWithSize_1options_1 = sel_registerName("boundingRectWithSize:options:");
+public static final int sel_magentaColor = sel_registerName("magentaColor");
+public static final int sel_performDefaultImplementation = sel_registerName("performDefaultImplementation");
+public static final int sel_getPeriodicDelay_1interval_1 = sel_registerName("getPeriodicDelay:interval:");
+public static final int sel_RTFFromRange_1 = sel_registerName("RTFFromRange:");
+public static final int sel_setStringValue_1 = sel_registerName("setStringValue:");
+public static final int sel_setPaletteLabel_1 = sel_registerName("setPaletteLabel:");
+public static final int sel_years_1months_1days_1hours_1minutes_1seconds_1sinceDate_1 = sel_registerName("years:months:days:hours:minutes:seconds:sinceDate:");
+public static final int sel_initWithFormat_1arguments_1 = sel_registerName("initWithFormat:arguments:");
+public static final int sel_firstUnlaidCharacterIndex = sel_registerName("firstUnlaidCharacterIndex");
+public static final int sel_panelSelectionDidChange_1 = sel_registerName("panelSelectionDidChange:");
+public static final int sel_typesFilterableTo_1 = sel_registerName("typesFilterableTo:");
+public static final int sel_selectPreviousTabViewItem_1 = sel_registerName("selectPreviousTabViewItem:");
+public static final int sel_URLProtocol_1didReceiveResponse_1cacheStoragePolicy_1 = sel_registerName("URLProtocol:didReceiveResponse:cacheStoragePolicy:");
+public static final int sel_loadView = sel_registerName("loadView");
+public static final int sel_setPositiveSuffix_1 = sel_registerName("setPositiveSuffix:");
+public static final int sel_setSizeMode_1 = sel_registerName("setSizeMode:");
+public static final int sel_addValue_1forHTTPHeaderField_1 = sel_registerName("addValue:forHTTPHeaderField:");
+public static final int sel_replacementObjectForPortCoder_1 = sel_registerName("replacementObjectForPortCoder:");
+public static final int sel_cycleToNextInputLanguage_1 = sel_registerName("cycleToNextInputLanguage:");
+public static final int sel_setContentMinSize_1 = sel_registerName("setContentMinSize:");
+public static final int sel_convertWeight_1ofFont_1 = sel_registerName("convertWeight:ofFont:");
+public static final int sel_code = sel_registerName("code");
+public static final int sel_TIFFRepresentationUsingCompression_1factor_1 = sel_registerName("TIFFRepresentationUsingCompression:factor:");
+public static final int sel_setSelector_1 = sel_registerName("setSelector:");
+public static final int sel_URLHandleResourceDidCancelLoading_1 = sel_registerName("URLHandleResourceDidCancelLoading:");
+public static final int sel_setTag_1forSegment_1 = sel_registerName("setTag:forSegment:");
+public static final int sel_viewFrameChanged_1 = sel_registerName("viewFrameChanged:");
+public static final int sel_attachmentCell = sel_registerName("attachmentCell");
+public static final int sel_removeStatusItem_1 = sel_registerName("removeStatusItem:");
+public static final int sel_pathForAuxiliaryExecutable_1 = sel_registerName("pathForAuxiliaryExecutable:");
+public static final int sel_fileURL = sel_registerName("fileURL");
+public static final int sel_drawerShouldOpen_1 = sel_registerName("drawerShouldOpen:");
+public static final int sel_initForWritingWithMutableData_1 = sel_registerName("initForWritingWithMutableData:");
+public static final int sel_content = sel_registerName("content");
+public static final int sel_addSubview_1 = sel_registerName("addSubview:");
+public static final int sel_stringByReplacingOccurrencesOfString_1withString_1 = sel_registerName("stringByReplacingOccurrencesOfString:withString:");
+public static final int sel_stringWithFileSystemRepresentation_1length_1 = sel_registerName("stringWithFileSystemRepresentation:length:");
+public static final int sel_isVerticallyCentered = sel_registerName("isVerticallyCentered");
+public static final int sel_setVerticallyCentered_1 = sel_registerName("setVerticallyCentered:");
+public static final int sel_selectPrevious_1 = sel_registerName("selectPrevious:");
+public static final int sel_addTemporaryAttributes_1forCharacterRange_1 = sel_registerName("addTemporaryAttributes:forCharacterRange:");
+public static final int sel_tabState = sel_registerName("tabState");
+public static final int sel_defaultQueue = sel_registerName("defaultQueue");
+public static final int sel_showsControlCharacters = sel_registerName("showsControlCharacters");
+public static final int sel_indexOfObject_1 = sel_registerName("indexOfObject:");
+public static final int sel_shadow = sel_registerName("shadow");
+public static final int sel_fontMenu_1 = sel_registerName("fontMenu:");
+public static final int sel_movePath_1toPath_1handler_1 = sel_registerName("movePath:toPath:handler:");
+public static final int sel_setDictionary_1 = sel_registerName("setDictionary:");
+public static final int sel_verticalLineScroll = sel_registerName("verticalLineScroll");
+public static final int sel_showsAlpha = sel_registerName("showsAlpha");
+public static final int sel_removeObserver_1 = sel_registerName("removeObserver:");
+public static final int sel_isFieldEditor = sel_registerName("isFieldEditor");
+public static final int sel_fileHandleForWriting = sel_registerName("fileHandleForWriting");
+public static final int sel_contentsAtPath_1 = sel_registerName("contentsAtPath:");
+public static final int sel_writeProperty_1forKey_1 = sel_registerName("writeProperty:forKey:");
+public static final int sel_drawWithRect_1options_1attributes_1 = sel_registerName("drawWithRect:options:attributes:");
+public static final int sel_initWithName_1 = sel_registerName("initWithName:");
+public static final int sel_getFileSystemInfoForPath_1isRemovable_1isWritable_1isUnmountable_1description_1type_1 = sel_registerName("getFileSystemInfoForPath:isRemovable:isWritable:isUnmountable:description:type:");
+public static final int sel_setOpenGLContext_1 = sel_registerName("setOpenGLContext:");
+public static final int sel_hasSubmenu = sel_registerName("hasSubmenu");
+public static final int sel_rangeOfTextTable_1atIndex_1 = sel_registerName("rangeOfTextTable:atIndex:");
+public static final int sel_connection_1willCacheResponse_1 = sel_registerName("connection:willCacheResponse:");
+public static final int sel_automaticallyRearrangesObjects = sel_registerName("automaticallyRearrangesObjects");
+public static final int sel_registerCommandDescription_1 = sel_registerName("registerCommandDescription:");
+public static final int sel_indexOfSelectedItem = sel_registerName("indexOfSelectedItem");
+public static final int sel_underline_1 = sel_registerName("underline:");
+public static final int sel_beginModalSessionForWindow_1relativeToWindow_1 = sel_registerName("beginModalSessionForWindow:relativeToWindow:");
+public static final int sel_initWithData_1options_1documentAttributes_1error_1 = sel_registerName("initWithData:options:documentAttributes:error:");
+public static final int sel_revert_1 = sel_registerName("revert:");
+public static final int sel_displayableSubpredicatesOfPredicate_1 = sel_registerName("displayableSubpredicatesOfPredicate:");
+public static final int sel_dataWithData_1 = sel_registerName("dataWithData:");
+public static final int sel_scaleXBy_1yBy_1 = sel_registerName("scaleXBy:yBy:");
+public static final int sel_decodeBoolForKey_1 = sel_registerName("decodeBoolForKey:");
+public static final int sel_itemTitles = sel_registerName("itemTitles");
+public static final int sel_removeFontDescriptor_1fromCollection_1 = sel_registerName("removeFontDescriptor:fromCollection:");
+public static final int sel_isContinuousSpellCheckingEnabled = sel_registerName("isContinuousSpellCheckingEnabled");
+public static final int sel_paragraphSpacingBeforeGlyphAtIndex_1withProposedLineFragmentRect_1 = sel_registerName("paragraphSpacingBeforeGlyphAtIndex:withProposedLineFragmentRect:");
+public static final int sel_ignoreSpelling_1 = sel_registerName("ignoreSpelling:");
+public static final int sel_crosshairCursor = sel_registerName("crosshairCursor");
+public static final int sel_setSelected_1 = sel_registerName("setSelected:");
+public static final int sel_RTFDFromRange_1 = sel_registerName("RTFDFromRange:");
+public static final int sel_setCanSelectHiddenExtension_1 = sel_registerName("setCanSelectHiddenExtension:");
+public static final int sel_setNestingMode_1 = sel_registerName("setNestingMode:");
+public static final int sel_addItemsWithObjectValues_1 = sel_registerName("addItemsWithObjectValues:");
+public static final int sel_setContentFilters_1 = sel_registerName("setContentFilters:");
+public static final int sel_setAutorepeat_1 = sel_registerName("setAutorepeat:");
+public static final int sel_resizeWithOldSuperviewSize_1 = sel_registerName("resizeWithOldSuperviewSize:");
+public static final int sel_areCursorRectsEnabled = sel_registerName("areCursorRectsEnabled");
+public static final int sel_browser_1selectCellWithString_1inColumn_1 = sel_registerName("browser:selectCellWithString:inColumn:");
+public static final int sel_setLastColumn_1 = sel_registerName("setLastColumn:");
+public static final int sel_isContextHelpModeActive = sel_registerName("isContextHelpModeActive");
+public static final int sel_setTitleColor_1 = sel_registerName("setTitleColor:");
+public static final int sel_initWithBytes_1length_1 = sel_registerName("initWithBytes:length:");
+public static final int sel_animation_1valueForProgress_1 = sel_registerName("animation:valueForProgress:");
+public static final int sel_fillColor = sel_registerName("fillColor");
+public static final int sel_completionsForPartialWordRange_1inString_1language_1inSpellDocumentWithTag_1 = sel_registerName("completionsForPartialWordRange:inString:language:inSpellDocumentWithTag:");
+public static final int sel_typeForContentsOfURL_1error_1 = sel_registerName("typeForContentsOfURL:error:");
+public static final int sel_setShowPanels_1 = sel_registerName("setShowPanels:");
+public static final int sel_outlineView_1dataCellForTableColumn_1item_1 = sel_registerName("outlineView:dataCellForTableColumn:item:");
+public static final int sel_setLineJoinStyle_1 = sel_registerName("setLineJoinStyle:");
+public static final int sel_cancelPerformSelectorsWithTarget_1 = sel_registerName("cancelPerformSelectorsWithTarget:");
+public static final int sel_nextDaylightSavingTimeTransition = sel_registerName("nextDaylightSavingTimeTransition");
+public static final int sel_setEndSubelementIdentifier_1 = sel_registerName("setEndSubelementIdentifier:");
+public static final int sel_channelMapping = sel_registerName("channelMapping");
+public static final int sel_setTitle_1ofColumn_1 = sel_registerName("setTitle:ofColumn:");
+public static final int sel_setHeaderToolTip_1 = sel_registerName("setHeaderToolTip:");
+public static final int sel_initWithChar_1 = sel_registerName("initWithChar:");
+public static final int sel_shouldReportNamespacePrefixes = sel_registerName("shouldReportNamespacePrefixes");
+public static final int sel_decomposedStringWithCompatibilityMapping = sel_registerName("decomposedStringWithCompatibilityMapping");
+public static final int sel_undoActionName = sel_registerName("undoActionName");
+public static final int sel_attachColorList_1 = sel_registerName("attachColorList:");
+public static final int sel_cancelPreviousPerformRequestsWithTarget_1 = sel_registerName("cancelPreviousPerformRequestsWithTarget:");
+public static final int sel_addToolTipRect_1owner_1userData_1 = sel_registerName("addToolTipRect:owner:userData:");
+public static final int sel_isOptionalArgumentWithName_1 = sel_registerName("isOptionalArgumentWithName:");
+public static final int sel_fileHandleForReading = sel_registerName("fileHandleForReading");
+public static final int sel_removeConnection_1fromRunLoop_1forMode_1 = sel_registerName("removeConnection:fromRunLoop:forMode:");
+public static final int sel_controlTextDidBeginEditing_1 = sel_registerName("controlTextDidBeginEditing:");
+public static final int sel_closePath = sel_registerName("closePath");
+public static final int sel_isPlaying = sel_registerName("isPlaying");
+public static final int sel_matrixClass = sel_registerName("matrixClass");
+public static final int sel_doCommandBySelector_1client_1 = sel_registerName("doCommandBySelector:client:");
+public static final int sel_appendBytes_1length_1 = sel_registerName("appendBytes:length:");
+public static final int sel_lightGrayColor = sel_registerName("lightGrayColor");
+public static final int sel_menuRepresentation = sel_registerName("menuRepresentation");
+public static final int sel_dateWithString_1calendarFormat_1 = sel_registerName("dateWithString:calendarFormat:");
+public static final int sel_decodeClassName_1asClassName_1 = sel_registerName("decodeClassName:asClassName:");
+public static final int sel_deleteToBeginningOfParagraph_1 = sel_registerName("deleteToBeginningOfParagraph:");
+public static final int sel_runModalForDirectory_1file_1 = sel_registerName("runModalForDirectory:file:");
+public static final int sel_inverseForRelationshipKey_1 = sel_registerName("inverseForRelationshipKey:");
+public static final int sel_cancelLoadInBackground = sel_registerName("cancelLoadInBackground");
+public static final int sel_setLeftMargin_1 = sel_registerName("setLeftMargin:");
+public static final int sel_tabStopType = sel_registerName("tabStopType");
+public static final int sel_replaceCharactersInRange_1withRTF_1 = sel_registerName("replaceCharactersInRange:withRTF:");
+public static final int sel_drawInRect_1fromRect_1operation_1fraction_1 = sel_registerName("drawInRect:fromRect:operation:fraction:");
+public static final int sel_sound = sel_registerName("sound");
+public static final int sel_localizedRecoverySuggestion = sel_registerName("localizedRecoverySuggestion");
+public static final int sel_getInputStream_1outputStream_1 = sel_registerName("getInputStream:outputStream:");
+public static final int sel_defaultType = sel_registerName("defaultType");
+public static final int sel_sharedFontPanel = sel_registerName("sharedFontPanel");
+public static final int sel_fixParagraphStyleAttributeInRange_1 = sel_registerName("fixParagraphStyleAttributeInRange:");
+public static final int sel_textColor = sel_registerName("textColor");
+public static final int sel_noteFileSystemChanged = sel_registerName("noteFileSystemChanged");
+public static final int sel_setObject_1forKey_1 = sel_registerName("setObject:forKey:");
+public static final int sel_drawAtPoint_1 = sel_registerName("drawAtPoint:");
+public static final int sel_tableView_1shouldSelectTableColumn_1 = sel_registerName("tableView:shouldSelectTableColumn:");
+public static final int sel_deleteWordBackward_1 = sel_registerName("deleteWordBackward:");
+public static final int sel_pipe = sel_registerName("pipe");
+public static final int sel_resetStandardUserDefaults = sel_registerName("resetStandardUserDefaults");
+public static final int sel_orderFrontSpacingPanel_1 = sel_registerName("orderFrontSpacingPanel:");
+public static final int sel_setUsesFontPanel_1 = sel_registerName("setUsesFontPanel:");
+public static final int sel_saveToURL_1ofType_1forSaveOperation_1delegate_1didSaveSelector_1contextInfo_1 = sel_registerName("saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:");
+public static final int sel_linkPath_1toPath_1handler_1 = sel_registerName("linkPath:toPath:handler:");
+public static final int sel_addTimeInterval_1 = sel_registerName("addTimeInterval:");
+public static final int sel_formattingDictionary = sel_registerName("formattingDictionary");
+public static final int sel_ignoresMultiClick = sel_registerName("ignoresMultiClick");
+public static final int sel_encodeValuesOfObjCTypes_1 = sel_registerName("encodeValuesOfObjCTypes:");
+public static final int sel_indexAtPosition_1 = sel_registerName("indexAtPosition:");
+public static final int sel_autoresizesSubviews = sel_registerName("autoresizesSubviews");
+public static final int sel_takesTitleFromPreviousColumn = sel_registerName("takesTitleFromPreviousColumn");
+public static final int sel_titlePosition = sel_registerName("titlePosition");
+public static final int sel_currentAppleEvent = sel_registerName("currentAppleEvent");
+public static final int sel_valueForDimension_1 = sel_registerName("valueForDimension:");
+public static final int sel_printDocumentWithSettings_1showPrintPanel_1delegate_1didPrintSelector_1contextInfo_1 = sel_registerName("printDocumentWithSettings:showPrintPanel:delegate:didPrintSelector:contextInfo:");
+public static final int sel_isZoomable = sel_registerName("isZoomable");
+public static final int sel_setNeedsDisplay = sel_registerName("setNeedsDisplay");
+public static final int sel_initWithColors_1 = sel_registerName("initWithColors:");
+public static final int sel_isSubclassOfClass_1 = sel_registerName("isSubclassOfClass:");
+public static final int sel_adobeRGB1998ColorSpace = sel_registerName("adobeRGB1998ColorSpace");
+public static final int sel_textView_1willChangeSelectionFromCharacterRange_1toCharacterRange_1 = sel_registerName("textView:willChangeSelectionFromCharacterRange:toCharacterRange:");
+public static final int sel_useAllLigatures_1 = sel_registerName("useAllLigatures:");
+public static final int sel_setFrameUsingName_1force_1 = sel_registerName("setFrameUsingName:force:");
+public static final int sel_percentSymbol = sel_registerName("percentSymbol");
+public static final int sel_addRepresentations_1 = sel_registerName("addRepresentations:");
+public static final int sel_writeEPSInsideRect_1toPasteboard_1 = sel_registerName("writeEPSInsideRect:toPasteboard:");
+public static final int sel_systemFontSize = sel_registerName("systemFontSize");
+public static final int sel_canRemoveAllRows = sel_registerName("canRemoveAllRows");
+public static final int sel_endLineWithGlyphRange_1 = sel_registerName("endLineWithGlyphRange:");
+public static final int sel_maxItemSize = sel_registerName("maxItemSize");
+public static final int sel_setImageScaling_1forSegment_1 = sel_registerName("setImageScaling:forSegment:");
+public static final int sel_reloadDefaultFontFamilies = sel_registerName("reloadDefaultFontFamilies");
+public static final int sel_removeRow_1 = sel_registerName("removeRow:");
+public static final int sel_contentSize = sel_registerName("contentSize");
+public static final int sel_setValueTransformer_1forName_1 = sel_registerName("setValueTransformer:forName:");
+public static final int sel_defaultCStringEncoding = sel_registerName("defaultCStringEncoding");
+public static final int sel_setMaxNumberOfRows_1 = sel_registerName("setMaxNumberOfRows:");
+public static final int sel_continueWithoutCredentialForAuthenticationChallenge_1 = sel_registerName("continueWithoutCredentialForAuthenticationChallenge:");
+public static final int sel_encodeArrayOfObjCType_1count_1at_1 = sel_registerName("encodeArrayOfObjCType:count:at:");
+public static final int sel_tabStops = sel_registerName("tabStops");
+public static final int sel_altIncrementValue = sel_registerName("altIncrementValue");
+public static final int sel_removeAttribute_1range_1 = sel_registerName("removeAttribute:range:");
+public static final int sel_rightExpressionAttributeType = sel_registerName("rightExpressionAttributeType");
+public static final int sel_setAutoresizesAllColumnsToFit_1 = sel_registerName("setAutoresizesAllColumnsToFit:");
+public static final int sel_removeAllToolTips = sel_registerName("removeAllToolTips");
+public static final int sel_setNotANumberSymbol_1 = sel_registerName("setNotANumberSymbol:");
+public static final int sel_setMinWidth_1 = sel_registerName("setMinWidth:");
+public static final int sel_setDefaultTimeZone_1 = sel_registerName("setDefaultTimeZone:");
+public static final int sel_setTabStops_1 = sel_registerName("setTabStops:");
+public static final int sel_textView_1draggedCell_1inRect_1event_1 = sel_registerName("textView:draggedCell:inRect:event:");
+public static final int sel_PDFOperationWithView_1insideRect_1toData_1 = sel_registerName("PDFOperationWithView:insideRect:toData:");
+public static final int sel_outlineView_1selectionIndexesForProposedSelection_1 = sel_registerName("outlineView:selectionIndexesForProposedSelection:");
+public static final int sel_initWithContentsOfURL_1 = sel_registerName("initWithContentsOfURL:");
+public static final int sel_setBidiProcessingEnabled_1 = sel_registerName("setBidiProcessingEnabled:");
+public static final int sel_selectToMark_1 = sel_registerName("selectToMark:");
+public static final int sel_newlineCharacterSet = sel_registerName("newlineCharacterSet");
+public static final int sel_accessibilitySetOverrideValue_1forAttribute_1 = sel_registerName("accessibilitySetOverrideValue:forAttribute:");
+public static final int sel_setPostsFrameChangedNotifications_1 = sel_registerName("setPostsFrameChangedNotifications:");
+public static final int sel_cellPrototype = sel_registerName("cellPrototype");
+public static final int sel_unmarkText = sel_registerName("unmarkText");
+public static final int sel_displayValuesKeyPath = sel_registerName("displayValuesKeyPath");
+public static final int sel_orderFrontStylesPanel_1 = sel_registerName("orderFrontStylesPanel:");
+public static final int sel_getBuffer_1length_1 = sel_registerName("getBuffer:length:");
+public static final int sel_calcDrawInfo_1 = sel_registerName("calcDrawInfo:");
+public static final int sel_initWithUTF8String_1 = sel_registerName("initWithUTF8String:");
+public static final int sel_deselectAllCells = sel_registerName("deselectAllCells");
+public static final int sel_checkGrammarOfString_1startingAt_1language_1wrap_1inSpellDocumentWithTag_1details_1 = sel_registerName("checkGrammarOfString:startingAt:language:wrap:inSpellDocumentWithTag:details:");
+public static final int sel_poolCountHighWaterResolution = sel_registerName("poolCountHighWaterResolution");
+public static final int sel_canInitWithData_1 = sel_registerName("canInitWithData:");
+public static final int sel_setHasVerticalScroller_1 = sel_registerName("setHasVerticalScroller:");
+public static final int sel_flushHostCache = sel_registerName("flushHostCache");
+public static final int sel_toolbarDefaultItemIdentifiers_1 = sel_registerName("toolbarDefaultItemIdentifiers:");
+public static final int sel_setSearchButtonCell_1 = sel_registerName("setSearchButtonCell:");
+public static final int sel_defaultButtonCell = sel_registerName("defaultButtonCell");
+public static final int sel_sizeLastColumnToFit = sel_registerName("sizeLastColumnToFit");
+public static final int sel_addColumn = sel_registerName("addColumn");
+public static final int sel_failureResponse = sel_registerName("failureResponse");
+public static final int sel_insertTabIgnoringFieldEditor_1 = sel_registerName("insertTabIgnoringFieldEditor:");
+public static final int sel_locationForGlyphAtIndex_1 = sel_registerName("locationForGlyphAtIndex:");
+public static final int sel_insertContainerBreak_1 = sel_registerName("insertContainerBreak:");
+public static final int sel_setAutosizesCells_1 = sel_registerName("setAutosizesCells:");
+public static final int sel_isEditable = sel_registerName("isEditable");
+public static final int sel_path = sel_registerName("path");
+public static final int sel_setStringValue_1resolvingEntities_1 = sel_registerName("setStringValue:resolvingEntities:");
+public static final int sel_readFileContentsType_1toFile_1 = sel_registerName("readFileContentsType:toFile:");
+public static final int sel_fileExtensionHidden = sel_registerName("fileExtensionHidden");
+public static final int sel_setTextureImageToPixelBuffer_1colorBuffer_1 = sel_registerName("setTextureImageToPixelBuffer:colorBuffer:");
+public static final int sel_setFilename_1 = sel_registerName("setFilename:");
+public static final int sel_callStackReturnAddresses = sel_registerName("callStackReturnAddresses");
+public static final int sel_blocksOtherRecognizers = sel_registerName("blocksOtherRecognizers");
+public static final int sel_pixelBuffer = sel_registerName("pixelBuffer");
+public static final int sel_initWithStartingColor_1endingColor_1 = sel_registerName("initWithStartingColor:endingColor:");
+public static final int sel_indexOfObjectIdenticalTo_1inRange_1 = sel_registerName("indexOfObjectIdenticalTo:inRange:");
+public static final int sel_duration = sel_registerName("duration");
+public static final int sel_matchForPredicate_1 = sel_registerName("matchForPredicate:");
+public static final int sel_windowDidMiniaturize_1 = sel_registerName("windowDidMiniaturize:");
+public static final int sel_drawWithFrame_1inView_1characterIndex_1layoutManager_1 = sel_registerName("drawWithFrame:inView:characterIndex:layoutManager:");
+public static final int sel_setTwoDigitStartDate_1 = sel_registerName("setTwoDigitStartDate:");
+public static final int sel_selectTextAtRow_1column_1 = sel_registerName("selectTextAtRow:column:");
+public static final int sel_splitView_1shouldHideDividerAtIndex_1 = sel_registerName("splitView:shouldHideDividerAtIndex:");
+public static final int sel_isExcludedFromWindowsMenu = sel_registerName("isExcludedFromWindowsMenu");
+public static final int sel_earlierDate_1 = sel_registerName("earlierDate:");
+public static final int sel_initWithLeftExpressions_1rightExpressionAttributeType_1modifier_1operators_1options_1 = sel_registerName("initWithLeftExpressions:rightExpressionAttributeType:modifier:operators:options:");
+public static final int sel_minItemSize = sel_registerName("minItemSize");
+public static final int sel_setSearchMenuTemplate_1 = sel_registerName("setSearchMenuTemplate:");
+public static final int sel_rightMouseUp_1 = sel_registerName("rightMouseUp:");
+public static final int sel_stopSpeaking_1 = sel_registerName("stopSpeaking:");
+public static final int sel_getObjectValue_1forString_1errorDescription_1 = sel_registerName("getObjectValue:forString:errorDescription:");
+public static final int sel_unarchiver_1didDecodeObject_1 = sel_registerName("unarchiver:didDecodeObject:");
+public static final int sel_endSpecifier = sel_registerName("endSpecifier");
+public static final int sel_ascending = sel_registerName("ascending");
+public static final int sel_sharedCoercionHandler = sel_registerName("sharedCoercionHandler");
+public static final int sel_textAttributesForPositiveInfinity = sel_registerName("textAttributesForPositiveInfinity");
+public static final int sel_isEqualToData_1 = sel_registerName("isEqualToData:");
+public static final int sel_setHighlightMode_1 = sel_registerName("setHighlightMode:");
+public static final int sel_valueWithNonretainedObject_1 = sel_registerName("valueWithNonretainedObject:");
+public static final int sel_textAttributesForNotANumber = sel_registerName("textAttributesForNotANumber");
+public static final int sel_getCFRunLoop = sel_registerName("getCFRunLoop");
+public static final int sel_invalidateGlyphsForCharacterRange_1changeInLength_1actualCharacterRange_1 = sel_registerName("invalidateGlyphsForCharacterRange:changeInLength:actualCharacterRange:");
+public static final int sel_cachedResponse = sel_registerName("cachedResponse");
+public static final int sel_containerIsRangeContainerObject = sel_registerName("containerIsRangeContainerObject");
+public static final int sel_setLanguage_1 = sel_registerName("setLanguage:");
+public static final int sel_loadNibFile_1externalNameTable_1withZone_1 = sel_registerName("loadNibFile:externalNameTable:withZone:");
+public static final int sel_offsetInFile = sel_registerName("offsetInFile");
+public static final int sel_initWithRulerView_1markerLocation_1image_1imageOrigin_1 = sel_registerName("initWithRulerView:markerLocation:image:imageOrigin:");
+public static final int sel_commandDescriptionWithAppleEventClass_1andAppleEventCode_1 = sel_registerName("commandDescriptionWithAppleEventClass:andAppleEventCode:");
+public static final int sel_detachDrawingThread_1toTarget_1withObject_1 = sel_registerName("detachDrawingThread:toTarget:withObject:");
+public static final int sel_outlineView_1shouldShowCellExpansionForTableColumn_1item_1 = sel_registerName("outlineView:shouldShowCellExpansionForTableColumn:item:");
+public static final int sel_catalogNameComponent = sel_registerName("catalogNameComponent");
+public static final int sel_monthSymbols = sel_registerName("monthSymbols");
+public static final int sel_invalidateShadow = sel_registerName("invalidateShadow");
+public static final int sel_waitUntilDate_1 = sel_registerName("waitUntilDate:");
+public static final int sel_languageLevel = sel_registerName("languageLevel");
+public static final int sel_XMLData = sel_registerName("XMLData");
+public static final int sel_textView_1shouldChangeTextInRanges_1replacementStrings_1 = sel_registerName("textView:shouldChangeTextInRanges:replacementStrings:");
+public static final int sel_initWithPointerFunctions_1 = sel_registerName("initWithPointerFunctions:");
+public static final int sel_initWithTextureTarget_1textureInternalFormat_1textureMaxMipMapLevel_1pixelsWide_1pixelsHigh_1 = sel_registerName("initWithTextureTarget:textureInternalFormat:textureMaxMipMapLevel:pixelsWide:pixelsHigh:");
+public static final int sel_classForClassName_1 = sel_registerName("classForClassName:");
+public static final int sel_decodeInt64ForKey_1 = sel_registerName("decodeInt64ForKey:");
+public static final int sel_stringWithSavedFrame = sel_registerName("stringWithSavedFrame");
+public static final int sel_writeRTFDToFile_1atomically_1 = sel_registerName("writeRTFDToFile:atomically:");
+public static final int sel_initWithLocal_1connection_1 = sel_registerName("initWithLocal:connection:");
+public static final int sel_sendBeforeDate_1msgid_1components_1from_1reserved_1 = sel_registerName("sendBeforeDate:msgid:components:from:reserved:");
+public static final int sel_playsEveryFrame = sel_registerName("playsEveryFrame");
+public static final int sel_prependTransform_1 = sel_registerName("prependTransform:");
+public static final int sel_setUsesWeakReadAndWriteBarriers_1 = sel_registerName("setUsesWeakReadAndWriteBarriers:");
+public static final int sel_isContinuous = sel_registerName("isContinuous");
+public static final int sel_andPredicateWithSubpredicates_1 = sel_registerName("andPredicateWithSubpredicates:");
+public static final int sel_cookieWithProperties_1 = sel_registerName("cookieWithProperties:");
+public static final int sel_builtInPlugInsPath = sel_registerName("builtInPlugInsPath");
+public static final int sel_performSelector_1onThread_1withObject_1waitUntilDone_1 = sel_registerName("performSelector:onThread:withObject:waitUntilDone:");
+public static final int sel_sharedDocumentController = sel_registerName("sharedDocumentController");
+public static final int sel_setNeedsSizing_1 = sel_registerName("setNeedsSizing:");
+public static final int sel_selectorForCommand_1 = sel_registerName("selectorForCommand:");
+public static final int sel_displayIfNeededInRectIgnoringOpacity_1 = sel_registerName("displayIfNeededInRectIgnoringOpacity:");
+public static final int sel_draggingPasteboard = sel_registerName("draggingPasteboard");
+public static final int sel_unscriptRange_1 = sel_registerName("unscriptRange:");
+public static final int sel_launchApplication_1 = sel_registerName("launchApplication:");
+public static final int sel_inputClientBecomeActive_1 = sel_registerName("inputClientBecomeActive:");
+public static final int sel_getFirstUnlaidCharacterIndex_1glyphIndex_1 = sel_registerName("getFirstUnlaidCharacterIndex:glyphIndex:");
+public static final int sel_initWithContentsOfURL_1options_1error_1 = sel_registerName("initWithContentsOfURL:options:error:");
+public static final int sel_createSymbolicLinkAtPath_1withDestinationPath_1error_1 = sel_registerName("createSymbolicLinkAtPath:withDestinationPath:error:");
+public static final int sel_accessibilityAttributeValue_1forParameter_1 = sel_registerName("accessibilityAttributeValue:forParameter:");
+public static final int sel_setPlaceholderAttributedString_1 = sel_registerName("setPlaceholderAttributedString:");
+public static final int sel_initWithIndex_1 = sel_registerName("initWithIndex:");
+public static final int sel_readFromURL_1ofType_1error_1 = sel_registerName("readFromURL:ofType:error:");
+public static final int sel_preferredFilename = sel_registerName("preferredFilename");
+public static final int sel_smartInsertDeleteEnabled = sel_registerName("smartInsertDeleteEnabled");
+public static final int sel_horizontalLineScroll = sel_registerName("horizontalLineScroll");
+public static final int sel_doDoubleClick_1 = sel_registerName("doDoubleClick:");
+public static final int sel_fontDescriptorWithFace_1 = sel_registerName("fontDescriptorWithFace:");
+public static final int sel_pointerArrayWithPointerFunctions_1 = sel_registerName("pointerArrayWithPointerFunctions:");
+public static final int sel_defaultDate = sel_registerName("defaultDate");
+public static final int sel_typesetterBehavior = sel_registerName("typesetterBehavior");
+public static final int sel_setAllowsNonContiguousLayout_1 = sel_registerName("setAllowsNonContiguousLayout:");
+public static final int sel_control_1didFailToFormatString_1errorDescription_1 = sel_registerName("control:didFailToFormatString:errorDescription:");
+public static final int sel_isBaseFont = sel_registerName("isBaseFont");
+public static final int sel_removeDescriptorWithKeyword_1 = sel_registerName("removeDescriptorWithKeyword:");
+public static final int sel_substringFromIndex_1 = sel_registerName("substringFromIndex:");
+public static final int sel_componentsFromLocaleIdentifier_1 = sel_registerName("componentsFromLocaleIdentifier:");
+public static final int sel_setUsesFeedbackWindow_1 = sel_registerName("setUsesFeedbackWindow:");
+public static final int sel_setAnimates_1 = sel_registerName("setAnimates:");
+public static final int sel_initWithDomain_1code_1userInfo_1 = sel_registerName("initWithDomain:code:userInfo:");
+public static final int sel_setContentView_1 = sel_registerName("setContentView:");
+public static final int sel_allowedFileTypes = sel_registerName("allowedFileTypes");
+public static final int sel_leftExpressions = sel_registerName("leftExpressions");
+public static final int sel_isStandalone = sel_registerName("isStandalone");
+public static final int sel_floatForKey_1inTable_1 = sel_registerName("floatForKey:inTable:");
+public static final int sel_notANumber = sel_registerName("notANumber");
+public static final int sel_updateFromPMPrintSettings = sel_registerName("updateFromPMPrintSettings");
+public static final int sel_wantsToTrackMouse = sel_registerName("wantsToTrackMouse");
+public static final int sel_initWithName_1reason_1userInfo_1 = sel_registerName("initWithName:reason:userInfo:");
+public static final int sel_prepareOpenGL = sel_registerName("prepareOpenGL");
+public static final int sel_setAttributedStringForNil_1 = sel_registerName("setAttributedStringForNil:");
+public static final int sel_sizeToFit = sel_registerName("sizeToFit");
+public static final int sel_setSortDescriptorPrototype_1 = sel_registerName("setSortDescriptorPrototype:");
+public static final int sel_canHide = sel_registerName("canHide");
+public static final int sel_replacementObjectForArchiver_1 = sel_registerName("replacementObjectForArchiver:");
+public static final int sel_purpleColor = sel_registerName("purpleColor");
+public static final int sel_setProperty_1forKey_1 = sel_registerName("setProperty:forKey:");
+public static final int sel_separatorItem = sel_registerName("separatorItem");
+public static final int sel_loadedCellAtRow_1column_1 = sel_registerName("loadedCellAtRow:column:");
+public static final int sel_containerSpecifier = sel_registerName("containerSpecifier");
+public static final int sel_draggingSourceOperationMaskForLocal_1 = sel_registerName("draggingSourceOperationMaskForLocal:");
+public static final int sel_willPresentError_1 = sel_registerName("willPresentError:");
+public static final int sel_strikethroughGlyphRange_1strikethroughType_1lineFragmentRect_1lineFragmentGlyphRange_1containerOrigin_1 = sel_registerName("strikethroughGlyphRange:strikethroughType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:");
+public static final int sel_elementWithName_1stringValue_1 = sel_registerName("elementWithName:stringValue:");
+public static final int sel_unsignedCharValue = sel_registerName("unsignedCharValue");
+public static final int sel_rangeOfComposedCharacterSequencesForRange_1 = sel_registerName("rangeOfComposedCharacterSequencesForRange:");
+public static final int sel_activate_1 = sel_registerName("activate:");
+public static final int sel_controlView = sel_registerName("controlView");
+public static final int sel_cachePolicy = sel_registerName("cachePolicy");
+public static final int sel_fontAttributesInRange_1 = sel_registerName("fontAttributesInRange:");
+public static final int sel_setPreservesSelection_1 = sel_registerName("setPreservesSelection:");
+public static final int sel_unscript_1 = sel_registerName("unscript:");
+public static final int sel_deltaZ = sel_registerName("deltaZ");
+public static final int sel_connection_1handleRequest_1 = sel_registerName("connection:handleRequest:");
+public static final int sel_caseSensitive = sel_registerName("caseSensitive");
+public static final int sel_tabViewItemAtPoint_1 = sel_registerName("tabViewItemAtPoint:");
+public static final int sel_setTextAttributesForNegativeValues_1 = sel_registerName("setTextAttributesForNegativeValues:");
+public static final int sel_underlineGlyphRange_1underlineType_1lineFragmentRect_1lineFragmentGlyphRange_1containerOrigin_1 = sel_registerName("underlineGlyphRange:underlineType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:");
+public static final int sel_classForCoder = sel_registerName("classForCoder");
+public static final int sel_setContent_1 = sel_registerName("setContent:");
+public static final int sel_getLineStart_1end_1contentsEnd_1forRange_1 = sel_registerName("getLineStart:end:contentsEnd:forRange:");
+public static final int sel_removeRowsAtIndexes_1includeSubrows_1 = sel_registerName("removeRowsAtIndexes:includeSubrows:");
+public static final int sel_tokenFieldCell_1styleForRepresentedObject_1 = sel_registerName("tokenFieldCell:styleForRepresentedObject:");
+public static final int sel_setToolTip_1 = sel_registerName("setToolTip:");
+public static final int sel_titleHeight = sel_registerName("titleHeight");
+public static final int sel_setShowsStateBy_1 = sel_registerName("setShowsStateBy:");
+public static final int sel_URLWithString_1relativeToURL_1 = sel_registerName("URLWithString:relativeToURL:");
+public static final int sel_fileSystemRepresentationWithPath_1 = sel_registerName("fileSystemRepresentationWithPath:");
+public static final int sel_setRate_1 = sel_registerName("setRate:");
+public static final int sel_extraLineFragmentTextContainer = sel_registerName("extraLineFragmentTextContainer");
+public static final int sel_insertObjects_1atArrangedObjectIndexes_1 = sel_registerName("insertObjects:atArrangedObjectIndexes:");
+public static final int sel_fontDescriptorWithSymbolicTraits_1 = sel_registerName("fontDescriptorWithSymbolicTraits:");
+public static final int sel_topMargin = sel_registerName("topMargin");
+public static final int sel_tokenField_1representedObjectForEditingString_1 = sel_registerName("tokenField:representedObjectForEditingString:");
+public static final int sel_drawInsertionPointInRect_1color_1turnedOn_1 = sel_registerName("drawInsertionPointInRect:color:turnedOn:");
+public static final int sel_fontNamed_1hasTraits_1 = sel_registerName("fontNamed:hasTraits:");
+public static final int sel_revertToSavedFromFile_1ofType_1 = sel_registerName("revertToSavedFromFile:ofType:");
+public static final int sel_cString = sel_registerName("cString");
+public static final int sel_markerForItemNumber_1 = sel_registerName("markerForItemNumber:");
+public static final int sel_mapTableWithWeakToStrongObjects = sel_registerName("mapTableWithWeakToStrongObjects");
+public static final int sel_autosaveExpandedItems = sel_registerName("autosaveExpandedItems");
+public static final int sel_setMiterLimit_1 = sel_registerName("setMiterLimit:");
+public static final int sel_indentationLevel = sel_registerName("indentationLevel");
+public static final int sel_fileHandleForUpdatingAtPath_1 = sel_registerName("fileHandleForUpdatingAtPath:");
+public static final int sel_fontWithDescriptor_1textTransform_1 = sel_registerName("fontWithDescriptor:textTransform:");
+public static final int sel_selectLine_1 = sel_registerName("selectLine:");
+public static final int sel_deleteForward_1 = sel_registerName("deleteForward:");
+public static final int sel_getAdvancements_1forPackedGlyphs_1length_1 = sel_registerName("getAdvancements:forPackedGlyphs:length:");
+public static final int sel_usesRuler = sel_registerName("usesRuler");
+public static final int sel_performClose_1 = sel_registerName("performClose:");
+public static final int sel_trackRect = sel_registerName("trackRect");
+public static final int sel_setFont_1 = sel_registerName("setFont:");
+public static final int sel_conformsToProtocol_1 = sel_registerName("conformsToProtocol:");
+public static final int sel_appendBezierPathWithPoints_1count_1 = sel_registerName("appendBezierPathWithPoints:count:");
+public static final int sel_defaultLineHeightForFont_1 = sel_registerName("defaultLineHeightForFont:");
+public static final int sel_mouse_1inRect_1 = sel_registerName("mouse:inRect:");
+public static final int sel_portCoderWithReceivePort_1sendPort_1components_1 = sel_registerName("portCoderWithReceivePort:sendPort:components:");
+public static final int sel_inputClientDisabled_1 = sel_registerName("inputClientDisabled:");
+public static final int sel_widthForSegment_1 = sel_registerName("widthForSegment:");
+public static final int sel_performSelector_1 = sel_registerName("performSelector:");
+public static final int sel_recalculateKeyViewLoop = sel_registerName("recalculateKeyViewLoop");
+public static final int sel_initWithDrawSelector_1delegate_1 = sel_registerName("initWithDrawSelector:delegate:");
+public static final int sel_breakUndoCoalescing = sel_registerName("breakUndoCoalescing");
+public static final int sel_font = sel_registerName("font");
+public static final int sel_fontDescriptorWithSize_1 = sel_registerName("fontDescriptorWithSize:");
+public static final int sel_insertItemWithTitle_1atIndex_1 = sel_registerName("insertItemWithTitle:atIndex:");
+public static final int sel_contentAspectRatio = sel_registerName("contentAspectRatio");
+public static final int sel_currentHandler = sel_registerName("currentHandler");
+public static final int sel_sharedAppleEventManager = sel_registerName("sharedAppleEventManager");
+public static final int sel_pathForResource_1ofType_1 = sel_registerName("pathForResource:ofType:");
+public static final int sel_initWithRequest_1cachedResponse_1client_1 = sel_registerName("initWithRequest:cachedResponse:client:");
+public static final int sel_isTitled = sel_registerName("isTitled");
+public static final int sel_drawerWillOpen_1 = sel_registerName("drawerWillOpen:");
+public static final int sel_screenFont = sel_registerName("screenFont");
+public static final int sel_principalClass = sel_registerName("principalClass");
+public static final int sel_pathControl_1willDisplayOpenPanel_1 = sel_registerName("pathControl:willDisplayOpenPanel:");
+public static final int sel_setGroupingSeparator_1 = sel_registerName("setGroupingSeparator:");
+public static final int sel_fontWithDescriptor_1size_1 = sel_registerName("fontWithDescriptor:size:");
+public static final int sel_glyphInfoWithCharacterIdentifier_1collection_1baseString_1 = sel_registerName("glyphInfoWithCharacterIdentifier:collection:baseString:");
+public static final int sel_movieUnfilteredFileTypes = sel_registerName("movieUnfilteredFileTypes");
+public static final int sel_portList = sel_registerName("portList");
+public static final int sel_tokenField_1readFromPasteboard_1 = sel_registerName("tokenField:readFromPasteboard:");
+public static final int sel_setEndSpecifier_1 = sel_registerName("setEndSpecifier:");
+public static final int sel_textView_1willDisplayToolTip_1forCharacterAtIndex_1 = sel_registerName("textView:willDisplayToolTip:forCharacterAtIndex:");
+public static final int sel_applicationIconImage = sel_registerName("applicationIconImage");
+public static final int sel_target = sel_registerName("target");
+public static final int sel_replaceGlyphAtIndex_1withGlyph_1 = sel_registerName("replaceGlyphAtIndex:withGlyph:");
+public static final int sel_borderColorForEdge_1 = sel_registerName("borderColorForEdge:");
+public static final int sel_timeIntervalSinceDate_1 = sel_registerName("timeIntervalSinceDate:");
+public static final int sel_pathsForResourcesOfType_1inDirectory_1forLocalization_1 = sel_registerName("pathsForResourcesOfType:inDirectory:forLocalization:");
+public static final int sel_bitmapData = sel_registerName("bitmapData");
+public static final int sel_redComponent = sel_registerName("redComponent");
+public static final int sel_numberOfVisibleItems = sel_registerName("numberOfVisibleItems");
+public static final int sel_selectCell_1 = sel_registerName("selectCell:");
+public static final int sel_applicationWillHide_1 = sel_registerName("applicationWillHide:");
+public static final int sel_characterIsMember_1 = sel_registerName("characterIsMember:");
+public static final int sel_setArrowsPosition_1 = sel_registerName("setArrowsPosition:");
+public static final int sel_minusSign = sel_registerName("minusSign");
+public static final int sel_canSpawnSeparateThread = sel_registerName("canSpawnSeparateThread");
+public static final int sel_setContinuous_1 = sel_registerName("setContinuous:");
+public static final int sel_addSymbolicLinkWithDestination_1preferredFilename_1 = sel_registerName("addSymbolicLinkWithDestination:preferredFilename:");
+public static final int sel_destinationOfSymbolicLinkAtPath_1error_1 = sel_registerName("destinationOfSymbolicLinkAtPath:error:");
+public static final int sel_runUntilDate_1 = sel_registerName("runUntilDate:");
+public static final int sel_stringByAbbreviatingWithTildeInPath = sel_registerName("stringByAbbreviatingWithTildeInPath");
+public static final int sel_drawerWillResizeContents_1toSize_1 = sel_registerName("drawerWillResizeContents:toSize:");
+public static final int sel_imageRectForBounds_1 = sel_registerName("imageRectForBounds:");
+public static final int sel_indexGreaterThanIndex_1 = sel_registerName("indexGreaterThanIndex:");
+public static final int sel_setSelectionFrom_1to_1anchor_1highlight_1 = sel_registerName("setSelectionFrom:to:anchor:highlight:");
+public static final int sel_unsignedIntegerValue = sel_registerName("unsignedIntegerValue");
+public static final int sel_focusView = sel_registerName("focusView");
+public static final int sel_longCharacterIsMember_1 = sel_registerName("longCharacterIsMember:");
+public static final int sel_groupingSeparator = sel_registerName("groupingSeparator");
+public static final int sel_depthLimit = sel_registerName("depthLimit");
+public static final int sel_attributesAtIndex_1longestEffectiveRange_1inRange_1 = sel_registerName("attributesAtIndex:longestEffectiveRange:inRange:");
+public static final int sel_setAcceptsArrowKeys_1 = sel_registerName("setAcceptsArrowKeys:");
+public static final int sel_isGreaterThanOrEqualTo_1 = sel_registerName("isGreaterThanOrEqualTo:");
+public static final int sel_maxContentSize = sel_registerName("maxContentSize");
+public static final int sel_setParentWindow_1 = sel_registerName("setParentWindow:");
+public static final int sel_importsGraphics = sel_registerName("importsGraphics");
+public static final int sel_setPaddingPosition_1 = sel_registerName("setPaddingPosition:");
+public static final int sel_yearOfCommonEra = sel_registerName("yearOfCommonEra");
+public static final int sel_cells = sel_registerName("cells");
+public static final int sel_cyanComponent = sel_registerName("cyanComponent");
+public static final int sel_documentClassForType_1 = sel_registerName("documentClassForType:");
+public static final int sel_setSelectionHighlightStyle_1 = sel_registerName("setSelectionHighlightStyle:");
+public static final int sel_addWindowController_1 = sel_registerName("addWindowController:");
+public static final int sel_initWithXMLString_1error_1 = sel_registerName("initWithXMLString:error:");
+public static final int sel_authenticateComponents_1withData_1 = sel_registerName("authenticateComponents:withData:");
+public static final int sel_traitsOfFont_1 = sel_registerName("traitsOfFont:");
+public static final int sel_timeIntervalSinceReferenceDate = sel_registerName("timeIntervalSinceReferenceDate");
+public static final int sel_orderFrontCharacterPalette_1 = sel_registerName("orderFrontCharacterPalette:");
+public static final int sel_setServicesProvider_1 = sel_registerName("setServicesProvider:");
+public static final int sel_setMessage_1 = sel_registerName("setMessage:");
+public static final int sel_msgid = sel_registerName("msgid");
+public static final int sel_beginUndoGrouping = sel_registerName("beginUndoGrouping");
+public static final int sel_RTFDFromRange_1documentAttributes_1 = sel_registerName("RTFDFromRange:documentAttributes:");
+public static final int sel_selectedItem = sel_registerName("selectedItem");
+public static final int sel_addTabStop_1 = sel_registerName("addTabStop:");
+public static final int sel_scrollRect_1by_1 = sel_registerName("scrollRect:by:");
+public static final int sel_icon = sel_registerName("icon");
+public static final int sel_setValue_1forUndefinedKey_1 = sel_registerName("setValue:forUndefinedKey:");
+public static final int sel_decodeFloatForKey_1 = sel_registerName("decodeFloatForKey:");
+public static final int sel_commentURL = sel_registerName("commentURL");
+public static final int sel_shortStandaloneMonthSymbols = sel_registerName("shortStandaloneMonthSymbols");
+public static final int sel_browser_1titleOfColumn_1 = sel_registerName("browser:titleOfColumn:");
+public static final int sel_exit = sel_registerName("exit");
+public static final int sel_deselectAll_1 = sel_registerName("deselectAll:");
+public static final int sel_canRemove = sel_registerName("canRemove");
+public static final int sel_proxyType = sel_registerName("proxyType");
+public static final int sel_shouldCloseDocument = sel_registerName("shouldCloseDocument");
+public static final int sel_setMinimumLineHeight_1 = sel_registerName("setMinimumLineHeight:");
+public static final int sel_grayColor = sel_registerName("grayColor");
+public static final int sel_suspend = sel_registerName("suspend");
+public static final int sel_printJobTitle = sel_registerName("printJobTitle");
+public static final int sel_fileHandleWithStandardOutput = sel_registerName("fileHandleWithStandardOutput");
+public static final int sel_objCType = sel_registerName("objCType");
+public static final int sel_maximumIntegerDigits = sel_registerName("maximumIntegerDigits");
+public static final int sel_initWithKey_1ascending_1 = sel_registerName("initWithKey:ascending:");
+public static final int sel_paramDescriptorForKeyword_1 = sel_registerName("paramDescriptorForKeyword:");
+public static final int sel_cookiesForURL_1 = sel_registerName("cookiesForURL:");
+public static final int sel_currentTextContainer = sel_registerName("currentTextContainer");
+public static final int sel_removeAllCachedResponses = sel_registerName("removeAllCachedResponses");
+public static final int sel_setAllHTTPHeaderFields_1 = sel_registerName("setAllHTTPHeaderFields:");
+public static final int sel_setShortQuarterSymbols_1 = sel_registerName("setShortQuarterSymbols:");
+public static final int sel_removeItemWithObjectValue_1 = sel_registerName("removeItemWithObjectValue:");
+public static final int sel_reloadColumn_1 = sel_registerName("reloadColumn:");
+public static final int sel_initWithData_1 = sel_registerName("initWithData:");
+public static final int sel_textDidEndEditing_1 = sel_registerName("textDidEndEditing:");
+public static final int sel_descriptorForKeyword_1 = sel_registerName("descriptorForKeyword:");
+public static final int sel_gState = sel_registerName("gState");
+public static final int sel_setCellClass_1 = sel_registerName("setCellClass:");
+public static final int sel_requestUserAttention_1 = sel_registerName("requestUserAttention:");
+public static final int sel_disableUndoRegistration = sel_registerName("disableUndoRegistration");
+public static final int sel_currencySymbol = sel_registerName("currencySymbol");
+public static final int sel_defaultWritingDirectionForLanguage_1 = sel_registerName("defaultWritingDirectionForLanguage:");
+public static final int sel_selectedCellInColumn_1 = sel_registerName("selectedCellInColumn:");
+public static final int sel_spellServer_1didForgetWord_1inLanguage_1 = sel_registerName("spellServer:didForgetWord:inLanguage:");
+public static final int sel_initWithType_1error_1 = sel_registerName("initWithType:error:");
+public static final int sel_editedRow = sel_registerName("editedRow");
+public static final int sel_expressionForUnionSet_1with_1 = sel_registerName("expressionForUnionSet:with:");
+public static final int sel_verticalMotionCanBeginDrag = sel_registerName("verticalMotionCanBeginDrag");
+public static final int sel_selectNextKeyView_1 = sel_registerName("selectNextKeyView:");
+public static final int sel_lowercaseString = sel_registerName("lowercaseString");
+public static final int sel_intercellSpacing = sel_registerName("intercellSpacing");
+public static final int sel_selectedItemIdentifier = sel_registerName("selectedItemIdentifier");
+public static final int sel_getIndexes_1 = sel_registerName("getIndexes:");
+public static final int sel_contentRect = sel_registerName("contentRect");
+public static final int sel_addObjects_1 = sel_registerName("addObjects:");
+public static final int sel_selectedRowIndexes = sel_registerName("selectedRowIndexes");
+public static final int sel_setSecond_1 = sel_registerName("setSecond:");
+public static final int sel_setIgnoresMultiClick_1 = sel_registerName("setIgnoresMultiClick:");
+public static final int sel_hasMemberInPlane_1 = sel_registerName("hasMemberInPlane:");
+public static final int sel_setClientView_1 = sel_registerName("setClientView:");
+public static final int sel_setInitialFirstResponder_1 = sel_registerName("setInitialFirstResponder:");
+public static final int sel_defaultAnimationForKey_1 = sel_registerName("defaultAnimationForKey:");
+public static final int sel_systemTimeZone = sel_registerName("systemTimeZone");
+public static final int sel_pageSizeForPaper_1 = sel_registerName("pageSizeForPaper:");
+public static final int sel_windowBackgroundColor = sel_registerName("windowBackgroundColor");
+public static final int sel_prepareGState = sel_registerName("prepareGState");
+public static final int sel_willSetLineFragmentRect_1forGlyphRange_1usedRect_1baselineOffset_1 = sel_registerName("willSetLineFragmentRect:forGlyphRange:usedRect:baselineOffset:");
+public static final int sel_setScriptingProperties_1 = sel_registerName("setScriptingProperties:");
+public static final int sel_initWithScrollView_1orientation_1 = sel_registerName("initWithScrollView:orientation:");
+public static final int sel_canBecomeVisibleWithoutLogin = sel_registerName("canBecomeVisibleWithoutLogin");
+public static final int sel_scrollLineDown_1 = sel_registerName("scrollLineDown:");
+public static final int sel_setServicesMenu_1 = sel_registerName("setServicesMenu:");
+public static final int sel_appleEventCode = sel_registerName("appleEventCode");
+public static final int sel_replaceObjectsInRange_1withObjectsFromArray_1range_1 = sel_registerName("replaceObjectsInRange:withObjectsFromArray:range:");
+public static final int sel_autosizesCells = sel_registerName("autosizesCells");
+public static final int sel_tableView_1toolTipForCell_1rect_1tableColumn_1row_1mouseLocation_1 = sel_registerName("tableView:toolTipForCell:rect:tableColumn:row:mouseLocation:");
+public static final int sel_dateWithYear_1month_1day_1hour_1minute_1second_1timeZone_1 = sel_registerName("dateWithYear:month:day:hour:minute:second:timeZone:");
+public static final int sel_windowWillResize_1toSize_1 = sel_registerName("windowWillResize:toSize:");
+public static final int sel_initWithUnsignedChar_1 = sel_registerName("initWithUnsignedChar:");
+public static final int sel_suiteForAppleEventCode_1 = sel_registerName("suiteForAppleEventCode:");
+public static final int sel_setTrailingOffset_1 = sel_registerName("setTrailingOffset:");
+public static final int sel_canBecomeKeyWindow = sel_registerName("canBecomeKeyWindow");
+public static final int sel_setAnimationBlockingMode_1 = sel_registerName("setAnimationBlockingMode:");
+public static final int sel_formUnionWithCharacterSet_1 = sel_registerName("formUnionWithCharacterSet:");
+public static final int sel_typeForArgumentWithName_1 = sel_registerName("typeForArgumentWithName:");
+public static final int sel_setFileName_1 = sel_registerName("setFileName:");
+public static final int sel_createSymbolicLinkAtPath_1pathContent_1 = sel_registerName("createSymbolicLinkAtPath:pathContent:");
+public static final int sel_undoMenuTitleForUndoActionName_1 = sel_registerName("undoMenuTitleForUndoActionName:");
+public static final int sel_dateStyle = sel_registerName("dateStyle");
+public static final int sel_currentContext = sel_registerName("currentContext");
+public static final int sel_dequeueNotificationsMatching_1coalesceMask_1 = sel_registerName("dequeueNotificationsMatching:coalesceMask:");
+public static final int sel_thousandSeparator = sel_registerName("thousandSeparator");
+public static final int sel_writeData_1 = sel_registerName("writeData:");
+public static final int sel_selectedTag = sel_registerName("selectedTag");
+public static final int sel_drawWithRect_1options_1 = sel_registerName("drawWithRect:options:");
+public static final int sel_canonicalLocaleIdentifierFromString_1 = sel_registerName("canonicalLocaleIdentifierFromString:");
+public static final int sel_convertFontTraits_1 = sel_registerName("convertFontTraits:");
+public static final int sel_itemAdded_1 = sel_registerName("itemAdded:");
+public static final int sel_scriptErrorString = sel_registerName("scriptErrorString");
+public static final int sel_submenuAction_1 = sel_registerName("submenuAction:");
+public static final int sel_initWithType_1subpredicates_1 = sel_registerName("initWithType:subpredicates:");
+public static final int sel_subpathsOfDirectoryAtPath_1error_1 = sel_registerName("subpathsOfDirectoryAtPath:error:");
+public static final int sel_becomesKeyOnlyIfNeeded = sel_registerName("becomesKeyOnlyIfNeeded");
+public static final int sel_displayAllColumns = sel_registerName("displayAllColumns");
+public static final int sel_indexOfItemWithSubmenu_1 = sel_registerName("indexOfItemWithSubmenu:");
+public static final int sel_runModalSavePanelForSaveOperation_1delegate_1didSaveSelector_1contextInfo_1 = sel_registerName("runModalSavePanelForSaveOperation:delegate:didSaveSelector:contextInfo:");
+public static final int sel_setCollectionBehavior_1 = sel_registerName("setCollectionBehavior:");
+public static final int sel_boundingRectWithSize_1options_1attributes_1 = sel_registerName("boundingRectWithSize:options:attributes:");
+public static final int sel_valueForAttribute_1 = sel_registerName("valueForAttribute:");
+public static final int sel_attributedStringForNotANumber = sel_registerName("attributedStringForNotANumber");
+public static final int sel_indicesOfObjectsByEvaluatingObjectSpecifier_1 = sel_registerName("indicesOfObjectsByEvaluatingObjectSpecifier:");
+public static final int sel_initWithPath_1 = sel_registerName("initWithPath:");
+public static final int sel_doCommandBySelector_1 = sel_registerName("doCommandBySelector:");
+public static final int sel_numberWithChar_1 = sel_registerName("numberWithChar:");
+public static final int sel_setAllowsMixedState_1 = sel_registerName("setAllowsMixedState:");
+public static final int sel_abortEditing = sel_registerName("abortEditing");
+public static final int sel_context = sel_registerName("context");
+public static final int sel_drawerShouldClose_1 = sel_registerName("drawerShouldClose:");
+public static final int sel_tabViewDidChangeNumberOfTabViewItems_1 = sel_registerName("tabViewDidChangeNumberOfTabViewItems:");
+public static final int sel_focusRingType = sel_registerName("focusRingType");
+public static final int sel_copyScriptingValue_1forKey_1withProperties_1 = sel_registerName("copyScriptingValue:forKey:withProperties:");
+public static final int sel_acceptsFirstMouse_1 = sel_registerName("acceptsFirstMouse:");
+public static final int sel_initWithPosition_1objectSpecifier_1 = sel_registerName("initWithPosition:objectSpecifier:");
+public static final int sel_selectionRangeForProposedRange_1granularity_1 = sel_registerName("selectionRangeForProposedRange:granularity:");
+public static final int sel_isNotEqualTo_1 = sel_registerName("isNotEqualTo:");
+public static final int sel_encodeRootObject_1 = sel_registerName("encodeRootObject:");
+public static final int sel_hasSuffix_1 = sel_registerName("hasSuffix:");
+public static final int sel_initWithFontAttributes_1 = sel_registerName("initWithFontAttributes:");
+public static final int sel_initWithRTFDFileWrapper_1documentAttributes_1 = sel_registerName("initWithRTFDFileWrapper:documentAttributes:");
+public static final int sel_miniwindowImage = sel_registerName("miniwindowImage");
+public static final int sel_developmentLocalization = sel_registerName("developmentLocalization");
+public static final int sel_localizedSummaryItems = sel_registerName("localizedSummaryItems");
+public static final int sel_intValue = sel_registerName("intValue");
+public static final int sel_setReturnValue_1 = sel_registerName("setReturnValue:");
+public static final int sel_selectedMenuItemColor = sel_registerName("selectedMenuItemColor");
+public static final int sel_editColumn_1row_1withEvent_1select_1 = sel_registerName("editColumn:row:withEvent:select:");
+public static final int sel_descriptionWithCalendarFormat_1timeZone_1locale_1 = sel_registerName("descriptionWithCalendarFormat:timeZone:locale:");
+public static final int sel_itemHeight = sel_registerName("itemHeight");
+public static final int sel_application_1openFiles_1 = sel_registerName("application:openFiles:");
+public static final int sel_window = sel_registerName("window");
+public static final int sel_setShortStandaloneMonthSymbols_1 = sel_registerName("setShortStandaloneMonthSymbols:");
+public static final int sel_setTag_1 = sel_registerName("setTag:");
+public static final int sel_ignoredWordsInSpellDocumentWithTag_1 = sel_registerName("ignoredWordsInSpellDocumentWithTag:");
+public static final int sel_preferredLocalizationsFromArray_1 = sel_registerName("preferredLocalizationsFromArray:");
+public static final int sel_intersectsIndexesInRange_1 = sel_registerName("intersectsIndexesInRange:");
+public static final int sel_scanLongLong_1 = sel_registerName("scanLongLong:");
+public static final int sel_characterSetWithContentsOfFile_1 = sel_registerName("characterSetWithContentsOfFile:");
+public static final int sel_elementWithName_1children_1attributes_1 = sel_registerName("elementWithName:children:attributes:");
+public static final int sel_removeItem_1 = sel_registerName("removeItem:");
+public static final int sel_classForKeyedArchiver = sel_registerName("classForKeyedArchiver");
+public static final int sel_initWithString_1locale_1 = sel_registerName("initWithString:locale:");
+public static final int sel_initWithData_1options_1error_1 = sel_registerName("initWithData:options:error:");
+public static final int sel_setIsPaneSplitter_1 = sel_registerName("setIsPaneSplitter:");
+public static final int sel_URLHandle_1resourceDataDidBecomeAvailable_1 = sel_registerName("URLHandle:resourceDataDidBecomeAvailable:");
+public static final int sel_systemDefaultPortNameServer = sel_registerName("systemDefaultPortNameServer");
+public static final int sel_controlTextDidEndEditing_1 = sel_registerName("controlTextDidEndEditing:");
+public static final int sel_commandDescription = sel_registerName("commandDescription");
+public static final int sel_collapseItem_1 = sel_registerName("collapseItem:");
+public static final int sel_setAutoresizesOutlineColumn_1 = sel_registerName("setAutoresizesOutlineColumn:");
+public static final int sel_isSubsetOfHashTable_1 = sel_registerName("isSubsetOfHashTable:");
+public static final int sel_discardEventsMatchingMask_1beforeEvent_1 = sel_registerName("discardEventsMatchingMask:beforeEvent:");
+public static final int sel_highlightSelectionInClipRect_1 = sel_registerName("highlightSelectionInClipRect:");
+public static final int sel_decodeSizeForKey_1 = sel_registerName("decodeSizeForKey:");
+public static final int sel_decimalNumberByRaisingToPower_1 = sel_registerName("decimalNumberByRaisingToPower:");
+public static final int sel_canBecomeMainWindow = sel_registerName("canBecomeMainWindow");
+public static final int sel_setMenuItem_1 = sel_registerName("setMenuItem:");
+public static final int sel_contentRectForFrameRect_1styleMask_1 = sel_registerName("contentRectForFrameRect:styleMask:");
+public static final int sel_clearGLContext = sel_registerName("clearGLContext");
+public static final int sel_setFileType_1 = sel_registerName("setFileType:");
+public static final int sel_expressionForIntersectSet_1with_1 = sel_registerName("expressionForIntersectSet:with:");
+public static final int sel_sharedHelpManager = sel_registerName("sharedHelpManager");
+public static final int sel_setMiniwindowTitle_1 = sel_registerName("setMiniwindowTitle:");
+public static final int sel_fontDescriptorWithName_1size_1 = sel_registerName("fontDescriptorWithName:size:");
+public static final int sel_cookies = sel_registerName("cookies");
+public static final int sel_detachNewThreadSelector_1toTarget_1withObject_1 = sel_registerName("detachNewThreadSelector:toTarget:withObject:");
+public static final int sel_needsPanelToBecomeKey = sel_registerName("needsPanelToBecomeKey");
+public static final int sel_retainArguments = sel_registerName("retainArguments");
+public static final int sel_textStorageWillProcessEditing_1 = sel_registerName("textStorageWillProcessEditing:");
+public static final int sel_location = sel_registerName("location");
+public static final int sel_shouldChangeTextInRange_1replacementString_1 = sel_registerName("shouldChangeTextInRange:replacementString:");
+public static final int sel_textView_1doubleClickedOnCell_1inRect_1 = sel_registerName("textView:doubleClickedOnCell:inRect:");
+public static final int sel_validateVisibleItems = sel_registerName("validateVisibleItems");
+public static final int sel_isOneway = sel_registerName("isOneway");
+public static final int sel_zone = sel_registerName("zone");
+public static final int sel_titleAlignment = sel_registerName("titleAlignment");
+public static final int sel_localNameForName_1 = sel_registerName("localNameForName:");
+public static final int sel_loopMode = sel_registerName("loopMode");
+public static final int sel_setFocusRingType_1 = sel_registerName("setFocusRingType:");
+public static final int sel_stringForKey_1 = sel_registerName("stringForKey:");
+public static final int sel_initWithDomain_1type_1name_1 = sel_registerName("initWithDomain:type:name:");
+public static final int sel_animationDidEnd_1 = sel_registerName("animationDidEnd:");
+public static final int sel_addSubview_1positioned_1relativeTo_1 = sel_registerName("addSubview:positioned:relativeTo:");
+public static final int sel_removeObjects_1 = sel_registerName("removeObjects:");
+public static final int sel_graphicsContextWithBitmapImageRep_1 = sel_registerName("graphicsContextWithBitmapImageRep:");
+public static final int sel_isDescendantOf_1 = sel_registerName("isDescendantOf:");
+public static final int sel_tableView_1nextTypeSelectMatchFromRow_1toRow_1forString_1 = sel_registerName("tableView:nextTypeSelectMatchFromRow:toRow:forString:");
+public static final int sel_initWithRequest_1delegate_1startImmediately_1 = sel_registerName("initWithRequest:delegate:startImmediately:");
+public static final int sel_reservedThicknessForMarkers = sel_registerName("reservedThicknessForMarkers");
+public static final int sel_movieRect = sel_registerName("movieRect");
+public static final int sel_portForName_1host_1 = sel_registerName("portForName:host:");
+public static final int sel_tabView_1willSelectTabViewItem_1 = sel_registerName("tabView:willSelectTabViewItem:");
+public static final int sel_isOneShot = sel_registerName("isOneShot");
+public static final int sel_usesThreadedAnimation = sel_registerName("usesThreadedAnimation");
+public static final int sel_shortStandaloneQuarterSymbols = sel_registerName("shortStandaloneQuarterSymbols");
+public static final int sel_browser_1validateDrop_1proposedRow_1column_1dropOperation_1 = sel_registerName("browser:validateDrop:proposedRow:column:dropOperation:");
+public static final int sel_setLineSpacing_1 = sel_registerName("setLineSpacing:");
+public static final int sel_indexOfItemWithTitle_1 = sel_registerName("indexOfItemWithTitle:");
+public static final int sel_subrowsKeyPath = sel_registerName("subrowsKeyPath");
+public static final int sel_showsResizeIndicator = sel_registerName("showsResizeIndicator");
+public static final int sel_setState_1 = sel_registerName("setState:");
+public static final int sel_fileAttributesAtPath_1traverseLink_1 = sel_registerName("fileAttributesAtPath:traverseLink:");
+public static final int sel_setHorizontal_1 = sel_registerName("setHorizontal:");
+public static final int sel_windowDidExpose_1 = sel_registerName("windowDidExpose:");
+public static final int sel_systemID = sel_registerName("systemID");
+public static final int sel_turnOffKerning_1 = sel_registerName("turnOffKerning:");
+public static final int sel_stringByReplacingPercentEscapesUsingEncoding_1 = sel_registerName("stringByReplacingPercentEscapesUsingEncoding:");
+public static final int sel_control_1textView_1completions_1forPartialWordRange_1indexOfSelectedItem_1 = sel_registerName("control:textView:completions:forPartialWordRange:indexOfSelectedItem:");
+public static final int sel_selectLastTabViewItem_1 = sel_registerName("selectLastTabViewItem:");
+public static final int sel_setKeyEquivalentFont_1 = sel_registerName("setKeyEquivalentFont:");
+public static final int sel_invalidateCursorRectsForView_1 = sel_registerName("invalidateCursorRectsForView:");
+public static final int sel_selectTextAtIndex_1 = sel_registerName("selectTextAtIndex:");
+public static final int sel_showPools = sel_registerName("showPools");
+public static final int sel_setPlaysSelectionOnly_1 = sel_registerName("setPlaysSelectionOnly:");
+public static final int sel_note = sel_registerName("note");
+public static final int sel_setDrawsCellBackground_1 = sel_registerName("setDrawsCellBackground:");
+public static final int sel_layoutCharactersInRange_1forLayoutManager_1maximumNumberOfLineFragments_1 = sel_registerName("layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:");
+public static final int sel_lengthOfBytesUsingEncoding_1 = sel_registerName("lengthOfBytesUsingEncoding:");
+public static final int sel_columnResizingType = sel_registerName("columnResizingType");
+public static final int sel_paragraphSeparatorGlyphRange = sel_registerName("paragraphSeparatorGlyphRange");
+public static final int sel_floatValue = sel_registerName("floatValue");
+public static final int sel_setRoundingIncrement_1 = sel_registerName("setRoundingIncrement:");
+public static final int sel_dateFromString_1 = sel_registerName("dateFromString:");
+public static final int sel_panel_1shouldShowFilename_1 = sel_registerName("panel:shouldShowFilename:");
+public static final int sel_isEqualToDate_1 = sel_registerName("isEqualToDate:");
+public static final int sel_drawWithFrame_1inView_1characterIndex_1 = sel_registerName("drawWithFrame:inView:characterIndex:");
+public static final int sel_initWithInteger_1 = sel_registerName("initWithInteger:");
+public static final int sel_CGImage = sel_registerName("CGImage");
+public static final int sel_endDocument = sel_registerName("endDocument");
+public static final int sel_removeFile = sel_registerName("removeFile");
+public static final int sel_splitView_1shouldCollapseSubview_1forDoubleClickOnDividerAtIndex_1 = sel_registerName("splitView:shouldCollapseSubview:forDoubleClickOnDividerAtIndex:");
+public static final int sel_setDefaultMiterLimit_1 = sel_registerName("setDefaultMiterLimit:");
+public static final int sel_keyCode = sel_registerName("keyCode");
+public static final int sel_raise_1format_1 = sel_registerName("raise:format:");
+public static final int sel_cellSize = sel_registerName("cellSize");
+public static final int sel_runModalForWindow_1 = sel_registerName("runModalForWindow:");
+public static final int sel_colorListNamed_1 = sel_registerName("colorListNamed:");
+public static final int sel_detachColorList_1 = sel_registerName("detachColorList:");
+public static final int sel_postEvent_1atStart_1 = sel_registerName("postEvent:atStart:");
+public static final int sel_setMaximumFractionDigits_1 = sel_registerName("setMaximumFractionDigits:");
+public static final int sel_setVolatileDomain_1forName_1 = sel_registerName("setVolatileDomain:forName:");
+public static final int sel_imageInterpolation = sel_registerName("imageInterpolation");
+public static final int sel_setTitlePosition_1 = sel_registerName("setTitlePosition:");
+public static final int sel_leadingOffset = sel_registerName("leadingOffset");
+public static final int sel_invokeWithTarget_1 = sel_registerName("invokeWithTarget:");
+public static final int sel_negativeFormat = sel_registerName("negativeFormat");
+public static final int sel_windowController = sel_registerName("windowController");
+public static final int sel_setVerticalPageScroll_1 = sel_registerName("setVerticalPageScroll:");
+public static final int sel_applicationDidUpdate_1 = sel_registerName("applicationDidUpdate:");
+public static final int sel_valueForProperty_1 = sel_registerName("valueForProperty:");
+public static final int sel_tokenField_1hasMenuForRepresentedObject_1 = sel_registerName("tokenField:hasMenuForRepresentedObject:");
+public static final int sel_resolveClassMethod_1 = sel_registerName("resolveClassMethod:");
+public static final int sel_setAutomaticQuoteSubstitutionEnabled_1 = sel_registerName("setAutomaticQuoteSubstitutionEnabled:");
+public static final int sel_ordinalityOfUnit_1inUnit_1forDate_1 = sel_registerName("ordinalityOfUnit:inUnit:forDate:");
+public static final int sel_initWithHost_1port_1protocol_1realm_1authenticationMethod_1 = sel_registerName("initWithHost:port:protocol:realm:authenticationMethod:");
+public static final int sel_timeIntervalSinceNow = sel_registerName("timeIntervalSinceNow");
+public static final int sel_showFindIndicatorForRange_1 = sel_registerName("showFindIndicatorForRange:");
+public static final int sel_drawLabel_1inRect_1 = sel_registerName("drawLabel:inRect:");
+public static final int sel_startQuery = sel_registerName("startQuery");
+public static final int sel_initWithNibNamed_1bundle_1 = sel_registerName("initWithNibNamed:bundle:");
+public static final int sel_firstResponder = sel_registerName("firstResponder");
+public static final int sel_windowWillMove_1 = sel_registerName("windowWillMove:");
+public static final int sel_dictionaryForKey_1 = sel_registerName("dictionaryForKey:");
+public static final int sel_decodeValueOfObjCType_1at_1 = sel_registerName("decodeValueOfObjCType:at:");
+public static final int sel_activeApplication = sel_registerName("activeApplication");
+public static final int sel_initWithUnsignedLongLong_1 = sel_registerName("initWithUnsignedLongLong:");
+public static final int sel_decimalNumberWithString_1 = sel_registerName("decimalNumberWithString:");
+public static final int sel_replaceTextStorage_1 = sel_registerName("replaceTextStorage:");
+public static final int sel_relativePosition = sel_registerName("relativePosition");
+public static final int sel_objectValueOfSelectedItem = sel_registerName("objectValueOfSelectedItem");
+public static final int sel_timeInterval = sel_registerName("timeInterval");
+public static final int sel_getBytes_1range_1 = sel_registerName("getBytes:range:");
+public static final int sel_initWithViewAnimations_1 = sel_registerName("initWithViewAnimations:");
+public static final int sel_setHorizontalRulerView_1 = sel_registerName("setHorizontalRulerView:");
+public static final int sel_keyPathsForValuesAffectingPreview = sel_registerName("keyPathsForValuesAffectingPreview");
+public static final int sel_setWithObjects_1count_1 = sel_registerName("setWithObjects:count:");
+public static final int sel_bitsPerSample = sel_registerName("bitsPerSample");
+public static final int sel_dayOfYear = sel_registerName("dayOfYear");
+public static final int sel_maximumFractionDigits = sel_registerName("maximumFractionDigits");
+public static final int sel_isSelectionByRect = sel_registerName("isSelectionByRect");
+public static final int sel_getRed_1green_1blue_1alpha_1 = sel_registerName("getRed:green:blue:alpha:");
+public static final int sel_glyphIsEncoded_1 = sel_registerName("glyphIsEncoded:");
+public static final int sel_setStartSubelementIdentifier_1 = sel_registerName("setStartSubelementIdentifier:");
+public static final int sel_connection_1didFailWithError_1 = sel_registerName("connection:didFailWithError:");
+public static final int sel_parser_1foundExternalEntityDeclarationWithName_1publicID_1systemID_1 = sel_registerName("parser:foundExternalEntityDeclarationWithName:publicID:systemID:");
+public static final int sel_outlineView_1shouldTypeSelectForEvent_1withCurrentSearchString_1 = sel_registerName("outlineView:shouldTypeSelectForEvent:withCurrentSearchString:");
+public static final int sel_lowerBaseline_1 = sel_registerName("lowerBaseline:");
+public static final int sel_outlineView_1willDisplayCell_1forTableColumn_1item_1 = sel_registerName("outlineView:willDisplayCell:forTableColumn:item:");
+public static final int sel_notificationWithName_1object_1userInfo_1 = sel_registerName("notificationWithName:object:userInfo:");
+public static final int sel_setMaxConcurrentOperationCount_1 = sel_registerName("setMaxConcurrentOperationCount:");
+public static final int sel_closeSpellDocumentWithTag_1 = sel_registerName("closeSpellDocumentWithTag:");
+public static final int sel_popUpStatusItemMenu_1 = sel_registerName("popUpStatusItemMenu:");
+public static final int sel_itemPrototype = sel_registerName("itemPrototype");
+public static final int sel_commandName = sel_registerName("commandName");
+public static final int sel_setTextAttributesForZero_1 = sel_registerName("setTextAttributesForZero:");
+public static final int sel_dateFromComponents_1 = sel_registerName("dateFromComponents:");
+public static final int sel_outlineViewColumnDidResize_1 = sel_registerName("outlineViewColumnDidResize:");
+public static final int sel_setTailIndent_1 = sel_registerName("setTailIndent:");
+public static final int sel_setRowTemplates_1 = sel_registerName("setRowTemplates:");
+public static final int sel_objectsForXQuery_1constants_1error_1 = sel_registerName("objectsForXQuery:constants:error:");
+public static final int sel_mutableCopyWithZone_1 = sel_registerName("mutableCopyWithZone:");
+public static final int sel_initWithItemIdentifier_1 = sel_registerName("initWithItemIdentifier:");
+public static final int sel_minuteOfHour = sel_registerName("minuteOfHour");
+public static final int sel_setAutosavingDelay_1 = sel_registerName("setAutosavingDelay:");
+public static final int sel_nextKeyView = sel_registerName("nextKeyView");
+public static final int sel_orderFront_1 = sel_registerName("orderFront:");
+public static final int sel_encodeValueOfObjCType_1at_1 = sel_registerName("encodeValueOfObjCType:at:");
+public static final int sel_mode = sel_registerName("mode");
+public static final int sel_appleEventWithEventClass_1eventID_1targetDescriptor_1returnID_1transactionID_1 = sel_registerName("appleEventWithEventClass:eventID:targetDescriptor:returnID:transactionID:");
+public static final int sel_stringByDeletingPathExtension = sel_registerName("stringByDeletingPathExtension");
+public static final int sel_standardOutput = sel_registerName("standardOutput");
+public static final int sel_enumCodeValue = sel_registerName("enumCodeValue");
+public static final int sel_setResourceData_1 = sel_registerName("setResourceData:");
+public static final int sel_convertRectFromBase_1 = sel_registerName("convertRectFromBase:");
+public static final int sel_initWithContentRect_1styleMask_1backing_1defer_1screen_1 = sel_registerName("initWithContentRect:styleMask:backing:defer:screen:");
+public static final int sel_autoenablesItems = sel_registerName("autoenablesItems");
+public static final int sel_textContainerForGlyphAtIndex_1effectiveRange_1withoutAdditionalLayout_1 = sel_registerName("textContainerForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:");
+public static final int sel_QTMovie = sel_registerName("QTMovie");
+public static final int sel_addObserver_1selector_1name_1object_1suspensionBehavior_1 = sel_registerName("addObserver:selector:name:object:suspensionBehavior:");
+public static final int sel_getArgument_1atIndex_1 = sel_registerName("getArgument:atIndex:");
+public static final int sel_replaceChildAtIndex_1withNode_1 = sel_registerName("replaceChildAtIndex:withNode:");
+public static final int sel_beginForDirectory_1file_1types_1modelessDelegate_1didEndSelector_1contextInfo_1 = sel_registerName("beginForDirectory:file:types:modelessDelegate:didEndSelector:contextInfo:");
+public static final int sel_supportsMode_1 = sel_registerName("supportsMode:");
+public static final int sel_openFile_1 = sel_registerName("openFile:");
+public static final int sel_zero = sel_registerName("zero");
+public static final int sel_compositingFilter = sel_registerName("compositingFilter");
+public static final int sel_fileGroupOwnerAccountID = sel_registerName("fileGroupOwnerAccountID");
+public static final int sel_tokenField_1writeRepresentedObjects_1toPasteboard_1 = sel_registerName("tokenField:writeRepresentedObjects:toPasteboard:");
+public static final int sel_tabViewType = sel_registerName("tabViewType");
+public static final int sel_drawSortIndicatorWithFrame_1inView_1ascending_1priority_1 = sel_registerName("drawSortIndicatorWithFrame:inView:ascending:priority:");
+public static final int sel_spellCheckerDocumentTag = sel_registerName("spellCheckerDocumentTag");
+public static final int sel_updateFromPMPageFormat = sel_registerName("updateFromPMPageFormat");
+public static final int sel_colorSyncProfile = sel_registerName("colorSyncProfile");
+public static final int sel_flushBufferedKeyEvents = sel_registerName("flushBufferedKeyEvents");
+public static final int sel_removeAllObjects = sel_registerName("removeAllObjects");
+public static final int sel_selectItemWithTitle_1 = sel_registerName("selectItemWithTitle:");
+public static final int sel_textContainers = sel_registerName("textContainers");
+public static final int sel_isHorizontallyResizable = sel_registerName("isHorizontallyResizable");
+public static final int sel_selectionIndexPaths = sel_registerName("selectionIndexPaths");
+public static final int sel_setString_1forType_1 = sel_registerName("setString:forType:");
+public static final int sel_setWraps_1 = sel_registerName("setWraps:");
+public static final int sel_dataCell = sel_registerName("dataCell");
+public static final int sel_addPointer_1 = sel_registerName("addPointer:");
+public static final int sel_invalidate = sel_registerName("invalidate");
+public static final int sel_draggingImageForRowsWithIndexes_1inColumn_1withEvent_1offset_1 = sel_registerName("draggingImageForRowsWithIndexes:inColumn:withEvent:offset:");
+public static final int sel_horizontalEdgePadding = sel_registerName("horizontalEdgePadding");
+public static final int sel_view = sel_registerName("view");
+public static final int sel_showsPrintPanel = sel_registerName("showsPrintPanel");
+public static final int sel_hyphenationFactor = sel_registerName("hyphenationFactor");
+public static final int sel_setAcceptsGlyphInfo_1 = sel_registerName("setAcceptsGlyphInfo:");
+public static final int sel_formatWidth = sel_registerName("formatWidth");
+public static final int sel_stringByAppendingFormat_1 = sel_registerName("stringByAppendingFormat:");
+public static final int sel_documentForFileName_1 = sel_registerName("documentForFileName:");
+public static final int sel_outlineView_1nextTypeSelectMatchFromItem_1toItem_1forString_1 = sel_registerName("outlineView:nextTypeSelectMatchFromItem:toItem:forString:");
+public static final int sel_isItemExpanded_1 = sel_registerName("isItemExpanded:");
+public static final int sel_playbackDeviceIdentifier = sel_registerName("playbackDeviceIdentifier");
+public static final int sel_addButtonWithTitle_1 = sel_registerName("addButtonWithTitle:");
+public static final int sel_lowercaseLetterCharacterSet = sel_registerName("lowercaseLetterCharacterSet");
+public static final int sel_netService_1didNotResolve_1 = sel_registerName("netService:didNotResolve:");
+public static final int sel_copiesOnScroll = sel_registerName("copiesOnScroll");
+public static final int sel_unarchiver_1willReplaceObject_1withObject_1 = sel_registerName("unarchiver:willReplaceObject:withObject:");
+public static final int sel_setHasShadow_1 = sel_registerName("setHasShadow:");
+public static final int sel_addObserver_1selector_1name_1object_1 = sel_registerName("addObserver:selector:name:object:");
+public static final int sel_setDouble_1forKey_1 = sel_registerName("setDouble:forKey:");
+public static final int sel_positionOfGlyph_1struckOverRect_1metricsExist_1 = sel_registerName("positionOfGlyph:struckOverRect:metricsExist:");
+public static final int sel_sharedInstance = sel_registerName("sharedInstance");
+public static final int sel_setPaperSize_1 = sel_registerName("setPaperSize:");
+public static final int sel_data1 = sel_registerName("data1");
+public static final int sel_applicationWillBecomeActive_1 = sel_registerName("applicationWillBecomeActive:");
+public static final int sel_URLProtocol_1cachedResponseIsValid_1 = sel_registerName("URLProtocol:cachedResponseIsValid:");
+public static final int sel_mouseDown_1 = sel_registerName("mouseDown:");
+public static final int sel_setVeryShortStandaloneWeekdaySymbols_1 = sel_registerName("setVeryShortStandaloneWeekdaySymbols:");
+public static final int sel_setUsesStrongWriteBarrier_1 = sel_registerName("setUsesStrongWriteBarrier:");
+public static final int sel_second = sel_registerName("second");
+public static final int sel_predicateWithLeftExpression_1rightExpression_1modifier_1type_1options_1 = sel_registerName("predicateWithLeftExpression:rightExpression:modifier:type:options:");
+public static final int sel_setFloatingPanel_1 = sel_registerName("setFloatingPanel:");
+public static final int sel_parser_1didEndElement_1namespaceURI_1qualifiedName_1 = sel_registerName("parser:didEndElement:namespaceURI:qualifiedName:");
+public static final int sel_handlePortMessage_1 = sel_registerName("handlePortMessage:");
+public static final int sel_filteredSetUsingPredicate_1 = sel_registerName("filteredSetUsingPredicate:");
+public static final int sel_setLocalizedKeyDictionary_1 = sel_registerName("setLocalizedKeyDictionary:");
+public static final int sel_drawCellInside_1 = sel_registerName("drawCellInside:");
+public static final int sel_browserDidScroll_1 = sel_registerName("browserDidScroll:");
+public static final int sel_isDirectory = sel_registerName("isDirectory");
+public static final int sel_setEnvironment_1 = sel_registerName("setEnvironment:");
+public static final int sel_persistence = sel_registerName("persistence");
+public static final int sel_backingType = sel_registerName("backingType");
+public static final int sel_orderedDocuments = sel_registerName("orderedDocuments");
+public static final int sel_windowWillUseStandardFrame_1defaultFrame_1 = sel_registerName("windowWillUseStandardFrame:defaultFrame:");
+public static final int sel_toggleTraditionalCharacterShape_1 = sel_registerName("toggleTraditionalCharacterShape:");
+public static final int sel_fractionOfDistanceThroughGlyphForPoint_1 = sel_registerName("fractionOfDistanceThroughGlyphForPoint:");
+public static final int sel_netServiceWillPublish_1 = sel_registerName("netServiceWillPublish:");
+public static final int sel_drawInRect_1relativeCenterPosition_1 = sel_registerName("drawInRect:relativeCenterPosition:");
+public static final int sel_setShowsAlpha_1 = sel_registerName("setShowsAlpha:");
+public static final int sel_canDragRowsWithIndexes_1inColumn_1withEvent_1 = sel_registerName("canDragRowsWithIndexes:inColumn:withEvent:");
+public static final int sel_start = sel_registerName("start");
+public static final int sel_imageRectInRuler = sel_registerName("imageRectInRuler");
+public static final int sel_TXTRecordData = sel_registerName("TXTRecordData");
+public static final int sel_groupingLevel = sel_registerName("groupingLevel");
+public static final int sel_response = sel_registerName("response");
+public static final int sel_insertionIndex = sel_registerName("insertionIndex");
+public static final int sel_cancelPreviousPerformRequestsWithTarget_1selector_1object_1 = sel_registerName("cancelPreviousPerformRequestsWithTarget:selector:object:");
+public static final int sel_itemWithTitle_1 = sel_registerName("itemWithTitle:");
+public static final int sel_insertRow_1 = sel_registerName("insertRow:");
+public static final int sel_mutableChildNodes = sel_registerName("mutableChildNodes");
+public static final int sel_removeAllPoints = sel_registerName("removeAllPoints");
+public static final int sel_searchForRegistrationDomains = sel_registerName("searchForRegistrationDomains");
+public static final int sel_replacementObjectForCoder_1 = sel_registerName("replacementObjectForCoder:");
+public static final int sel_tangentialPressure = sel_registerName("tangentialPressure");
+public static final int sel_setMaxDate_1 = sel_registerName("setMaxDate:");
+public static final int sel_performMnemonic_1 = sel_registerName("performMnemonic:");
+public static final int sel_maximumRecentDocumentCount = sel_registerName("maximumRecentDocumentCount");
+public static final int sel_stringsByAppendingPaths_1 = sel_registerName("stringsByAppendingPaths:");
+public static final int sel_localTimeZone = sel_registerName("localTimeZone");
+public static final int sel_draggingLocation = sel_registerName("draggingLocation");
+public static final int sel_searchForAllDomains = sel_registerName("searchForAllDomains");
+public static final int sel_attributedStringWithAttachment_1 = sel_registerName("attributedStringWithAttachment:");
+public static final int sel_initWithContentsOfURL_1byReference_1 = sel_registerName("initWithContentsOfURL:byReference:");
+public static final int sel_exchangeObjectAtIndex_1withObjectAtIndex_1 = sel_registerName("exchangeObjectAtIndex:withObjectAtIndex:");
+public static final int sel_draw = sel_registerName("draw");
+public static final int sel_fileIsImmutable = sel_registerName("fileIsImmutable");
+public static final int sel_tokenField_1styleForRepresentedObject_1 = sel_registerName("tokenField:styleForRepresentedObject:");
+public static final int sel_setAutorecalculatesContentBorderThickness_1forEdge_1 = sel_registerName("setAutorecalculatesContentBorderThickness:forEdge:");
+public static final int sel_firstRectForCharacterRange_1actualRange_1 = sel_registerName("firstRectForCharacterRange:actualRange:");
+public static final int sel_targetForAction_1to_1from_1 = sel_registerName("targetForAction:to:from:");
+public static final int sel_setShouldCloseDocument_1 = sel_registerName("setShouldCloseDocument:");
+public static final int sel_originOffset = sel_registerName("originOffset");
+public static final int sel_sharedSupportPath = sel_registerName("sharedSupportPath");
+public static final int sel_disableScreenUpdatesUntilFlush = sel_registerName("disableScreenUpdatesUntilFlush");
+public static final int sel_setShortStandaloneQuarterSymbols_1 = sel_registerName("setShortStandaloneQuarterSymbols:");
+public static final int sel_filenames = sel_registerName("filenames");
+public static final int sel_numberOfItemsInComboBox_1 = sel_registerName("numberOfItemsInComboBox:");
+public static final int sel_hasBytesAvailable = sel_registerName("hasBytesAvailable");
+public static final int sel_currentConversation = sel_registerName("currentConversation");
+public static final int sel_setAllowsEditingTextAttributes_1 = sel_registerName("setAllowsEditingTextAttributes:");
+public static final int sel_initWithName_1stringValue_1 = sel_registerName("initWithName:stringValue:");
+public static final int sel_tableViewColumnDidResize_1 = sel_registerName("tableViewColumnDidResize:");
+public static final int sel_knowsPageRange_1 = sel_registerName("knowsPageRange:");
+public static final int sel_uppercaseLetterCharacterSet = sel_registerName("uppercaseLetterCharacterSet");
+public static final int sel_capitalizedLetterCharacterSet = sel_registerName("capitalizedLetterCharacterSet");
+public static final int sel_main = sel_registerName("main");
+public static final int sel_genericRGBColorSpace = sel_registerName("genericRGBColorSpace");
+public static final int sel_clearsFilterPredicateOnInsertion = sel_registerName("clearsFilterPredicateOnInsertion");
+public static final int sel_paragraphs = sel_registerName("paragraphs");
+public static final int sel_setJobDisposition_1 = sel_registerName("setJobDisposition:");
+public static final int sel_setContainerClassDescription_1 = sel_registerName("setContainerClassDescription:");
+public static final int sel_stringWithContentsOfURL_1 = sel_registerName("stringWithContentsOfURL:");
+public static final int sel_setTrackingMode_1 = sel_registerName("setTrackingMode:");
+public static final int sel_canCloseDocumentWithDelegate_1shouldCloseSelector_1contextInfo_1 = sel_registerName("canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:");
+public static final int sel_usesItemFromMenu = sel_registerName("usesItemFromMenu");
+public static final int sel_shortValue = sel_registerName("shortValue");
+public static final int sel_readDataOfLength_1 = sel_registerName("readDataOfLength:");
+public static final int sel_descriptorWithDescriptorType_1data_1 = sel_registerName("descriptorWithDescriptorType:data:");
+public static final int sel_setCanRemoveAllRows_1 = sel_registerName("setCanRemoveAllRows:");
+public static final int sel_defaultCenter = sel_registerName("defaultCenter");
+public static final int sel_scriptingIsGreaterThan_1 = sel_registerName("scriptingIsGreaterThan:");
+public static final int sel_splitView_1constrainSplitPosition_1ofSubviewAt_1 = sel_registerName("splitView:constrainSplitPosition:ofSubviewAt:");
+public static final int sel_setTokenStyle_1 = sel_registerName("setTokenStyle:");
+public static final int sel_initWithContentRect_1styleMask_1backing_1defer_1 = sel_registerName("initWithContentRect:styleMask:backing:defer:");
+public static final int sel_insertTabViewItem_1atIndex_1 = sel_registerName("insertTabViewItem:atIndex:");
+public static final int sel_rowForDisplayValue_1 = sel_registerName("rowForDisplayValue:");
+public static final int sel_isDrawingToScreen = sel_registerName("isDrawingToScreen");
+public static final int sel_encodeRect_1 = sel_registerName("encodeRect:");
+public static final int sel_controlDarkShadowColor = sel_registerName("controlDarkShadowColor");
+public static final int sel_maxDate = sel_registerName("maxDate");
+public static final int sel_lock = sel_registerName("lock");
+public static final int sel_resetSystemTimeZone = sel_registerName("resetSystemTimeZone");
+public static final int sel_coerceValue_1toClass_1 = sel_registerName("coerceValue:toClass:");
+public static final int sel_qdPort = sel_registerName("qdPort");
+public static final int sel_resultAtIndex_1 = sel_registerName("resultAtIndex:");
+public static final int sel_descriptorWithBoolean_1 = sel_registerName("descriptorWithBoolean:");
+public static final int sel_markedRange = sel_registerName("markedRange");
+public static final int sel_colorWithCalibratedHue_1saturation_1brightness_1alpha_1 = sel_registerName("colorWithCalibratedHue:saturation:brightness:alpha:");
+public static final int sel_setSharedPrintInfo_1 = sel_registerName("setSharedPrintInfo:");
+public static final int sel_setBorderColor_1 = sel_registerName("setBorderColor:");
+public static final int sel_parser_1foundCharacters_1 = sel_registerName("parser:foundCharacters:");
+public static final int sel_preferredPasteboardTypeFromArray_1restrictedToTypesFromArray_1 = sel_registerName("preferredPasteboardTypeFromArray:restrictedToTypesFromArray:");
+public static final int sel_resume = sel_registerName("resume");
+public static final int sel_iconForFiles_1 = sel_registerName("iconForFiles:");
+public static final int sel_drawKeyEquivalentWithFrame_1inView_1 = sel_registerName("drawKeyEquivalentWithFrame:inView:");
+public static final int sel_boxType = sel_registerName("boxType");
+public static final int sel_initWithContainerClassDescription_1containerSpecifier_1key_1name_1 = sel_registerName("initWithContainerClassDescription:containerSpecifier:key:name:");
+public static final int sel_setFill = sel_registerName("setFill");
+public static final int sel_setParagraphGlyphRange_1separatorGlyphRange_1 = sel_registerName("setParagraphGlyphRange:separatorGlyphRange:");
+public static final int sel_copyWithZone_1 = sel_registerName("copyWithZone:");
+public static final int sel_self = sel_registerName("self");
+public static final int sel_reservedSpaceLength = sel_registerName("reservedSpaceLength");
+public static final int sel_unsignedIntValue = sel_registerName("unsignedIntValue");
+public static final int sel_URLHandleResourceDidFinishLoading_1 = sel_registerName("URLHandleResourceDidFinishLoading:");
+public static final int sel_menuWillOpen_1 = sel_registerName("menuWillOpen:");
+public static final int sel_pointerArrayWithWeakObjects = sel_registerName("pointerArrayWithWeakObjects");
+public static final int sel_fetchPredicate = sel_registerName("fetchPredicate");
+public static final int sel_pathToColumn_1 = sel_registerName("pathToColumn:");
+public static final int sel_columnWithIdentifier_1 = sel_registerName("columnWithIdentifier:");
+public static final int sel_setShouldCreateUI_1 = sel_registerName("setShouldCreateUI:");
+public static final int sel_getGlyphs_1range_1 = sel_registerName("getGlyphs:range:");
+public static final int sel_returnID = sel_registerName("returnID");
+public static final int sel_miterLimit = sel_registerName("miterLimit");
+public static final int sel_hidesEmptyCells = sel_registerName("hidesEmptyCells");
+public static final int sel_userSpaceScaleFactor = sel_registerName("userSpaceScaleFactor");
+public static final int sel_xHeight = sel_registerName("xHeight");
+public static final int sel_decimalNumberByMultiplyingBy_1withBehavior_1 = sel_registerName("decimalNumberByMultiplyingBy:withBehavior:");
+public static final int sel_reloadData = sel_registerName("reloadData");
+public static final int sel_setShortWeekdaySymbols_1 = sel_registerName("setShortWeekdaySymbols:");
+public static final int sel_containsIndexesInRange_1 = sel_registerName("containsIndexesInRange:");
+public static final int sel_colorWithDeviceRed_1green_1blue_1alpha_1 = sel_registerName("colorWithDeviceRed:green:blue:alpha:");
+public static final int sel_screenFontWithRenderingMode_1 = sel_registerName("screenFontWithRenderingMode:");
+public static final int sel_suggestedFilename = sel_registerName("suggestedFilename");
+public static final int sel_fileNameExtensionForType_1saveOperation_1 = sel_registerName("fileNameExtensionForType:saveOperation:");
+public static final int sel_labelFontSize = sel_registerName("labelFontSize");
+public static final int sel_setAlphaValue_1 = sel_registerName("setAlphaValue:");
+public static final int sel_openGLContext = sel_registerName("openGLContext");
+public static final int sel_scriptingIsLessThan_1 = sel_registerName("scriptingIsLessThan:");
+public static final int sel_keysSortedByValueUsingSelector_1 = sel_registerName("keysSortedByValueUsingSelector:");
+public static final int sel_control_1didFailToValidatePartialString_1errorDescription_1 = sel_registerName("control:didFailToValidatePartialString:errorDescription:");
+public static final int sel_offStateImage = sel_registerName("offStateImage");
+public static final int sel_bidiProcessingEnabled = sel_registerName("bidiProcessingEnabled");
+public static final int sel_isKeyWindow = sel_registerName("isKeyWindow");
+public static final int sel_initWithIconRef_1 = sel_registerName("initWithIconRef:");
+public static final int sel_changeCurrentDirectoryPath_1 = sel_registerName("changeCurrentDirectoryPath:");
+public static final int sel_textView = sel_registerName("textView");
+public static final int sel_localizedStringForStatusCode_1 = sel_registerName("localizedStringForStatusCode:");
+public static final int sel_setWantsLayer_1 = sel_registerName("setWantsLayer:");
+public static final int sel_positivePrefix = sel_registerName("positivePrefix");
+public static final int sel_setDefaultFlatness_1 = sel_registerName("setDefaultFlatness:");
+public static final int sel_addChild_1 = sel_registerName("addChild:");
+public static final int sel_parser_1foundAttributeDeclarationWithName_1forElement_1type_1defaultValue_1 = sel_registerName("parser:foundAttributeDeclarationWithName:forElement:type:defaultValue:");
+public static final int sel_scannerWithString_1 = sel_registerName("scannerWithString:");
+public static final int sel_removeFileWrapper_1 = sel_registerName("removeFileWrapper:");
+public static final int sel_setTitleWidth_1 = sel_registerName("setTitleWidth:");
+public static final int sel_setTabKeyTraversesCells_1 = sel_registerName("setTabKeyTraversesCells:");
+public static final int sel_glyphRangeForBoundingRect_1inTextContainer_1 = sel_registerName("glyphRangeForBoundingRect:inTextContainer:");
+public static final int sel_fileHandleForWritingAtPath_1 = sel_registerName("fileHandleForWritingAtPath:");
+public static final int sel_initWithContainerClassDescription_1containerSpecifier_1key_1 = sel_registerName("initWithContainerClassDescription:containerSpecifier:key:");
+public static final int sel_fontAttributes = sel_registerName("fontAttributes");
+public static final int sel_reviewUnsavedDocumentsWithAlertTitle_1cancellable_1delegate_1didReviewAllSelector_1contextInfo_1 = sel_registerName("reviewUnsavedDocumentsWithAlertTitle:cancellable:delegate:didReviewAllSelector:contextInfo:");
+public static final int sel_minWidth = sel_registerName("minWidth");
+public static final int sel_getLineFragmentInsertionPointsForCharacterAtIndex_1alternatePositions_1inDisplayOrder_1positions_1characterIndexes_1 = sel_registerName("getLineFragmentInsertionPointsForCharacterAtIndex:alternatePositions:inDisplayOrder:positions:characterIndexes:");
+public static final int sel_finishDecoding = sel_registerName("finishDecoding");
+public static final int sel_currentContextDrawingToScreen = sel_registerName("currentContextDrawingToScreen");
+public static final int sel_setKeyEquivalent_1 = sel_registerName("setKeyEquivalent:");
+public static final int sel_smartInsertForString_1replacingRange_1beforeString_1afterString_1 = sel_registerName("smartInsertForString:replacingRange:beforeString:afterString:");
+public static final int sel_useStandardKerning_1 = sel_registerName("useStandardKerning:");
+public static final int sel_sharedSystemTypesetter = sel_registerName("sharedSystemTypesetter");
+public static final int sel_setDatePickerMode_1 = sel_registerName("setDatePickerMode:");
+public static final int sel_encodePoint_1forKey_1 = sel_registerName("encodePoint:forKey:");
+public static final int sel_colorSpace = sel_registerName("colorSpace");
+public static final int sel_pasteboardByFilteringTypesInPasteboard_1 = sel_registerName("pasteboardByFilteringTypesInPasteboard:");
+public static final int sel_sendDoubleAction = sel_registerName("sendDoubleAction");
+public static final int sel_isColumnSelected_1 = sel_registerName("isColumnSelected:");
+public static final int sel_unarchiveObjectWithFile_1 = sel_registerName("unarchiveObjectWithFile:");
+public static final int sel_usesEPSOnResolutionMismatch = sel_registerName("usesEPSOnResolutionMismatch");
+public static final int sel_encodeBycopyObject_1 = sel_registerName("encodeBycopyObject:");
+public static final int sel_removeAttributeForName_1 = sel_registerName("removeAttributeForName:");
+public static final int sel_keyCell = sel_registerName("keyCell");
+public static final int sel_allocWithZone_1 = sel_registerName("allocWithZone:");
+public static final int sel_getCompression_1factor_1 = sel_registerName("getCompression:factor:");
+public static final int sel_insertValue_1inPropertyWithKey_1 = sel_registerName("insertValue:inPropertyWithKey:");
+public static final int sel_drawAtPoint_1withAttributes_1 = sel_registerName("drawAtPoint:withAttributes:");
+public static final int sel_isTrue = sel_registerName("isTrue");
+public static final int sel_expectedContentLength = sel_registerName("expectedContentLength");
+public static final int sel_setTitle_1 = sel_registerName("setTitle:");
+public static final int sel_connection_1didReceiveAuthenticationChallenge_1 = sel_registerName("connection:didReceiveAuthenticationChallenge:");
+public static final int sel_isEnabledForSegment_1 = sel_registerName("isEnabledForSegment:");
+public static final int sel_speechSynthesizer_1willSpeakPhoneme_1 = sel_registerName("speechSynthesizer:willSpeakPhoneme:");
+public static final int sel_setShowsStateColumn_1 = sel_registerName("setShowsStateColumn:");
+public static final int sel_requiredFileType = sel_registerName("requiredFileType");
+public static final int sel_convertRect_1fromView_1 = sel_registerName("convertRect:fromView:");
+public static final int sel_visibleFrame = sel_registerName("visibleFrame");
+public static final int sel_concludeDragOperation_1 = sel_registerName("concludeDragOperation:");
+public static final int sel_minimumFractionDigits = sel_registerName("minimumFractionDigits");
+public static final int sel_reopenDocumentForURL_1withContentsOfURL_1error_1 = sel_registerName("reopenDocumentForURL:withContentsOfURL:error:");
+public static final int sel_roundingMode = sel_registerName("roundingMode");
+public static final int sel_colorWithCatalogName_1colorName_1 = sel_registerName("colorWithCatalogName:colorName:");
+public static final int sel_setWithSet_1 = sel_registerName("setWithSet:");
+public static final int sel_fileManager_1willProcessPath_1 = sel_registerName("fileManager:willProcessPath:");
+public static final int sel_setSuspended_1 = sel_registerName("setSuspended:");
+public static final int sel_currentInputManager = sel_registerName("currentInputManager");
+public static final int sel_operatingSystemVersionString = sel_registerName("operatingSystemVersionString");
+public static final int sel_resetBytesInRange_1 = sel_registerName("resetBytesInRange:");
+public static final int sel_sizeForKey_1inTable_1 = sel_registerName("sizeForKey:inTable:");
+public static final int sel_setFloat_1forKey_1 = sel_registerName("setFloat:forKey:");
+public static final int sel_enableUndoRegistration = sel_registerName("enableUndoRegistration");
+public static final int sel_initWithCGImage_1 = sel_registerName("initWithCGImage:");
+public static final int sel_initWithCIImage_1 = sel_registerName("initWithCIImage:");
+public static final int sel_addCharactersInRange_1 = sel_registerName("addCharactersInRange:");
+public static final int sel_initWithRect_1options_1owner_1userInfo_1 = sel_registerName("initWithRect:options:owner:userInfo:");
+public static final int sel_incrementalLoadFromData_1complete_1 = sel_registerName("incrementalLoadFromData:complete:");
+public static final int sel_tableView_1acceptDrop_1row_1dropOperation_1 = sel_registerName("tableView:acceptDrop:row:dropOperation:");
+public static final int sel_classNamed_1 = sel_registerName("classNamed:");
+public static final int sel_setIndeterminate_1 = sel_registerName("setIndeterminate:");
+public static final int sel_normalizeAdjacentTextNodesPreservingCDATA_1 = sel_registerName("normalizeAdjacentTextNodesPreservingCDATA:");
+public static final int sel_validateUserInterfaceItem_1 = sel_registerName("validateUserInterfaceItem:");
+public static final int sel_setPlaysEveryFrame_1 = sel_registerName("setPlaysEveryFrame:");
+public static final int sel_isCompiled = sel_registerName("isCompiled");
+public static final int sel_tokenFieldCell_1editingStringForRepresentedObject_1 = sel_registerName("tokenFieldCell:editingStringForRepresentedObject:");
+public static final int sel_tableView_1isGroupRow_1 = sel_registerName("tableView:isGroupRow:");
+public static final int sel_orderFrontLinkPanel_1 = sel_registerName("orderFrontLinkPanel:");
+public static final int sel_alphaControlAddedOrRemoved_1 = sel_registerName("alphaControlAddedOrRemoved:");
+public static final int sel_setShadowColor_1 = sel_registerName("setShadowColor:");
+public static final int sel_canBecomeKeyView = sel_registerName("canBecomeKeyView");
+public static final int sel_addTimer_1forMode_1 = sel_registerName("addTimer:forMode:");
+public static final int sel_clickedColumn = sel_registerName("clickedColumn");
+public static final int sel_initWithName_1URI_1 = sel_registerName("initWithName:URI:");
+public static final int sel_saveDocument_1 = sel_registerName("saveDocument:");
+public static final int sel_observationInfo = sel_registerName("observationInfo");
+public static final int sel_readFromURL_1options_1documentAttributes_1error_1 = sel_registerName("readFromURL:options:documentAttributes:error:");
+public static final int sel_addClient_1 = sel_registerName("addClient:");
+public static final int sel_appleEventForSuspensionID_1 = sel_registerName("appleEventForSuspensionID:");
+public static final int sel_setGeneratesCalendarDates_1 = sel_registerName("setGeneratesCalendarDates:");
+public static final int sel_tableView_1sortDescriptorsDidChange_1 = sel_registerName("tableView:sortDescriptorsDidChange:");
+public static final int sel_predicateFormat = sel_registerName("predicateFormat");
+public static final int sel_windowShouldZoom_1toFrame_1 = sel_registerName("windowShouldZoom:toFrame:");
+public static final int sel_usesFontPanel = sel_registerName("usesFontPanel");
+public static final int sel_encodeNXObject_1 = sel_registerName("encodeNXObject:");
+public static final int sel_colorAtX_1y_1 = sel_registerName("colorAtX:y:");
+public static final int sel_publishWithOptions_1 = sel_registerName("publishWithOptions:");
+public static final int sel_allHTTPHeaderFields = sel_registerName("allHTTPHeaderFields");
+public static final int sel_registerPort_1name_1 = sel_registerName("registerPort:name:");
+public static final int sel_lineFragmentUsedRectForGlyphAtIndex_1effectiveRange_1withoutAdditionalLayout_1 = sel_registerName("lineFragmentUsedRectForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:");
+public static final int sel_hour = sel_registerName("hour");
+public static final int sel_setTextLists_1 = sel_registerName("setTextLists:");
+public static final int sel_maximumAdvancement = sel_registerName("maximumAdvancement");
+public static final int sel_setHighlightedItemIndex_1 = sel_registerName("setHighlightedItemIndex:");
+public static final int sel_initWithMemoryCapacity_1diskCapacity_1diskPath_1 = sel_registerName("initWithMemoryCapacity:diskCapacity:diskPath:");
+public static final int sel_setDocumentContentKind_1 = sel_registerName("setDocumentContentKind:");
+public static final int sel_updateDragTypeRegistration = sel_registerName("updateDragTypeRegistration");
+public static final int sel_deviceDescription = sel_registerName("deviceDescription");
+public static final int sel_setMiniwindowImage_1 = sel_registerName("setMiniwindowImage:");
+public static final int sel_sharedTypesetter = sel_registerName("sharedTypesetter");
+public static final int sel_deleteToEndOfLine_1 = sel_registerName("deleteToEndOfLine:");
+public static final int sel_setState_1atRow_1column_1 = sel_registerName("setState:atRow:column:");
+public static final int sel_validModesForFontPanel_1 = sel_registerName("validModesForFontPanel:");
+public static final int sel_currentCalendar = sel_registerName("currentCalendar");
+public static final int sel_selectionIndexPath = sel_registerName("selectionIndexPath");
+public static final int sel_setTextFont_1 = sel_registerName("setTextFont:");
+public static final int sel_password = sel_registerName("password");
+public static final int sel_words = sel_registerName("words");
+public static final int sel_status = sel_registerName("status");
+public static final int sel_typingAttributes = sel_registerName("typingAttributes");
+public static final int sel_handleTakeValue_1forUnboundKey_1 = sel_registerName("handleTakeValue:forUnboundKey:");
+public static final int sel_image_1didLoadRepresentation_1withStatus_1 = sel_registerName("image:didLoadRepresentation:withStatus:");
+public static final int sel_setBitsPerSample_1 = sel_registerName("setBitsPerSample:");
+public static final int sel_sortSubviewsUsingFunction_1context_1 = sel_registerName("sortSubviewsUsingFunction:context:");
+public static final int sel_initWithProtocolFamily_1socketType_1protocol_1socket_1 = sel_registerName("initWithProtocolFamily:socketType:protocol:socket:");
+public static final int sel_numberOfItemsInMenu_1 = sel_registerName("numberOfItemsInMenu:");
+public static final int sel_numberWithUnsignedShort_1 = sel_registerName("numberWithUnsignedShort:");
+public static final int sel_textView_1menu_1forEvent_1atIndex_1 = sel_registerName("textView:menu:forEvent:atIndex:");
+public static final int sel_arrowCursor = sel_registerName("arrowCursor");
+public static final int sel_abbreviation = sel_registerName("abbreviation");
+public static final int sel_moveDown_1 = sel_registerName("moveDown:");
+public static final int sel_activateContextHelpMode_1 = sel_registerName("activateContextHelpMode:");
+public static final int sel_properties = sel_registerName("properties");
+public static final int sel_setObject_1forProperty_1error_1 = sel_registerName("setObject:forProperty:error:");
+public static final int sel_setAutodisplay_1 = sel_registerName("setAutodisplay:");
+public static final int sel_locationInWindow = sel_registerName("locationInWindow");
+public static final int sel_layoutManager = sel_registerName("layoutManager");
+public static final int sel_hyphenCharacterForGlyphAtIndex_1 = sel_registerName("hyphenCharacterForGlyphAtIndex:");
+public static final int sel_play = sel_registerName("play");
+public static final int sel_compositeToPoint_1fromRect_1operation_1fraction_1 = sel_registerName("compositeToPoint:fromRect:operation:fraction:");
+public static final int sel_cellBackgroundColor = sel_registerName("cellBackgroundColor");
+public static final int sel_shouldAntialias = sel_registerName("shouldAntialias");
+public static final int sel_windowWillReturnFieldEditor_1toObject_1 = sel_registerName("windowWillReturnFieldEditor:toObject:");
+public static final int sel_setValuesForKeysWithDictionary_1 = sel_registerName("setValuesForKeysWithDictionary:");
+public static final int sel_drawsGrid = sel_registerName("drawsGrid");
+public static final int sel_patternPhase = sel_registerName("patternPhase");
+public static final int sel_setFrame_1 = sel_registerName("setFrame:");
+public static final int sel_roundingIncrement = sel_registerName("roundingIncrement");
+public static final int sel_adjustScroll_1 = sel_registerName("adjustScroll:");
+public static final int sel_alertShowHelp_1 = sel_registerName("alertShowHelp:");
+public static final int sel_animate_1 = sel_registerName("animate:");
+public static final int sel_tabletID = sel_registerName("tabletID");
+public static final int sel_selectedRowEnumerator = sel_registerName("selectedRowEnumerator");
+public static final int sel_XMLString = sel_registerName("XMLString");
+public static final int sel_setWarningValue_1 = sel_registerName("setWarningValue:");
+public static final int sel_tableView_1validateDrop_1proposedRow_1proposedDropOperation_1 = sel_registerName("tableView:validateDrop:proposedRow:proposedDropOperation:");
+public static final int sel_checkSpelling_1 = sel_registerName("checkSpelling:");
+public static final int sel_setFormattingStringsFilename_1 = sel_registerName("setFormattingStringsFilename:");
+public static final int sel_displayIfNeeded = sel_registerName("displayIfNeeded");
+public static final int sel_localizedName = sel_registerName("localizedName");
+public static final int sel_isEqualToSet_1 = sel_registerName("isEqualToSet:");
+public static final int sel_initWithBytesNoCopy_1length_1encoding_1freeWhenDone_1 = sel_registerName("initWithBytesNoCopy:length:encoding:freeWhenDone:");
+public static final int sel_reloadPredicate = sel_registerName("reloadPredicate");
+public static final int sel_setNumberOfMajorTickMarks_1 = sel_registerName("setNumberOfMajorTickMarks:");
+public static final int sel_defaultPlaceholderForMarker_1withBinding_1 = sel_registerName("defaultPlaceholderForMarker:withBinding:");
+public static final int sel_encodeDataObject_1 = sel_registerName("encodeDataObject:");
+public static final int sel_writeToURL_1ofType_1 = sel_registerName("writeToURL:ofType:");
+public static final int sel_createContext = sel_registerName("createContext");
+public static final int sel_verticalScroller = sel_registerName("verticalScroller");
+public static final int sel_setShowsInvisibleCharacters_1 = sel_registerName("setShowsInvisibleCharacters:");
+public static final int sel_encodeConditionalObject_1forKey_1 = sel_registerName("encodeConditionalObject:forKey:");
+public static final int sel_isEqualTo_1 = sel_registerName("isEqualTo:");
+public static final int sel_translateXBy_1yBy_1 = sel_registerName("translateXBy:yBy:");
+public static final int sel_customizationPaletteIsRunning = sel_registerName("customizationPaletteIsRunning");
+public static final int sel_dictionaryWithDictionary_1 = sel_registerName("dictionaryWithDictionary:");
+public static final int sel_drawMarkersInRect_1 = sel_registerName("drawMarkersInRect:");
+public static final int sel_centerSelectionInVisibleArea_1 = sel_registerName("centerSelectionInVisibleArea:");
+public static final int sel_stringByAppendingString_1 = sel_registerName("stringByAppendingString:");
+public static final int sel_flushWindowIfNeeded = sel_registerName("flushWindowIfNeeded");
+public static final int sel_lockFocusOnRepresentation_1 = sel_registerName("lockFocusOnRepresentation:");
+public static final int sel_setNotShownAttribute_1forGlyphAtIndex_1 = sel_registerName("setNotShownAttribute:forGlyphAtIndex:");
+public static final int sel_currentReplyAppleEvent = sel_registerName("currentReplyAppleEvent");
+public static final int sel_setTitleAlignment_1 = sel_registerName("setTitleAlignment:");
+public static final int sel_removeSuiteNamed_1 = sel_registerName("removeSuiteNamed:");
+public static final int sel_capitalizedString = sel_registerName("capitalizedString");
+public static final int sel_typeFromFileExtension_1 = sel_registerName("typeFromFileExtension:");
+public static final int sel_allowsImageEditing = sel_registerName("allowsImageEditing");
+public static final int sel_loosenKerning_1 = sel_registerName("loosenKerning:");
+public static final int sel_decomposableCharacterSet = sel_registerName("decomposableCharacterSet");
+public static final int sel_subdataWithRange_1 = sel_registerName("subdataWithRange:");
+public static final int sel_attachPopUpWithFrame_1inView_1 = sel_registerName("attachPopUpWithFrame:inView:");
+public static final int sel_setColumnResizingType_1 = sel_registerName("setColumnResizingType:");
+public static final int sel_genericCMYKColorSpace = sel_registerName("genericCMYKColorSpace");
+public static final int sel_actionForControlCharacterAtIndex_1 = sel_registerName("actionForControlCharacterAtIndex:");
+public static final int sel_documentRect = sel_registerName("documentRect");
+public static final int sel_dataWithContentsOfFile_1 = sel_registerName("dataWithContentsOfFile:");
+public static final int sel_localizedDescriptionForType_1 = sel_registerName("localizedDescriptionForType:");
+public static final int sel_increment = sel_registerName("increment");
+public static final int sel_deleteToEndOfParagraph_1 = sel_registerName("deleteToEndOfParagraph:");
+public static final int sel_exceptionWithName_1reason_1userInfo_1 = sel_registerName("exceptionWithName:reason:userInfo:");
+public static final int sel_postscriptName = sel_registerName("postscriptName");
+public static final int sel_setPreferredFilename_1 = sel_registerName("setPreferredFilename:");
+public static final int sel_setPostsBoundsChangedNotifications_1 = sel_registerName("setPostsBoundsChangedNotifications:");
+public static final int sel_decimalNumberHandlerWithRoundingMode_1scale_1raiseOnExactness_1raiseOnOverflow_1raiseOnUnderflow_1raiseOnDivideByZero_1 = sel_registerName("decimalNumberHandlerWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero:");
+public static final int sel_openDocumentWithContentsOfFile_1display_1 = sel_registerName("openDocumentWithContentsOfFile:display:");
+public static final int sel_objectForInfoDictionaryKey_1 = sel_registerName("objectForInfoDictionaryKey:");
+public static final int sel_setFrameOrigin_1 = sel_registerName("setFrameOrigin:");
+public static final int sel_pathControl_1willPopUpMenu_1 = sel_registerName("pathControl:willPopUpMenu:");
+public static final int sel_lineWidth = sel_registerName("lineWidth");
+public static final int sel_poseAsClass_1 = sel_registerName("poseAsClass:");
+public static final int sel_selectPreviousKeyView_1 = sel_registerName("selectPreviousKeyView:");
+public static final int sel_isKey_1inTable_1 = sel_registerName("isKey:inTable:");
+public static final int sel_isZoomed = sel_registerName("isZoomed");
+public static final int sel_setCompletionDelay_1 = sel_registerName("setCompletionDelay:");
+public static final int sel_mainMenu = sel_registerName("mainMenu");
+public static final int sel_scrollView = sel_registerName("scrollView");
+public static final int sel_dividerColor = sel_registerName("dividerColor");
+public static final int sel_requestModes = sel_registerName("requestModes");
+public static final int sel_setShowsResizeIndicator_1 = sel_registerName("setShowsResizeIndicator:");
+public static final int sel_setScrollable_1 = sel_registerName("setScrollable:");
+public static final int sel_setLineScroll_1 = sel_registerName("setLineScroll:");
+public static final int sel_resolvePrefixForNamespaceURI_1 = sel_registerName("resolvePrefixForNamespaceURI:");
+public static final int sel_bind_1toObject_1withKeyPath_1options_1 = sel_registerName("bind:toObject:withKeyPath:options:");
+public static final int sel_alignCenter_1 = sel_registerName("alignCenter:");
+public static final int sel_addTemporaryAttribute_1value_1forCharacterRange_1 = sel_registerName("addTemporaryAttribute:value:forCharacterRange:");
+public static final int sel_expressionForConstantValue_1 = sel_registerName("expressionForConstantValue:");
+public static final int sel_initWithContentSize_1preferredEdge_1 = sel_registerName("initWithContentSize:preferredEdge:");
+public static final int sel_setAccessoryView_1 = sel_registerName("setAccessoryView:");
+public static final int sel_setContentWidth_1type_1 = sel_registerName("setContentWidth:type:");
+public static final int sel_searchMenuTemplate = sel_registerName("searchMenuTemplate");
+public static final int sel_imageRepClassForType_1 = sel_registerName("imageRepClassForType:");
+public static final int sel_decimalValue = sel_registerName("decimalValue");
+public static final int sel_protocolSpecificInformation = sel_registerName("protocolSpecificInformation");
+public static final int sel_statusBar = sel_registerName("statusBar");
+public static final int sel_setTimeZone_1 = sel_registerName("setTimeZone:");
+public static final int sel_setWidth_1forSegment_1 = sel_registerName("setWidth:forSegment:");
+public static final int sel_objectIsForcedForKey_1inDomain_1 = sel_registerName("objectIsForcedForKey:inDomain:");
+public static final int sel_evaluationErrorSpecifier = sel_registerName("evaluationErrorSpecifier");
+public static final int sel_application_1openFile_1 = sel_registerName("application:openFile:");
+public static final int sel_changeDocumentBackgroundColor_1 = sel_registerName("changeDocumentBackgroundColor:");
+public static final int sel_volatileDomainNames = sel_registerName("volatileDomainNames");
+public static final int sel_changeInLength = sel_registerName("changeInLength");
+public static final int sel_autoresizingMask = sel_registerName("autoresizingMask");
+public static final int sel_setRepresentedObject_1 = sel_registerName("setRepresentedObject:");
+public static final int sel_isUndoRegistrationEnabled = sel_registerName("isUndoRegistrationEnabled");
+public static final int sel_alertWithError_1 = sel_registerName("alertWithError:");
+public static final int sel_saturationComponent = sel_registerName("saturationComponent");
+public static final int sel_spellServer_1didLearnWord_1inLanguage_1 = sel_registerName("spellServer:didLearnWord:inLanguage:");
+public static final int sel_performActionWithHighlightingForItemAtIndex_1 = sel_registerName("performActionWithHighlightingForItemAtIndex:");
+public static final int sel_loadSuitesFromBundle_1 = sel_registerName("loadSuitesFromBundle:");
+public static final int sel_firstTextView = sel_registerName("firstTextView");
+public static final int sel_targetForAction_1 = sel_registerName("targetForAction:");
+public static final int sel_enterExitEventWithType_1location_1modifierFlags_1timestamp_1windowNumber_1context_1eventNumber_1trackingNumber_1userData_1 = sel_registerName("enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingNumber:userData:");
+public static final int sel_setHelpAnchor_1 = sel_registerName("setHelpAnchor:");
+public static final int sel_printerWithName_1 = sel_registerName("printerWithName:");
+public static final int sel_boundingBoxForControlGlyphAtIndex_1forTextContainer_1proposedLineFragment_1glyphPosition_1characterIndex_1 = sel_registerName("boundingBoxForControlGlyphAtIndex:forTextContainer:proposedLineFragment:glyphPosition:characterIndex:");
+public static final int sel_initWithBytesNoCopy_1length_1freeWhenDone_1 = sel_registerName("initWithBytesNoCopy:length:freeWhenDone:");
+public static final int sel_getRow_1column_1ofCell_1 = sel_registerName("getRow:column:ofCell:");
+public static final int sel_smartDeleteRangeForProposedRange_1 = sel_registerName("smartDeleteRangeForProposedRange:");
+public static final int sel_getHue_1saturation_1brightness_1alpha_1 = sel_registerName("getHue:saturation:brightness:alpha:");
+public static final int sel_automaticallyNotifiesObserversForKey_1 = sel_registerName("automaticallyNotifiesObserversForKey:");
+public static final int sel_setAllowsImageEditing_1 = sel_registerName("setAllowsImageEditing:");
+public static final int sel_draggingUpdated_1 = sel_registerName("draggingUpdated:");
+public static final int sel_insertRowAtIndex_1withType_1asSubrowOfRow_1animate_1 = sel_registerName("insertRowAtIndex:withType:asSubrowOfRow:animate:");
+public static final int sel_getRectsExposedDuringLiveResize_1count_1 = sel_registerName("getRectsExposedDuringLiveResize:count:");
+public static final int sel_usesSignificantDigits = sel_registerName("usesSignificantDigits");
+public static final int sel_numberOfVirtualScreens = sel_registerName("numberOfVirtualScreens");
+public static final int sel_sendSynchronousRequest_1returningResponse_1error_1 = sel_registerName("sendSynchronousRequest:returningResponse:error:");
+public static final int sel_setBecomesKeyOnlyIfNeeded_1 = sel_registerName("setBecomesKeyOnlyIfNeeded:");
+public static final int sel_autorecalculatesKeyViewLoop = sel_registerName("autorecalculatesKeyViewLoop");
+public static final int sel_decodeDataObject = sel_registerName("decodeDataObject");
+public static final int sel_setOriginOffset_1 = sel_registerName("setOriginOffset:");
+public static final int sel_pointingDeviceSerialNumber = sel_registerName("pointingDeviceSerialNumber");
+public static final int sel_drawSegment_1inFrame_1withView_1 = sel_registerName("drawSegment:inFrame:withView:");
+public static final int sel_close = sel_registerName("close");
+public static final int sel_setAlignmentRect_1 = sel_registerName("setAlignmentRect:");
+public static final int sel_paragraphSeparatorCharacterRange = sel_registerName("paragraphSeparatorCharacterRange");
+public static final int sel_measurementUnits = sel_registerName("measurementUnits");
+public static final int sel_setUsesEPSOnResolutionMismatch_1 = sel_registerName("setUsesEPSOnResolutionMismatch:");
+public static final int sel_setLineFragmentPadding_1 = sel_registerName("setLineFragmentPadding:");
+public static final int sel_setLastComponentOfFileName_1 = sel_registerName("setLastComponentOfFileName:");
+public static final int sel_initWithSuiteName_1commandName_1dictionary_1 = sel_registerName("initWithSuiteName:commandName:dictionary:");
+public static final int sel_initWithContent_1 = sel_registerName("initWithContent:");
+public static final int sel_provideNewView_1 = sel_registerName("provideNewView:");
+public static final int sel_pathComponentCells = sel_registerName("pathComponentCells");
+public static final int sel_instanceMethodForSelector_1 = sel_registerName("instanceMethodForSelector:");
+public static final int sel_layoutManagerDidInvalidateLayout_1 = sel_registerName("layoutManagerDidInvalidateLayout:");
+public static final int sel_helpAnchor = sel_registerName("helpAnchor");
+public static final int sel_URLProtocol_1wasRedirectedToRequest_1redirectResponse_1 = sel_registerName("URLProtocol:wasRedirectedToRequest:redirectResponse:");
+public static final int sel_setIsVisible_1 = sel_registerName("setIsVisible:");
+public static final int sel_browser_1sizeToFitWidthOfColumn_1 = sel_registerName("browser:sizeToFitWidthOfColumn:");
+public static final int sel_handleFailureInMethod_1object_1file_1lineNumber_1description_1 = sel_registerName("handleFailureInMethod:object:file:lineNumber:description:");
+public static final int sel_serializedRepresentation = sel_registerName("serializedRepresentation");
+public static final int sel_replaceTextContainer_1 = sel_registerName("replaceTextContainer:");
+public static final int sel_speechSynthesizer_1willSpeakWord_1ofString_1 = sel_registerName("speechSynthesizer:willSpeakWord:ofString:");
+public static final int sel_startSpeaking_1 = sel_registerName("startSpeaking:");
+public static final int sel_setHyphenationFactor_1 = sel_registerName("setHyphenationFactor:");
+public static final int sel_retain = sel_registerName("retain");
+public static final int sel_insertItem_1atIndex_1 = sel_registerName("insertItem:atIndex:");
+public static final int sel_sortWithSortDescriptors_1recursively_1 = sel_registerName("sortWithSortDescriptors:recursively:");
+public static final int sel_selectTabViewItem_1 = sel_registerName("selectTabViewItem:");
+public static final int sel_clipRect_1 = sel_registerName("clipRect:");
+public static final int sel_close_1 = sel_registerName("close:");
+public static final int sel_didAddSubview_1 = sel_registerName("didAddSubview:");
+public static final int sel_markedTextSelectionChanged_1client_1 = sel_registerName("markedTextSelectionChanged:client:");
+public static final int sel_registerLanguage_1byVendor_1 = sel_registerName("registerLanguage:byVendor:");
+public static final int sel_removeClient_1 = sel_registerName("removeClient:");
+public static final int sel_setSendsWholeSearchString_1 = sel_registerName("setSendsWholeSearchString:");
+public static final int sel_localName = sel_registerName("localName");
+public static final int sel_setSelectedSegment_1 = sel_registerName("setSelectedSegment:");
+public static final int sel_setLineHeightMultiple_1 = sel_registerName("setLineHeightMultiple:");
+public static final int sel_setCanCreateDirectories_1 = sel_registerName("setCanCreateDirectories:");
+public static final int sel_setCookieAcceptPolicy_1 = sel_registerName("setCookieAcceptPolicy:");
+public static final int sel_convertFont_1toHaveTrait_1 = sel_registerName("convertFont:toHaveTrait:");
+public static final int sel_headerCell = sel_registerName("headerCell");
+public static final int sel_maximumDecimalNumber = sel_registerName("maximumDecimalNumber");
+public static final int sel_browser_1isColumnValid_1 = sel_registerName("browser:isColumnValid:");
+public static final int sel_tableViewSelectionIsChanging_1 = sel_registerName("tableViewSelectionIsChanging:");
+public static final int sel_setNotificationBatchingInterval_1 = sel_registerName("setNotificationBatchingInterval:");
+public static final int sel_isLeaf = sel_registerName("isLeaf");
+public static final int sel_valuesForAttributes_1 = sel_registerName("valuesForAttributes:");
+public static final int sel_removeTemporaryAttribute_1forCharacterRange_1 = sel_registerName("removeTemporaryAttribute:forCharacterRange:");
+public static final int sel_pixelsWide = sel_registerName("pixelsWide");
+public static final int sel_orderFrontStandardAboutPanel_1 = sel_registerName("orderFrontStandardAboutPanel:");
+public static final int sel_beginSheetModalForWindow_1modalDelegate_1didEndSelector_1contextInfo_1 = sel_registerName("beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:");
+public static final int sel_setToolTip_1forSegment_1 = sel_registerName("setToolTip:forSegment:");
+public static final int sel_canonicalXMLStringPreservingComments_1 = sel_registerName("canonicalXMLStringPreservingComments:");
+public static final int sel_orderFrontListPanel_1 = sel_registerName("orderFrontListPanel:");
+public static final int sel_setIsMiniaturized_1 = sel_registerName("setIsMiniaturized:");
+public static final int sel_download_1didReceiveDataOfLength_1 = sel_registerName("download:didReceiveDataOfLength:");
+public static final int sel_layoutManager_1didCompleteLayoutForTextContainer_1atEnd_1 = sel_registerName("layoutManager:didCompleteLayoutForTextContainer:atEnd:");
+public static final int sel_standardWindowButton_1forStyleMask_1 = sel_registerName("standardWindowButton:forStyleMask:");
+public static final int sel_writeToURL_1atomically_1 = sel_registerName("writeToURL:atomically:");
+public static final int sel_useStandardLigatures_1 = sel_registerName("useStandardLigatures:");
+public static final int sel_currentRunLoop = sel_registerName("currentRunLoop");
+public static final int sel_setExtraLineFragmentRect_1usedRect_1textContainer_1 = sel_registerName("setExtraLineFragmentRect:usedRect:textContainer:");
+public static final int sel_rootElement = sel_registerName("rootElement");
+public static final int sel_setContentViewMargins_1 = sel_registerName("setContentViewMargins:");
+public static final int sel_cancelPerformSelector_1target_1argument_1 = sel_registerName("cancelPerformSelector:target:argument:");
+public static final int sel_outputFormat = sel_registerName("outputFormat");
+public static final int sel_arrayWithContentsOfFile_1 = sel_registerName("arrayWithContentsOfFile:");
+public static final int sel_applicationWillFinishLaunching_1 = sel_registerName("applicationWillFinishLaunching:");
+public static final int sel_prefixForName_1 = sel_registerName("prefixForName:");
+public static final int sel_decimalNumberByDividingBy_1 = sel_registerName("decimalNumberByDividingBy:");
+public static final int sel_mouseUpOnCharacterIndex_1atCoordinate_1withModifier_1client_1 = sel_registerName("mouseUpOnCharacterIndex:atCoordinate:withModifier:client:");
+public static final int sel_defaultVoice = sel_registerName("defaultVoice");
+public static final int sel_operand = sel_registerName("operand");
+public static final int sel_moveToEndOfLine_1 = sel_registerName("moveToEndOfLine:");
+public static final int sel_addEntry_1 = sel_registerName("addEntry:");
+public static final int sel_scaleBy_1 = sel_registerName("scaleBy:");
+public static final int sel_setMnemonicLocation_1 = sel_registerName("setMnemonicLocation:");
+public static final int sel_dateWithCalendarFormat_1timeZone_1 = sel_registerName("dateWithCalendarFormat:timeZone:");
+public static final int sel_setUsesFontLeading_1 = sel_registerName("setUsesFontLeading:");
+public static final int sel_CIContext = sel_registerName("CIContext");
+public static final int sel_isDaylightSavingTime = sel_registerName("isDaylightSavingTime");
+public static final int sel_setShowsBorderOnlyWhileMouseInside_1 = sel_registerName("setShowsBorderOnlyWhileMouseInside:");
+public static final int sel_isSetOnMouseEntered = sel_registerName("isSetOnMouseEntered");
+public static final int sel_stringFromDate_1 = sel_registerName("stringFromDate:");
+public static final int sel_deselectColumn_1 = sel_registerName("deselectColumn:");
+public static final int sel_requestHeaderFieldsWithCookies_1 = sel_registerName("requestHeaderFieldsWithCookies:");
+public static final int sel_outlineViewColumnDidMove_1 = sel_registerName("outlineViewColumnDidMove:");
+public static final int sel_fileExtensionsFromType_1 = sel_registerName("fileExtensionsFromType:");
+public static final int sel_setUsesScreenFonts_1 = sel_registerName("setUsesScreenFonts:");
+public static final int sel_commandDescriptionsInSuite_1 = sel_registerName("commandDescriptionsInSuite:");
+public static final int sel_notShownAttributeForGlyphAtIndex_1 = sel_registerName("notShownAttributeForGlyphAtIndex:");
+public static final int sel_isRunning = sel_registerName("isRunning");
+public static final int sel_sharedPrintInfo = sel_registerName("sharedPrintInfo");
+public static final int sel_isValid = sel_registerName("isValid");
+public static final int sel_handleFailureInFunction_1file_1lineNumber_1description_1 = sel_registerName("handleFailureInFunction:file:lineNumber:description:");
+public static final int sel_localizedRecoveryOptions = sel_registerName("localizedRecoveryOptions");
+public static final int sel_establishConnection = sel_registerName("establishConnection");
+public static final int sel_isMainWindow = sel_registerName("isMainWindow");
+public static final int sel_setDrawsBackground_1 = sel_registerName("setDrawsBackground:");
+public static final int sel_intAttribute_1forGlyphAtIndex_1 = sel_registerName("intAttribute:forGlyphAtIndex:");
+public static final int sel_shadowColor = sel_registerName("shadowColor");
+public static final int sel_keyEquivalentModifierMask = sel_registerName("keyEquivalentModifierMask");
+public static final int sel_textStorageDidProcessEditing_1 = sel_registerName("textStorageDidProcessEditing:");
+public static final int sel_setType_1 = sel_registerName("setType:");
+public static final int sel_previousSibling = sel_registerName("previousSibling");
+public static final int sel_dateByAddingYears_1months_1days_1hours_1minutes_1seconds_1 = sel_registerName("dateByAddingYears:months:days:hours:minutes:seconds:");
+public static final int sel_setMinimum_1 = sel_registerName("setMinimum:");
+public static final int sel_columnAutoresizingStyle = sel_registerName("columnAutoresizingStyle");
+public static final int sel_convertPointFromBase_1 = sel_registerName("convertPointFromBase:");
+public static final int sel_layout = sel_registerName("layout");
+public static final int sel_textStorage = sel_registerName("textStorage");
+public static final int sel_values = sel_registerName("values");
+public static final int sel_RTFFromRange_1documentAttributes_1 = sel_registerName("RTFFromRange:documentAttributes:");
+public static final int sel_isMiniaturizable = sel_registerName("isMiniaturizable");
+public static final int sel_opaqueAncestor = sel_registerName("opaqueAncestor");
+public static final int sel_notationName = sel_registerName("notationName");
+public static final int sel_setBaseWritingDirection_1range_1 = sel_registerName("setBaseWritingDirection:range:");
+public static final int sel_setManagedObjectContext_1 = sel_registerName("setManagedObjectContext:");
+public static final int sel_patternImage = sel_registerName("patternImage");
+public static final int sel_windowDidResize_1 = sel_registerName("windowDidResize:");
+public static final int sel_setFieldEditor_1 = sel_registerName("setFieldEditor:");
+public static final int sel_initWithContainerClassDescription_1containerSpecifier_1key_1relativePosition_1baseSpecifier_1 = sel_registerName("initWithContainerClassDescription:containerSpecifier:key:relativePosition:baseSpecifier:");
+public static final int sel_setMainMenu_1 = sel_registerName("setMainMenu:");
+public static final int sel_setObjectZone_1 = sel_registerName("setObjectZone:");
+public static final int sel_localizedDescription = sel_registerName("localizedDescription");
+public static final int sel_setImageScaling_1 = sel_registerName("setImageScaling:");
+public static final int sel_moveToBeginningOfLine_1 = sel_registerName("moveToBeginningOfLine:");
+public static final int sel_transposeWords_1 = sel_registerName("transposeWords:");
+public static final int sel_protocol = sel_registerName("protocol");
+public static final int sel_isHorizontallyCentered = sel_registerName("isHorizontallyCentered");
+public static final int sel_invert = sel_registerName("invert");
+public static final int sel_isEqualToValue_1 = sel_registerName("isEqualToValue:");
+public static final int sel_registerName_1withNameServer_1 = sel_registerName("registerName:withNameServer:");
+public static final int sel_writeToURL_1ofType_1error_1 = sel_registerName("writeToURL:ofType:error:");
+public static final int sel_rangeForUserTextChange = sel_registerName("rangeForUserTextChange");
+public static final int sel_configurePersistentStoreCoordinatorForURL_1ofType_1error_1 = sel_registerName("configurePersistentStoreCoordinatorForURL:ofType:error:");
+public static final int sel_setShouldAntialias_1 = sel_registerName("setShouldAntialias:");
+public static final int sel_alignmentRect = sel_registerName("alignmentRect");
+public static final int sel_zoom_1 = sel_registerName("zoom:");
+public static final int sel_rate = sel_registerName("rate");
+public static final int sel_maxVisibleColumns = sel_registerName("maxVisibleColumns");
+public static final int sel_splitViewDidResizeSubviews_1 = sel_registerName("splitViewDidResizeSubviews:");
+public static final int sel_maxWidth = sel_registerName("maxWidth");
+public static final int sel_setData_1 = sel_registerName("setData:");
+public static final int sel_isVisible = sel_registerName("isVisible");
+public static final int sel_isSelected = sel_registerName("isSelected");
+public static final int sel_rulerView_1shouldRemoveMarker_1 = sel_registerName("rulerView:shouldRemoveMarker:");
+public static final int sel_setURL_1 = sel_registerName("setURL:");
+public static final int sel_drawTitle_1withFrame_1inView_1 = sel_registerName("drawTitle:withFrame:inView:");
+public static final int sel_usesWeakReadAndWriteBarriers = sel_registerName("usesWeakReadAndWriteBarriers");
+public static final int sel_elementDeclarationForName_1 = sel_registerName("elementDeclarationForName:");
+public static final int sel_setOneShot_1 = sel_registerName("setOneShot:");
+public static final int sel_shouldProcessNamespaces = sel_registerName("shouldProcessNamespaces");
+public static final int sel_isEqualToArray_1 = sel_registerName("isEqualToArray:");
+public static final int sel_XMLStringWithOptions_1 = sel_registerName("XMLStringWithOptions:");
+public static final int sel_initFileURLWithPath_1isDirectory_1 = sel_registerName("initFileURLWithPath:isDirectory:");
+public static final int sel_datePickerElements = sel_registerName("datePickerElements");
+public static final int sel_willChange_1valuesAtIndexes_1forKey_1 = sel_registerName("willChange:valuesAtIndexes:forKey:");
+public static final int sel_setSelected_1forSegment_1 = sel_registerName("setSelected:forSegment:");
+public static final int sel_initWithFormat_1shareContext_1 = sel_registerName("initWithFormat:shareContext:");
+public static final int sel_browser_1shouldSizeColumn_1forUserResize_1toWidth_1 = sel_registerName("browser:shouldSizeColumn:forUserResize:toWidth:");
+public static final int sel_indexSetWithIndexesInRange_1 = sel_registerName("indexSetWithIndexesInRange:");
+public static final int sel_netServiceBrowser_1didFindService_1moreComing_1 = sel_registerName("netServiceBrowser:didFindService:moreComing:");
+public static final int sel_keyUp_1 = sel_registerName("keyUp:");
+public static final int sel_pageHeader = sel_registerName("pageHeader");
+public static final int sel_isCancelled = sel_registerName("isCancelled");
+public static final int sel_segmentStyle = sel_registerName("segmentStyle");
+public static final int sel_imageRepWithContentsOfURL_1 = sel_registerName("imageRepWithContentsOfURL:");
+public static final int sel_initWithNibName_1bundle_1 = sel_registerName("initWithNibName:bundle:");
+public static final int sel_removeObserver_1fromObjectsAtIndexes_1forKeyPath_1 = sel_registerName("removeObserver:fromObjectsAtIndexes:forKeyPath:");
+public static final int sel_setFetchPredicate_1 = sel_registerName("setFetchPredicate:");
+public static final int sel_compare_1options_1range_1 = sel_registerName("compare:options:range:");
+public static final int sel_validateVisibleColumns = sel_registerName("validateVisibleColumns");
+public static final int sel_initWithCGColorSpace_1 = sel_registerName("initWithCGColorSpace:");
+public static final int sel_mountNewRemovableMedia = sel_registerName("mountNewRemovableMedia");
+public static final int sel_compare_1options_1range_1locale_1 = sel_registerName("compare:options:range:locale:");
+public static final int sel_setTopMargin_1 = sel_registerName("setTopMargin:");
+public static final int sel_maximumLengthOfBytesUsingEncoding_1 = sel_registerName("maximumLengthOfBytesUsingEncoding:");
+public static final int sel_colorWithAlphaComponent_1 = sel_registerName("colorWithAlphaComponent:");
+public static final int sel_appendBezierPathWithRoundedRect_1xRadius_1yRadius_1 = sel_registerName("appendBezierPathWithRoundedRect:xRadius:yRadius:");
+public static final int sel_autosavedContentsFileURL = sel_registerName("autosavedContentsFileURL");
+public static final int sel_markedTextAttributes = sel_registerName("markedTextAttributes");
+public static final int sel_predicateWithValue_1 = sel_registerName("predicateWithValue:");
+public static final int sel_makeFirstResponder_1 = sel_registerName("makeFirstResponder:");
+public static final int sel_alternateTitle = sel_registerName("alternateTitle");
+public static final int sel_attribute = sel_registerName("attribute");
+public static final int sel_decodeIntegerForKey_1 = sel_registerName("decodeIntegerForKey:");
+public static final int sel_setSeparatesColumns_1 = sel_registerName("setSeparatesColumns:");
+public static final int sel_imageRepsWithContentsOfURL_1 = sel_registerName("imageRepsWithContentsOfURL:");
+public static final int sel_isPlanar = sel_registerName("isPlanar");
+public static final int sel_download_1didReceiveAuthenticationChallenge_1 = sel_registerName("download:didReceiveAuthenticationChallenge:");
+public static final int sel_startingRow = sel_registerName("startingRow");
+public static final int sel_evaluateWithObject_1substitutionVariables_1 = sel_registerName("evaluateWithObject:substitutionVariables:");
+public static final int sel_initWithRTFD_1documentAttributes_1 = sel_registerName("initWithRTFD:documentAttributes:");
+public static final int sel_ensureLayoutForTextContainer_1 = sel_registerName("ensureLayoutForTextContainer:");
+public static final int sel_runModalForWindow_1relativeToWindow_1 = sel_registerName("runModalForWindow:relativeToWindow:");
+public static final int sel_isResizable = sel_registerName("isResizable");
+public static final int sel_isSymbolicLink = sel_registerName("isSymbolicLink");
+public static final int sel_containsIndexes_1 = sel_registerName("containsIndexes:");
+public static final int sel_splitView_1constrainMaxCoordinate_1ofSubviewAt_1 = sel_registerName("splitView:constrainMaxCoordinate:ofSubviewAt:");
+public static final int sel_setImportsGraphics_1 = sel_registerName("setImportsGraphics:");
+public static final int sel_action = sel_registerName("action");
+public static final int sel_noteNumberOfItemsChanged = sel_registerName("noteNumberOfItemsChanged");
+public static final int sel_drawBackgroundInClipRect_1 = sel_registerName("drawBackgroundInClipRect:");
+public static final int sel_booleanValue = sel_registerName("booleanValue");
+public static final int sel_printInfo = sel_registerName("printInfo");
+public static final int sel_performSelector_1withObject_1afterDelay_1 = sel_registerName("performSelector:withObject:afterDelay:");
+public static final int sel_boundingRectForGlyphRange_1inTextContainer_1 = sel_registerName("boundingRectForGlyphRange:inTextContainer:");
+public static final int sel_currencyCode = sel_registerName("currencyCode");
+public static final int sel_splitView_1canCollapseSubview_1 = sel_registerName("splitView:canCollapseSubview:");
+public static final int sel_hide = sel_registerName("hide");
+public static final int sel_setMonth_1 = sel_registerName("setMonth:");
+public static final int sel_dataFromTXTRecordDictionary_1 = sel_registerName("dataFromTXTRecordDictionary:");
+public static final int sel_rulerView_1didAddMarker_1 = sel_registerName("rulerView:didAddMarker:");
+public static final int sel_deleteBackward_1 = sel_registerName("deleteBackward:");
+public static final int sel_setMaximumLineHeight_1 = sel_registerName("setMaximumLineHeight:");
+public static final int sel_orderedWindows = sel_registerName("orderedWindows");
+public static final int sel_standaloneWeekdaySymbols = sel_registerName("standaloneWeekdaySymbols");
+public static final int sel_isAttached = sel_registerName("isAttached");
+public static final int sel_resizeLeftRightCursor = sel_registerName("resizeLeftRightCursor");
+public static final int sel_methodSignature = sel_registerName("methodSignature");
+public static final int sel_setDiskCapacity_1 = sel_registerName("setDiskCapacity:");
+public static final int sel_lineFragmentRectForGlyphAtIndex_1effectiveRange_1withoutAdditionalLayout_1 = sel_registerName("lineFragmentRectForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:");
+public static final int sel_screen = sel_registerName("screen");
+public static final int sel_windowNumber = sel_registerName("windowNumber");
+public static final int sel_selectSegmentWithTag_1 = sel_registerName("selectSegmentWithTag:");
+public static final int sel_availableFontFamilies = sel_registerName("availableFontFamilies");
+public static final int sel_superclass = sel_registerName("superclass");
+public static final int sel_registeredImageRepClasses = sel_registerName("registeredImageRepClasses");
+public static final int sel_needsSizing = sel_registerName("needsSizing");
+public static final int sel_setUsesAlternatingRowBackgroundColors_1 = sel_registerName("setUsesAlternatingRowBackgroundColors:");
+public static final int sel_getBitmapDataPlanes_1 = sel_registerName("getBitmapDataPlanes:");
+public static final int sel_fontWithFamily_1traits_1weight_1size_1 = sel_registerName("fontWithFamily:traits:weight:size:");
+public static final int sel_borderColor = sel_registerName("borderColor");
+public static final int sel_colorUsingColorSpace_1 = sel_registerName("colorUsingColorSpace:");
+public static final int sel_propertyForKey_1 = sel_registerName("propertyForKey:");
+public static final int sel_setPublicID_1 = sel_registerName("setPublicID:");
+public static final int sel_forwardInvocation_1 = sel_registerName("forwardInvocation:");
+public static final int sel_deleteToBeginningOfLine_1 = sel_registerName("deleteToBeginningOfLine:");
+public static final int sel_hasNonContiguousLayout = sel_registerName("hasNonContiguousLayout");
+public static final int sel_getObjects_1 = sel_registerName("getObjects:");
+public static final int sel_clearRecentDocuments_1 = sel_registerName("clearRecentDocuments:");
+public static final int sel_paletteFontOfSize_1 = sel_registerName("paletteFontOfSize:");
+public static final int sel_rightMargin = sel_registerName("rightMargin");
+public static final int sel_browser_1createRowsForColumn_1inMatrix_1 = sel_registerName("browser:createRowsForColumn:inMatrix:");
+public static final int sel_removeItemAtPath_1error_1 = sel_registerName("removeItemAtPath:error:");
+public static final int sel_getRectsBeingDrawn_1count_1 = sel_registerName("getRectsBeingDrawn:count:");
+public static final int sel_numberWithUnsignedInt_1 = sel_registerName("numberWithUnsignedInt:");
+public static final int sel_complete_1 = sel_registerName("complete:");
+public static final int sel_synchronizeTitleAndSelectedItem = sel_registerName("synchronizeTitleAndSelectedItem");
+public static final int sel_archiverData = sel_registerName("archiverData");
+public static final int sel_selectNextTabViewItem_1 = sel_registerName("selectNextTabViewItem:");
+public static final int sel_displayNameForType_1 = sel_registerName("displayNameForType:");
+public static final int sel_defaultNameServerPortNumber = sel_registerName("defaultNameServerPortNumber");
+public static final int sel_setFireDate_1 = sel_registerName("setFireDate:");
+public static final int sel_selectFirstTabViewItem_1 = sel_registerName("selectFirstTabViewItem:");
+public static final int sel_setRightMargin_1 = sel_registerName("setRightMargin:");
+public static final int sel_menuView = sel_registerName("menuView");
+public static final int sel_removeObjectsFromIndices_1numIndices_1 = sel_registerName("removeObjectsFromIndices:numIndices:");
+public static final int sel_tabKeyTraversesCells = sel_registerName("tabKeyTraversesCells");
+public static final int sel_initToBuffer_1capacity_1 = sel_registerName("initToBuffer:capacity:");
+public static final int sel_endPage = sel_registerName("endPage");
+public static final int sel_setTextAttributesForNotANumber_1 = sel_registerName("setTextAttributesForNotANumber:");
+public static final int sel_makeNextSegmentKey = sel_registerName("makeNextSegmentKey");
+public static final int sel_addAttributes_1range_1 = sel_registerName("addAttributes:range:");
+public static final int sel_lineFragmentPadding = sel_registerName("lineFragmentPadding");
+public static final int sel_showController_1adjustingSize_1 = sel_registerName("showController:adjustingSize:");
+public static final int sel_glyphInfoWithGlyphName_1forFont_1baseString_1 = sel_registerName("glyphInfoWithGlyphName:forFont:baseString:");
+public static final int sel_initWithCondition_1 = sel_registerName("initWithCondition:");
+public static final int sel_handleMachMessage_1 = sel_registerName("handleMachMessage:");
+public static final int sel_setFontMenu_1 = sel_registerName("setFontMenu:");
+public static final int sel_invocationWithMethodSignature_1 = sel_registerName("invocationWithMethodSignature:");
+public static final int sel_textAttributesForPositiveValues = sel_registerName("textAttributesForPositiveValues");
+public static final int sel_decodePointForKey_1 = sel_registerName("decodePointForKey:");
+public static final int sel_doubleForKey_1 = sel_registerName("doubleForKey:");
+public static final int sel_application_1willPresentError_1 = sel_registerName("application:willPresentError:");
+public static final int sel_setFloatingPointFormat_1left_1right_1 = sel_registerName("setFloatingPointFormat:left:right:");
+public static final int sel_loadColumnZero = sel_registerName("loadColumnZero");
+public static final int sel_availableFonts = sel_registerName("availableFonts");
+public static final int sel_drawUnderlineForGlyphRange_1underlineType_1baselineOffset_1lineFragmentRect_1lineFragmentGlyphRange_1containerOrigin_1 = sel_registerName("drawUnderlineForGlyphRange:underlineType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:");
+public static final int sel_highlightedTableColumn = sel_registerName("highlightedTableColumn");
+public static final int sel_removeObjectsInRange_1 = sel_registerName("removeObjectsInRange:");
+public static final int sel_rectForKey_1inTable_1 = sel_registerName("rectForKey:inTable:");
+public static final int sel_canStoreColor = sel_registerName("canStoreColor");
+public static final int sel_windowWillMiniaturize_1 = sel_registerName("windowWillMiniaturize:");
+public static final int sel_documentForWindow_1 = sel_registerName("documentForWindow:");
+public static final int sel_setAttributedStringForNotANumber_1 = sel_registerName("setAttributedStringForNotANumber:");
+public static final int sel_rangeOfString_1options_1range_1 = sel_registerName("rangeOfString:options:range:");
+public static final int sel_pause = sel_registerName("pause");
+public static final int sel_continueTracking_1at_1inView_1 = sel_registerName("continueTracking:at:inView:");
+public static final int sel_servicesProvider = sel_registerName("servicesProvider");
+public static final int sel_setIgnoredWords_1inSpellDocumentWithTag_1 = sel_registerName("setIgnoredWords:inSpellDocumentWithTag:");
+public static final int sel_clear_1 = sel_registerName("clear:");
+public static final int sel_readFromData_1options_1documentAttributes_1error_1 = sel_registerName("readFromData:options:documentAttributes:error:");
+public static final int sel_columnNumber = sel_registerName("columnNumber");
+public static final int sel_components = sel_registerName("components");
+public static final int sel_image = sel_registerName("image");
+public static final int sel_setDisplayMode_1 = sel_registerName("setDisplayMode:");
+public static final int sel_insertParagraphSeparator_1 = sel_registerName("insertParagraphSeparator:");
+public static final int sel_setPaperName_1 = sel_registerName("setPaperName:");
+public static final int sel_defaultFormatterBehavior = sel_registerName("defaultFormatterBehavior");
+public static final int sel_timeZoneWithAbbreviation_1 = sel_registerName("timeZoneWithAbbreviation:");
+public static final int sel_setHighlighted_1 = sel_registerName("setHighlighted:");
+public static final int sel_addFileWithPath_1 = sel_registerName("addFileWithPath:");
+public static final int sel_allowsDocumentBackgroundColorChange = sel_registerName("allowsDocumentBackgroundColorChange");
+public static final int sel_initWithURL_1documentAttributes_1 = sel_registerName("initWithURL:documentAttributes:");
+public static final int sel_allowsUndo = sel_registerName("allowsUndo");
+public static final int sel_localeIdentifierFromComponents_1 = sel_registerName("localeIdentifierFromComponents:");
+public static final int sel_allowsNonContiguousLayout = sel_registerName("allowsNonContiguousLayout");
+public static final int sel_arrayWithArray_1 = sel_registerName("arrayWithArray:");
+public static final int sel_setCompositingOperation_1 = sel_registerName("setCompositingOperation:");
+public static final int sel_netServiceBrowserDidStopSearch_1 = sel_registerName("netServiceBrowserDidStopSearch:");
+public static final int sel_setHorizontalEdgePadding_1 = sel_registerName("setHorizontalEdgePadding:");
+public static final int sel_accessibilityActionDescription_1 = sel_registerName("accessibilityActionDescription:");
+public static final int sel_localizedKeyDictionary = sel_registerName("localizedKeyDictionary");
+public static final int sel_initWithColorSyncProfile_1 = sel_registerName("initWithColorSyncProfile:");
+public static final int sel_displayedCommandsTitle = sel_registerName("displayedCommandsTitle");
+public static final int sel_flatness = sel_registerName("flatness");
+public static final int sel_localizations = sel_registerName("localizations");
+public static final int sel_mountedRemovableMedia = sel_registerName("mountedRemovableMedia");
+public static final int sel_topAutoreleasePoolCount = sel_registerName("topAutoreleasePoolCount");
+public static final int sel_postsFrameChangedNotifications = sel_registerName("postsFrameChangedNotifications");
+public static final int sel_performZoom_1 = sel_registerName("performZoom:");
+public static final int sel_moveBackward_1 = sel_registerName("moveBackward:");
+public static final int sel_verticalPageScroll = sel_registerName("verticalPageScroll");
+public static final int sel_setToolTip_1forCell_1 = sel_registerName("setToolTip:forCell:");
+public static final int sel_layoutManagerOwnsFirstResponderInWindow_1 = sel_registerName("layoutManagerOwnsFirstResponderInWindow:");
+public static final int sel_jobStyleHint = sel_registerName("jobStyleHint");
+public static final int sel_selectionIndexes = sel_registerName("selectionIndexes");
+public static final int sel_segmentCount = sel_registerName("segmentCount");
+public static final int sel_accessibilityIsIgnored = sel_registerName("accessibilityIsIgnored");
+public static final int sel_hasUnautosavedChanges = sel_registerName("hasUnautosavedChanges");
+public static final int sel_deactivate = sel_registerName("deactivate");
+public static final int sel_setSelectionIndexPaths_1 = sel_registerName("setSelectionIndexPaths:");
+public static final int sel_pathForSoundResource_1 = sel_registerName("pathForSoundResource:");
+public static final int sel_setUsesRuler_1 = sel_registerName("setUsesRuler:");
+public static final int sel_takeSelectedTabViewItemFromSender_1 = sel_registerName("takeSelectedTabViewItemFromSender:");
+public static final int sel_writeToFile_1ofType_1originalFile_1saveOperation_1 = sel_registerName("writeToFile:ofType:originalFile:saveOperation:");
+public static final int sel_numberWithLong_1 = sel_registerName("numberWithLong:");
+public static final int sel_interiorBackgroundStyle = sel_registerName("interiorBackgroundStyle");
+public static final int sel_insertionPointColor = sel_registerName("insertionPointColor");
+public static final int sel_prompt = sel_registerName("prompt");
+public static final int sel_finishLaunching = sel_registerName("finishLaunching");
+public static final int sel_addTextContainer_1 = sel_registerName("addTextContainer:");
+public static final int sel_setAutosavedContentsFileURL_1 = sel_registerName("setAutosavedContentsFileURL:");
+public static final int sel_initWithFrame_1textContainer_1 = sel_registerName("initWithFrame:textContainer:");
+public static final int sel_clearColor = sel_registerName("clearColor");
+public static final int sel_insertText_1 = sel_registerName("insertText:");
+public static final int sel_sendAction = sel_registerName("sendAction");
+public static final int sel_innerRect = sel_registerName("innerRect");
+public static final int sel_pointerFunctions = sel_registerName("pointerFunctions");
+public static final int sel_key = sel_registerName("key");
+public static final int sel_comboBoxSelectionDidChange_1 = sel_registerName("comboBoxSelectionDidChange:");
+public static final int sel_hasMarkedText = sel_registerName("hasMarkedText");
+public static final int sel_setDefaultLineCapStyle_1 = sel_registerName("setDefaultLineCapStyle:");
+public static final int sel_stringListForKey_1inTable_1 = sel_registerName("stringListForKey:inTable:");
+public static final int sel_defaultConnection = sel_registerName("defaultConnection");
+public static final int sel_pathContentOfSymbolicLinkAtPath_1 = sel_registerName("pathContentOfSymbolicLinkAtPath:");
+public static final int sel_stringWithContentsOfFile_1encoding_1error_1 = sel_registerName("stringWithContentsOfFile:encoding:error:");
+public static final int sel_detachSubmenu = sel_registerName("detachSubmenu");
+public static final int sel_isSecure = sel_registerName("isSecure");
+public static final int sel_movie = sel_registerName("movie");
+public static final int sel_outlineViewItemWillExpand_1 = sel_registerName("outlineViewItemWillExpand:");
+public static final int sel_sharedScriptSuiteRegistry = sel_registerName("sharedScriptSuiteRegistry");
+public static final int sel_removeCharactersInString_1 = sel_registerName("removeCharactersInString:");
+public static final int sel_setLocation_1withAdvancements_1forStartOfGlyphRange_1 = sel_registerName("setLocation:withAdvancements:forStartOfGlyphRange:");
+public static final int sel_moveDownAndModifySelection_1 = sel_registerName("moveDownAndModifySelection:");
+public static final int sel_fileAttributesToWriteToURL_1ofType_1forSaveOperation_1originalContentsURL_1error_1 = sel_registerName("fileAttributesToWriteToURL:ofType:forSaveOperation:originalContentsURL:error:");
+public static final int sel_classDescriptionForKey_1 = sel_registerName("classDescriptionForKey:");
+public static final int sel_addRequestMode_1 = sel_registerName("addRequestMode:");
+public static final int sel_setPullsDown_1 = sel_registerName("setPullsDown:");
+public static final int sel_setItemHeight_1 = sel_registerName("setItemHeight:");
+public static final int sel_printerFont = sel_registerName("printerFont");
+public static final int sel_linkTextAttributes = sel_registerName("linkTextAttributes");
+public static final int sel_state = sel_registerName("state");
+public static final int sel_shouldCloseWindowController_1delegate_1shouldCloseSelector_1contextInfo_1 = sel_registerName("shouldCloseWindowController:delegate:shouldCloseSelector:contextInfo:");
+public static final int sel_addIndex_1 = sel_registerName("addIndex:");
+public static final int sel_setChildSpecifier_1 = sel_registerName("setChildSpecifier:");
+public static final int sel_toolbarDidRemoveItem_1 = sel_registerName("toolbarDidRemoveItem:");
+public static final int sel_displayName = sel_registerName("displayName");
+public static final int sel_setInsertionPointColor_1 = sel_registerName("setInsertionPointColor:");
+public static final int sel_bezierPathByReversingPath = sel_registerName("bezierPathByReversingPath");
+public static final int sel_connection_1didReceiveData_1 = sel_registerName("connection:didReceiveData:");
+public static final int sel_eraSymbols = sel_registerName("eraSymbols");
+public static final int sel_removeObjectsForKeys_1 = sel_registerName("removeObjectsForKeys:");
+public static final int sel_subrowIndexesForRow_1 = sel_registerName("subrowIndexesForRow:");
+public static final int sel_increaseLengthBy_1 = sel_registerName("increaseLengthBy:");
+public static final int sel_viewDidEndLiveResize = sel_registerName("viewDidEndLiveResize");
+public static final int sel_encodeBool_1forKey_1 = sel_registerName("encodeBool:forKey:");
+public static final int sel_handleQueryWithUnboundKey_1 = sel_registerName("handleQueryWithUnboundKey:");
+public static final int sel_elementsForName_1 = sel_registerName("elementsForName:");
+public static final int sel_cascadeTopLeftFromPoint_1 = sel_registerName("cascadeTopLeftFromPoint:");
+public static final int sel_linkItemAtPath_1toPath_1error_1 = sel_registerName("linkItemAtPath:toPath:error:");
+public static final int sel_frameSizeForContentSize_1hasHorizontalScroller_1hasVerticalScroller_1borderType_1 = sel_registerName("frameSizeForContentSize:hasHorizontalScroller:hasVerticalScroller:borderType:");
+public static final int sel_initWithString_1attributes_1 = sel_registerName("initWithString:attributes:");
+public static final int sel_readFromData_1options_1documentAttributes_1 = sel_registerName("readFromData:options:documentAttributes:");
+public static final int sel_setAlpha_1 = sel_registerName("setAlpha:");
+public static final int sel_hash = sel_registerName("hash");
+public static final int sel_rangeForUserParagraphAttributeChange = sel_registerName("rangeForUserParagraphAttributeChange");
+public static final int sel_initWithData_1encoding_1 = sel_registerName("initWithData:encoding:");
+public static final int sel_newScriptingObjectOfClass_1forValueForKey_1withContentsValue_1properties_1 = sel_registerName("newScriptingObjectOfClass:forValueForKey:withContentsValue:properties:");
+public static final int sel_pageDown_1 = sel_registerName("pageDown:");
+public static final int sel_hasCloseBox = sel_registerName("hasCloseBox");
+public static final int sel_standardizedURL = sel_registerName("standardizedURL");
+public static final int sel_setAttributes_1range_1 = sel_registerName("setAttributes:range:");
+public static final int sel_setControlSize_1 = sel_registerName("setControlSize:");
+public static final int sel_revertToInitialValues_1 = sel_registerName("revertToInitialValues:");
+public static final int sel_setIntAttribute_1value_1forGlyphAtIndex_1 = sel_registerName("setIntAttribute:value:forGlyphAtIndex:");
+public static final int sel_stopTracking_1at_1inView_1mouseIsUp_1 = sel_registerName("stopTracking:at:inView:mouseIsUp:");
+public static final int sel_setParamDescriptor_1forKeyword_1 = sel_registerName("setParamDescriptor:forKeyword:");
+public static final int sel_textShouldBeginEditing_1 = sel_registerName("textShouldBeginEditing:");
+public static final int sel_applicationDidHide_1 = sel_registerName("applicationDidHide:");
+public static final int sel_beginSheetWithPrintInfo_1modalForWindow_1delegate_1didEndSelector_1contextInfo_1 = sel_registerName("beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo:");
+public static final int sel_shiftIndexesStartingAtIndex_1by_1 = sel_registerName("shiftIndexesStartingAtIndex:by:");
+public static final int sel_getStreamsToHost_1port_1inputStream_1outputStream_1 = sel_registerName("getStreamsToHost:port:inputStream:outputStream:");
+public static final int sel_attributesOfFileSystemForPath_1error_1 = sel_registerName("attributesOfFileSystemForPath:error:");
+public static final int sel_setTemporaryAttributes_1forCharacterRange_1 = sel_registerName("setTemporaryAttributes:forCharacterRange:");
+public static final int sel_checkSpellingOfString_1startingAt_1language_1wrap_1inSpellDocumentWithTag_1wordCount_1 = sel_registerName("checkSpellingOfString:startingAt:language:wrap:inSpellDocumentWithTag:wordCount:");
+public static final int sel_insertChild_1atIndex_1 = sel_registerName("insertChild:atIndex:");
+public static final int sel_defaultManager = sel_registerName("defaultManager");
+public static final int sel_invocation = sel_registerName("invocation");
+public static final int sel_setMinValue_1 = sel_registerName("setMinValue:");
+public static final int sel_decodeSize = sel_registerName("decodeSize");
+public static final int sel_replaceObject_1withObject_1 = sel_registerName("replaceObject:withObject:");
+public static final int sel_descriptionWithLocale_1 = sel_registerName("descriptionWithLocale:");
+public static final int sel_setSharingType_1 = sel_registerName("setSharingType:");
+public static final int sel_isLenient = sel_registerName("isLenient");
+public static final int sel_decimalNumberWithString_1locale_1 = sel_registerName("decimalNumberWithString:locale:");
+public static final int sel_allowedTypes = sel_registerName("allowedTypes");
+public static final int sel_superscript_1 = sel_registerName("superscript:");
+public static final int sel_initWithContentsOfFile_1encoding_1error_1 = sel_registerName("initWithContentsOfFile:encoding:error:");
+public static final int sel_windowsMenu = sel_registerName("windowsMenu");
+public static final int sel_performSelector_1target_1argument_1order_1modes_1 = sel_registerName("performSelector:target:argument:order:modes:");
+public static final int sel_unscheduleFromRunLoop_1forMode_1 = sel_registerName("unscheduleFromRunLoop:forMode:");
+public static final int sel_evaluatedArguments = sel_registerName("evaluatedArguments");
+public static final int sel_encodeSize_1forKey_1 = sel_registerName("encodeSize:forKey:");
+public static final int sel_sendBeforeDate_1components_1from_1reserved_1 = sel_registerName("sendBeforeDate:components:from:reserved:");
+public static final int sel_containerSize = sel_registerName("containerSize");
+public static final int sel_selectedTextColor = sel_registerName("selectedTextColor");
+public static final int sel_getGlyphsInRange_1glyphs_1characterIndexes_1glyphInscriptions_1elasticBits_1 = sel_registerName("getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:");
+public static final int sel_curveToPoint_1controlPoint1_1controlPoint2_1 = sel_registerName("curveToPoint:controlPoint1:controlPoint2:");
+public static final int sel_mutableBytes = sel_registerName("mutableBytes");
+public static final int sel_rangeOfUnit_1inUnit_1forDate_1 = sel_registerName("rangeOfUnit:inUnit:forDate:");
+public static final int sel_allowsNaturalLanguage = sel_registerName("allowsNaturalLanguage");
+public static final int sel_mouseLocation = sel_registerName("mouseLocation");
+public static final int sel_selectCellAtRow_1column_1 = sel_registerName("selectCellAtRow:column:");
+public static final int sel_toggleBaseWritingDirection_1 = sel_registerName("toggleBaseWritingDirection:");
+public static final int sel_maximum = sel_registerName("maximum");
+public static final int sel_initWithFocusedViewRect_1 = sel_registerName("initWithFocusedViewRect:");
+public static final int sel_thickness = sel_registerName("thickness");
+public static final int sel_setImageOrigin_1 = sel_registerName("setImageOrigin:");
+public static final int sel_color = sel_registerName("color");
+public static final int sel_capitalizeWord_1 = sel_registerName("capitalizeWord:");
+public static final int sel_imageRepClassForData_1 = sel_registerName("imageRepClassForData:");
+public static final int sel_outlineTableColumn = sel_registerName("outlineTableColumn");
+public static final int sel_runModalWithPrintInfo_1 = sel_registerName("runModalWithPrintInfo:");
+public static final int sel_flushCachedData = sel_registerName("flushCachedData");
+public static final int sel_exitFullScreenModeWithOptions_1 = sel_registerName("exitFullScreenModeWithOptions:");
+public static final int sel_alertStyle = sel_registerName("alertStyle");
+public static final int sel_runModalPageLayoutWithPrintInfo_1delegate_1didRunSelector_1contextInfo_1 = sel_registerName("runModalPageLayoutWithPrintInfo:delegate:didRunSelector:contextInfo:");
+public static final int sel_setDisplayedWhenStopped_1 = sel_registerName("setDisplayedWhenStopped:");
+public static final int sel_drawBackgroundWithFrame_1inView_1characterRange_1layoutManager_1 = sel_registerName("drawBackgroundWithFrame:inView:characterRange:layoutManager:");
+public static final int sel_addObject_1 = sel_registerName("addObject:");
+public static final int sel_dragPromisedFilesOfTypes_1fromRect_1source_1slideBack_1event_1 = sel_registerName("dragPromisedFilesOfTypes:fromRect:source:slideBack:event:");
+public static final int sel_samplesPerPixel = sel_registerName("samplesPerPixel");
+public static final int sel_negativePrefix = sel_registerName("negativePrefix");
+public static final int sel_initialKey = sel_registerName("initialKey");
+public static final int sel_orderFrontColorPanel_1 = sel_registerName("orderFrontColorPanel:");
+public static final int sel_hasLearnedWord_1 = sel_registerName("hasLearnedWord:");
+public static final int sel_setLineFragmentRect_1forGlyphRange_1usedRect_1baselineOffset_1 = sel_registerName("setLineFragmentRect:forGlyphRange:usedRect:baselineOffset:");
+public static final int sel_setHidesOnDeactivate_1 = sel_registerName("setHidesOnDeactivate:");
+public static final int sel_setMsgid_1 = sel_registerName("setMsgid:");
+public static final int sel_elementCount = sel_registerName("elementCount");
+public static final int sel_dateWithString_1 = sel_registerName("dateWithString:");
+public static final int sel_rangeOfTextBlock_1atIndex_1 = sel_registerName("rangeOfTextBlock:atIndex:");
+public static final int sel_setMenuItemCell_1forItemAtIndex_1 = sel_registerName("setMenuItemCell:forItemAtIndex:");
+public static final int sel_defaultTimeZone = sel_registerName("defaultTimeZone");
+public static final int sel_gotoBeginning_1 = sel_registerName("gotoBeginning:");
+public static final int sel_setDrawsOutsideLineFragment_1forGlyphAtIndex_1 = sel_registerName("setDrawsOutsideLineFragment:forGlyphAtIndex:");
+public static final int sel_characterCollection = sel_registerName("characterCollection");
+public static final int sel_getValues_1forParameter_1 = sel_registerName("getValues:forParameter:");
+public static final int sel_removeColumn_1 = sel_registerName("removeColumn:");
+public static final int sel_descender = sel_registerName("descender");
+public static final int sel_fragment = sel_registerName("fragment");
+public static final int sel_setSelectionByRect_1 = sel_registerName("setSelectionByRect:");
+public static final int sel_colorWithColorSpace_1components_1count_1 = sel_registerName("colorWithColorSpace:components:count:");
+public static final int sel_windingRule = sel_registerName("windingRule");
+public static final int sel_insertColumn_1 = sel_registerName("insertColumn:");
+public static final int sel_resumeWithSuspensionID_1 = sel_registerName("resumeWithSuspensionID:");
+public static final int sel_seekToEndOfFile = sel_registerName("seekToEndOfFile");
+public static final int sel_initWithTarget_1connection_1 = sel_registerName("initWithTarget:connection:");
+public static final int sel_symbolCharacterSet = sel_registerName("symbolCharacterSet");
+public static final int sel_filterPredicate = sel_registerName("filterPredicate");
+public static final int sel_setAutoenablesItems_1 = sel_registerName("setAutoenablesItems:");
+public static final int sel_printShowingPrintPanel_1 = sel_registerName("printShowingPrintPanel:");
+public static final int sel_pathForResource_1ofType_1inDirectory_1forLocalization_1 = sel_registerName("pathForResource:ofType:inDirectory:forLocalization:");
+public static final int sel_objectByApplyingXSLTAtURL_1arguments_1error_1 = sel_registerName("objectByApplyingXSLTAtURL:arguments:error:");
+public static final int sel_setHidesEmptyCells_1 = sel_registerName("setHidesEmptyCells:");
+public static final int sel_date = sel_registerName("date");
+public static final int sel_writeToFile_1atomically_1 = sel_registerName("writeToFile:atomically:");
+public static final int sel_locale = sel_registerName("locale");
+public static final int sel_localizedKeyTable = sel_registerName("localizedKeyTable");
+public static final int sel_absoluteURL = sel_registerName("absoluteURL");
+public static final int sel_bundleWithPath_1 = sel_registerName("bundleWithPath:");
+public static final int sel_setHeaderCell_1 = sel_registerName("setHeaderCell:");
+public static final int sel_setAutoresizesSubviews_1 = sel_registerName("setAutoresizesSubviews:");
+public static final int sel_URI = sel_registerName("URI");
+public static final int sel_controlBackgroundColor = sel_registerName("controlBackgroundColor");
+public static final int sel_displayNameAtPath_1 = sel_registerName("displayNameAtPath:");
+public static final int sel_decodePortObject = sel_registerName("decodePortObject");
+public static final int sel_alpha = sel_registerName("alpha");
+public static final int sel_initWithLeftExpression_1rightExpression_1customSelector_1 = sel_registerName("initWithLeftExpression:rightExpression:customSelector:");
+public static final int sel_secondaryGroupingSize = sel_registerName("secondaryGroupingSize");
+public static final int sel_connectionDidFinishLoading_1 = sel_registerName("connectionDidFinishLoading:");
+public static final int sel_localObjects = sel_registerName("localObjects");
+public static final int sel_enableKeyEquivalentForDefaultButtonCell = sel_registerName("enableKeyEquivalentForDefaultButtonCell");
+public static final int sel_drawKnobSlotInRect_1highlight_1 = sel_registerName("drawKnobSlotInRect:highlight:");
+public static final int sel_dateWithString_1calendarFormat_1locale_1 = sel_registerName("dateWithString:calendarFormat:locale:");
+public static final int sel_stop = sel_registerName("stop");
+public static final int sel_appendBezierPathWithOvalInRect_1 = sel_registerName("appendBezierPathWithOvalInRect:");
+public static final int sel_componentsSeparatedByCharactersInSet_1 = sel_registerName("componentsSeparatedByCharactersInSet:");
+public static final int sel_tightenKerning_1 = sel_registerName("tightenKerning:");
+public static final int sel_verticalRulerView = sel_registerName("verticalRulerView");
+public static final int sel_setImageAlignment_1 = sel_registerName("setImageAlignment:");
+public static final int sel_removeFrameUsingName_1 = sel_registerName("removeFrameUsingName:");
+public static final int sel_insertColor_1key_1atIndex_1 = sel_registerName("insertColor:key:atIndex:");
+public static final int sel_terminate_1 = sel_registerName("terminate:");
+public static final int sel_textContainerChangedTextView_1 = sel_registerName("textContainerChangedTextView:");
+public static final int sel_removeFileAtPath_1handler_1 = sel_registerName("removeFileAtPath:handler:");
+public static final int sel_splitViewWillResizeSubviews_1 = sel_registerName("splitViewWillResizeSubviews:");
+public static final int sel_windowDidBecomeMain_1 = sel_registerName("windowDidBecomeMain:");
+public static final int sel_cellBaselineOffset = sel_registerName("cellBaselineOffset");
+public static final int sel_addEntriesFromDictionary_1 = sel_registerName("addEntriesFromDictionary:");
+public static final int sel_setOnStateImage_1 = sel_registerName("setOnStateImage:");
+public static final int sel_colorWithCIColor_1 = sel_registerName("colorWithCIColor:");
+public static final int sel_getCyan_1magenta_1yellow_1black_1alpha_1 = sel_registerName("getCyan:magenta:yellow:black:alpha:");
+public static final int sel_symbolicTraits = sel_registerName("symbolicTraits");
+public static final int sel_stringByAppendingPathExtension_1 = sel_registerName("stringByAppendingPathExtension:");
+public static final int sel_horizontalScroller = sel_registerName("horizontalScroller");
+public static final int sel_setInitialValue_1 = sel_registerName("setInitialValue:");
+public static final int sel_sizeForPaperName_1 = sel_registerName("sizeForPaperName:");
+public static final int sel_CGLContextObj = sel_registerName("CGLContextObj");
+public static final int sel_elementWithName_1 = sel_registerName("elementWithName:");
+public static final int sel_fileManager_1shouldMoveItemAtPath_1toPath_1 = sel_registerName("fileManager:shouldMoveItemAtPath:toPath:");
+public static final int sel_richTextSource = sel_registerName("richTextSource");
+public static final int sel_unregisterDraggedTypes = sel_registerName("unregisterDraggedTypes");
+public static final int sel_absoluteString = sel_registerName("absoluteString");
+public static final int sel_spellingPanel = sel_registerName("spellingPanel");
+public static final int sel_launchedApplications = sel_registerName("launchedApplications");
+public static final int sel_initWithContentsOfFile_1byReference_1 = sel_registerName("initWithContentsOfFile:byReference:");
+public static final int sel_setLoaded_1 = sel_registerName("setLoaded:");
+public static final int sel_setWindowFrameAutosaveName_1 = sel_registerName("setWindowFrameAutosaveName:");
+public static final int sel_initOrTestWithTests_1 = sel_registerName("initOrTestWithTests:");
+public static final int sel_drawsBackground = sel_registerName("drawsBackground");
+public static final int sel_numberWithDouble_1 = sel_registerName("numberWithDouble:");
+public static final int sel_textView_1writeCell_1atIndex_1toPasteboard_1type_1 = sel_registerName("textView:writeCell:atIndex:toPasteboard:type:");
+public static final int sel_defaultMiterLimit = sel_registerName("defaultMiterLimit");
+public static final int sel_containsObject_1 = sel_registerName("containsObject:");
+public static final int sel_headerTextColor = sel_registerName("headerTextColor");
+public static final int sel_textView_1doCommandBySelector_1 = sel_registerName("textView:doCommandBySelector:");
+public static final int sel_drawBorderAndBackgroundWithFrame_1inView_1 = sel_registerName("drawBorderAndBackgroundWithFrame:inView:");
+public static final int sel_quarterSymbols = sel_registerName("quarterSymbols");
+public static final int sel_setContainerSize_1 = sel_registerName("setContainerSize:");
+public static final int sel_sortUsingSelector_1 = sel_registerName("sortUsingSelector:");
+public static final int sel_setKey_1 = sel_registerName("setKey:");
+public static final int sel_headerView = sel_registerName("headerView");
+public static final int sel_isRegularFile = sel_registerName("isRegularFile");
+public static final int sel_userData = sel_registerName("userData");
+public static final int sel_documentCursor = sel_registerName("documentCursor");
+public static final int sel_textEncodingName = sel_registerName("textEncodingName");
+public static final int sel_performActionForItemAtIndex_1 = sel_registerName("performActionForItemAtIndex:");
+public static final int sel_isCaseInsensitiveLike_1 = sel_registerName("isCaseInsensitiveLike:");
+public static final int sel_isEditing = sel_registerName("isEditing");
+public static final int sel_selectFile_1inFileViewerRootedAtPath_1 = sel_registerName("selectFile:inFileViewerRootedAtPath:");
+public static final int sel_messageFontOfSize_1 = sel_registerName("messageFontOfSize:");
+public static final int sel_independentConversationQueueing = sel_registerName("independentConversationQueueing");
+public static final int sel_initWithCoder_1 = sel_registerName("initWithCoder:");
+public static final int sel_rangesForUserParagraphAttributeChange = sel_registerName("rangesForUserParagraphAttributeChange");
+public static final int sel_removeTrackingArea_1 = sel_registerName("removeTrackingArea:");
+public static final int sel_glyphGenerator = sel_registerName("glyphGenerator");
+public static final int sel_extraLineFragmentUsedRect = sel_registerName("extraLineFragmentUsedRect");
+public static final int sel_isButtonBordered = sel_registerName("isButtonBordered");
+public static final int sel_setDefaultFormatterBehavior_1 = sel_registerName("setDefaultFormatterBehavior:");
+public static final int sel_didChange_1valuesAtIndexes_1forKey_1 = sel_registerName("didChange:valuesAtIndexes:forKey:");
+public static final int sel_timeoutInterval = sel_registerName("timeoutInterval");
+public static final int sel_initialValues = sel_registerName("initialValues");
+public static final int sel_getRow_1column_1forPoint_1 = sel_registerName("getRow:column:forPoint:");
+public static final int sel_tabletPoint_1 = sel_registerName("tabletPoint:");
+public static final int sel_setAutorecalculatesKeyViewLoop_1 = sel_registerName("setAutorecalculatesKeyViewLoop:");
+public static final int sel_identifier = sel_registerName("identifier");
+public static final int sel_scheduleInRunLoop_1forMode_1 = sel_registerName("scheduleInRunLoop:forMode:");
+public static final int sel_baseURL = sel_registerName("baseURL");
+public static final int sel_initWithURL_1 = sel_registerName("initWithURL:");
+public static final int sel_setBackgroundColors_1 = sel_registerName("setBackgroundColors:");
+public static final int sel_addTableColumn_1 = sel_registerName("addTableColumn:");
+public static final int sel_fontDescriptorWithFontAttributes_1 = sel_registerName("fontDescriptorWithFontAttributes:");
+public static final int sel_dataCellForRow_1 = sel_registerName("dataCellForRow:");
+public static final int sel_speechSynthesizer_1didEncounterErrorAtIndex_1ofString_1message_1 = sel_registerName("speechSynthesizer:didEncounterErrorAtIndex:ofString:message:");
+public static final int sel_recoveryAttempter = sel_registerName("recoveryAttempter");
+public static final int sel_alignJustified_1 = sel_registerName("alignJustified:");
+public static final int sel_setCompression_1factor_1 = sel_registerName("setCompression:factor:");
+public static final int sel_elementsForLocalName_1URI_1 = sel_registerName("elementsForLocalName:URI:");
+public static final int sel_deviceGrayColorSpace = sel_registerName("deviceGrayColorSpace");
+public static final int sel_scheduledTimerWithTimeInterval_1target_1selector_1userInfo_1repeats_1 = sel_registerName("scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:");
+public static final int sel_runModalSession_1 = sel_registerName("runModalSession:");
+public static final int sel_awakeFromNib = sel_registerName("awakeFromNib");
+public static final int sel_connectionWithReceivePort_1sendPort_1 = sel_registerName("connectionWithReceivePort:sendPort:");
+public static final int sel_outlineView_1validateDrop_1proposedItem_1proposedChildIndex_1 = sel_registerName("outlineView:validateDrop:proposedItem:proposedChildIndex:");
+public static final int sel_remove_1 = sel_registerName("remove:");
+public static final int sel_setTimeInterval_1 = sel_registerName("setTimeInterval:");
+public static final int sel_splitView_1effectiveRect_1forDrawnRect_1ofDividerAtIndex_1 = sel_registerName("splitView:effectiveRect:forDrawnRect:ofDividerAtIndex:");
+public static final int sel_setUpGState = sel_registerName("setUpGState");
+public static final int sel_initWithResponse_1data_1 = sel_registerName("initWithResponse:data:");
+public static final int sel_notificationCenter = sel_registerName("notificationCenter");
+public static final int sel_setAlternateImage_1 = sel_registerName("setAlternateImage:");
+public static final int sel_mainWindow = sel_registerName("mainWindow");
+public static final int sel_substringWithRange_1 = sel_registerName("substringWithRange:");
+public static final int sel_forgetWord_1 = sel_registerName("forgetWord:");
+public static final int sel_shouldCascadeWindows = sel_registerName("shouldCascadeWindows");
+public static final int sel_updateScroller = sel_registerName("updateScroller");
+public static final int sel_currentDirectoryPath = sel_registerName("currentDirectoryPath");
+public static final int sel_isPartialStringValidationEnabled = sel_registerName("isPartialStringValidationEnabled");
+public static final int sel_splitView_1constrainMinCoordinate_1ofSubviewAt_1 = sel_registerName("splitView:constrainMinCoordinate:ofSubviewAt:");
+public static final int sel_drawWithFrame_1inView_1 = sel_registerName("drawWithFrame:inView:");
+public static final int sel_encodingScheme = sel_registerName("encodingScheme");
+public static final int sel_namespaceWithName_1stringValue_1 = sel_registerName("namespaceWithName:stringValue:");
+public static final int sel_initWithLongLong_1 = sel_registerName("initWithLongLong:");
+public static final int sel_processIdentifier = sel_registerName("processIdentifier");
+public static final int sel_setSubmenu_1forItem_1 = sel_registerName("setSubmenu:forItem:");
+public static final int sel_textAttributesForNil = sel_registerName("textAttributesForNil");
+public static final int sel_lockWithPath_1 = sel_registerName("lockWithPath:");
+public static final int sel_removeFromSuperviewWithoutNeedingDisplay = sel_registerName("removeFromSuperviewWithoutNeedingDisplay");
+public static final int sel_cut_1 = sel_registerName("cut:");
+public static final int sel_nullDescriptor = sel_registerName("nullDescriptor");
+public static final int sel_menuFormRepresentation = sel_registerName("menuFormRepresentation");
+public static final int sel_removeObjectsAtIndexes_1 = sel_registerName("removeObjectsAtIndexes:");
+public static final int sel_initWithSource_1 = sel_registerName("initWithSource:");
+public static final int sel_acceptsGlyphInfo = sel_registerName("acceptsGlyphInfo");
+public static final int sel_borderType = sel_registerName("borderType");
+public static final int sel_initWithResumeData_1delegate_1path_1 = sel_registerName("initWithResumeData:delegate:path:");
+public static final int sel_attachedMenu = sel_registerName("attachedMenu");
+public static final int sel_stopAnimation = sel_registerName("stopAnimation");
+public static final int sel_setDoubleAction_1 = sel_registerName("setDoubleAction:");
+public static final int sel_returnType = sel_registerName("returnType");
+public static final int sel_fontDescriptorsInCollection_1 = sel_registerName("fontDescriptorsInCollection:");
+public static final int sel_setMeasurementUnits_1 = sel_registerName("setMeasurementUnits:");
+public static final int sel_baseWritingDirection = sel_registerName("baseWritingDirection");
+public static final int sel_currentPoint = sel_registerName("currentPoint");
+public static final int sel_initRemoteWithTCPPort_1host_1 = sel_registerName("initRemoteWithTCPPort:host:");
+public static final int sel_entityDeclarationForName_1 = sel_registerName("entityDeclarationForName:");
+public static final int sel_evaluate = sel_registerName("evaluate");
+public static final int sel_browser_1draggingImageForRowsWithIndexes_1inColumn_1withEvent_1offset_1 = sel_registerName("browser:draggingImageForRowsWithIndexes:inColumn:withEvent:offset:");
+public static final int sel_turnOffLigatures_1 = sel_registerName("turnOffLigatures:");
+public static final int sel_setTitleWithMnemonic_1 = sel_registerName("setTitleWithMnemonic:");
+public static final int sel_deepestScreen = sel_registerName("deepestScreen");
+public static final int sel_connection_1shouldMakeNewConnection_1 = sel_registerName("connection:shouldMakeNewConnection:");
+public static final int sel_selectionShouldChangeInOutlineView_1 = sel_registerName("selectionShouldChangeInOutlineView:");
+public static final int sel_preservesSelection = sel_registerName("preservesSelection");
+public static final int sel_preparePageLayout_1 = sel_registerName("preparePageLayout:");
+public static final int sel_setOpaque_1 = sel_registerName("setOpaque:");
+public static final int sel_insertObject_1atIndex_1 = sel_registerName("insertObject:atIndex:");
+public static final int sel_isActive = sel_registerName("isActive");
+public static final int sel_drawStrikethroughForGlyphRange_1strikethroughType_1baselineOffset_1lineFragmentRect_1lineFragmentGlyphRange_1containerOrigin_1 = sel_registerName("drawStrikethroughForGlyphRange:strikethroughType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:");
+public static final int sel_insertObject_1atArrangedObjectIndex_1 = sel_registerName("insertObject:atArrangedObjectIndex:");
+public static final int sel_initWithCStringNoCopy_1length_1freeWhenDone_1 = sel_registerName("initWithCStringNoCopy:length:freeWhenDone:");
+public static final int sel_previousKeyView = sel_registerName("previousKeyView");
+public static final int sel_performMiniaturize_1 = sel_registerName("performMiniaturize:");
+public static final int sel_decimalNumberWithDecimal_1 = sel_registerName("decimalNumberWithDecimal:");
+public static final int sel_autosaveTableColumns = sel_registerName("autosaveTableColumns");
+public static final int sel_baselineOffsetInLayoutManager_1glyphIndex_1 = sel_registerName("baselineOffsetInLayoutManager:glyphIndex:");
+public static final int sel_keyViewSelectionDirection = sel_registerName("keyViewSelectionDirection");
+public static final int sel_encodeBytes_1length_1 = sel_registerName("encodeBytes:length:");
+public static final int sel_fileManager_1shouldProceedAfterError_1copyingItemAtPath_1toPath_1 = sel_registerName("fileManager:shouldProceedAfterError:copyingItemAtPath:toPath:");
+public static final int sel_menuNeedsUpdate_1 = sel_registerName("menuNeedsUpdate:");
+public static final int sel_paragraphSpacingAfterGlyphAtIndex_1withProposedLineFragmentRect_1 = sel_registerName("paragraphSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:");
+public static final int sel_synchronize = sel_registerName("synchronize");
+public static final int sel_lockFocus = sel_registerName("lockFocus");
+public static final int sel_toggleSmartInsertDelete_1 = sel_registerName("toggleSmartInsertDelete:");
+public static final int sel_setMenu_1forSegment_1 = sel_registerName("setMenu:forSegment:");
+public static final int sel_removeParamDescriptorWithKeyword_1 = sel_registerName("removeParamDescriptorWithKeyword:");
+public static final int sel_applicationShouldOpenUntitledFile_1 = sel_registerName("applicationShouldOpenUntitledFile:");
+public static final int sel_DTD = sel_registerName("DTD");
+public static final int sel_cancelTracking = sel_registerName("cancelTracking");
+public static final int sel_fileSystemNumber = sel_registerName("fileSystemNumber");
+public static final int sel_setLevel_1 = sel_registerName("setLevel:");
+public static final int sel_setRequiredFileType_1 = sel_registerName("setRequiredFileType:");
+public static final int sel_presentError_1 = sel_registerName("presentError:");
+public static final int sel_allowsUserCustomization = sel_registerName("allowsUserCustomization");
+public static final int sel_childrenKeyPathForNode_1 = sel_registerName("childrenKeyPathForNode:");
+public static final int sel_setYear_1 = sel_registerName("setYear:");
+public static final int sel_movieController = sel_registerName("movieController");
+public static final int sel_unsignedLongValue = sel_registerName("unsignedLongValue");
+public static final int sel_hashTableWithOptions_1 = sel_registerName("hashTableWithOptions:");
+public static final int sel_setVerticalAlignment_1 = sel_registerName("setVerticalAlignment:");
+public static final int sel_cycleToNextInputServerInLanguage_1 = sel_registerName("cycleToNextInputServerInLanguage:");
+public static final int sel_sendAction_1to_1from_1 = sel_registerName("sendAction:to:from:");
+public static final int sel_numberFromString_1 = sel_registerName("numberFromString:");
+public static final int sel_setUndoManager_1 = sel_registerName("setUndoManager:");
+public static final int sel_imageDimsWhenDisabled = sel_registerName("imageDimsWhenDisabled");
+public static final int sel_autosavingFileType = sel_registerName("autosavingFileType");
+public static final int sel_unsignedLongLongValue = sel_registerName("unsignedLongLongValue");
+public static final int sel_initImageCell_1 = sel_registerName("initImageCell:");
+public static final int sel_invalidateDisplayForCharacterRange_1 = sel_registerName("invalidateDisplayForCharacterRange:");
+public static final int sel_setMaxContentSize_1 = sel_registerName("setMaxContentSize:");
+public static final int sel_outlineView_1isItemExpandable_1 = sel_registerName("outlineView:isItemExpandable:");
+public static final int sel_initWithUser_1password_1persistence_1 = sel_registerName("initWithUser:password:persistence:");
+public static final int sel_setBackgroundFilters_1 = sel_registerName("setBackgroundFilters:");
+public static final int sel_setAllowsDocumentBackgroundColorChange_1 = sel_registerName("setAllowsDocumentBackgroundColorChange:");
+public static final int sel_decodeNXObject = sel_registerName("decodeNXObject");
+public static final int sel_setMaximumSignificantDigits_1 = sel_registerName("setMaximumSignificantDigits:");
+public static final int sel_URLsFromRunningOpenPanel = sel_registerName("URLsFromRunningOpenPanel");
+public static final int sel_removeChildWindow_1 = sel_registerName("removeChildWindow:");
+public static final int sel_removeObjectForKey_1 = sel_registerName("removeObjectForKey:");
+public static final int sel_setCellSize_1 = sel_registerName("setCellSize:");
+public static final int sel_getParagraphStart_1end_1contentsEnd_1forRange_1 = sel_registerName("getParagraphStart:end:contentsEnd:forRange:");
+public static final int sel_connectionWithRequest_1delegate_1 = sel_registerName("connectionWithRequest:delegate:");
+public static final int sel_setNotShownAttribute_1forGlyphRange_1 = sel_registerName("setNotShownAttribute:forGlyphRange:");
+public static final int sel_collapsesBorders = sel_registerName("collapsesBorders");
+public static final int sel_setNegativeInfinitySymbol_1 = sel_registerName("setNegativeInfinitySymbol:");
+public static final int sel_initWithKind_1 = sel_registerName("initWithKind:");
+public static final int sel_appleEventCodeForArgumentWithName_1 = sel_registerName("appleEventCodeForArgumentWithName:");
+public static final int sel_moveUp_1 = sel_registerName("moveUp:");
+public static final int sel_initWithTextAlignment_1location_1options_1 = sel_registerName("initWithTextAlignment:location:options:");
+public static final int sel_systemVersion = sel_registerName("systemVersion");
+public static final int sel_numberOfItemsInComboBoxCell_1 = sel_registerName("numberOfItemsInComboBoxCell:");
+public static final int sel_readableTypes = sel_registerName("readableTypes");
+public static final int sel_setDraggingSourceOperationMask_1forLocal_1 = sel_registerName("setDraggingSourceOperationMask:forLocal:");
+public static final int sel_insertLineBreak_1 = sel_registerName("insertLineBreak:");
+public static final int sel_inLiveResize = sel_registerName("inLiveResize");
+public static final int sel_setCanHide_1 = sel_registerName("setCanHide:");
+public static final int sel_nextResponder = sel_registerName("nextResponder");
+public static final int sel_scrollClipView_1toPoint_1 = sel_registerName("scrollClipView:toPoint:");
+public static final int sel_positiveFormat = sel_registerName("positiveFormat");
+public static final int sel_redoMenuItemTitle = sel_registerName("redoMenuItemTitle");
+public static final int sel_addIndexesInRange_1 = sel_registerName("addIndexesInRange:");
+public static final int sel_lockBeforeDate_1 = sel_registerName("lockBeforeDate:");
+public static final int sel_unlockWithCondition_1 = sel_registerName("unlockWithCondition:");
+public static final int sel_nextWordFromIndex_1forward_1 = sel_registerName("nextWordFromIndex:forward:");
+public static final int sel_waitUntilAllOperationsAreFinished = sel_registerName("waitUntilAllOperationsAreFinished");
+public static final int sel_drawRow_1clipRect_1 = sel_registerName("drawRow:clipRect:");
+public static final int sel_setPartialStringValidationEnabled_1 = sel_registerName("setPartialStringValidationEnabled:");
+public static final int sel_methodSignatureForSelector_1 = sel_registerName("methodSignatureForSelector:");
+public static final int sel_setSecondaryGroupingSize_1 = sel_registerName("setSecondaryGroupingSize:");
+public static final int sel_criteriaForRow_1 = sel_registerName("criteriaForRow:");
+public static final int sel_setShadowBlurRadius_1 = sel_registerName("setShadowBlurRadius:");
+public static final int sel_expressionForFunction_1selectorName_1arguments_1 = sel_registerName("expressionForFunction:selectorName:arguments:");
+public static final int sel_initWithWindowNibName_1 = sel_registerName("initWithWindowNibName:");
+public static final int sel_selectItemWithTag_1 = sel_registerName("selectItemWithTag:");
+public static final int sel_characterIndexForPoint_1 = sel_registerName("characterIndexForPoint:");
+public static final int sel_validate = sel_registerName("validate");
+public static final int sel_setHorizontalPageScroll_1 = sel_registerName("setHorizontalPageScroll:");
+public static final int sel_localizedColorNameComponent = sel_registerName("localizedColorNameComponent");
+public static final int sel_setVoice_1 = sel_registerName("setVoice:");
+public static final int sel_setCachedSeparately_1 = sel_registerName("setCachedSeparately:");
+public static final int sel_frameRectForContentRect_1 = sel_registerName("frameRectForContentRect:");
+public static final int sel_bezelStyle = sel_registerName("bezelStyle");
+public static final int sel_setDecimalSeparator_1 = sel_registerName("setDecimalSeparator:");
+public static final int sel_conversationIdentifier = sel_registerName("conversationIdentifier");
+public static final int sel_setPrompt_1 = sel_registerName("setPrompt:");
+public static final int sel_setShowsFirstResponder_1 = sel_registerName("setShowsFirstResponder:");
+public static final int sel_setRootObject_1 = sel_registerName("setRootObject:");
+public static final int sel_menuBarVisible = sel_registerName("menuBarVisible");
+public static final int sel_netServiceBrowser_1didRemoveDomain_1moreComing_1 = sel_registerName("netServiceBrowser:didRemoveDomain:moreComing:");
+public static final int sel_threadPriority = sel_registerName("threadPriority");
+public static final int sel_countKeyPath = sel_registerName("countKeyPath");
+public static final int sel_runCustomizationPalette_1 = sel_registerName("runCustomizationPalette:");
+public static final int sel_fileHandleWithStandardError = sel_registerName("fileHandleWithStandardError");
+public static final int sel_documentContentKind = sel_registerName("documentContentKind");
+public static final int sel_view_1stringForToolTip_1point_1userData_1 = sel_registerName("view:stringForToolTip:point:userData:");
+public static final int sel_nameFieldLabel = sel_registerName("nameFieldLabel");
+public static final int sel_miniaturizeAll_1 = sel_registerName("miniaturizeAll:");
+public static final int sel_initWithRepresentedObject_1 = sel_registerName("initWithRepresentedObject:");
+public static final int sel_runOperation = sel_registerName("runOperation");
+public static final int sel_drawBackgroundForBlock_1withFrame_1inView_1characterRange_1layoutManager_1 = sel_registerName("drawBackgroundForBlock:withFrame:inView:characterRange:layoutManager:");
+public static final int sel_localizedInfoDictionary = sel_registerName("localizedInfoDictionary");
+public static final int sel_scanFloat_1 = sel_registerName("scanFloat:");
+public static final int sel_scanHexDouble_1 = sel_registerName("scanHexDouble:");
+public static final int sel_continueSpeaking = sel_registerName("continueSpeaking");
+public static final int sel_attachedMenuView = sel_registerName("attachedMenuView");
+public static final int sel_wantsToHandleMouseEvents = sel_registerName("wantsToHandleMouseEvents");
+public static final int sel_attemptRecoveryFromError_1optionIndex_1 = sel_registerName("attemptRecoveryFromError:optionIndex:");
+public static final int sel_window_1shouldDragDocumentWithEvent_1from_1withPasteboard_1 = sel_registerName("window:shouldDragDocumentWithEvent:from:withPasteboard:");
+public static final int sel_mouseEntered_1 = sel_registerName("mouseEntered:");
+public static final int sel_setNameFieldLabel_1 = sel_registerName("setNameFieldLabel:");
+public static final int sel_setIndentationPerLevel_1 = sel_registerName("setIndentationPerLevel:");
+public static final int sel_setMinColumnWidth_1 = sel_registerName("setMinColumnWidth:");
+public static final int sel_classNameForClass_1 = sel_registerName("classNameForClass:");
+public static final int sel_runLoopModes = sel_registerName("runLoopModes");
+public static final int sel_pullsDown = sel_registerName("pullsDown");
+public static final int sel_setOutlineTableColumn_1 = sel_registerName("setOutlineTableColumn:");
+public static final int sel_windowDidLoad = sel_registerName("windowDidLoad");
+public static final int sel_read_1maxLength_1 = sel_registerName("read:maxLength:");
+public static final int sel_removeItemAtIndex_1 = sel_registerName("removeItemAtIndex:");
+public static final int sel_initWithColor_1 = sel_registerName("initWithColor:");
+public static final int sel_compare_1options_1 = sel_registerName("compare:options:");
+public static final int sel_removeTableColumn_1 = sel_registerName("removeTableColumn:");
+public static final int sel_isRedoing = sel_registerName("isRedoing");
+public static final int sel_setTitleWithRepresentedFilename_1 = sel_registerName("setTitleWithRepresentedFilename:");
+public static final int sel_setDirectory_1 = sel_registerName("setDirectory:");
+public static final int sel_makeDocumentWithContentsOfURL_1ofType_1error_1 = sel_registerName("makeDocumentWithContentsOfURL:ofType:error:");
+public static final int sel_isSelectedForSegment_1 = sel_registerName("isSelectedForSegment:");
+public static final int sel_month = sel_registerName("month");
+public static final int sel_addRow = sel_registerName("addRow");
+public static final int sel_layoutOptions = sel_registerName("layoutOptions");
+public static final int sel_maxNumberOfRows = sel_registerName("maxNumberOfRows");
+public static final int sel_setUpPrintOperationDefaultValues = sel_registerName("setUpPrintOperationDefaultValues");
+public static final int sel_initByReferencingURL_1 = sel_registerName("initByReferencingURL:");
+public static final int sel_class = sel_registerName("class");
+public static final int sel_setFrameAutosaveName_1 = sel_registerName("setFrameAutosaveName:");
+public static final int sel_fileWrapperFromRange_1documentAttributes_1error_1 = sel_registerName("fileWrapperFromRange:documentAttributes:error:");
+public static final int sel_int32Value = sel_registerName("int32Value");
+public static final int sel_setControlView_1 = sel_registerName("setControlView:");
+public static final int sel_setCharacterEncoding_1 = sel_registerName("setCharacterEncoding:");
+public static final int sel_disableFlushWindow = sel_registerName("disableFlushWindow");
+public static final int sel_insertString_1atIndex_1 = sel_registerName("insertString:atIndex:");
+public static final int sel_childNodes = sel_registerName("childNodes");
+public static final int sel_rangeContainerObject = sel_registerName("rangeContainerObject");
+public static final int sel_kind = sel_registerName("kind");
+public static final int sel_title = sel_registerName("title");
+public static final int sel_bundleWithIdentifier_1 = sel_registerName("bundleWithIdentifier:");
+public static final int sel_initWithMovie_1 = sel_registerName("initWithMovie:");
+public static final int sel_unionHashTable_1 = sel_registerName("unionHashTable:");
+public static final int sel_setStartSpecifier_1 = sel_registerName("setStartSpecifier:");
+public static final int sel_browser_1nextTypeSelectMatchFromRow_1toRow_1inColumn_1forString_1 = sel_registerName("browser:nextTypeSelectMatchFromRow:toRow:inColumn:forString:");
+public static final int sel_tokenFieldCell_1representedObjectForEditingString_1 = sel_registerName("tokenFieldCell:representedObjectForEditingString:");
+public static final int sel_initWithContentsOfFile_1 = sel_registerName("initWithContentsOfFile:");
+public static final int sel_dataWithContentsOfURL_1 = sel_registerName("dataWithContentsOfURL:");
+public static final int sel_firstWeekday = sel_registerName("firstWeekday");
+public static final int sel_setInitialValues_1 = sel_registerName("setInitialValues:");
+public static final int sel_setIntegerValue_1 = sel_registerName("setIntegerValue:");
+public static final int sel_calcSize = sel_registerName("calcSize");
+public static final int sel_setTokenizingCharacterSet_1 = sel_registerName("setTokenizingCharacterSet:");
+public static final int sel_setRepresentedFilename_1 = sel_registerName("setRepresentedFilename:");
+public static final int sel_colorSpaceName = sel_registerName("colorSpaceName");
+public static final int sel_setLineBreakMode_1 = sel_registerName("setLineBreakMode:");
+public static final int sel_appliesImmediately = sel_registerName("appliesImmediately");
+public static final int sel_classDescriptionWithAppleEventCode_1 = sel_registerName("classDescriptionWithAppleEventCode:");
+public static final int sel_eventRef = sel_registerName("eventRef");
+public static final int sel_textAttributesForZero = sel_registerName("textAttributesForZero");
+public static final int sel_setAutosavesConfiguration_1 = sel_registerName("setAutosavesConfiguration:");
+public static final int sel_countOfIndexesInRange_1 = sel_registerName("countOfIndexesInRange:");
+public static final int sel_count = sel_registerName("count");
+public static final int sel_initWithSuiteName_1className_1dictionary_1 = sel_registerName("initWithSuiteName:className:dictionary:");
+public static final int sel_isReleasedWhenClosed = sel_registerName("isReleasedWhenClosed");
+public static final int sel_windowWithWindowNumber_1 = sel_registerName("windowWithWindowNumber:");
+public static final int sel_removeNamespaceForPrefix_1 = sel_registerName("removeNamespaceForPrefix:");
+public static final int sel_documentWithRootElement_1 = sel_registerName("documentWithRootElement:");
+public static final int sel_pageFooter = sel_registerName("pageFooter");
+public static final int sel_initWithOptions_1capacity_1 = sel_registerName("initWithOptions:capacity:");
+public static final int sel_insertBacktab_1 = sel_registerName("insertBacktab:");
+public static final int sel_changeWindowsItem_1title_1filename_1 = sel_registerName("changeWindowsItem:title:filename:");
+public static final int sel_changeCount = sel_registerName("changeCount");
+public static final int sel_paragraphCharacterRange = sel_registerName("paragraphCharacterRange");
+public static final int sel_currentProgress = sel_registerName("currentProgress");
+public static final int sel_parser_1didStartMappingPrefix_1toURI_1 = sel_registerName("parser:didStartMappingPrefix:toURI:");
+public static final int sel_setFormatWidth_1 = sel_registerName("setFormatWidth:");
+public static final int sel_cancelAllOperations = sel_registerName("cancelAllOperations");
+public static final int sel_beginLoadInBackground = sel_registerName("beginLoadInBackground");
+public static final int sel_draggedDistance = sel_registerName("draggedDistance");
+public static final int sel_setIndex_1 = sel_registerName("setIndex:");
+public static final int sel_initWithScheme_1host_1path_1 = sel_registerName("initWithScheme:host:path:");
+public static final int sel_toolTipForCell_1 = sel_registerName("toolTipForCell:");
+public static final int sel_predicateForRow_1 = sel_registerName("predicateForRow:");
+public static final int sel_predefinedEntityDeclarationForName_1 = sel_registerName("predefinedEntityDeclarationForName:");
+public static final int sel_replacePointerAtIndex_1withPointer_1 = sel_registerName("replacePointerAtIndex:withPointer:");
+public static final int sel_fileURLWithPath_1 = sel_registerName("fileURLWithPath:");
+public static final int sel_currentDocument = sel_registerName("currentDocument");
+public static final int sel_shouldDrawInsertionPoint = sel_registerName("shouldDrawInsertionPoint");
+public static final int sel_saveAllDocuments_1 = sel_registerName("saveAllDocuments:");
+public static final int sel_windowControllerWillLoadNib_1 = sel_registerName("windowControllerWillLoadNib:");
+public static final int sel_closeAllDocumentsWithDelegate_1didCloseAllSelector_1contextInfo_1 = sel_registerName("closeAllDocumentsWithDelegate:didCloseAllSelector:contextInfo:");
+public static final int sel_tableView_1heightOfRow_1 = sel_registerName("tableView:heightOfRow:");
+public static final int sel_postNotificationName_1object_1userInfo_1options_1 = sel_registerName("postNotificationName:object:userInfo:options:");
+public static final int sel_imageTypes = sel_registerName("imageTypes");
+public static final int sel_setPreferredBackingLocation_1 = sel_registerName("setPreferredBackingLocation:");
+public static final int sel_netServiceDidPublish_1 = sel_registerName("netServiceDidPublish:");
+public static final int sel_diskCapacity = sel_registerName("diskCapacity");
+public static final int sel_initWithString_1calendarFormat_1locale_1 = sel_registerName("initWithString:calendarFormat:locale:");
+public static final int sel_preferredEdge = sel_registerName("preferredEdge");
+public static final int sel_comboBoxCell_1indexOfItemWithStringValue_1 = sel_registerName("comboBoxCell:indexOfItemWithStringValue:");
+public static final int sel_replaceCharactersInRange_1withString_1 = sel_registerName("replaceCharactersInRange:withString:");
+public static final int sel_initWithTimeIntervalSinceReferenceDate_1 = sel_registerName("initWithTimeIntervalSinceReferenceDate:");
+public static final int sel_secondsFromGMT = sel_registerName("secondsFromGMT");
+public static final int sel_hasOrderedToManyRelationshipForKey_1 = sel_registerName("hasOrderedToManyRelationshipForKey:");
+public static final int sel_resignFirstResponder = sel_registerName("resignFirstResponder");
+public static final int sel_netServiceDidStop_1 = sel_registerName("netServiceDidStop:");
+public static final int sel_absoluteY = sel_registerName("absoluteY");
+public static final int sel_beginModalSessionForWindow_1 = sel_registerName("beginModalSessionForWindow:");
+public static final int sel_alignment = sel_registerName("alignment");
+public static final int sel_setCharactersToBeSkipped_1 = sel_registerName("setCharactersToBeSkipped:");
+public static final int sel_requestWithURL_1cachePolicy_1timeoutInterval_1 = sel_registerName("requestWithURL:cachePolicy:timeoutInterval:");
+public static final int sel_ruler = sel_registerName("ruler");
+public static final int sel_isSetOnMouseExited = sel_registerName("isSetOnMouseExited");
+public static final int sel_setRemovable_1 = sel_registerName("setRemovable:");
+public static final int sel_draggingSource = sel_registerName("draggingSource");
+public static final int sel_textView_1clickedOnLink_1 = sel_registerName("textView:clickedOnLink:");
+public static final int sel_canBeVisibleOnAllSpaces = sel_registerName("canBeVisibleOnAllSpaces");
+public static final int sel_setBadgeLabel_1 = sel_registerName("setBadgeLabel:");
+public static final int sel_parser_1foundUnparsedEntityDeclarationWithName_1publicID_1systemID_1notationName_1 = sel_registerName("parser:foundUnparsedEntityDeclarationWithName:publicID:systemID:notationName:");
+public static final int sel_operations = sel_registerName("operations");
+public static final int sel_setInteger_1forKey_1 = sel_registerName("setInteger:forKey:");
+public static final int sel_otherMouseUp_1 = sel_registerName("otherMouseUp:");
+public static final int sel_drawImageWithFrame_1inView_1 = sel_registerName("drawImageWithFrame:inView:");
+public static final int sel_getPixel_1atX_1y_1 = sel_registerName("getPixel:atX:y:");
+public static final int sel_standardError = sel_registerName("standardError");
+public static final int sel_setLabel_1 = sel_registerName("setLabel:");
+public static final int sel_initWithUnsignedInt_1 = sel_registerName("initWithUnsignedInt:");
+public static final int sel_isFinished = sel_registerName("isFinished");
+public static final int sel_drawSwatchInRect_1 = sel_registerName("drawSwatchInRect:");
+public static final int sel_descriptorAtIndex_1 = sel_registerName("descriptorAtIndex:");
+public static final int sel_cachedHandleForURL_1 = sel_registerName("cachedHandleForURL:");
+public static final int sel_classCode = sel_registerName("classCode");
+public static final int sel_resolvesAliases = sel_registerName("resolvesAliases");
+public static final int sel_textTypes = sel_registerName("textTypes");
+public static final int sel_invalidateTextContainerOrigin = sel_registerName("invalidateTextContainerOrigin");
+public static final int sel_document = sel_registerName("document");
+public static final int sel_interiorBackgroundStyleForSegment_1 = sel_registerName("interiorBackgroundStyleForSegment:");
+public static final int sel_transformedValue_1 = sel_registerName("transformedValue:");
+public static final int sel_substringToIndex_1 = sel_registerName("substringToIndex:");
+public static final int sel_addDocument_1 = sel_registerName("addDocument:");
+public static final int sel_numberWithInteger_1 = sel_registerName("numberWithInteger:");
+public static final int sel_setBoundsRotation_1 = sel_registerName("setBoundsRotation:");
+public static final int sel_convertFont_1toFace_1 = sel_registerName("convertFont:toFace:");
+public static final int sel_updateInsertionPointStateAndRestartTimer_1 = sel_registerName("updateInsertionPointStateAndRestartTimer:");
+public static final int sel_tryToPerform_1with_1 = sel_registerName("tryToPerform:with:");
+public static final int sel_defaultLineHeightForFont = sel_registerName("defaultLineHeightForFont");
+public static final int sel_scriptingIsEqualTo_1 = sel_registerName("scriptingIsEqualTo:");
+public static final int sel_setDoubleValue_1 = sel_registerName("setDoubleValue:");
+public static final int sel_AMSymbol = sel_registerName("AMSymbol");
+public static final int sel_valueWraps = sel_registerName("valueWraps");
+public static final int sel_allCredentials = sel_registerName("allCredentials");
+
+/** Constants */
+public static final int NSAWTEventType = 16;
+public static final int NSAboveBottom = 4;
+public static final int NSAboveTop = 1;
+public static final int NSAddTraitFontAction = 2;
+public static final int NSAdobeCNS1CharacterCollection = 1;
+public static final int NSAdobeGB1CharacterCollection = 2;
+public static final int NSAdobeJapan1CharacterCollection = 3;
+public static final int NSAdobeJapan2CharacterCollection = 4;
+public static final int NSAdobeKorea1CharacterCollection = 5;
+public static final int NSAlertAlternateReturn = 0;
+public static final int NSAlertDefaultReturn = 1;
+public static final int NSAlertErrorReturn = -2;
+public static final int NSAlertFirstButtonReturn = 1000;
+public static final int NSAlertOtherReturn = -1;
+public static final int NSAlertSecondButtonReturn = 1001;
+public static final int NSAlertThirdButtonReturn = 1002;
+public static final int NSAllScrollerParts = 2;
+public static final int NSAlphaFirstBitmapFormat = 1;
+public static final int NSAlphaNonpremultipliedBitmapFormat = 2;
+public static final int NSAlphaShiftKeyMask = 65536;
+public static final int NSAlternateKeyMask = 524288;
+public static final int NSAnimationBlocking = 0;
+public static final int NSAnimationEaseIn = 1;
+public static final int NSAnimationEaseInOut = 0;
+public static final int NSAnimationEaseOut = 2;
+public static final int NSAnimationEffectDisappearingItemDefault = 0;
+public static final int NSAnimationEffectPoof = 10;
+public static final int NSAnimationLinear = 3;
+public static final int NSAnimationNonblocking = 1;
+public static final int NSAnimationNonblockingThreaded = 2;
+public static final int NSAnyEventMask = -1;
+public static final int NSAnyType = 0;
+public static final int NSAppKitDefined = 13;
+public static final int NSAppKitDefinedMask = 8192;
+public static final int NSAppKitVersionNumber10_0 = 577;
+public static final int NSAppKitVersionNumber10_1 = 620;
+public static final int NSAppKitVersionNumber10_2 = 663;
+public static final double NSAppKitVersionNumber10_2_3 = 663.60000000000002;
+public static final int NSAppKitVersionNumber10_3 = 743;
+public static final double NSAppKitVersionNumber10_3_2 = 743.13999999999999;
+public static final double NSAppKitVersionNumber10_3_3 = 743.20000000000005;
+public static final double NSAppKitVersionNumber10_3_5 = 743.24000000000001;
+public static final double NSAppKitVersionNumber10_3_7 = 743.33000000000004;
+public static final double NSAppKitVersionNumber10_3_9 = 743.36000000000001;
+public static final int NSAppKitVersionNumber10_4 = 824;
+public static final double NSAppKitVersionNumberWithColumnResizingBrowser = 685.00000000000000;
+public static final double NSAppKitVersionNumberWithContinuousScrollingBrowser = 680.00000000000000;
+public static final double NSAppKitVersionNumberWithCursorSizeSupport = 682.00000000000000;
+public static final double NSAppKitVersionNumberWithCustomSheetPosition = 686.00000000000000;
+public static final double NSAppKitVersionNumberWithDirectionalTabs = 631.00000000000000;
+public static final double NSAppKitVersionNumberWithPatternColorLeakFix = 641.00000000000000;
+public static final int NSApplicationActivatedEventType = 1;
+public static final int NSApplicationDeactivatedEventType = 2;
+public static final int NSApplicationDefined = 15;
+public static final int NSApplicationDefinedMask = 32768;
+public static final int NSApplicationDelegateReplyCancel = 1;
+public static final int NSApplicationDelegateReplyFailure = 2;
+public static final int NSApplicationDelegateReplySuccess = 0;
+public static final int NSAscendingPageOrder = 1;
+public static final int NSAtBottom = 5;
+public static final int NSAtTop = 2;
+public static final int NSAttachmentCharacter = 65532;
+public static final int NSAutoPagination = 0;
+public static final int NSAutosaveOperation = 3;
+public static final int NSBMPFileType = 1;
+public static final int NSBackTabCharacter = 25;
+public static final int NSBackgroundStyleDark = 1;
+public static final int NSBackgroundStyleLight = 0;
+public static final int NSBackgroundStyleLowered = 3;
+public static final int NSBackgroundStyleRaised = 2;
+public static final int NSBackgroundTab = 1;
+public static final int NSBackingStoreBuffered = 2;
+public static final int NSBackingStoreNonretained = 1;
+public static final int NSBackingStoreRetained = 0;
+public static final int NSBackspaceCharacter = 8;
+public static final int NSBacktabTextMovement = 18;
+public static final int NSBeginFunctionKey = 63274;
+public static final int NSBelowBottom = 6;
+public static final int NSBelowTop = 3;
+public static final int NSBevelLineJoinStyle = 2;
+public static final int NSBezelBorder = 2;
+public static final int NSBlueControlTint = 1;
+public static final int NSBoldFontMask = 2;
+public static final int NSBorderlessWindowMask = 0;
+public static final int NSBottomTabsBezelBorder = 2;
+public static final int NSBoxCustom = 4;
+public static final int NSBoxOldStyle = 3;
+public static final int NSBoxPrimary = 0;
+public static final int NSBoxSecondary = 1;
+public static final int NSBoxSeparator = 2;
+public static final int NSBreakFunctionKey = 63282;
+public static final int NSBrowserAutoColumnResizing = 1;
+public static final int NSBrowserDropAbove = 1;
+public static final int NSBrowserDropOn = 0;
+public static final int NSBrowserNoColumnResizing = 0;
+public static final int NSBrowserUserColumnResizing = 2;
+public static final int NSButtLineCapStyle = 0;
+public static final int NSCMYKColorSpaceModel = 2;
+public static final int NSCMYKModeColorPanel = 2;
+public static final int NSCancelButton = 0;
+public static final int NSCancelTextMovement = 23;
+public static final int NSCarriageReturnCharacter = 13;
+public static final int NSCellAllowsMixedState = 16;
+public static final int NSCellChangesContents = 14;
+public static final int NSCellDisabled = 0;
+public static final int NSCellEditable = 3;
+public static final int NSCellHasImageHorizontal = 12;
+public static final int NSCellHasImageOnLeftOrBottom = 13;
+public static final int NSCellHasOverlappingImage = 11;
+public static final int NSCellHighlighted = 5;
+public static final int NSCellHitContentArea = 1;
+public static final int NSCellHitEditableTextArea = 2;
+public static final int NSCellHitNone = 0;
+public static final int NSCellHitTrackableArea = 4;
+public static final int NSCellIsBordered = 10;
+public static final int NSCellIsInsetButton = 15;
+public static final int NSCellLightsByBackground = 9;
+public static final int NSCellLightsByContents = 6;
+public static final int NSCellLightsByGray = 7;
+public static final int NSCellState = 1;
+public static final int NSCenterTabStopType = 2;
+public static final int NSCenterTextAlignment = 2;
+public static final int NSChangeAutosaved = 4;
+public static final int NSChangeBackgroundCell = 8;
+public static final int NSChangeBackgroundCellMask = 8;
+public static final int NSChangeCleared = 2;
+public static final int NSChangeDone = 0;
+public static final int NSChangeGrayCell = 4;
+public static final int NSChangeGrayCellMask = 4;
+public static final int NSChangeReadOtherContents = 3;
+public static final int NSChangeRedone = 5;
+public static final int NSChangeUndone = 1;
+public static final int NSCircularBezelStyle = 7;
+public static final int NSCircularSlider = 1;
+public static final int NSClearControlTint = 7;
+public static final int NSClearDisplayFunctionKey = 63290;
+public static final int NSClearLineFunctionKey = 63289;
+public static final int NSClipPagination = 2;
+public static final int NSClockAndCalendarDatePickerStyle = 1;
+public static final int NSClosableWindowMask = 2;
+public static final int NSClosePathBezierPathElement = 3;
+public static final int NSColorListModeColorPanel = 5;
+public static final int NSColorPanelAllModesMask = 65535;
+public static final int NSColorPanelCMYKModeMask = 4;
+public static final int NSColorPanelColorListModeMask = 32;
+public static final int NSColorPanelCrayonModeMask = 128;
+public static final int NSColorPanelCustomPaletteModeMask = 16;
+public static final int NSColorPanelGrayModeMask = 1;
+public static final int NSColorPanelHSBModeMask = 8;
+public static final int NSColorPanelRGBModeMask = 2;
+public static final int NSColorPanelWheelModeMask = 64;
+public static final int NSColorRenderingIntentAbsoluteColorimetric = 1;
+public static final int NSColorRenderingIntentDefault = 0;
+public static final int NSColorRenderingIntentPerceptual = 3;
+public static final int NSColorRenderingIntentRelativeColorimetric = 2;
+public static final int NSColorRenderingIntentSaturation = 4;
+public static final int NSCommandKeyMask = 1048576;
+public static final int NSCompositeClear = 0;
+public static final int NSCompositeCopy = 1;
+public static final int NSCompositeDestinationAtop = 9;
+public static final int NSCompositeDestinationIn = 7;
+public static final int NSCompositeDestinationOut = 8;
+public static final int NSCompositeDestinationOver = 6;
+public static final int NSCompositeHighlight = 12;
+public static final int NSCompositePlusDarker = 11;
+public static final int NSCompositePlusLighter = 13;
+public static final int NSCompositeSourceAtop = 5;
+public static final int NSCompositeSourceIn = 3;
+public static final int NSCompositeSourceOut = 4;
+public static final int NSCompositeSourceOver = 2;
+public static final int NSCompositeXOR = 10;
+public static final int NSCompressedFontMask = 512;
+public static final int NSCondensedFontMask = 64;
+public static final int NSContentsCellMask = 1;
+public static final int NSContinuousCapacityLevelIndicatorStyle = 1;
+public static final int NSControlGlyph = 16777215;
+public static final int NSControlKeyMask = 262144;
+public static final int NSCrayonModeColorPanel = 7;
+public static final int NSCriticalAlertStyle = 2;
+public static final int NSCriticalRequest = 0;
+public static final int NSCursorPointingDevice = 2;
+public static final int NSCursorUpdate = 17;
+public static final int NSCursorUpdateMask = 131072;
+public static final int NSCurveToBezierPathElement = 2;
+public static final int NSCustomPaletteModeColorPanel = 4;
+public static final int NSDecimalTabStopType = 3;
+public static final int NSDefaultControlTint = 0;
+public static final int NSDefaultTokenStyle = 0;
+public static final int NSDeleteCharFunctionKey = 63294;
+public static final int NSDeleteCharacter = 127;
+public static final int NSDeleteFunctionKey = 63272;
+public static final int NSDeleteLineFunctionKey = 63292;
+public static final int NSDescendingPageOrder = -1;
+public static final int NSDeviceIndependentModifierFlagsMask = -65536;
+public static final int NSDeviceNColorSpaceModel = 4;
+public static final int NSDirectSelection = 0;
+public static final int NSDisclosureBezelStyle = 5;
+public static final int NSDiscreteCapacityLevelIndicatorStyle = 2;
+public static final int NSDisplayWindowRunLoopOrdering = 600000;
+public static final int NSDocModalWindowMask = 64;
+public static final int NSDockWindowLevel = 20;
+public static final int NSDoubleType = 6;
+public static final int NSDownArrowFunctionKey = 63233;
+public static final int NSDownTextMovement = 22;
+public static final int NSDragOperationAll = 15;
+public static final int NSDragOperationAll_Obsolete = 15;
+public static final int NSDragOperationCopy = 1;
+public static final int NSDragOperationDelete = 32;
+public static final int NSDragOperationEvery = -1;
+public static final int NSDragOperationGeneric = 4;
+public static final int NSDragOperationLink = 2;
+public static final int NSDragOperationMove = 16;
+public static final int NSDragOperationNone = 0;
+public static final int NSDragOperationPrivate = 8;
+public static final int NSDrawerClosedState = 0;
+public static final int NSDrawerClosingState = 3;
+public static final int NSDrawerOpenState = 2;
+public static final int NSDrawerOpeningState = 1;
+public static final int NSEndFunctionKey = 63275;
+public static final int NSEnterCharacter = 3;
+public static final int NSEraDatePickerElementFlag = 256;
+public static final int NSEraserPointingDevice = 3;
+public static final int NSEvenOddWindingRule = 1;
+public static final int NSExclude10_4ElementsIconCreationOption = 4;
+public static final int NSExcludeQuickDrawElementsIconCreationOption = 2;
+public static final int NSExecuteFunctionKey = 63298;
+public static final int NSExpandedFontMask = 32;
+public static final int NSF10FunctionKey = 63245;
+public static final int NSF11FunctionKey = 63246;
+public static final int NSF12FunctionKey = 63247;
+public static final int NSF13FunctionKey = 63248;
+public static final int NSF14FunctionKey = 63249;
+public static final int NSF15FunctionKey = 63250;
+public static final int NSF16FunctionKey = 63251;
+public static final int NSF17FunctionKey = 63252;
+public static final int NSF18FunctionKey = 63253;
+public static final int NSF19FunctionKey = 63254;
+public static final int NSF1FunctionKey = 63236;
+public static final int NSF20FunctionKey = 63255;
+public static final int NSF21FunctionKey = 63256;
+public static final int NSF22FunctionKey = 63257;
+public static final int NSF23FunctionKey = 63258;
+public static final int NSF24FunctionKey = 63259;
+public static final int NSF25FunctionKey = 63260;
+public static final int NSF26FunctionKey = 63261;
+public static final int NSF27FunctionKey = 63262;
+public static final int NSF28FunctionKey = 63263;
+public static final int NSF29FunctionKey = 63264;
+public static final int NSF2FunctionKey = 63237;
+public static final int NSF30FunctionKey = 63265;
+public static final int NSF31FunctionKey = 63266;
+public static final int NSF32FunctionKey = 63267;
+public static final int NSF33FunctionKey = 63268;
+public static final int NSF34FunctionKey = 63269;
+public static final int NSF35FunctionKey = 63270;
+public static final int NSF3FunctionKey = 63238;
+public static final int NSF4FunctionKey = 63239;
+public static final int NSF5FunctionKey = 63240;
+public static final int NSF6FunctionKey = 63241;
+public static final int NSF7FunctionKey = 63242;
+public static final int NSF8FunctionKey = 63243;
+public static final int NSF9FunctionKey = 63244;
+public static final int NSFPCurrentField = 134;
+public static final int NSFPPreviewButton = 131;
+public static final int NSFPPreviewField = 128;
+public static final int NSFPRevertButton = 130;
+public static final int NSFPSetButton = 132;
+public static final int NSFPSizeField = 129;
+public static final int NSFPSizeTitle = 133;
+public static final int NSFileHandlingPanelCancelButton = 0;
+public static final int NSFileHandlingPanelOKButton = 1;
+public static final int NSFindFunctionKey = 63301;
+public static final int NSFindPanelActionNext = 2;
+public static final int NSFindPanelActionPrevious = 3;
+public static final int NSFindPanelActionReplace = 5;
+public static final int NSFindPanelActionReplaceAll = 4;
+public static final int NSFindPanelActionReplaceAllInSelection = 8;
+public static final int NSFindPanelActionReplaceAndFind = 6;
+public static final int NSFindPanelActionSelectAll = 9;
+public static final int NSFindPanelActionSelectAllInSelection = 10;
+public static final int NSFindPanelActionSetFindString = 7;
+public static final int NSFindPanelActionShowFindPanel = 1;
+public static final int NSFindPanelSubstringMatchTypeContains = 0;
+public static final int NSFindPanelSubstringMatchTypeEndsWith = 3;
+public static final int NSFindPanelSubstringMatchTypeFullWord = 2;
+public static final int NSFindPanelSubstringMatchTypeStartsWith = 1;
+public static final int NSFitPagination = 1;
+public static final int NSFixedPitchFontMask = 1024;
+public static final int NSFlagsChanged = 12;
+public static final int NSFlagsChangedMask = 4096;
+public static final int NSFloatType = 3;
+public static final int NSFloatingPointSamplesBitmapFormat = 4;
+public static final int NSFloatingWindowLevel = 3;
+public static final int NSFocusRingAbove = 2;
+public static final int NSFocusRingBelow = 1;
+public static final int NSFocusRingOnly = 0;
+public static final int NSFocusRingTypeDefault = 0;
+public static final int NSFocusRingTypeExterior = 2;
+public static final int NSFocusRingTypeNone = 1;
+public static final int NSFontAntialiasedIntegerAdvancementsRenderingMode = 3;
+public static final int NSFontAntialiasedRenderingMode = 1;
+public static final int NSFontBoldTrait = 2;
+public static final int NSFontClarendonSerifsClass = 1073741824;
+public static final int NSFontCollectionApplicationOnlyMask = 1;
+public static final int NSFontCondensedTrait = 64;
+public static final int NSFontDefaultRenderingMode = 0;
+public static final int NSFontExpandedTrait = 32;
+public static final int NSFontFamilyClassMask = -268435456;
+public static final int NSFontFreeformSerifsClass = 1879048192;
+public static final int NSFontIntegerAdvancementsRenderingMode = 2;
+public static final int NSFontItalicTrait = 1;
+public static final int NSFontModernSerifsClass = 805306368;
+public static final int NSFontMonoSpaceTrait = 1024;
+public static final int NSFontOldStyleSerifsClass = 268435456;
+public static final int NSFontOrnamentalsClass = -1879048192;
+public static final int NSFontPanelAllEffectsModeMask = 1048320;
+public static final int NSFontPanelAllModesMask = -1;
+public static final int NSFontPanelCollectionModeMask = 4;
+public static final int NSFontPanelDocumentColorEffectModeMask = 2048;
+public static final int NSFontPanelFaceModeMask = 1;
+public static final int NSFontPanelShadowEffectModeMask = 4096;
+public static final int NSFontPanelSizeModeMask = 2;
+public static final int NSFontPanelStandardModesMask = 65535;
+public static final int NSFontPanelStrikethroughEffectModeMask = 512;
+public static final int NSFontPanelTextColorEffectModeMask = 1024;
+public static final int NSFontPanelUnderlineEffectModeMask = 256;
+public static final int NSFontSansSerifClass = -2147483648;
+public static final int NSFontScriptsClass = -1610612736;
+public static final int NSFontSlabSerifsClass = 1342177280;
+public static final int NSFontSymbolicClass = -1073741824;
+public static final int NSFontTransitionalSerifsClass = 536870912;
+public static final int NSFontUIOptimizedTrait = 4096;
+public static final int NSFontUnknownClass = 0;
+public static final int NSFontVerticalTrait = 2048;
+public static final int NSFormFeedCharacter = 12;
+public static final int NSFunctionKeyMask = 8388608;
+public static final int NSGIFFileType = 2;
+public static final int NSGlyphAttributeBidiLevel = 2;
+public static final int NSGlyphAttributeElastic = 1;
+public static final int NSGlyphAttributeInscribe = 5;
+public static final int NSGlyphAttributeSoft = 0;
+public static final int NSGlyphInscribeAbove = 2;
+public static final int NSGlyphInscribeBase = 0;
+public static final int NSGlyphInscribeBelow = 1;
+public static final int NSGlyphInscribeOverBelow = 4;
+public static final int NSGlyphInscribeOverstrike = 3;
+public static final int NSGradientConcaveStrong = 2;
+public static final int NSGradientConcaveWeak = 1;
+public static final int NSGradientConvexStrong = 4;
+public static final int NSGradientConvexWeak = 3;
+public static final int NSGradientDrawsAfterEndingLocation = 2;
+public static final int NSGradientDrawsBeforeStartingLocation = 1;
+public static final int NSGradientNone = 0;
+public static final int NSGraphiteControlTint = 6;
+public static final int NSGrayColorSpaceModel = 0;
+public static final int NSGrayModeColorPanel = 0;
+public static final int NSGrooveBorder = 3;
+public static final int NSHSBModeColorPanel = 3;
+public static final int NSHUDWindowMask = 8192;
+public static final int NSHeavierFontAction = 5;
+public static final int NSHelpButtonBezelStyle = 9;
+public static final int NSHelpFunctionKey = 63302;
+public static final int NSHelpKeyMask = 4194304;
+public static final int NSHighlightModeMatrix = 1;
+public static final int NSHomeFunctionKey = 63273;
+public static final int NSHorizontalRuler = 0;
+public static final int NSHourMinuteDatePickerElementFlag = 12;
+public static final int NSHourMinuteSecondDatePickerElementFlag = 14;
+public static final int NSIdentityMappingCharacterCollection = 0;
+public static final int NSIllegalTextMovement = 0;
+public static final int NSImageAbove = 5;
+public static final int NSImageAlignBottom = 5;
+public static final int NSImageAlignBottomLeft = 6;
+public static final int NSImageAlignBottomRight = 7;
+public static final int NSImageAlignCenter = 0;
+public static final int NSImageAlignLeft = 4;
+public static final int NSImageAlignRight = 8;
+public static final int NSImageAlignTop = 1;
+public static final int NSImageAlignTopLeft = 2;
+public static final int NSImageAlignTopRight = 3;
+public static final int NSImageBelow = 4;
+public static final int NSImageCacheAlways = 1;
+public static final int NSImageCacheBySize = 2;
+public static final int NSImageCacheDefault = 0;
+public static final int NSImageCacheNever = 3;
+public static final int NSImageCellType = 2;
+public static final int NSImageFrameButton = 4;
+public static final int NSImageFrameGrayBezel = 2;
+public static final int NSImageFrameGroove = 3;
+public static final int NSImageFrameNone = 0;
+public static final int NSImageFramePhoto = 1;
+public static final int NSImageInterpolationDefault = 0;
+public static final int NSImageInterpolationHigh = 3;
+public static final int NSImageInterpolationLow = 2;
+public static final int NSImageInterpolationNone = 1;
+public static final int NSImageLeft = 2;
+public static final int NSImageLoadStatusCancelled = 1;
+public static final int NSImageLoadStatusCompleted = 0;
+public static final int NSImageLoadStatusInvalidData = 2;
+public static final int NSImageLoadStatusReadError = 4;
+public static final int NSImageLoadStatusUnexpectedEOF = 3;
+public static final int NSImageOnly = 1;
+public static final int NSImageOverlaps = 6;
+public static final int NSImageRepLoadStatusCompleted = -6;
+public static final int NSImageRepLoadStatusInvalidData = -4;
+public static final int NSImageRepLoadStatusReadingHeader = -2;
+public static final int NSImageRepLoadStatusUnexpectedEOF = -5;
+public static final int NSImageRepLoadStatusUnknownType = -1;
+public static final int NSImageRepLoadStatusWillNeedAllData = -3;
+public static final int NSImageRepMatchesDevice = 0;
+public static final int NSImageRight = 3;
+public static final int NSImageScaleAxesIndependently = 1;
+public static final int NSImageScaleNone = 2;
+public static final int NSImageScaleProportionallyDown = 0;
+public static final int NSImageScaleProportionallyUpOrDown = 3;
+public static final int NSIndexedColorSpaceModel = 5;
+public static final int NSInformationalAlertStyle = 1;
+public static final int NSInformationalRequest = 10;
+public static final int NSInsertCharFunctionKey = 63293;
+public static final int NSInsertFunctionKey = 63271;
+public static final int NSInsertLineFunctionKey = 63291;
+public static final int NSIntType = 1;
+public static final int NSItalicFontMask = 1;
+public static final int NSJPEG2000FileType = 5;
+public static final int NSJPEGFileType = 3;
+public static final int NSJustifiedTextAlignment = 3;
+public static final int NSKeyDown = 10;
+public static final int NSKeyDownMask = 1024;
+public static final int NSKeyUp = 11;
+public static final int NSKeyUpMask = 2048;
+public static final int NSLABColorSpaceModel = 3;
+public static final int NSLandscapeOrientation = 1;
+public static final int NSLeftArrowFunctionKey = 63234;
+public static final int NSLeftMouseDown = 1;
+public static final int NSLeftMouseDownMask = 2;
+public static final int NSLeftMouseDragged = 6;
+public static final int NSLeftMouseDraggedMask = 64;
+public static final int NSLeftMouseUp = 2;
+public static final int NSLeftMouseUpMask = 4;
+public static final int NSLeftTabStopType = 0;
+public static final int NSLeftTabsBezelBorder = 1;
+public static final int NSLeftTextAlignment = 0;
+public static final int NSLeftTextMovement = 19;
+public static final int NSLighterFontAction = 6;
+public static final int NSLineBorder = 1;
+public static final int NSLineBreakByCharWrapping = 1;
+public static final int NSLineBreakByClipping = 2;
+public static final int NSLineBreakByTruncatingHead = 3;
+public static final int NSLineBreakByTruncatingMiddle = 5;
+public static final int NSLineBreakByTruncatingTail = 4;
+public static final int NSLineBreakByWordWrapping = 0;
+public static final int NSLineDoesntMove = 0;
+public static final int NSLineMovesDown = 3;
+public static final int NSLineMovesLeft = 1;
+public static final int NSLineMovesRight = 2;
+public static final int NSLineMovesUp = 4;
+public static final int NSLineSeparatorCharacter = 8232;
+public static final int NSLineSweepDown = 2;
+public static final int NSLineSweepLeft = 0;
+public static final int NSLineSweepRight = 1;
+public static final int NSLineSweepUp = 3;
+public static final int NSLineToBezierPathElement = 1;
+public static final int NSLinearSlider = 0;
+public static final int NSListModeMatrix = 2;
+public static final int NSMacintoshInterfaceStyle = 3;
+public static final int NSMainMenuWindowLevel = 24;
+public static final int NSMenuFunctionKey = 63285;
+public static final int NSMiniControlSize = 2;
+public static final int NSMiniaturizableWindowMask = 4;
+public static final int NSMiterLineJoinStyle = 0;
+public static final int NSMixedState = -1;
+public static final int NSModalPanelWindowLevel = 8;
+public static final int NSModeSwitchFunctionKey = 63303;
+public static final int NSMomentaryChangeButton = 5;
+public static final int NSMomentaryLight = 7;
+public static final int NSMomentaryLightButton = 0;
+public static final int NSMomentaryPushButton = 0;
+public static final int NSMomentaryPushInButton = 7;
+public static final int NSMouseEntered = 8;
+public static final int NSMouseEnteredMask = 256;
+public static final int NSMouseEventSubtype = 0;
+public static final int NSMouseExited = 9;
+public static final int NSMouseExitedMask = 512;
+public static final int NSMouseMoved = 5;
+public static final int NSMouseMovedMask = 32;
+public static final int NSMoveToBezierPathElement = 0;
+public static final int NSNarrowFontMask = 16;
+public static final int NSNativeShortGlyphPacking = 5;
+public static final int NSNaturalTextAlignment = 4;
+public static final int NSNewlineCharacter = 10;
+public static final int NSNextFunctionKey = 63296;
+public static final int NSNextStepInterfaceStyle = 1;
+public static final int NSNoBorder = 0;
+public static final int NSNoCellMask = 0;
+public static final int NSNoFontChangeAction = 0;
+public static final int NSNoImage = 0;
+public static final int NSNoInterfaceStyle = 0;
+public static final int NSNoModeColorPanel = -1;
+public static final int NSNoScrollerParts = 0;
+public static final int NSNoTabsBezelBorder = 4;
+public static final int NSNoTabsLineBorder = 5;
+public static final int NSNoTabsNoBorder = 6;
+public static final int NSNoTitle = 0;
+public static final int NSNoUnderlineStyle = 0;
+public static final int NSNonStandardCharacterSetFontMask = 8;
+public static final int NSNonZeroWindingRule = 0;
+public static final int NSNonactivatingPanelMask = 128;
+public static final int NSNormalWindowLevel = 0;
+public static final int NSNullCellType = 0;
+public static final int NSNullGlyph = 0;
+public static final int NSNumericPadKeyMask = 2097152;
+public static final int NSOKButton = 1;
+public static final int NSOPENGL_CURRENT_VERSION = 1;
+public static final int NSOffState = 0;
+public static final int NSOnOffButton = 6;
+public static final int NSOnState = 1;
+public static final int NSOnlyScrollerArrows = 1;
+public static final int NSOpenGLCPRasterizationEnable = 221;
+public static final int NSOpenGLCPStateValidation = 301;
+public static final int NSOpenGLCPSurfaceOpacity = 236;
+public static final int NSOpenGLCPSurfaceOrder = 235;
+public static final int NSOpenGLCPSwapInterval = 222;
+public static final int NSOpenGLCPSwapRectangle = 200;
+public static final int NSOpenGLCPSwapRectangleEnable = 201;
+public static final int NSOpenGLGOClearFormatCache = 502;
+public static final int NSOpenGLGOFormatCacheSize = 501;
+public static final int NSOpenGLGOResetLibrary = 504;
+public static final int NSOpenGLGORetainRenderers = 503;
+public static final int NSOpenGLPFAAccelerated = 73;
+public static final int NSOpenGLPFAAccumSize = 14;
+public static final int NSOpenGLPFAAllRenderers = 1;
+public static final int NSOpenGLPFAAllowOfflineRenderers = 96;
+public static final int NSOpenGLPFAAlphaSize = 11;
+public static final int NSOpenGLPFAAuxBuffers = 7;
+public static final int NSOpenGLPFAAuxDepthStencil = 57;
+public static final int NSOpenGLPFABackingStore = 76;
+public static final int NSOpenGLPFAClosestPolicy = 74;
+public static final int NSOpenGLPFAColorFloat = 58;
+public static final int NSOpenGLPFAColorSize = 8;
+public static final int NSOpenGLPFACompliant = 83;
+public static final int NSOpenGLPFADepthSize = 12;
+public static final int NSOpenGLPFADoubleBuffer = 5;
+public static final int NSOpenGLPFAFullScreen = 54;
+public static final int NSOpenGLPFAMPSafe = 78;
+public static final int NSOpenGLPFAMaximumPolicy = 52;
+public static final int NSOpenGLPFAMinimumPolicy = 51;
+public static final int NSOpenGLPFAMultiScreen = 81;
+public static final int NSOpenGLPFAMultisample = 59;
+public static final int NSOpenGLPFANoRecovery = 72;
+public static final int NSOpenGLPFAOffScreen = 53;
+public static final int NSOpenGLPFAPixelBuffer = 90;
+public static final int NSOpenGLPFARendererID = 70;
+public static final int NSOpenGLPFARobust = 75;
+public static final int NSOpenGLPFASampleAlpha = 61;
+public static final int NSOpenGLPFASampleBuffers = 55;
+public static final int NSOpenGLPFASamples = 56;
+public static final int NSOpenGLPFAScreenMask = 84;
+public static final int NSOpenGLPFASingleRenderer = 71;
+public static final int NSOpenGLPFAStencilSize = 13;
+public static final int NSOpenGLPFAStereo = 6;
+public static final int NSOpenGLPFASupersample = 60;
+public static final int NSOpenGLPFAVirtualScreenCount = 128;
+public static final int NSOpenGLPFAWindow = 80;
+public static final int NSOtherMouseDown = 25;
+public static final int NSOtherMouseDownMask = 33554432;
+public static final int NSOtherMouseDragged = 27;
+public static final int NSOtherMouseDraggedMask = 134217728;
+public static final int NSOtherMouseUp = 26;
+public static final int NSOtherMouseUpMask = 67108864;
+public static final int NSOtherTextMovement = 0;
+public static final int NSOutlineViewDropOnItemIndex = -1;
+public static final int NSPNGFileType = 4;
+public static final int NSPageDownFunctionKey = 63277;
+public static final int NSPageUpFunctionKey = 63276;
+public static final int NSParagraphSeparatorCharacter = 8233;
+public static final int NSPathStyleNavigationBar = 1;
+public static final int NSPathStylePopUp = 2;
+public static final int NSPathStyleStandard = 0;
+public static final int NSPatternColorSpaceModel = 6;
+public static final int NSPauseFunctionKey = 63280;
+public static final int NSPenLowerSideMask = 2;
+public static final int NSPenPointingDevice = 1;
+public static final int NSPenTipMask = 1;
+public static final int NSPenUpperSideMask = 4;
+public static final int NSPeriodic = 16;
+public static final int NSPeriodicMask = 65536;
+public static final int NSPlainTextTokenStyle = 1;
+public static final int NSPopUpArrowAtBottom = 2;
+public static final int NSPopUpArrowAtCenter = 1;
+public static final int NSPopUpMenuWindowLevel = 101;
+public static final int NSPopUpNoArrow = 0;
+public static final int NSPortraitOrientation = 0;
+public static final int NSPositiveDoubleType = 7;
+public static final int NSPositiveFloatType = 4;
+public static final int NSPositiveIntType = 2;
+public static final int NSPosterFontMask = 256;
+public static final int NSPowerOffEventType = 1;
+public static final int NSPressedTab = 2;
+public static final int NSPrevFunctionKey = 63295;
+public static final int NSPrintFunctionKey = 63288;
+public static final int NSPrintPanelShowsCopies = 1;
+public static final int NSPrintPanelShowsOrientation = 8;
+public static final int NSPrintPanelShowsPageRange = 2;
+public static final int NSPrintPanelShowsPageSetupAccessory = 256;
+public static final int NSPrintPanelShowsPaperSize = 4;
+public static final int NSPrintPanelShowsPreview = 131072;
+public static final int NSPrintPanelShowsScaling = 16;
+public static final int NSPrintScreenFunctionKey = 63278;
+public static final int NSPrinterTableError = 2;
+public static final int NSPrinterTableNotFound = 1;
+public static final int NSPrinterTableOK = 0;
+public static final int NSPrintingCancelled = 0;
+public static final int NSPrintingFailure = 3;
+public static final int NSPrintingReplyLater = 2;
+public static final int NSPrintingSuccess = 1;
+public static final int NSProgressIndicatorBarStyle = 0;
+public static final int NSProgressIndicatorPreferredAquaThickness = 12;
+public static final int NSProgressIndicatorPreferredLargeThickness = 18;
+public static final int NSProgressIndicatorPreferredSmallThickness = 10;
+public static final int NSProgressIndicatorPreferredThickness = 14;
+public static final int NSProgressIndicatorSpinningStyle = 1;
+public static final int NSPushInCell = 2;
+public static final int NSPushInCellMask = 2;
+public static final int NSPushOnPushOffButton = 1;
+public static final int NSQTMovieLoopingBackAndForthPlayback = 2;
+public static final int NSQTMovieLoopingPlayback = 1;
+public static final int NSQTMovieNormalPlayback = 0;
+public static final int NSRGBColorSpaceModel = 1;
+public static final int NSRGBModeColorPanel = 1;
+public static final int NSRadioButton = 4;
+public static final int NSRadioModeMatrix = 0;
+public static final int NSRangeDateMode = 1;
+public static final int NSRatingLevelIndicatorStyle = 3;
+public static final int NSRecessedBezelStyle = 13;
+public static final int NSRedoFunctionKey = 63300;
+public static final int NSRegularControlSize = 0;
+public static final int NSRegularSquareBezelStyle = 2;
+public static final int NSRelevancyLevelIndicatorStyle = 0;
+public static final int NSRemoveTraitFontAction = 7;
+public static final int NSResetCursorRectsRunLoopOrdering = 700000;
+public static final int NSResetFunctionKey = 63283;
+public static final int NSResizableWindowMask = 8;
+public static final int NSReturnTextMovement = 16;
+public static final int NSRightArrowFunctionKey = 63235;
+public static final int NSRightMouseDown = 3;
+public static final int NSRightMouseDownMask = 8;
+public static final int NSRightMouseDragged = 7;
+public static final int NSRightMouseDraggedMask = 128;
+public static final int NSRightMouseUp = 4;
+public static final int NSRightMouseUpMask = 16;
+public static final int NSRightTabStopType = 1;
+public static final int NSRightTabsBezelBorder = 3;
+public static final int NSRightTextAlignment = 1;
+public static final int NSRightTextMovement = 20;
+public static final int NSRoundLineCapStyle = 1;
+public static final int NSRoundLineJoinStyle = 1;
+public static final int NSRoundRectBezelStyle = 12;
+public static final int NSRoundedBezelStyle = 1;
+public static final int NSRoundedDisclosureBezelStyle = 14;
+public static final int NSRoundedTokenStyle = 2;
+public static final int NSRuleEditorNestingModeCompound = 2;
+public static final int NSRuleEditorNestingModeList = 1;
+public static final int NSRuleEditorNestingModeSimple = 3;
+public static final int NSRuleEditorNestingModeSingle = 0;
+public static final int NSRuleEditorRowTypeCompound = 1;
+public static final int NSRuleEditorRowTypeSimple = 0;
+public static final int NSRunAbortedResponse = -1001;
+public static final int NSRunContinuesResponse = -1002;
+public static final int NSRunStoppedResponse = -1000;
+public static final int NSSaveAsOperation = 1;
+public static final int NSSaveOperation = 0;
+public static final int NSSaveToOperation = 2;
+public static final int NSScaleNone = 2;
+public static final int NSScaleProportionally = 0;
+public static final int NSScaleToFit = 1;
+public static final int NSScreenChangedEventType = 8;
+public static final int NSScreenSaverWindowLevel = 1000;
+public static final int NSScrollLockFunctionKey = 63279;
+public static final int NSScrollWheel = 22;
+public static final int NSScrollWheelMask = 4194304;
+public static final int NSScrollerArrowsDefaultSetting = 0;
+public static final int NSScrollerArrowsMaxEnd = 0;
+public static final int NSScrollerArrowsMinEnd = 1;
+public static final int NSScrollerArrowsNone = 2;
+public static final int NSScrollerDecrementArrow = 1;
+public static final int NSScrollerDecrementLine = 4;
+public static final int NSScrollerDecrementPage = 1;
+public static final int NSScrollerIncrementArrow = 0;
+public static final int NSScrollerIncrementLine = 5;
+public static final int NSScrollerIncrementPage = 3;
+public static final int NSScrollerKnob = 2;
+public static final int NSScrollerKnobSlot = 6;
+public static final int NSScrollerNoPart = 0;
+public static final int NSSearchFieldClearRecentsMenuItemTag = 1002;
+public static final int NSSearchFieldNoRecentsMenuItemTag = 1003;
+public static final int NSSearchFieldRecentsMenuItemTag = 1001;
+public static final int NSSearchFieldRecentsTitleMenuItemTag = 1000;
+public static final int NSSegmentStyleAutomatic = 0;
+public static final int NSSegmentStyleCapsule = 5;
+public static final int NSSegmentStyleRoundRect = 3;
+public static final int NSSegmentStyleRounded = 1;
+public static final int NSSegmentStyleSmallSquare = 6;
+public static final int NSSegmentStyleTexturedRounded = 2;
+public static final int NSSegmentStyleTexturedSquare = 4;
+public static final int NSSegmentSwitchTrackingMomentary = 2;
+public static final int NSSegmentSwitchTrackingSelectAny = 1;
+public static final int NSSegmentSwitchTrackingSelectOne = 0;
+public static final int NSSelectByCharacter = 0;
+public static final int NSSelectByParagraph = 2;
+public static final int NSSelectByWord = 1;
+public static final int NSSelectFunctionKey = 63297;
+public static final int NSSelectedTab = 0;
+public static final int NSSelectingNext = 1;
+public static final int NSSelectingPrevious = 2;
+public static final int NSSelectionAffinityDownstream = 1;
+public static final int NSSelectionAffinityUpstream = 0;
+public static final int NSServiceApplicationLaunchFailedError = 66561;
+public static final int NSServiceApplicationNotFoundError = 66560;
+public static final int NSServiceErrorMaximum = 66817;
+public static final int NSServiceErrorMinimum = 66560;
+public static final int NSServiceInvalidPasteboardDataError = 66563;
+public static final int NSServiceMalformedServiceDictionaryError = 66564;
+public static final int NSServiceMiscellaneousError = 66800;
+public static final int NSServiceRequestTimedOutError = 66562;
+public static final int NSShadowlessSquareBezelStyle = 6;
+public static final int NSShiftKeyMask = 131072;
+public static final int NSShowControlGlyphs = 1;
+public static final int NSShowInvisibleGlyphs = 2;
+public static final int NSSingleDateMode = 0;
+public static final int NSSingleUnderlineStyle = 1;
+public static final int NSSizeDownFontAction = 4;
+public static final int NSSizeUpFontAction = 3;
+public static final int NSSmallCapsFontMask = 128;
+public static final int NSSmallControlSize = 1;
+public static final int NSSmallIconButtonBezelStyle = 2;
+public static final int NSSmallSquareBezelStyle = 10;
+public static final int NSSpecialPageOrder = 0;
+public static final int NSSpeechImmediateBoundary = 0;
+public static final int NSSpeechSentenceBoundary = 2;
+public static final int NSSpeechWordBoundary = 1;
+public static final int NSSpellingStateGrammarFlag = 2;
+public static final int NSSpellingStateSpellingFlag = 1;
+public static final int NSSplitViewDividerStyleThick = 1;
+public static final int NSSplitViewDividerStyleThin = 2;
+public static final int NSSquareLineCapStyle = 2;
+public static final int NSSquareStatusItemLength = -2;
+public static final int NSStatusWindowLevel = 25;
+public static final int NSStopFunctionKey = 63284;
+public static final int NSStringDrawingDisableScreenFontSubstitution = 4;
+public static final int NSStringDrawingOneShot = 16;
+public static final int NSStringDrawingTruncatesLastVisibleLine = 32;
+public static final int NSStringDrawingUsesDeviceMetrics = 8;
+public static final int NSStringDrawingUsesFontLeading = 2;
+public static final int NSStringDrawingUsesLineFragmentOrigin = 1;
+public static final int NSSubmenuWindowLevel = 3;
+public static final int NSSwitchButton = 3;
+public static final int NSSysReqFunctionKey = 63281;
+public static final int NSSystemDefined = 14;
+public static final int NSSystemDefinedMask = 16384;
+public static final int NSSystemFunctionKey = 63287;
+public static final int NSTIFFCompressionCCITTFAX3 = 3;
+public static final int NSTIFFCompressionCCITTFAX4 = 4;
+public static final int NSTIFFCompressionJPEG = 6;
+public static final int NSTIFFCompressionLZW = 5;
+public static final int NSTIFFCompressionNEXT = 32766;
+public static final int NSTIFFCompressionNone = 1;
+public static final int NSTIFFCompressionOldJPEG = 32865;
+public static final int NSTIFFCompressionPackBits = 32773;
+public static final int NSTIFFFileType = 0;
+public static final int NSTabCharacter = 9;
+public static final int NSTabTextMovement = 17;
+public static final int NSTableColumnAutoresizingMask = 1;
+public static final int NSTableColumnNoResizing = 0;
+public static final int NSTableColumnUserResizingMask = 2;
+public static final int NSTableViewDropAbove = 1;
+public static final int NSTableViewDropOn = 0;
+public static final int NSTableViewFirstColumnOnlyAutoresizingStyle = 5;
+public static final int NSTableViewGridNone = 0;
+public static final int NSTableViewLastColumnOnlyAutoresizingStyle = 4;
+public static final int NSTableViewNoColumnAutoresizing = 0;
+public static final int NSTableViewReverseSequentialColumnAutoresizingStyle = 3;
+public static final int NSTableViewSelectionHighlightStyleRegular = 0;
+public static final int NSTableViewSelectionHighlightStyleSourceList = 1;
+public static final int NSTableViewSequentialColumnAutoresizingStyle = 2;
+public static final int NSTableViewSolidHorizontalGridLineMask = 2;
+public static final int NSTableViewSolidVerticalGridLineMask = 1;
+public static final int NSTableViewUniformColumnAutoresizingStyle = 1;
+public static final int NSTabletPoint = 23;
+public static final int NSTabletPointEventSubtype = 1;
+public static final int NSTabletPointMask = 8388608;
+public static final int NSTabletProximity = 24;
+public static final int NSTabletProximityEventSubtype = 2;
+public static final int NSTabletProximityMask = 16777216;
+public static final int NSTerminateCancel = 0;
+public static final int NSTerminateLater = 2;
+public static final int NSTerminateNow = 1;
+public static final int NSTextBlockAbsoluteValueType = 0;
+public static final int NSTextBlockBaselineAlignment = 3;
+public static final int NSTextBlockBorder = 0;
+public static final int NSTextBlockBottomAlignment = 2;
+public static final int NSTextBlockHeight = 4;
+public static final int NSTextBlockMargin = 1;
+public static final int NSTextBlockMaximumHeight = 6;
+public static final int NSTextBlockMaximumWidth = 2;
+public static final int NSTextBlockMiddleAlignment = 1;
+public static final int NSTextBlockMinimumHeight = 5;
+public static final int NSTextBlockMinimumWidth = 1;
+public static final int NSTextBlockPadding = -1;
+public static final int NSTextBlockPercentageValueType = 1;
+public static final int NSTextBlockTopAlignment = 0;
+public static final int NSTextBlockWidth = 0;
+public static final int NSTextCellType = 1;
+public static final int NSTextFieldAndStepperDatePickerStyle = 0;
+public static final int NSTextFieldDatePickerStyle = 2;
+public static final int NSTextFieldRoundedBezel = 1;
+public static final int NSTextFieldSquareBezel = 0;
+public static final int NSTextListPrependEnclosingMarker = 1;
+public static final int NSTextReadInapplicableDocumentTypeError = 65806;
+public static final int NSTextReadWriteErrorMaximum = 66303;
+public static final int NSTextReadWriteErrorMinimum = 65792;
+public static final int NSTextStorageEditedAttributes = 1;
+public static final int NSTextStorageEditedCharacters = 2;
+public static final int NSTextTableAutomaticLayoutAlgorithm = 0;
+public static final int NSTextTableFixedLayoutAlgorithm = 1;
+public static final int NSTextWriteInapplicableDocumentTypeError = 66062;
+public static final int NSTexturedBackgroundWindowMask = 256;
+public static final int NSTexturedRoundedBezelStyle = 11;
+public static final int NSTexturedSquareBezelStyle = 8;
+public static final int NSThickSquareBezelStyle = 3;
+public static final int NSThickerSquareBezelStyle = 4;
+public static final int NSTickMarkAbove = 1;
+public static final int NSTickMarkBelow = 0;
+public static final int NSTickMarkLeft = 1;
+public static final int NSTickMarkRight = 0;
+public static final int NSTimeZoneDatePickerElementFlag = 16;
+public static final int NSTitledWindowMask = 1;
+public static final int NSToggleButton = 2;
+public static final int NSToolbarDisplayModeDefault = 0;
+public static final int NSToolbarDisplayModeIconAndLabel = 1;
+public static final int NSToolbarDisplayModeIconOnly = 2;
+public static final int NSToolbarDisplayModeLabelOnly = 3;
+public static final int NSToolbarItemVisibilityPriorityHigh = 1000;
+public static final int NSToolbarItemVisibilityPriorityLow = -1000;
+public static final int NSToolbarItemVisibilityPriorityStandard = 0;
+public static final int NSToolbarItemVisibilityPriorityUser = 2000;
+public static final int NSToolbarSizeModeDefault = 0;
+public static final int NSToolbarSizeModeRegular = 1;
+public static final int NSToolbarSizeModeSmall = 2;
+public static final int NSTopTabsBezelBorder = 0;
+public static final int NSTornOffMenuWindowLevel = 3;
+public static final int NSTrackModeMatrix = 3;
+public static final int NSTrackingActiveAlways = 128;
+public static final int NSTrackingActiveInActiveApp = 64;
+public static final int NSTrackingActiveInKeyWindow = 32;
+public static final int NSTrackingActiveWhenFirstResponder = 16;
+public static final int NSTrackingAssumeInside = 256;
+public static final int NSTrackingCursorUpdate = 4;
+public static final int NSTrackingEnabledDuringMouseDrag = 1024;
+public static final int NSTrackingInVisibleRect = 512;
+public static final int NSTrackingMouseEnteredAndExited = 1;
+public static final int NSTrackingMouseMoved = 2;
+public static final int NSTypesetterBehavior_10_2 = 2;
+public static final int NSTypesetterBehavior_10_2_WithCompatibility = 1;
+public static final int NSTypesetterBehavior_10_3 = 3;
+public static final int NSTypesetterBehavior_10_4 = 4;
+public static final int NSTypesetterContainerBreakAction = 32;
+public static final int NSTypesetterHorizontalTabAction = 4;
+public static final int NSTypesetterLatestBehavior = -1;
+public static final int NSTypesetterLineBreakAction = 8;
+public static final int NSTypesetterOriginalBehavior = 0;
+public static final int NSTypesetterParagraphBreakAction = 16;
+public static final int NSTypesetterWhitespaceAction = 2;
+public static final int NSTypesetterZeroAdvancementAction = 1;
+public static final int NSUnboldFontMask = 4;
+public static final int NSUnderlinePatternDash = 512;
+public static final int NSUnderlinePatternDashDot = 768;
+public static final int NSUnderlinePatternDashDotDot = 1024;
+public static final int NSUnderlinePatternDot = 256;
+public static final int NSUnderlinePatternSolid = 0;
+public static final int NSUnderlineStyleDouble = 9;
+public static final int NSUnderlineStyleNone = 0;
+public static final int NSUnderlineStyleSingle = 1;
+public static final int NSUnderlineStyleThick = 2;
+public static final int NSUndoFunctionKey = 63299;
+public static final int NSUnifiedTitleAndToolbarWindowMask = 4096;
+public static final int NSUnitalicFontMask = 16777216;
+public static final int NSUnknownColorSpaceModel = -1;
+public static final int NSUnknownPageOrder = 2;
+public static final int NSUnknownPointingDevice = 0;
+public static final int NSUnscaledWindowMask = 2048;
+public static final int NSUpArrowFunctionKey = 63232;
+public static final int NSUpTextMovement = 21;
+public static final int NSUpdateWindowsRunLoopOrdering = 500000;
+public static final int NSUserFunctionKey = 63286;
+public static final int NSUtilityWindowMask = 16;
+public static final int NSVariableStatusItemLength = -1;
+public static final int NSVerticalRuler = 1;
+public static final int NSViaPanelFontAction = 1;
+public static final int NSViewHeightSizable = 16;
+public static final int NSViewMaxXMargin = 4;
+public static final int NSViewMaxYMargin = 32;
+public static final int NSViewMinXMargin = 1;
+public static final int NSViewMinYMargin = 8;
+public static final int NSViewNotSizable = 0;
+public static final int NSViewWidthSizable = 2;
+public static final int NSWantsBidiLevels = 4;
+public static final int NSWarningAlertStyle = 0;
+public static final int NSWheelModeColorPanel = 6;
+public static final int NSWindowAbove = 1;
+public static final int NSWindowBackingLocationDefault = 0;
+public static final int NSWindowBackingLocationMainMemory = 2;
+public static final int NSWindowBackingLocationVideoMemory = 1;
+public static final int NSWindowBelow = -1;
+public static final int NSWindowCloseButton = 0;
+public static final int NSWindowCollectionBehaviorCanJoinAllSpaces = 1;
+public static final int NSWindowCollectionBehaviorDefault = 0;
+public static final int NSWindowCollectionBehaviorMoveToActiveSpace = 2;
+public static final int NSWindowDocumentIconButton = 4;
+public static final int NSWindowExposedEventType = 0;
+public static final int NSWindowMiniaturizeButton = 1;
+public static final int NSWindowMovedEventType = 4;
+public static final int NSWindowOut = 0;
+public static final int NSWindowSharingNone = 0;
+public static final int NSWindowSharingReadOnly = 1;
+public static final int NSWindowSharingReadWrite = 2;
+public static final int NSWindowToolbarButton = 3;
+public static final int NSWindowZoomButton = 2;
+public static final int NSWindows95InterfaceStyle = 2;
+public static final int NSWorkspaceLaunchAllowingClassicStartup = 131072;
+public static final int NSWorkspaceLaunchAndHide = 1048576;
+public static final int NSWorkspaceLaunchAndHideOthers = 2097152;
+public static final int NSWorkspaceLaunchAndPrint = 2;
+public static final int NSWorkspaceLaunchAsync = 65536;
+public static final int NSWorkspaceLaunchDefault = 196608;
+public static final int NSWorkspaceLaunchInhibitingBackgroundOnly = 128;
+public static final int NSWorkspaceLaunchNewInstance = 524288;
+public static final int NSWorkspaceLaunchPreferringClassic = 262144;
+public static final int NSWorkspaceLaunchWithoutActivation = 512;
+public static final int NSWorkspaceLaunchWithoutAddingToRecents = 256;
+public static final int NSWritingDirectionLeftToRight = 0;
+public static final int NSWritingDirectionNatural = -1;
+public static final int NSWritingDirectionRightToLeft = 1;
+public static final int NSYearMonthDatePickerElementFlag = 192;
+public static final int NSYearMonthDayDatePickerElementFlag = 224;
+public static final int NSASCIIStringEncoding = 1;
+public static final int NSAdminApplicationDirectory = 4;
+public static final int NSAggregateExpressionType = 14;
+public static final int NSAllApplicationsDirectory = 100;
+public static final int NSAllDomainsMask = 65535;
+public static final int NSAllLibrariesDirectory = 101;
+public static final int NSAllPredicateModifier = 1;
+public static final int NSAnchoredSearch = 8;
+public static final int NSAndPredicateType = 1;
+public static final int NSAnyPredicateModifier = 2;
+public static final int NSApplicationDirectory = 1;
+public static final int NSApplicationSupportDirectory = 14;
+public static final int NSArgumentEvaluationScriptError = 3;
+public static final int NSArgumentsWrongScriptError = 6;
+public static final int NSAtomicWrite = 1;
+public static final int NSBackwardsSearch = 4;
+public static final int NSBeginsWithComparison = 5;
+public static final int NSBeginsWithPredicateOperatorType = 8;
+public static final int NSBetweenPredicateOperatorType = 100;
+public static final int NSBundleExecutableArchitectureI386 = 7;
+public static final int NSBundleExecutableArchitecturePPC = 18;
+public static final int NSBundleExecutableArchitecturePPC64 = 16777234;
+public static final int NSBundleExecutableArchitectureX86_64 = 16777223;
+public static final int NSCachesDirectory = 13;
+public static final int NSCalculationDivideByZero = 4;
+public static final int NSCalculationLossOfPrecision = 1;
+public static final int NSCalculationNoError = 0;
+public static final int NSCalculationOverflow = 3;
+public static final int NSCalculationUnderflow = 2;
+public static final int NSCannotCreateScriptCommandError = 10;
+public static final int NSCaseInsensitivePredicateOption = 1;
+public static final int NSCaseInsensitiveSearch = 1;
+public static final int NSCollectorDisabledOption = 2;
+public static final int NSConstantValueExpressionType = 0;
+public static final int NSContainerSpecifierError = 2;
+public static final int NSContainsComparison = 7;
+public static final int NSContainsPredicateOperatorType = 99;
+public static final int NSCoreServiceDirectory = 10;
+public static final int NSCustomSelectorPredicateOperatorType = 11;
+public static final int NSDateFormatterBehavior10_0 = 1000;
+public static final int NSDateFormatterBehavior10_4 = 1040;
+public static final int NSDateFormatterBehaviorDefault = 0;
+public static final int NSDateFormatterFullStyle = 4;
+public static final int NSDateFormatterLongStyle = 3;
+public static final int NSDateFormatterMediumStyle = 2;
+public static final int NSDateFormatterNoStyle = 0;
+public static final int NSDateFormatterShortStyle = 1;
+public static final int NSDayCalendarUnit = 16;
+public static final int NSDecimalMaxSize = 8;
+public static final int NSDecimalNoScale = 32767;
+public static final int NSDemoApplicationDirectory = 2;
+public static final int NSDesktopDirectory = 12;
+public static final int NSDeveloperApplicationDirectory = 3;
+public static final int NSDeveloperDirectory = 6;
+public static final int NSDiacriticInsensitivePredicateOption = 2;
+public static final int NSDiacriticInsensitiveSearch = 128;
+public static final int NSDirectPredicateModifier = 0;
+public static final int NSDocumentDirectory = 9;
+public static final int NSDocumentationDirectory = 8;
+public static final int NSDownloadsDirectory = 15;
+public static final int NSEndsWithComparison = 6;
+public static final int NSEndsWithPredicateOperatorType = 9;
+public static final int NSEqualToComparison = 0;
+public static final int NSEqualToPredicateOperatorType = 4;
+public static final int NSEraCalendarUnit = 2;
+public static final int NSEvaluatedObjectExpressionType = 1;
+public static final int NSEverySubelement = 1;
+public static final int NSExecutableArchitectureMismatchError = 3585;
+public static final int NSExecutableErrorMaximum = 3839;
+public static final int NSExecutableErrorMinimum = 3584;
+public static final int NSExecutableLinkError = 3588;
+public static final int NSExecutableLoadError = 3587;
+public static final int NSExecutableNotLoadableError = 3584;
+public static final int NSExecutableRuntimeMismatchError = 3586;
+public static final int NSFileErrorMaximum = 1023;
+public static final int NSFileErrorMinimum = 0;
+public static final int NSFileLockingError = 255;
+public static final int NSFileNoSuchFileError = 4;
+public static final int NSFileReadCorruptFileError = 259;
+public static final int NSFileReadInapplicableStringEncodingError = 261;
+public static final int NSFileReadInvalidFileNameError = 258;
+public static final int NSFileReadNoPermissionError = 257;
+public static final int NSFileReadNoSuchFileError = 260;
+public static final int NSFileReadTooLargeError = 263;
+public static final int NSFileReadUnknownError = 256;
+public static final int NSFileReadUnknownStringEncodingError = 264;
+public static final int NSFileReadUnsupportedSchemeError = 262;
+public static final int NSFileWriteInapplicableStringEncodingError = 517;
+public static final int NSFileWriteInvalidFileNameError = 514;
+public static final int NSFileWriteNoPermissionError = 513;
+public static final int NSFileWriteOutOfSpaceError = 640;
+public static final int NSFileWriteUnknownError = 512;
+public static final int NSFileWriteUnsupportedSchemeError = 518;
+public static final int NSForcedOrderingSearch = 512;
+public static final int NSFormattingError = 2048;
+public static final int NSFormattingErrorMaximum = 2559;
+public static final int NSFormattingErrorMinimum = 2048;
+public static final double NSFoundationVersionNumber10_0 = 397.39999999999998;
+public static final double NSFoundationVersionNumber10_1 = 425.00000000000000;
+public static final double NSFoundationVersionNumber10_1_1 = 425.00000000000000;
+public static final double NSFoundationVersionNumber10_1_2 = 425.00000000000000;
+public static final double NSFoundationVersionNumber10_1_3 = 425.00000000000000;
+public static final double NSFoundationVersionNumber10_1_4 = 425.00000000000000;
+public static final double NSFoundationVersionNumber10_2 = 462.00000000000000;
+public static final double NSFoundationVersionNumber10_2_1 = 462.00000000000000;
+public static final double NSFoundationVersionNumber10_2_2 = 462.00000000000000;
+public static final double NSFoundationVersionNumber10_2_3 = 462.00000000000000;
+public static final double NSFoundationVersionNumber10_2_4 = 462.00000000000000;
+public static final double NSFoundationVersionNumber10_2_5 = 462.00000000000000;
+public static final double NSFoundationVersionNumber10_2_6 = 462.00000000000000;
+public static final double NSFoundationVersionNumber10_2_7 = 462.69999999999999;
+public static final double NSFoundationVersionNumber10_2_8 = 462.69999999999999;
+public static final double NSFoundationVersionNumber10_3 = 500.00000000000000;
+public static final double NSFoundationVersionNumber10_3_1 = 500.00000000000000;
+public static final double NSFoundationVersionNumber10_3_2 = 500.30000000000001;
+public static final double NSFoundationVersionNumber10_3_3 = 500.54000000000002;
+public static final double NSFoundationVersionNumber10_3_4 = 500.56000000000000;
+public static final double NSFoundationVersionNumber10_3_5 = 500.56000000000000;
+public static final double NSFoundationVersionNumber10_3_6 = 500.56000000000000;
+public static final double NSFoundationVersionNumber10_3_7 = 500.56000000000000;
+public static final double NSFoundationVersionNumber10_3_8 = 500.56000000000000;
+public static final double NSFoundationVersionNumber10_3_9 = 500.57999999999998;
+public static final double NSFoundationVersionNumber10_4 = 567.00000000000000;
+public static final double NSFoundationVersionNumber10_4_1 = 567.00000000000000;
+public static final double NSFoundationVersionNumber10_4_10 = 567.28999999999996;
+public static final double NSFoundationVersionNumber10_4_11 = 567.36000000000001;
+public static final double NSFoundationVersionNumber10_4_2 = 567.12000000000000;
+public static final double NSFoundationVersionNumber10_4_3 = 567.21000000000004;
+public static final double NSFoundationVersionNumber10_4_4_Intel = 567.23000000000002;
+public static final double NSFoundationVersionNumber10_4_4_PowerPC = 567.21000000000004;
+public static final double NSFoundationVersionNumber10_4_5 = 567.25000000000000;
+public static final double NSFoundationVersionNumber10_4_6 = 567.25999999999999;
+public static final double NSFoundationVersionNumber10_4_7 = 567.26999999999998;
+public static final double NSFoundationVersionNumber10_4_8 = 567.27999999999997;
+public static final double NSFoundationVersionNumber10_4_9 = 567.28999999999996;
+public static final int NSFoundationVersionWithFileManagerResourceForkSupport = 412;
+public static final int NSFunctionExpressionType = 4;
+public static final int NSGreaterThanComparison = 4;
+public static final int NSGreaterThanOrEqualToComparison = 3;
+public static final int NSGreaterThanOrEqualToPredicateOperatorType = 3;
+public static final int NSGreaterThanPredicateOperatorType = 2;
+public static final int NSHPUXOperatingSystem = 4;
+public static final int NSHTTPCookieAcceptPolicyAlways = 0;
+public static final int NSHTTPCookieAcceptPolicyNever = 1;
+public static final int NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain = 2;
+public static final int NSHashTableCopyIn = 65536;
+public static final int NSHashTableObjectPointerPersonality = 512;
+public static final int NSHashTableStrongMemory = 0;
+public static final int NSHashTableZeroingWeakMemory = 1;
+public static final int NSHourCalendarUnit = 32;
+public static final int NSINTEGER_DEFINED = 1;
+public static final int NSISO2022JPStringEncoding = 21;
+public static final int NSISOLatin1StringEncoding = 5;
+public static final int NSISOLatin2StringEncoding = 9;
+public static final int NSInPredicateOperatorType = 10;
+public static final int NSIndexSubelement = 0;
+public static final int NSIntegerMax = 2147483647;
+public static final int NSIntegerMin = -2147483648;
+public static final int NSInternalScriptError = 8;
+public static final int NSInternalSpecifierError = 5;
+public static final int NSIntersectSetExpressionType = 6;
+public static final int NSInvalidIndexSpecifierError = 4;
+public static final int NSJapaneseEUCStringEncoding = 3;
+public static final int NSKeyPathExpressionType = 3;
+public static final int NSKeySpecifierEvaluationScriptError = 2;
+public static final int NSKeyValueChangeInsertion = 2;
+public static final int NSKeyValueChangeRemoval = 3;
+public static final int NSKeyValueChangeReplacement = 4;
+public static final int NSKeyValueChangeSetting = 1;
+public static final int NSKeyValueIntersectSetMutation = 3;
+public static final int NSKeyValueMinusSetMutation = 2;
+public static final int NSKeyValueObservingOptionInitial = 4;
+public static final int NSKeyValueObservingOptionNew = 1;
+public static final int NSKeyValueObservingOptionOld = 2;
+public static final int NSKeyValueObservingOptionPrior = 8;
+public static final int NSKeyValueSetSetMutation = 4;
+public static final int NSKeyValueUnionSetMutation = 1;
+public static final int NSKeyValueValidationError = 1024;
+public static final int NSLessThanComparison = 2;
+public static final int NSLessThanOrEqualToComparison = 1;
+public static final int NSLessThanOrEqualToPredicateOperatorType = 1;
+public static final int NSLessThanPredicateOperatorType = 0;
+public static final int NSLibraryDirectory = 5;
+public static final int NSLikePredicateOperatorType = 7;
+public static final int NSLiteralSearch = 2;
+public static final int NSLocalDomainMask = 2;
+public static final int NSMACHOperatingSystem = 5;
+public static final int NSMacOSRomanStringEncoding = 30;
+public static final int NSMachPortDeallocateNone = 0;
+public static final int NSMachPortDeallocateReceiveRight = 2;
+public static final int NSMachPortDeallocateSendRight = 1;
+public static final int NSMapTableCopyIn = 65536;
+public static final int NSMapTableObjectPointerPersonality = 512;
+public static final int NSMapTableStrongMemory = 0;
+public static final int NSMapTableZeroingWeakMemory = 1;
+public static final int NSMappedRead = 1;
+public static final int NSMatchesPredicateOperatorType = 6;
+public static final int NSMaxXEdge = 2;
+public static final int NSMaxYEdge = 3;
+public static final int NSMiddleSubelement = 2;
+public static final int NSMinXEdge = 0;
+public static final int NSMinYEdge = 1;
+public static final int NSMinusSetExpressionType = 7;
+public static final int NSMinuteCalendarUnit = 64;
+public static final int NSMonthCalendarUnit = 8;
+public static final int NSNEXTSTEPStringEncoding = 2;
+public static final int NSNetServiceNoAutoRename = 1;
+public static final int NSNetServicesActivityInProgress = -72003;
+public static final int NSNetServicesBadArgumentError = -72004;
+public static final int NSNetServicesCancelledError = -72005;
+public static final int NSNetServicesCollisionError = -72001;
+public static final int NSNetServicesInvalidError = -72006;
+public static final int NSNetServicesNotFoundError = -72002;
+public static final int NSNetServicesTimeoutError = -72007;
+public static final int NSNetServicesUnknownError = -72000;
+public static final int NSNetworkDomainMask = 4;
+public static final int NSNoScriptError = 0;
+public static final int NSNoSpecifierError = 0;
+public static final int NSNoSubelement = 4;
+public static final int NSNoTopLevelContainersSpecifierError = 1;
+public static final int NSNonLossyASCIIStringEncoding = 7;
+public static final int NSNotEqualToPredicateOperatorType = 5;
+public static final int NSNotFound = 2147483647;
+public static final int NSNotPredicateType = 0;
+public static final int NSNotificationCoalescingOnName = 1;
+public static final int NSNotificationCoalescingOnSender = 2;
+public static final int NSNotificationDeliverImmediately = 1;
+public static final int NSNotificationNoCoalescing = 0;
+public static final int NSNotificationPostToAllSessions = 2;
+public static final int NSNotificationSuspensionBehaviorCoalesce = 2;
+public static final int NSNotificationSuspensionBehaviorDeliverImmediately = 4;
+public static final int NSNotificationSuspensionBehaviorDrop = 1;
+public static final int NSNotificationSuspensionBehaviorHold = 3;
+public static final int NSNumberFormatterBehavior10_0 = 1000;
+public static final int NSNumberFormatterBehavior10_4 = 1040;
+public static final int NSNumberFormatterBehaviorDefault = 0;
+public static final int NSNumberFormatterCurrencyStyle = 2;
+public static final int NSNumberFormatterDecimalStyle = 1;
+public static final int NSNumberFormatterNoStyle = 0;
+public static final int NSNumberFormatterPadAfterPrefix = 1;
+public static final int NSNumberFormatterPadAfterSuffix = 3;
+public static final int NSNumberFormatterPadBeforePrefix = 0;
+public static final int NSNumberFormatterPadBeforeSuffix = 2;
+public static final int NSNumberFormatterPercentStyle = 3;
+public static final int NSNumberFormatterRoundCeiling = 0;
+public static final int NSNumberFormatterRoundDown = 2;
+public static final int NSNumberFormatterRoundFloor = 1;
+public static final int NSNumberFormatterRoundHalfDown = 5;
+public static final int NSNumberFormatterRoundHalfEven = 4;
+public static final int NSNumberFormatterRoundHalfUp = 6;
+public static final int NSNumberFormatterRoundUp = 3;
+public static final int NSNumberFormatterScientificStyle = 4;
+public static final int NSNumberFormatterSpellOutStyle = 5;
+public static final int NSNumericSearch = 64;
+public static final int NSOSF1OperatingSystem = 7;
+public static final int NSObjCArrayType = 91;
+public static final int NSObjCBitfield = 98;
+public static final int NSObjCBoolType = 66;
+public static final int NSObjCCharType = 99;
+public static final int NSObjCDoubleType = 100;
+public static final int NSObjCFloatType = 102;
+public static final int NSObjCLongType = 108;
+public static final int NSObjCLonglongType = 113;
+public static final int NSObjCNoType = 0;
+public static final int NSObjCObjectType = 64;
+public static final int NSObjCPointerType = 94;
+public static final int NSObjCSelectorType = 58;
+public static final int NSObjCShortType = 115;
+public static final int NSObjCStringType = 42;
+public static final int NSObjCStructType = 123;
+public static final int NSObjCUnionType = 40;
+public static final int NSObjCVoidType = 118;
+public static final int NSObjectAutoreleasedEvent = 3;
+public static final int NSObjectExtraRefDecrementedEvent = 5;
+public static final int NSObjectExtraRefIncrementedEvent = 4;
+public static final int NSObjectInternalRefDecrementedEvent = 7;
+public static final int NSObjectInternalRefIncrementedEvent = 6;
+public static final int NSOpenStepUnicodeReservedBase = 62464;
+public static final int NSOperationNotSupportedForKeyScriptError = 9;
+public static final int NSOperationNotSupportedForKeySpecifierError = 6;
+public static final int NSOperationQueueDefaultMaxConcurrentOperationCount = -1;
+public static final int NSOperationQueuePriorityHigh = 4;
+public static final int NSOperationQueuePriorityLow = -4;
+public static final int NSOperationQueuePriorityNormal = 0;
+public static final int NSOperationQueuePriorityVeryHigh = 8;
+public static final int NSOperationQueuePriorityVeryLow = -8;
+public static final int NSOrPredicateType = 2;
+public static final int NSOrderedAscending = -1;
+public static final int NSOrderedDescending = 1;
+public static final int NSOrderedSame = 0;
+public static final int NSPointerFunctionsCStringPersonality = 768;
+public static final int NSPointerFunctionsCopyIn = 65536;
+public static final int NSPointerFunctionsIntegerPersonality = 1280;
+public static final int NSPointerFunctionsMachVirtualMemory = 4;
+public static final int NSPointerFunctionsMallocMemory = 3;
+public static final int NSPointerFunctionsObjectPersonality = 0;
+public static final int NSPointerFunctionsObjectPointerPersonality = 512;
+public static final int NSPointerFunctionsOpaqueMemory = 2;
+public static final int NSPointerFunctionsOpaquePersonality = 256;
+public static final int NSPointerFunctionsStrongMemory = 0;
+public static final int NSPointerFunctionsStructPersonality = 1024;
+public static final int NSPointerFunctionsZeroingWeakMemory = 1;
+public static final int NSPositionAfter = 0;
+public static final int NSPositionBefore = 1;
+public static final int NSPositionBeginning = 2;
+public static final int NSPositionEnd = 3;
+public static final int NSPositionReplace = 4;
+public static final int NSPostASAP = 2;
+public static final int NSPostNow = 3;
+public static final int NSPostWhenIdle = 1;
+public static final int NSPropertyListBinaryFormat_v1_0 = 200;
+public static final int NSPropertyListImmutable = 0;
+public static final int NSPropertyListMutableContainers = 1;
+public static final int NSPropertyListMutableContainersAndLeaves = 2;
+public static final int NSPropertyListOpenStepFormat = 1;
+public static final int NSPropertyListXMLFormat_v1_0 = 100;
+public static final int NSRandomSubelement = 3;
+public static final int NSReceiverEvaluationScriptError = 1;
+public static final int NSReceiversCantHandleCommandScriptError = 4;
+public static final int NSRelativeAfter = 0;
+public static final int NSRelativeBefore = 1;
+public static final int NSRequiredArgumentsMissingScriptError = 5;
+public static final int NSRoundBankers = 3;
+public static final int NSRoundDown = 1;
+public static final int NSRoundPlain = 0;
+public static final int NSRoundUp = 2;
+public static final int NSSaveOptionsAsk = 2;
+public static final int NSSaveOptionsNo = 1;
+public static final int NSSaveOptionsYes = 0;
+public static final int NSScannedOption = 1;
+public static final int NSSecondCalendarUnit = 128;
+public static final int NSShiftJISStringEncoding = 8;
+public static final int NSSolarisOperatingSystem = 3;
+public static final int NSStreamEventEndEncountered = 16;
+public static final int NSStreamEventErrorOccurred = 8;
+public static final int NSStreamEventHasBytesAvailable = 2;
+public static final int NSStreamEventHasSpaceAvailable = 4;
+public static final int NSStreamEventNone = 0;
+public static final int NSStreamEventOpenCompleted = 1;
+public static final int NSStreamStatusAtEnd = 5;
+public static final int NSStreamStatusClosed = 6;
+public static final int NSStreamStatusError = 7;
+public static final int NSStreamStatusNotOpen = 0;
+public static final int NSStreamStatusOpen = 2;
+public static final int NSStreamStatusOpening = 1;
+public static final int NSStreamStatusReading = 3;
+public static final int NSStreamStatusWriting = 4;
+public static final int NSStringEncodingConversionAllowLossy = 1;
+public static final int NSStringEncodingConversionExternalRepresentation = 2;
+public static final int NSSubqueryExpressionType = 13;
+public static final int NSSunOSOperatingSystem = 6;
+public static final int NSSymbolStringEncoding = 6;
+public static final int NSSystemDomainMask = 8;
+public static final double NSTimeIntervalSince1970 = 978307200.00000000;
+public static final int NSTimeZoneNameStyleDaylightSaving = 2;
+public static final int NSTimeZoneNameStyleShortDaylightSaving = 3;
+public static final int NSTimeZoneNameStyleShortStandard = 1;
+public static final int NSTimeZoneNameStyleStandard = 0;
+public static final long NSUIntegerMax = 4294967295L;
+public static final int NSURLCacheStorageAllowed = 0;
+public static final int NSURLCacheStorageAllowedInMemoryOnly = 1;
+public static final int NSURLCacheStorageNotAllowed = 2;
+public static final int NSURLCredentialPersistenceForSession = 1;
+public static final int NSURLCredentialPersistenceNone = 0;
+public static final int NSURLCredentialPersistencePermanent = 2;
+public static final int NSURLErrorBadServerResponse = -1011;
+public static final int NSURLErrorBadURL = -1000;
+public static final int NSURLErrorCancelled = -999;
+public static final int NSURLErrorCannotCloseFile = -3002;
+public static final int NSURLErrorCannotConnectToHost = -1004;
+public static final int NSURLErrorCannotCreateFile = -3000;
+public static final int NSURLErrorCannotDecodeContentData = -1016;
+public static final int NSURLErrorCannotDecodeRawData = -1015;
+public static final int NSURLErrorCannotFindHost = -1003;
+public static final int NSURLErrorCannotLoadFromNetwork = -2000;
+public static final int NSURLErrorCannotMoveFile = -3005;
+public static final int NSURLErrorCannotOpenFile = -3001;
+public static final int NSURLErrorCannotParseResponse = -1017;
+public static final int NSURLErrorCannotRemoveFile = -3004;
+public static final int NSURLErrorCannotWriteToFile = -3003;
+public static final int NSURLErrorClientCertificateRejected = -1205;
+public static final int NSURLErrorDNSLookupFailed = -1006;
+public static final int NSURLErrorDataLengthExceedsMaximum = -1103;
+public static final int NSURLErrorDownloadDecodingFailedMidStream = -3006;
+public static final int NSURLErrorDownloadDecodingFailedToComplete = -3007;
+public static final int NSURLErrorFileDoesNotExist = -1100;
+public static final int NSURLErrorFileIsDirectory = -1101;
+public static final int NSURLErrorHTTPTooManyRedirects = -1007;
+public static final int NSURLErrorNetworkConnectionLost = -1005;
+public static final int NSURLErrorNoPermissionsToReadFile = -1102;
+public static final int NSURLErrorNotConnectedToInternet = -1009;
+public static final int NSURLErrorRedirectToNonExistentLocation = -1010;
+public static final int NSURLErrorResourceUnavailable = -1008;
+public static final int NSURLErrorSecureConnectionFailed = -1200;
+public static final int NSURLErrorServerCertificateHasBadDate = -1201;
+public static final int NSURLErrorServerCertificateHasUnknownRoot = -1203;
+public static final int NSURLErrorServerCertificateNotYetValid = -1204;
+public static final int NSURLErrorServerCertificateUntrusted = -1202;
+public static final int NSURLErrorTimedOut = -1001;
+public static final int NSURLErrorUnknown = -1;
+public static final int NSURLErrorUnsupportedURL = -1002;
+public static final int NSURLErrorUserAuthenticationRequired = -1013;
+public static final int NSURLErrorUserCancelledAuthentication = -1012;
+public static final int NSURLErrorZeroByteResource = -1014;
+public static final int NSURLHandleLoadFailed = 3;
+public static final int NSURLHandleLoadInProgress = 2;
+public static final int NSURLHandleLoadSucceeded = 1;
+public static final int NSURLHandleNotLoaded = 0;
+public static final int NSURLRequestReloadIgnoringCacheData = 1;
+public static final int NSURLRequestReloadIgnoringLocalAndRemoteCacheData = 4;
+public static final int NSURLRequestReloadIgnoringLocalCacheData = 1;
+public static final int NSURLRequestReloadRevalidatingCacheData = 5;
+public static final int NSURLRequestReturnCacheDataDontLoad = 3;
+public static final int NSURLRequestReturnCacheDataElseLoad = 2;
+public static final int NSURLRequestUseProtocolCachePolicy = 0;
+public static final int NSUTF16BigEndianStringEncoding = -1879047936;
+public static final int NSUTF16LittleEndianStringEncoding = -1811939072;
+public static final int NSUTF16StringEncoding = 10;
+public static final int NSUTF32BigEndianStringEncoding = -1744830208;
+public static final int NSUTF32LittleEndianStringEncoding = -1677721344;
+public static final int NSUTF32StringEncoding = -1946156800;
+public static final int NSUTF8StringEncoding = 4;
+public static final int NSUncachedRead = 2;
+public static final int NSUndefinedDateComponent = 2147483647;
+public static final int NSUndoCloseGroupingRunLoopOrdering = 350000;
+public static final int NSUnicodeStringEncoding = 10;
+public static final int NSUnionSetExpressionType = 5;
+public static final int NSUnknownKeyScriptError = 7;
+public static final int NSUnknownKeySpecifierError = 3;
+public static final int NSUserCancelledError = 3072;
+public static final int NSUserDirectory = 7;
+public static final int NSUserDomainMask = 1;
+public static final int NSValidationErrorMaximum = 2047;
+public static final int NSValidationErrorMinimum = 1024;
+public static final int NSVariableExpressionType = 2;
+public static final int NSWeekCalendarUnit = 256;
+public static final int NSWeekdayCalendarUnit = 512;
+public static final int NSWeekdayOrdinalCalendarUnit = 1024;
+public static final int NSWidthInsensitiveSearch = 256;
+public static final int NSWindows95OperatingSystem = 2;
+public static final int NSWindowsCP1250StringEncoding = 15;
+public static final int NSWindowsCP1251StringEncoding = 11;
+public static final int NSWindowsCP1252StringEncoding = 12;
+public static final int NSWindowsCP1253StringEncoding = 13;
+public static final int NSWindowsCP1254StringEncoding = 14;
+public static final int NSWindowsNTOperatingSystem = 1;
+public static final int NSWrapCalendarComponents = 1;
+public static final int NSXMLAttributeCDATAKind = 6;
+public static final int NSXMLAttributeDeclarationKind = 10;
+public static final int NSXMLAttributeEntitiesKind = 11;
+public static final int NSXMLAttributeEntityKind = 10;
+public static final int NSXMLAttributeEnumerationKind = 14;
+public static final int NSXMLAttributeIDKind = 7;
+public static final int NSXMLAttributeIDRefKind = 8;
+public static final int NSXMLAttributeIDRefsKind = 9;
+public static final int NSXMLAttributeKind = 3;
+public static final int NSXMLAttributeNMTokenKind = 12;
+public static final int NSXMLAttributeNMTokensKind = 13;
+public static final int NSXMLAttributeNotationKind = 15;
+public static final int NSXMLCommentKind = 6;
+public static final int NSXMLDTDKind = 8;
+public static final int NSXMLDocumentHTMLKind = 2;
+public static final int NSXMLDocumentIncludeContentTypeDeclaration = 262144;
+public static final int NSXMLDocumentKind = 1;
+public static final int NSXMLDocumentTextKind = 3;
+public static final int NSXMLDocumentTidyHTML = 512;
+public static final int NSXMLDocumentTidyXML = 1024;
+public static final int NSXMLDocumentValidate = 8192;
+public static final int NSXMLDocumentXHTMLKind = 1;
+public static final int NSXMLDocumentXInclude = 65536;
+public static final int NSXMLDocumentXMLKind = 0;
+public static final int NSXMLElementDeclarationAnyKind = 18;
+public static final int NSXMLElementDeclarationElementKind = 20;
+public static final int NSXMLElementDeclarationEmptyKind = 17;
+public static final int NSXMLElementDeclarationKind = 11;
+public static final int NSXMLElementDeclarationMixedKind = 19;
+public static final int NSXMLElementDeclarationUndefinedKind = 16;
+public static final int NSXMLElementKind = 2;
+public static final int NSXMLEntityDeclarationKind = 9;
+public static final int NSXMLEntityGeneralKind = 1;
+public static final int NSXMLEntityParameterKind = 4;
+public static final int NSXMLEntityParsedKind = 2;
+public static final int NSXMLEntityPredefined = 5;
+public static final int NSXMLEntityUnparsedKind = 3;
+public static final int NSXMLInvalidKind = 0;
+public static final int NSXMLNamespaceKind = 4;
+public static final int NSXMLNodeCompactEmptyElement = 4;
+public static final int NSXMLNodeExpandEmptyElement = 2;
+public static final int NSXMLNodeIsCDATA = 1;
+public static final int NSXMLNodeOptionsNone = 0;
+public static final int NSXMLNodePreserveAll = -1048546;
+public static final int NSXMLNodePreserveAttributeOrder = 2097152;
+public static final int NSXMLNodePreserveCDATA = 16777216;
+public static final int NSXMLNodePreserveCharacterReferences = 134217728;
+public static final int NSXMLNodePreserveDTD = 67108864;
+public static final int NSXMLNodePreserveEmptyElements = 6;
+public static final int NSXMLNodePreserveEntities = 4194304;
+public static final int NSXMLNodePreserveNamespaceOrder = 1048576;
+public static final int NSXMLNodePreservePrefixes = 8388608;
+public static final int NSXMLNodePreserveQuotes = 24;
+public static final int NSXMLNodePreserveWhitespace = 33554432;
+public static final int NSXMLNodePrettyPrint = 131072;
+public static final int NSXMLNodeUseDoubleQuotes = 16;
+public static final int NSXMLNodeUseSingleQuotes = 8;
+public static final int NSXMLNotationDeclarationKind = 12;
+public static final int NSXMLParserAttributeHasNoValueError = 41;
+public static final int NSXMLParserAttributeListNotFinishedError = 51;
+public static final int NSXMLParserAttributeListNotStartedError = 50;
+public static final int NSXMLParserAttributeNotFinishedError = 40;
+public static final int NSXMLParserAttributeNotStartedError = 39;
+public static final int NSXMLParserAttributeRedefinedError = 42;
+public static final int NSXMLParserCDATANotFinishedError = 63;
+public static final int NSXMLParserCharacterRefAtEOFError = 10;
+public static final int NSXMLParserCharacterRefInDTDError = 13;
+public static final int NSXMLParserCharacterRefInEpilogError = 12;
+public static final int NSXMLParserCharacterRefInPrologError = 11;
+public static final int NSXMLParserCommentContainsDoubleHyphenError = 80;
+public static final int NSXMLParserCommentNotFinishedError = 45;
+public static final int NSXMLParserConditionalSectionNotFinishedError = 59;
+public static final int NSXMLParserConditionalSectionNotStartedError = 58;
+public static final int NSXMLParserDOCTYPEDeclNotFinishedError = 61;
+public static final int NSXMLParserDelegateAbortedParseError = 512;
+public static final int NSXMLParserDocumentStartError = 3;
+public static final int NSXMLParserElementContentDeclNotFinishedError = 55;
+public static final int NSXMLParserElementContentDeclNotStartedError = 54;
+public static final int NSXMLParserEmptyDocumentError = 4;
+public static final int NSXMLParserEncodingNotSupportedError = 32;
+public static final int NSXMLParserEntityBoundaryError = 90;
+public static final int NSXMLParserEntityIsExternalError = 29;
+public static final int NSXMLParserEntityIsParameterError = 30;
+public static final int NSXMLParserEntityNotFinishedError = 37;
+public static final int NSXMLParserEntityNotStartedError = 36;
+public static final int NSXMLParserEntityRefAtEOFError = 14;
+public static final int NSXMLParserEntityRefInDTDError = 17;
+public static final int NSXMLParserEntityRefInEpilogError = 16;
+public static final int NSXMLParserEntityRefInPrologError = 15;
+public static final int NSXMLParserEntityRefLoopError = 89;
+public static final int NSXMLParserEntityReferenceMissingSemiError = 23;
+public static final int NSXMLParserEntityReferenceWithoutNameError = 22;
+public static final int NSXMLParserEntityValueRequiredError = 84;
+public static final int NSXMLParserEqualExpectedError = 75;
+public static final int NSXMLParserExternalStandaloneEntityError = 82;
+public static final int NSXMLParserExternalSubsetNotFinishedError = 60;
+public static final int NSXMLParserExtraContentError = 86;
+public static final int NSXMLParserGTRequiredError = 73;
+public static final int NSXMLParserInternalError = 1;
+public static final int NSXMLParserInvalidCharacterError = 9;
+public static final int NSXMLParserInvalidCharacterInEntityError = 87;
+public static final int NSXMLParserInvalidCharacterRefError = 8;
+public static final int NSXMLParserInvalidConditionalSectionError = 83;
+public static final int NSXMLParserInvalidDecimalCharacterRefError = 7;
+public static final int NSXMLParserInvalidEncodingError = 81;
+public static final int NSXMLParserInvalidEncodingNameError = 79;
+public static final int NSXMLParserInvalidHexCharacterRefError = 6;
+public static final int NSXMLParserInvalidURIError = 91;
+public static final int NSXMLParserLTRequiredError = 72;
+public static final int NSXMLParserLTSlashRequiredError = 74;
+public static final int NSXMLParserLessThanSymbolInAttributeError = 38;
+public static final int NSXMLParserLiteralNotFinishedError = 44;
+public static final int NSXMLParserLiteralNotStartedError = 43;
+public static final int NSXMLParserMisplacedCDATAEndStringError = 62;
+public static final int NSXMLParserMisplacedXMLDeclarationError = 64;
+public static final int NSXMLParserMixedContentDeclNotFinishedError = 53;
+public static final int NSXMLParserMixedContentDeclNotStartedError = 52;
+public static final int NSXMLParserNAMERequiredError = 68;
+public static final int NSXMLParserNMTOKENRequiredError = 67;
+public static final int NSXMLParserNamespaceDeclarationError = 35;
+public static final int NSXMLParserNoDTDError = 94;
+public static final int NSXMLParserNotWellBalancedError = 85;
+public static final int NSXMLParserNotationNotFinishedError = 49;
+public static final int NSXMLParserNotationNotStartedError = 48;
+public static final int NSXMLParserOutOfMemoryError = 2;
+public static final int NSXMLParserPCDATARequiredError = 69;
+public static final int NSXMLParserParsedEntityRefAtEOFError = 18;
+public static final int NSXMLParserParsedEntityRefInEpilogError = 20;
+public static final int NSXMLParserParsedEntityRefInInternalError = 88;
+public static final int NSXMLParserParsedEntityRefInInternalSubsetError = 21;
+public static final int NSXMLParserParsedEntityRefInPrologError = 19;
+public static final int NSXMLParserParsedEntityRefMissingSemiError = 25;
+public static final int NSXMLParserParsedEntityRefNoNameError = 24;
+public static final int NSXMLParserPrematureDocumentEndError = 5;
+public static final int NSXMLParserProcessingInstructionNotFinishedError = 47;
+public static final int NSXMLParserProcessingInstructionNotStartedError = 46;
+public static final int NSXMLParserPublicIdentifierRequiredError = 71;
+public static final int NSXMLParserSeparatorRequiredError = 66;
+public static final int NSXMLParserSpaceRequiredError = 65;
+public static final int NSXMLParserStandaloneValueError = 78;
+public static final int NSXMLParserStringNotClosedError = 34;
+public static final int NSXMLParserStringNotStartedError = 33;
+public static final int NSXMLParserTagNameMismatchError = 76;
+public static final int NSXMLParserURIFragmentError = 92;
+public static final int NSXMLParserURIRequiredError = 70;
+public static final int NSXMLParserUndeclaredEntityError = 26;
+public static final int NSXMLParserUnfinishedTagError = 77;
+public static final int NSXMLParserUnknownEncodingError = 31;
+public static final int NSXMLParserUnparsedEntityError = 28;
+public static final int NSXMLParserXMLDeclNotFinishedError = 57;
+public static final int NSXMLParserXMLDeclNotStartedError = 56;
+public static final int NSXMLProcessingInstructionKind = 5;
+public static final int NSXMLTextKind = 7;
+public static final int NSYearCalendarUnit = 4;
+public static final int NS_BigEndian = 2;
+public static final int NS_LittleEndian = 1;
+public static final int NS_UNICHAR_IS_EIGHT_BIT = 0;
+public static final int NS_UnknownByteOrder = 0;
+
+/** Globals */
+//public static final native int NSAbortModalException();
+//public static final native int NSAbortPrintingException();
+//public static final native int NSAccessibilityAllowedValuesAttribute();
+//public static final native int NSAccessibilityApplicationActivatedNotification();
+//public static final native int NSAccessibilityApplicationDeactivatedNotification();
+//public static final native int NSAccessibilityApplicationHiddenNotification();
+//public static final native int NSAccessibilityApplicationRole();
+//public static final native int NSAccessibilityApplicationShownNotification();
+//public static final native int NSAccessibilityAscendingSortDirectionValue();
+//public static final native int NSAccessibilityAttachmentTextAttribute();
+//public static final native int NSAccessibilityAttributedStringForRangeParameterizedAttribute();
+//public static final native int NSAccessibilityBackgroundColorTextAttribute();
+//public static final native int NSAccessibilityBoundsForRangeParameterizedAttribute();
+//public static final native int NSAccessibilityBrowserRole();
+//public static final native int NSAccessibilityBusyIndicatorRole();
+//public static final native int NSAccessibilityButtonRole();
+//public static final native int NSAccessibilityCancelAction();
+//public static final native int NSAccessibilityCancelButtonAttribute();
+//public static final native int NSAccessibilityCenterTabStopMarkerTypeValue();
+//public static final native int NSAccessibilityCentimetersUnitValue();
+//public static final native int NSAccessibilityCheckBoxRole();
+//public static final native int NSAccessibilityChildrenAttribute();
+//public static final native int NSAccessibilityClearButtonAttribute();
+//public static final native int NSAccessibilityCloseButtonAttribute();
+//public static final native int NSAccessibilityCloseButtonSubrole();
+//public static final native int NSAccessibilityColorWellRole();
+//public static final native int NSAccessibilityColumnCountAttribute();
+//public static final native int NSAccessibilityColumnRole();
+//public static final native int NSAccessibilityColumnTitlesAttribute();
+//public static final native int NSAccessibilityColumnsAttribute();
+//public static final native int NSAccessibilityComboBoxRole();
+//public static final native int NSAccessibilityConfirmAction();
+//public static final native int NSAccessibilityContentsAttribute();
+//public static final native int NSAccessibilityCreatedNotification();
+//public static final native int NSAccessibilityDecimalTabStopMarkerTypeValue();
+//public static final native int NSAccessibilityDecrementAction();
+//public static final native int NSAccessibilityDecrementArrowSubrole();
+//public static final native int NSAccessibilityDecrementButtonAttribute();
+//public static final native int NSAccessibilityDecrementPageSubrole();
+//public static final native int NSAccessibilityDefaultButtonAttribute();
+//public static final native int NSAccessibilityDeleteAction();
+//public static final native int NSAccessibilityDescendingSortDirectionValue();
+//public static final native int NSAccessibilityDescriptionAttribute();
+//public static final native int NSAccessibilityDialogSubrole();
+//public static final native int NSAccessibilityDisclosedByRowAttribute();
+//public static final native int NSAccessibilityDisclosedRowsAttribute();
+//public static final native int NSAccessibilityDisclosingAttribute();
+//public static final native int NSAccessibilityDisclosureLevelAttribute();
+//public static final native int NSAccessibilityDisclosureTriangleRole();
+//public static final native int NSAccessibilityDocumentAttribute();
+//public static final native int NSAccessibilityDrawerCreatedNotification();
+//public static final native int NSAccessibilityDrawerRole();
+//public static final native int NSAccessibilityEditedAttribute();
+//public static final native int NSAccessibilityEnabledAttribute();
+//public static final native int NSAccessibilityErrorCodeExceptionInfo();
+//public static final native int NSAccessibilityException();
+//public static final native int NSAccessibilityExpandedAttribute();
+//public static final native int NSAccessibilityFilenameAttribute();
+//public static final native int NSAccessibilityFirstLineIndentMarkerTypeValue();
+//public static final native int NSAccessibilityFloatingWindowSubrole();
+//public static final native int NSAccessibilityFocusedAttribute();
+//public static final native int NSAccessibilityFocusedUIElementAttribute();
+//public static final native int NSAccessibilityFocusedUIElementChangedNotification();
+//public static final native int NSAccessibilityFocusedWindowAttribute();
+//public static final native int NSAccessibilityFocusedWindowChangedNotification();
+//public static final native int NSAccessibilityFontFamilyKey();
+//public static final native int NSAccessibilityFontNameKey();
+//public static final native int NSAccessibilityFontSizeKey();
+//public static final native int NSAccessibilityFontTextAttribute();
+//public static final native int NSAccessibilityForegroundColorTextAttribute();
+//public static final native int NSAccessibilityFrontmostAttribute();
+//public static final native int NSAccessibilityGridRole();
+//public static final native int NSAccessibilityGroupRole();
+//public static final native int NSAccessibilityGrowAreaAttribute();
+//public static final native int NSAccessibilityGrowAreaRole();
+//public static final native int NSAccessibilityHeadIndentMarkerTypeValue();
+//public static final native int NSAccessibilityHeaderAttribute();
+//public static final native int NSAccessibilityHelpAttribute();
+//public static final native int NSAccessibilityHelpTagCreatedNotification();
+//public static final native int NSAccessibilityHelpTagRole();
+//public static final native int NSAccessibilityHiddenAttribute();
+//public static final native int NSAccessibilityHorizontalOrientationValue();
+//public static final native int NSAccessibilityHorizontalScrollBarAttribute();
+//public static final native int NSAccessibilityImageRole();
+//public static final native int NSAccessibilityInchesUnitValue();
+//public static final native int NSAccessibilityIncrementAction();
+//public static final native int NSAccessibilityIncrementArrowSubrole();
+//public static final native int NSAccessibilityIncrementButtonAttribute();
+//public static final native int NSAccessibilityIncrementPageSubrole();
+//public static final native int NSAccessibilityIncrementorRole();
+//public static final native int NSAccessibilityIndexAttribute();
+//public static final native int NSAccessibilityInsertionPointLineNumberAttribute();
+//public static final native int NSAccessibilityLabelUIElementsAttribute();
+//public static final native int NSAccessibilityLabelValueAttribute();
+//public static final native int NSAccessibilityLeftTabStopMarkerTypeValue();
+//public static final native int NSAccessibilityLineForIndexParameterizedAttribute();
+//public static final native int NSAccessibilityLinkRole();
+//public static final native int NSAccessibilityLinkTextAttribute();
+//public static final native int NSAccessibilityLinkedUIElementsAttribute();
+//public static final native int NSAccessibilityListRole();
+//public static final native int NSAccessibilityMainAttribute();
+//public static final native int NSAccessibilityMainWindowAttribute();
+//public static final native int NSAccessibilityMainWindowChangedNotification();
+//public static final native int NSAccessibilityMarkerGroupUIElementAttribute();
+//public static final native int NSAccessibilityMarkerTypeAttribute();
+//public static final native int NSAccessibilityMarkerTypeDescriptionAttribute();
+//public static final native int NSAccessibilityMarkerUIElementsAttribute();
+//public static final native int NSAccessibilityMarkerValuesAttribute();
+//public static final native int NSAccessibilityMatteContentUIElementAttribute();
+//public static final native int NSAccessibilityMatteHoleAttribute();
+//public static final native int NSAccessibilityMatteRole();
+//public static final native int NSAccessibilityMaxValueAttribute();
+//public static final native int NSAccessibilityMenuBarAttribute();
+//public static final native int NSAccessibilityMenuBarRole();
+//public static final native int NSAccessibilityMenuButtonRole();
+//public static final native int NSAccessibilityMenuItemRole();
+//public static final native int NSAccessibilityMenuRole();
+//public static final native int NSAccessibilityMinValueAttribute();
+//public static final native int NSAccessibilityMinimizeButtonAttribute();
+//public static final native int NSAccessibilityMinimizeButtonSubrole();
+//public static final native int NSAccessibilityMinimizedAttribute();
+//public static final native int NSAccessibilityMisspelledTextAttribute();
+//public static final native int NSAccessibilityModalAttribute();
+//public static final native int NSAccessibilityMovedNotification();
+//public static final native int NSAccessibilityNextContentsAttribute();
+//public static final native int NSAccessibilityNumberOfCharactersAttribute();
+//public static final native int NSAccessibilityOrderedByRowAttribute();
+//public static final native int NSAccessibilityOrientationAttribute();
+//public static final native int NSAccessibilityOutlineRole();
+//public static final native int NSAccessibilityOutlineRowSubrole();
+//public static final native int NSAccessibilityOverflowButtonAttribute();
+//public static final native int NSAccessibilityParentAttribute();
+//public static final native int NSAccessibilityPicasUnitValue();
+//public static final native int NSAccessibilityPickAction();
+//public static final native int NSAccessibilityPointsUnitValue();
+//public static final native int NSAccessibilityPopUpButtonRole();
+//public static final native int NSAccessibilityPositionAttribute();
+//public static final native int NSAccessibilityPressAction();
+//public static final native int NSAccessibilityPreviousContentsAttribute();
+//public static final native int NSAccessibilityProgressIndicatorRole();
+//public static final native int NSAccessibilityProxyAttribute();
+//public static final native int NSAccessibilityRTFForRangeParameterizedAttribute();
+//public static final native int NSAccessibilityRadioButtonRole();
+//public static final native int NSAccessibilityRadioGroupRole();
+//public static final native int NSAccessibilityRaiseAction();
+//public static final native int NSAccessibilityRangeForIndexParameterizedAttribute();
+//public static final native int NSAccessibilityRangeForLineParameterizedAttribute();
+//public static final native int NSAccessibilityRangeForPositionParameterizedAttribute();
+//public static final native int NSAccessibilityResizedNotification();
+//public static final native int NSAccessibilityRightTabStopMarkerTypeValue();
+//public static final native int NSAccessibilityRoleAttribute();
+//public static final native int NSAccessibilityRoleDescriptionAttribute();
+//public static final native int NSAccessibilityRowCountAttribute();
+//public static final native int NSAccessibilityRowCountChangedNotification();
+//public static final native int NSAccessibilityRowRole();
+//public static final native int NSAccessibilityRowsAttribute();
+//public static final native int NSAccessibilityRulerMarkerRole();
+//public static final native int NSAccessibilityRulerRole();
+//public static final native int NSAccessibilityScrollAreaRole();
+//public static final native int NSAccessibilityScrollBarRole();
+//public static final native int NSAccessibilitySearchButtonAttribute();
+//public static final native int NSAccessibilitySearchFieldSubrole();
+//public static final native int NSAccessibilitySearchMenuAttribute();
+//public static final native int NSAccessibilitySecureTextFieldSubrole();
+//public static final native int NSAccessibilitySelectedAttribute();
+//public static final native int NSAccessibilitySelectedChildrenAttribute();
+//public static final native int NSAccessibilitySelectedChildrenChangedNotification();
+//public static final native int NSAccessibilitySelectedColumnsAttribute();
+//public static final native int NSAccessibilitySelectedColumnsChangedNotification();
+//public static final native int NSAccessibilitySelectedRowsAttribute();
+//public static final native int NSAccessibilitySelectedRowsChangedNotification();
+//public static final native int NSAccessibilitySelectedTextAttribute();
+//public static final native int NSAccessibilitySelectedTextChangedNotification();
+//public static final native int NSAccessibilitySelectedTextRangeAttribute();
+//public static final native int NSAccessibilitySelectedTextRangesAttribute();
+//public static final native int NSAccessibilityServesAsTitleForUIElementsAttribute();
+//public static final native int NSAccessibilityShadowTextAttribute();
+//public static final native int NSAccessibilitySharedCharacterRangeAttribute();
+//public static final native int NSAccessibilitySharedTextUIElementsAttribute();
+//public static final native int NSAccessibilitySheetCreatedNotification();
+//public static final native int NSAccessibilitySheetRole();
+//public static final native int NSAccessibilityShowMenuAction();
+//public static final native int NSAccessibilityShownMenuAttribute();
+//public static final native int NSAccessibilitySizeAttribute();
+//public static final native int NSAccessibilitySliderRole();
+//public static final native int NSAccessibilitySortButtonRole();
+//public static final native int NSAccessibilitySortDirectionAttribute();
+//public static final native int NSAccessibilitySplitGroupRole();
+//public static final native int NSAccessibilitySplitterRole();
+//public static final native int NSAccessibilitySplittersAttribute();
+//public static final native int NSAccessibilityStandardWindowSubrole();
+//public static final native int NSAccessibilityStaticTextRole();
+//public static final native int NSAccessibilityStrikethroughColorTextAttribute();
+//public static final native int NSAccessibilityStrikethroughTextAttribute();
+//public static final native int NSAccessibilityStringForRangeParameterizedAttribute();
+//public static final native int NSAccessibilityStyleRangeForIndexParameterizedAttribute();
+//public static final native int NSAccessibilitySubroleAttribute();
+//public static final native int NSAccessibilitySuperscriptTextAttribute();
+//public static final native int NSAccessibilitySystemDialogSubrole();
+//public static final native int NSAccessibilitySystemFloatingWindowSubrole();
+//public static final native int NSAccessibilitySystemWideRole();
+//public static final native int NSAccessibilityTabGroupRole();
+//public static final native int NSAccessibilityTableRole();
+//public static final native int NSAccessibilityTableRowSubrole();
+//public static final native int NSAccessibilityTabsAttribute();
+//public static final native int NSAccessibilityTailIndentMarkerTypeValue();
+//public static final native int NSAccessibilityTextAreaRole();
+//public static final native int NSAccessibilityTextAttachmentSubrole();
+//public static final native int NSAccessibilityTextFieldRole();
+//public static final native int NSAccessibilityTextLinkSubrole();
+//public static final native int NSAccessibilityTimelineSubrole();
+//public static final native int NSAccessibilityTitleAttribute();
+//public static final native int NSAccessibilityTitleChangedNotification();
+//public static final native int NSAccessibilityTitleUIElementAttribute();
+//public static final native int NSAccessibilityToolbarButtonAttribute();
+//public static final native int NSAccessibilityToolbarButtonSubrole();
+//public static final native int NSAccessibilityToolbarRole();
+//public static final native int NSAccessibilityTopLevelUIElementAttribute();
+//public static final native int NSAccessibilityUIElementDestroyedNotification();
+//public static final native int NSAccessibilityURLAttribute();
+//public static final native int NSAccessibilityUnderlineColorTextAttribute();
+//public static final native int NSAccessibilityUnderlineTextAttribute();
+//public static final native int NSAccessibilityUnitDescriptionAttribute();
+//public static final native int NSAccessibilityUnitsAttribute();
+//public static final native int NSAccessibilityUnknownMarkerTypeValue();
+//public static final native int NSAccessibilityUnknownRole();
+//public static final native int NSAccessibilityUnknownSortDirectionValue();
+//public static final native int NSAccessibilityUnknownSubrole();
+//public static final native int NSAccessibilityUnknownUnitValue();
+//public static final native int NSAccessibilityValueAttribute();
+//public static final native int NSAccessibilityValueChangedNotification();
+//public static final native int NSAccessibilityValueDescriptionAttribute();
+//public static final native int NSAccessibilityValueIndicatorRole();
+//public static final native int NSAccessibilityVerticalOrientationValue();
+//public static final native int NSAccessibilityVerticalScrollBarAttribute();
+//public static final native int NSAccessibilityVisibleCharacterRangeAttribute();
+//public static final native int NSAccessibilityVisibleChildrenAttribute();
+//public static final native int NSAccessibilityVisibleColumnsAttribute();
+//public static final native int NSAccessibilityVisibleNameKey();
+//public static final native int NSAccessibilityVisibleRowsAttribute();
+//public static final native int NSAccessibilityWindowAttribute();
+//public static final native int NSAccessibilityWindowCreatedNotification();
+//public static final native int NSAccessibilityWindowDeminiaturizedNotification();
+//public static final native int NSAccessibilityWindowMiniaturizedNotification();
+//public static final native int NSAccessibilityWindowMovedNotification();
+//public static final native int NSAccessibilityWindowResizedNotification();
+//public static final native int NSAccessibilityWindowRole();
+//public static final native int NSAccessibilityWindowsAttribute();
+//public static final native int NSAccessibilityZoomButtonAttribute();
+//public static final native int NSAccessibilityZoomButtonSubrole();
+//public static final native int NSAlignmentBinding();
+//public static final native int NSAllRomanInputSourcesLocaleIdentifier();
+//public static final native int NSAllowsEditingMultipleValuesSelectionBindingOption();
+//public static final native int NSAllowsNullArgumentBindingOption();
+//public static final native int NSAlternateImageBinding();
+//public static final native int NSAlternateTitleBinding();
+//public static final native int NSAlwaysPresentsApplicationModalAlertsBindingOption();
+//public static final native int NSAnimateBinding();
+//public static final native int NSAnimationDelayBinding();
+//public static final native int NSAnimationProgressMark();
+//public static final native int NSAnimationProgressMarkNotification();
+//public static final native int NSAnimationTriggerOrderIn();
+//public static final native int NSAnimationTriggerOrderOut();
+//public static final native int NSAntialiasThresholdChangedNotification();
+//public static final native int NSApp();
+//public static final native int NSAppKitIgnoredException();
+//public static final native int NSAppKitVersionNumber();
+//public static final native int NSAppKitVirtualMemoryException();
+//public static final native int NSApplicationDidBecomeActiveNotification();
+//public static final native int NSApplicationDidChangeScreenParametersNotification();
+//public static final native int NSApplicationDidFinishLaunchingNotification();
+//public static final native int NSApplicationDidHideNotification();
+//public static final native int NSApplicationDidResignActiveNotification();
+//public static final native int NSApplicationDidUnhideNotification();
+//public static final native int NSApplicationDidUpdateNotification();
+//public static final native int NSApplicationFileType();
+//public static final native int NSApplicationWillBecomeActiveNotification();
+//public static final native int NSApplicationWillFinishLaunchingNotification();
+//public static final native int NSApplicationWillHideNotification();
+//public static final native int NSApplicationWillResignActiveNotification();
+//public static final native int NSApplicationWillTerminateNotification();
+//public static final native int NSApplicationWillUnhideNotification();
+//public static final native int NSApplicationWillUpdateNotification();
+//public static final native int NSArgumentBinding();
+//public static final native int NSAttachmentAttributeName();
+//public static final native int NSAttributedStringBinding();
+//public static final native int NSAuthorDocumentAttribute();
+public static final native int NSBackgroundColorAttributeName();
+//public static final native int NSBackgroundColorDocumentAttribute();
+//public static final native int NSBadBitmapParametersException();
+//public static final native int NSBadComparisonException();
+//public static final native int NSBadRTFColorTableException();
+//public static final native int NSBadRTFDirectiveException();
+//public static final native int NSBadRTFFontTableException();
+//public static final native int NSBadRTFStyleSheetException();
+//public static final native int NSBaseURLDocumentOption();
+public static final native int NSBaselineOffsetAttributeName();
+//public static final native int NSBlack();
+//public static final native int NSBottomMarginDocumentAttribute();
+//public static final native int NSBrowserColumnConfigurationDidChangeNotification();
+//public static final native int NSBrowserIllegalDelegateException();
+//public static final native int NSCalibratedBlackColorSpace();
+//public static final native int NSCalibratedRGBColorSpace();
+//public static final native int NSCalibratedWhiteColorSpace();
+//public static final native int NSCharacterEncodingDocumentAttribute();
+//public static final native int NSCharacterEncodingDocumentOption();
+//public static final native int NSCharacterShapeAttributeName();
+//public static final native int NSCocoaVersionDocumentAttribute();
+//public static final native int NSColorListDidChangeNotification();
+//public static final native int NSColorListIOException();
+//public static final native int NSColorListNotEditableException();
+//public static final native int NSColorPanelColorDidChangeNotification();
+//public static final native int NSColorPboardType();
+//public static final native int NSComboBoxSelectionDidChangeNotification();
+//public static final native int NSComboBoxSelectionIsChangingNotification();
+//public static final native int NSComboBoxWillDismissNotification();
+//public static final native int NSComboBoxWillPopUpNotification();
+//public static final native int NSCommentDocumentAttribute();
+//public static final native int NSCompanyDocumentAttribute();
+//public static final native int NSConditionallySetsEditableBindingOption();
+//public static final native int NSConditionallySetsEnabledBindingOption();
+//public static final native int NSConditionallySetsHiddenBindingOption();
+//public static final native int NSContentArrayBinding();
+//public static final native int NSContentArrayForMultipleSelectionBinding();
+//public static final native int NSContentBinding();
+//public static final native int NSContentDictionaryBinding();
+//public static final native int NSContentHeightBinding();
+//public static final native int NSContentObjectBinding();
+//public static final native int NSContentObjectsBinding();
+//public static final native int NSContentPlacementTagBindingOption();
+//public static final native int NSContentSetBinding();
+//public static final native int NSContentValuesBinding();
+//public static final native int NSContentWidthBinding();
+//public static final native int NSContextHelpModeDidActivateNotification();
+//public static final native int NSContextHelpModeDidDeactivateNotification();
+//public static final native int NSContinuouslyUpdatesValueBindingOption();
+//public static final native int NSControlTextDidBeginEditingNotification();
+//public static final native int NSControlTextDidChangeNotification();
+//public static final native int NSControlTextDidEndEditingNotification();
+//public static final native int NSControlTintDidChangeNotification();
+//public static final native int NSConvertedDocumentAttribute();
+//public static final native int NSCopyrightDocumentAttribute();
+//public static final native int NSCreatesSortDescriptorBindingOption();
+//public static final native int NSCreationTimeDocumentAttribute();
+//public static final native int NSCriticalValueBinding();
+//public static final native int NSCursorAttributeName();
+//public static final native int NSCustomColorSpace();
+//public static final native int NSDarkGray();
+//public static final native int NSDataBinding();
+//public static final native int NSDefaultAttributesDocumentOption();
+//public static final native int NSDefaultTabIntervalDocumentAttribute();
+//public static final native int NSDeletesObjectsOnRemoveBindingsOption();
+//public static final native int NSDeviceBitsPerSample();
+//public static final native int NSDeviceBlackColorSpace();
+//public static final native int NSDeviceCMYKColorSpace();
+//public static final native int NSDeviceColorSpaceName();
+//public static final native int NSDeviceIsPrinter();
+//public static final native int NSDeviceIsScreen();
+//public static final native int NSDeviceRGBColorSpace();
+public static final native int NSDeviceResolution();
+//public static final native int NSDeviceSize();
+//public static final native int NSDeviceWhiteColorSpace();
+//public static final native int NSDirectoryFileType();
+//public static final native int NSDisplayNameBindingOption();
+//public static final native int NSDisplayPatternBindingOption();
+//public static final native int NSDisplayPatternTitleBinding();
+//public static final native int NSDisplayPatternValueBinding();
+//public static final native int NSDocFormatTextDocumentType();
+//public static final native int NSDocumentEditedBinding();
+//public static final native int NSDocumentTypeDocumentAttribute();
+//public static final native int NSDocumentTypeDocumentOption();
+//public static final native int NSDoubleClickArgumentBinding();
+//public static final native int NSDoubleClickTargetBinding();
+//public static final native int NSDragPboard();
+//public static final native int NSDraggingException();
+//public static final native int NSDrawerDidCloseNotification();
+//public static final native int NSDrawerDidOpenNotification();
+//public static final native int NSDrawerWillCloseNotification();
+//public static final native int NSDrawerWillOpenNotification();
+//public static final native int NSEditableBinding();
+//public static final native int NSEditorDocumentAttribute();
+//public static final native int NSEnabledBinding();
+//public static final native int NSEventTrackingRunLoopMode();
+//public static final native int NSExcludedElementsDocumentAttribute();
+//public static final native int NSExcludedKeysBinding();
+//public static final native int NSExpansionAttributeName();
+//public static final native int NSFileContentsPboardType();
+//public static final native int NSFilenamesPboardType();
+//public static final native int NSFilesPromisePboardType();
+//public static final native int NSFilesystemFileType();
+//public static final native int NSFilterPredicateBinding();
+//public static final native int NSFindPanelCaseInsensitiveSearch();
+//public static final native int NSFindPanelSearchOptionsPboardType();
+//public static final native int NSFindPanelSubstringMatch();
+//public static final native int NSFindPboard();
+public static final native int NSFontAttributeName();
+//public static final native int NSFontBinding();
+//public static final native int NSFontBoldBinding();
+//public static final native int NSFontCascadeListAttribute();
+//public static final native int NSFontCharacterSetAttribute();
+//public static final native int NSFontFaceAttribute();
+//public static final native int NSFontFamilyAttribute();
+//public static final native int NSFontFamilyNameBinding();
+//public static final native int NSFontFeatureSelectorIdentifierKey();
+//public static final native int NSFontFeatureSettingsAttribute();
+//public static final native int NSFontFeatureTypeIdentifierKey();
+//public static final native int NSFontFixedAdvanceAttribute();
+//public static final native int NSFontIdentityMatrix();
+//public static final native int NSFontItalicBinding();
+//public static final native int NSFontMatrixAttribute();
+//public static final native int NSFontNameAttribute();
+//public static final native int NSFontNameBinding();
+//public static final native int NSFontPboard();
+//public static final native int NSFontPboardType();
+//public static final native int NSFontSetChangedNotification();
+//public static final native int NSFontSizeAttribute();
+//public static final native int NSFontSizeBinding();
+//public static final native int NSFontSlantTrait();
+//public static final native int NSFontSymbolicTrait();
+//public static final native int NSFontTraitsAttribute();
+//public static final native int NSFontUnavailableException();
+//public static final native int NSFontVariationAttribute();
+//public static final native int NSFontVariationAxisDefaultValueKey();
+//public static final native int NSFontVariationAxisIdentifierKey();
+//public static final native int NSFontVariationAxisMaximumValueKey();
+//public static final native int NSFontVariationAxisMinimumValueKey();
+//public static final native int NSFontVariationAxisNameKey();
+//public static final native int NSFontVisibleNameAttribute();
+//public static final native int NSFontWeightTrait();
+//public static final native int NSFontWidthTrait();
+public static final native int NSForegroundColorAttributeName();
+//public static final native int NSFullScreenModeAllScreens();
+//public static final native int NSFullScreenModeSetting();
+//public static final native int NSFullScreenModeWindowLevel();
+//public static final native int NSGeneralPboard();
+//public static final native int NSGlyphInfoAttributeName();
+//public static final native int NSGraphicsContextDestinationAttributeName();
+//public static final native int NSGraphicsContextPDFFormat();
+//public static final native int NSGraphicsContextPSFormat();
+//public static final native int NSGraphicsContextRepresentationFormatAttributeName();
+//public static final native int NSHTMLPboardType();
+//public static final native int NSHTMLTextDocumentType();
+//public static final native int NSHandlesContentAsCompoundValueBindingOption();
+//public static final native int NSHeaderTitleBinding();
+//public static final native int NSHiddenBinding();
+//public static final native int NSHyphenationFactorDocumentAttribute();
+//public static final native int NSIllegalSelectorException();
+//public static final native int NSImageBinding();
+//public static final native int NSImageCacheException();
+//public static final native int NSImageColorSyncProfileData();
+//public static final native int NSImageCompressionFactor();
+//public static final native int NSImageCompressionMethod();
+//public static final native int NSImageCurrentFrame();
+//public static final native int NSImageCurrentFrameDuration();
+//public static final native int NSImageDitherTransparency();
+//public static final native int NSImageEXIFData();
+//public static final native int NSImageFallbackBackgroundColor();
+//public static final native int NSImageFrameCount();
+//public static final native int NSImageGamma();
+//public static final native int NSImageInterlaced();
+//public static final native int NSImageLoopCount();
+//public static final native int NSImageNameActionTemplate();
+//public static final native int NSImageNameAddTemplate();
+//public static final native int NSImageNameAdvanced();
+//public static final native int NSImageNameBluetoothTemplate();
+//public static final native int NSImageNameBonjour();
+//public static final native int NSImageNameColorPanel();
+//public static final native int NSImageNameColumnViewTemplate();
+//public static final native int NSImageNameComputer();
+//public static final native int NSImageNameDotMac();
+//public static final native int NSImageNameEnterFullScreenTemplate();
+//public static final native int NSImageNameEveryone();
+//public static final native int NSImageNameExitFullScreenTemplate();
+//public static final native int NSImageNameFlowViewTemplate();
+//public static final native int NSImageNameFolderBurnable();
+//public static final native int NSImageNameFolderSmart();
+//public static final native int NSImageNameFollowLinkFreestandingTemplate();
+//public static final native int NSImageNameFontPanel();
+//public static final native int NSImageNameGoLeftTemplate();
+//public static final native int NSImageNameGoRightTemplate();
+//public static final native int NSImageNameIChatTheaterTemplate();
+//public static final native int NSImageNameIconViewTemplate();
+//public static final native int NSImageNameInfo();
+//public static final native int NSImageNameInvalidDataFreestandingTemplate();
+//public static final native int NSImageNameLeftFacingTriangleTemplate();
+//public static final native int NSImageNameListViewTemplate();
+//public static final native int NSImageNameLockLockedTemplate();
+//public static final native int NSImageNameLockUnlockedTemplate();
+//public static final native int NSImageNameMultipleDocuments();
+//public static final native int NSImageNameNetwork();
+//public static final native int NSImageNamePathTemplate();
+//public static final native int NSImageNamePreferencesGeneral();
+//public static final native int NSImageNameQuickLookTemplate();
+//public static final native int NSImageNameRefreshFreestandingTemplate();
+//public static final native int NSImageNameRefreshTemplate();
+//public static final native int NSImageNameRemoveTemplate();
+//public static final native int NSImageNameRevealFreestandingTemplate();
+//public static final native int NSImageNameRightFacingTriangleTemplate();
+//public static final native int NSImageNameSlideshowTemplate();
+//public static final native int NSImageNameSmartBadgeTemplate();
+//public static final native int NSImageNameStopProgressFreestandingTemplate();
+//public static final native int NSImageNameStopProgressTemplate();
+//public static final native int NSImageNameUser();
+//public static final native int NSImageNameUserAccounts();
+//public static final native int NSImageNameUserGroup();
+//public static final native int NSImageProgressive();
+//public static final native int NSImageRGBColorTable();
+//public static final native int NSImageRepRegistryDidChangeNotification();
+//public static final native int NSIncludedKeysBinding();
+//public static final native int NSInitialKeyBinding();
+//public static final native int NSInitialValueBinding();
+//public static final native int NSInkTextPboardType();
+//public static final native int NSInsertsNullPlaceholderBindingOption();
+//public static final native int NSInterfaceStyleDefault();
+//public static final native int NSInvokesSeparatelyWithArrayObjectsBindingOption();
+//public static final native int NSIsIndeterminateBinding();
+//public static final native int NSKernAttributeName();
+//public static final native int NSKeywordsDocumentAttribute();
+//public static final native int NSLabelBinding();
+//public static final native int NSLeftMarginDocumentAttribute();
+//public static final native int NSLigatureAttributeName();
+//public static final native int NSLightGray();
+public static final native int NSLinkAttributeName();
+//public static final native int NSLocalizedKeyDictionaryBinding();
+//public static final native int NSMacSimpleTextDocumentType();
+//public static final native int NSManagedObjectContextBinding();
+//public static final native int NSMarkedClauseSegmentAttributeName();
+//public static final native int NSMaxValueBinding();
+//public static final native int NSMaxWidthBinding();
+//public static final native int NSMaximumRecentsBinding();
+//public static final native int NSMenuDidAddItemNotification();
+//public static final native int NSMenuDidBeginTrackingNotification();
+//public static final native int NSMenuDidChangeItemNotification();
+//public static final native int NSMenuDidEndTrackingNotification();
+//public static final native int NSMenuDidRemoveItemNotification();
+//public static final native int NSMenuDidSendActionNotification();
+//public static final native int NSMenuWillSendActionNotification();
+//public static final native int NSMinValueBinding();
+//public static final native int NSMinWidthBinding();
+//public static final native int NSMixedStateImageBinding();
+//public static final native int NSModalPanelRunLoopMode();
+//public static final native int NSModificationTimeDocumentAttribute();
+//public static final native int NSMultipleTextSelectionPboardType();
+//public static final native int NSMultipleValuesMarker();
+//public static final native int NSMultipleValuesPlaceholderBindingOption();
+//public static final native int NSNamedColorSpace();
+//public static final native int NSNibLoadingException();
+//public static final native int NSNibOwner();
+//public static final native int NSNibTopLevelObjects();
+//public static final native int NSNoSelectionMarker();
+//public static final native int NSNoSelectionPlaceholderBindingOption();
+//public static final native int NSNotApplicableMarker();
+//public static final native int NSNotApplicablePlaceholderBindingOption();
+//public static final native int NSNullPlaceholderBindingOption();
+//public static final native int NSObliquenessAttributeName();
+//public static final native int NSObservedKeyPathKey();
+//public static final native int NSObservedObjectKey();
+//public static final native int NSOffStateImageBinding();
+//public static final native int NSOfficeOpenXMLTextDocumentType();
+//public static final native int NSOnStateImageBinding();
+//public static final native int NSOpenDocumentTextDocumentType();
+//public static final native int NSOptionsKey();
+//public static final native int NSOutlineViewColumnDidMoveNotification();
+//public static final native int NSOutlineViewColumnDidResizeNotification();
+//public static final native int NSOutlineViewItemDidCollapseNotification();
+//public static final native int NSOutlineViewItemDidExpandNotification();
+//public static final native int NSOutlineViewItemWillCollapseNotification();
+//public static final native int NSOutlineViewItemWillExpandNotification();
+//public static final native int NSOutlineViewSelectionDidChangeNotification();
+//public static final native int NSOutlineViewSelectionIsChangingNotification();
+//public static final native int NSPDFPboardType();
+//public static final native int NSPICTPboardType();
+//public static final native int NSPPDIncludeNotFoundException();
+//public static final native int NSPPDIncludeStackOverflowException();
+//public static final native int NSPPDIncludeStackUnderflowException();
+//public static final native int NSPPDParseException();
+//public static final native int NSPaperSizeDocumentAttribute();
+public static final native int NSParagraphStyleAttributeName();
+//public static final native int NSPasteboardCommunicationException();
+//public static final native int NSPatternColorSpace();
+//public static final native int NSPlainFileType();
+//public static final native int NSPlainTextDocumentType();
+//public static final native int NSPopUpButtonCellWillPopUpNotification();
+//public static final native int NSPopUpButtonWillPopUpNotification();
+//public static final native int NSPostScriptPboardType();
+//public static final native int NSPredicateBinding();
+//public static final native int NSPredicateFormatBindingOption();
+//public static final native int NSPrefixSpacesDocumentAttribute();
+//public static final native int NSPrintAllPages();
+//public static final native int NSPrintBottomMargin();
+//public static final native int NSPrintCancelJob();
+//public static final native int NSPrintCopies();
+//public static final native int NSPrintDetailedErrorReporting();
+//public static final native int NSPrintFaxCoverSheetName();
+//public static final native int NSPrintFaxHighResolution();
+//public static final native int NSPrintFaxJob();
+//public static final native int NSPrintFaxModem();
+//public static final native int NSPrintFaxNumber();
+//public static final native int NSPrintFaxReceiverNames();
+//public static final native int NSPrintFaxReceiverNumbers();
+//public static final native int NSPrintFaxReturnReceipt();
+//public static final native int NSPrintFaxSendTime();
+//public static final native int NSPrintFaxTrimPageEnds();
+//public static final native int NSPrintFaxUseCoverSheet();
+//public static final native int NSPrintFirstPage();
+//public static final native int NSPrintFormName();
+//public static final native int NSPrintHeaderAndFooter();
+//public static final native int NSPrintHorizontalPagination();
+//public static final native int NSPrintHorizontallyCentered();
+//public static final native int NSPrintJobDisposition();
+//public static final native int NSPrintJobFeatures();
+//public static final native int NSPrintLastPage();
+//public static final native int NSPrintLeftMargin();
+//public static final native int NSPrintManualFeed();
+//public static final native int NSPrintMustCollate();
+//public static final native int NSPrintOperationExistsException();
+//public static final native int NSPrintOrientation();
+//public static final native int NSPrintPackageException();
+//public static final native int NSPrintPagesAcross();
+//public static final native int NSPrintPagesDown();
+//public static final native int NSPrintPagesPerSheet();
+//public static final native int NSPrintPanelAccessorySummaryItemDescriptionKey();
+//public static final native int NSPrintPanelAccessorySummaryItemNameKey();
+//public static final native int NSPrintPaperFeed();
+//public static final native int NSPrintPaperName();
+//public static final native int NSPrintPaperSize();
+//public static final native int NSPrintPhotoJobStyleHint();
+//public static final native int NSPrintPreviewJob();
+//public static final native int NSPrintPrinter();
+//public static final native int NSPrintPrinterName();
+//public static final native int NSPrintReversePageOrder();
+//public static final native int NSPrintRightMargin();
+//public static final native int NSPrintSaveJob();
+//public static final native int NSPrintSavePath();
+//public static final native int NSPrintScalingFactor();
+//public static final native int NSPrintSpoolJob();
+//public static final native int NSPrintTime();
+//public static final native int NSPrintTopMargin();
+//public static final native int NSPrintVerticalPagination();
+//public static final native int NSPrintVerticallyCentered();
+//public static final native int NSPrintingCommunicationException();
+//public static final native int NSRTFDPboardType();
+//public static final native int NSRTFDTextDocumentType();
+//public static final native int NSRTFPboardType();
+//public static final native int NSRTFPropertyStackOverflowException();
+//public static final native int NSRTFTextDocumentType();
+//public static final native int NSRaisesForNotApplicableKeysBindingOption();
+//public static final native int NSReadOnlyDocumentAttribute();
+//public static final native int NSRecentSearchesBinding();
+//public static final native int NSRepresentedFilenameBinding();
+//public static final native int NSRightMarginDocumentAttribute();
+//public static final native int NSRowHeightBinding();
+//public static final native int NSRuleEditorPredicateComparisonModifier();
+//public static final native int NSRuleEditorPredicateCompoundType();
+//public static final native int NSRuleEditorPredicateCustomSelector();
+//public static final native int NSRuleEditorPredicateLeftExpression();
+//public static final native int NSRuleEditorPredicateOperatorType();
+//public static final native int NSRuleEditorPredicateOptions();
+//public static final native int NSRuleEditorPredicateRightExpression();
+//public static final native int NSRuleEditorRowsDidChangeNotification();
+//public static final native int NSRulerPboard();
+//public static final native int NSRulerPboardType();
+//public static final native int NSSelectedIdentifierBinding();
+//public static final native int NSSelectedIndexBinding();
+//public static final native int NSSelectedLabelBinding();
+//public static final native int NSSelectedObjectBinding();
+//public static final native int NSSelectedObjectsBinding();
+//public static final native int NSSelectedTagBinding();
+//public static final native int NSSelectedValueBinding();
+//public static final native int NSSelectedValuesBinding();
+//public static final native int NSSelectionIndexPathsBinding();
+//public static final native int NSSelectionIndexesBinding();
+//public static final native int NSSelectorNameBindingOption();
+//public static final native int NSSelectsAllWhenSettingContentBindingOption();
+//public static final native int NSShadowAttributeName();
+//public static final native int NSShellCommandFileType();
+//public static final native int NSSortDescriptorsBinding();
+//public static final native int NSSoundPboardType();
+//public static final native int NSSpeechCharacterModeProperty();
+//public static final native int NSSpeechCommandDelimiterProperty();
+//public static final native int NSSpeechCommandPrefix();
+//public static final native int NSSpeechCommandSuffix();
+//public static final native int NSSpeechCurrentVoiceProperty();
+//public static final native int NSSpeechDictionaryAbbreviations();
+//public static final native int NSSpeechDictionaryEntryPhonemes();
+//public static final native int NSSpeechDictionaryEntrySpelling();
+//public static final native int NSSpeechDictionaryLocaleIdentifier();
+//public static final native int NSSpeechDictionaryModificationDate();
+//public static final native int NSSpeechDictionaryPronunciations();
+//public static final native int NSSpeechErrorCount();
+//public static final native int NSSpeechErrorNewestCharacterOffset();
+//public static final native int NSSpeechErrorNewestCode();
+//public static final native int NSSpeechErrorOldestCharacterOffset();
+//public static final native int NSSpeechErrorOldestCode();
+//public static final native int NSSpeechErrorsProperty();
+//public static final native int NSSpeechInputModeProperty();
+//public static final native int NSSpeechModeLiteral();
+//public static final native int NSSpeechModeNormal();
+//public static final native int NSSpeechModePhoneme();
+//public static final native int NSSpeechModeText();
+//public static final native int NSSpeechNumberModeProperty();
+//public static final native int NSSpeechOutputToFileURLProperty();
+//public static final native int NSSpeechPhonemeInfoExample();
+//public static final native int NSSpeechPhonemeInfoHiliteEnd();
+//public static final native int NSSpeechPhonemeInfoHiliteStart();
+//public static final native int NSSpeechPhonemeInfoOpcode();
+//public static final native int NSSpeechPhonemeInfoSymbol();
+//public static final native int NSSpeechPhonemeSymbolsProperty();
+//public static final native int NSSpeechPitchBaseProperty();
+//public static final native int NSSpeechPitchModProperty();
+//public static final native int NSSpeechRateProperty();
+//public static final native int NSSpeechRecentSyncProperty();
+//public static final native int NSSpeechResetProperty();
+//public static final native int NSSpeechStatusNumberOfCharactersLeft();
+//public static final native int NSSpeechStatusOutputBusy();
+//public static final native int NSSpeechStatusOutputPaused();
+//public static final native int NSSpeechStatusPhonemeCode();
+//public static final native int NSSpeechStatusProperty();
+//public static final native int NSSpeechSynthesizerInfoIdentifier();
+//public static final native int NSSpeechSynthesizerInfoProperty();
+//public static final native int NSSpeechSynthesizerInfoVersion();
+//public static final native int NSSpeechVolumeProperty();
+//public static final native int NSSpellingStateAttributeName();
+//public static final native int NSSplitViewDidResizeSubviewsNotification();
+//public static final native int NSSplitViewWillResizeSubviewsNotification();
+public static final native int NSStrikethroughColorAttributeName();
+public static final native int NSStrikethroughStyleAttributeName();
+//public static final native int NSStringPboardType();
+//public static final native int NSStrokeColorAttributeName();
+//public static final native int NSStrokeWidthAttributeName();
+//public static final native int NSSubjectDocumentAttribute();
+//public static final native int NSSuperscriptAttributeName();
+//public static final native int NSSystemColorsDidChangeNotification();
+//public static final native int NSTIFFException();
+//public static final native int NSTIFFPboardType();
+//public static final native int NSTabColumnTerminatorsAttributeName();
+//public static final native int NSTableViewColumnDidMoveNotification();
+//public static final native int NSTableViewColumnDidResizeNotification();
+//public static final native int NSTableViewSelectionDidChangeNotification();
+//public static final native int NSTableViewSelectionIsChangingNotification();
+//public static final native int NSTabularTextPboardType();
+//public static final native int NSTargetBinding();
+//public static final native int NSTextColorBinding();
+//public static final native int NSTextDidBeginEditingNotification();
+//public static final native int NSTextDidChangeNotification();
+//public static final native int NSTextDidEndEditingNotification();
+//public static final native int NSTextEncodingNameDocumentAttribute();
+//public static final native int NSTextEncodingNameDocumentOption();
+//public static final native int NSTextLineTooLongException();
+//public static final native int NSTextNoSelectionException();
+//public static final native int NSTextReadException();
+//public static final native int NSTextSizeMultiplierDocumentOption();
+//public static final native int NSTextStorageDidProcessEditingNotification();
+//public static final native int NSTextStorageWillProcessEditingNotification();
+//public static final native int NSTextViewDidChangeSelectionNotification();
+//public static final native int NSTextViewDidChangeTypingAttributesNotification();
+//public static final native int NSTextViewWillChangeNotifyingTextViewNotification();
+//public static final native int NSTextWriteException();
+//public static final native int NSTimeoutDocumentOption();
+//public static final native int NSTitleBinding();
+//public static final native int NSTitleDocumentAttribute();
+//public static final native int NSToolTipAttributeName();
+//public static final native int NSToolTipBinding();
+//public static final native int NSToolbarCustomizeToolbarItemIdentifier();
+//public static final native int NSToolbarDidRemoveItemNotification();
+//public static final native int NSToolbarFlexibleSpaceItemIdentifier();
+//public static final native int NSToolbarPrintItemIdentifier();
+//public static final native int NSToolbarSeparatorItemIdentifier();
+//public static final native int NSToolbarShowColorsItemIdentifier();
+//public static final native int NSToolbarShowFontsItemIdentifier();
+//public static final native int NSToolbarSpaceItemIdentifier();
+//public static final native int NSToolbarWillAddItemNotification();
+//public static final native int NSTopMarginDocumentAttribute();
+//public static final native int NSTransparentBinding();
+//public static final native int NSTypedStreamVersionException();
+//public static final native int NSURLPboardType();
+//public static final native int NSUnderlineByWordMask();
+public static final native int NSUnderlineColorAttributeName();
+//public static final native int NSUnderlineStrikethroughMask();
+public static final native int NSUnderlineStyleAttributeName();
+//public static final native int NSVCardPboardType();
+//public static final native int NSValidatesImmediatelyBindingOption();
+//public static final native int NSValueBinding();
+//public static final native int NSValuePathBinding();
+//public static final native int NSValueTransformerBindingOption();
+//public static final native int NSValueTransformerNameBindingOption();
+//public static final native int NSValueURLBinding();
+//public static final native int NSViewAnimationEffectKey();
+//public static final native int NSViewAnimationEndFrameKey();
+//public static final native int NSViewAnimationFadeInEffect();
+//public static final native int NSViewAnimationFadeOutEffect();
+//public static final native int NSViewAnimationStartFrameKey();
+//public static final native int NSViewAnimationTargetKey();
+//public static final native int NSViewBoundsDidChangeNotification();
+//public static final native int NSViewDidUpdateTrackingAreasNotification();
+//public static final native int NSViewFocusDidChangeNotification();
+//public static final native int NSViewFrameDidChangeNotification();
+//public static final native int NSViewGlobalFrameDidChangeNotification();
+//public static final native int NSViewModeDocumentAttribute();
+//public static final native int NSViewSizeDocumentAttribute();
+//public static final native int NSViewZoomDocumentAttribute();
+//public static final native int NSVisibleBinding();
+//public static final native int NSVoiceAge();
+//public static final native int NSVoiceDemoText();
+//public static final native int NSVoiceGender();
+//public static final native int NSVoiceGenderFemale();
+//public static final native int NSVoiceGenderMale();
+//public static final native int NSVoiceGenderNeuter();
+//public static final native int NSVoiceIdentifier();
+//public static final native int NSVoiceIndividuallySpokenCharacters();
+//public static final native int NSVoiceLocaleIdentifier();
+//public static final native int NSVoiceName();
+//public static final native int NSVoiceSupportedCharacters();
+//public static final native int NSWarningValueBinding();
+//public static final native int NSWebArchiveTextDocumentType();
+//public static final native int NSWebPreferencesDocumentOption();
+//public static final native int NSWebResourceLoadDelegateDocumentOption();
+//public static final native int NSWhite();
+//public static final native int NSWidthBinding();
+//public static final native int NSWindowDidBecomeKeyNotification();
+//public static final native int NSWindowDidBecomeMainNotification();
+//public static final native int NSWindowDidChangeScreenNotification();
+//public static final native int NSWindowDidChangeScreenProfileNotification();
+//public static final native int NSWindowDidDeminiaturizeNotification();
+//public static final native int NSWindowDidEndSheetNotification();
+//public static final native int NSWindowDidExposeNotification();
+//public static final native int NSWindowDidMiniaturizeNotification();
+//public static final native int NSWindowDidMoveNotification();
+//public static final native int NSWindowDidResignKeyNotification();
+//public static final native int NSWindowDidResignMainNotification();
+//public static final native int NSWindowDidResizeNotification();
+//public static final native int NSWindowDidUpdateNotification();
+//public static final native int NSWindowServerCommunicationException();
+//public static final native int NSWindowWillBeginSheetNotification();
+//public static final native int NSWindowWillCloseNotification();
+//public static final native int NSWindowWillMiniaturizeNotification();
+//public static final native int NSWindowWillMoveNotification();
+//public static final native int NSWordMLTextDocumentType();
+//public static final native int NSWordTablesReadException();
+//public static final native int NSWordTablesWriteException();
+//public static final native int NSWorkspaceCompressOperation();
+//public static final native int NSWorkspaceCopyOperation();
+//public static final native int NSWorkspaceDecompressOperation();
+//public static final native int NSWorkspaceDecryptOperation();
+//public static final native int NSWorkspaceDestroyOperation();
+//public static final native int NSWorkspaceDidLaunchApplicationNotification();
+//public static final native int NSWorkspaceDidMountNotification();
+//public static final native int NSWorkspaceDidPerformFileOperationNotification();
+//public static final native int NSWorkspaceDidTerminateApplicationNotification();
+//public static final native int NSWorkspaceDidUnmountNotification();
+//public static final native int NSWorkspaceDidWakeNotification();
+//public static final native int NSWorkspaceDuplicateOperation();
+//public static final native int NSWorkspaceEncryptOperation();
+//public static final native int NSWorkspaceLinkOperation();
+//public static final native int NSWorkspaceMoveOperation();
+//public static final native int NSWorkspaceRecycleOperation();
+//public static final native int NSWorkspaceSessionDidBecomeActiveNotification();
+//public static final native int NSWorkspaceSessionDidResignActiveNotification();
+//public static final native int NSWorkspaceWillLaunchApplicationNotification();
+//public static final native int NSWorkspaceWillPowerOffNotification();
+//public static final native int NSWorkspaceWillSleepNotification();
+//public static final native int NSWorkspaceWillUnmountNotification();
+//public static final native int NSAppleEventManagerWillProcessFirstEventNotification();
+//public static final native int NSAppleEventTimeOutDefault();
+//public static final native int NSAppleEventTimeOutNone();
+//public static final native int NSAppleScriptErrorAppName();
+//public static final native int NSAppleScriptErrorBriefMessage();
+//public static final native int NSAppleScriptErrorMessage();
+//public static final native int NSAppleScriptErrorNumber();
+//public static final native int NSAppleScriptErrorRange();
+//public static final native int NSArgumentDomain();
+//public static final native int NSAverageKeyValueOperator();
+//public static final native int NSBuddhistCalendar();
+//public static final native int NSBundleDidLoadNotification();
+//public static final native int NSCharacterConversionException();
+//public static final native int NSChineseCalendar();
+//public static final native int NSClassDescriptionNeededForClassNotification();
+//public static final native int NSCocoaErrorDomain();
+//public static final native int NSConnectionDidDieNotification();
+//public static final native int NSConnectionDidInitializeNotification();
+//public static final native int NSConnectionReplyMode();
+//public static final native int NSCountKeyValueOperator();
+//public static final native int NSCurrentLocaleDidChangeNotification();
+//public static final native int NSDeallocateZombies();
+//public static final native int NSDebugEnabled();
+//public static final native int NSDecimalNumberDivideByZeroException();
+//public static final native int NSDecimalNumberExactnessException();
+//public static final native int NSDecimalNumberOverflowException();
+//public static final native int NSDecimalNumberUnderflowException();
+public static final NSString NSDefaultRunLoopMode = new NSString(OS.NSDefaultRunLoopMode());
+public static final native int NSDefaultRunLoopMode();
+//public static final native int NSDestinationInvalidException();
+//public static final native int NSDidBecomeSingleThreadedNotification();
+//public static final native int NSDistinctUnionOfArraysKeyValueOperator();
+//public static final native int NSDistinctUnionOfObjectsKeyValueOperator();
+//public static final native int NSDistinctUnionOfSetsKeyValueOperator();
+//public static final native int NSErrorFailingURLStringKey();
+//public static final native int NSFailedAuthenticationException();
+//public static final native int NSFileAppendOnly();
+//public static final native int NSFileBusy();
+//public static final native int NSFileCreationDate();
+//public static final native int NSFileDeviceIdentifier();
+//public static final native int NSFileExtensionHidden();
+//public static final native int NSFileGroupOwnerAccountID();
+//public static final native int NSFileGroupOwnerAccountName();
+//public static final native int NSFileHFSCreatorCode();
+//public static final native int NSFileHFSTypeCode();
+//public static final native int NSFileHandleConnectionAcceptedNotification();
+//public static final native int NSFileHandleDataAvailableNotification();
+//public static final native int NSFileHandleNotificationDataItem();
+//public static final native int NSFileHandleNotificationFileHandleItem();
+//public static final native int NSFileHandleNotificationMonitorModes();
+//public static final native int NSFileHandleOperationException();
+//public static final native int NSFileHandleReadCompletionNotification();
+//public static final native int NSFileHandleReadToEndOfFileCompletionNotification();
+//public static final native int NSFileImmutable();
+//public static final native int NSFileModificationDate();
+//public static final native int NSFileOwnerAccountID();
+//public static final native int NSFileOwnerAccountName();
+//public static final native int NSFilePathErrorKey();
+//public static final native int NSFilePosixPermissions();
+//public static final native int NSFileReferenceCount();
+//public static final native int NSFileSize();
+//public static final native int NSFileSystemFileNumber();
+//public static final native int NSFileSystemFreeNodes();
+//public static final native int NSFileSystemFreeSize();
+//public static final native int NSFileSystemNodes();
+//public static final native int NSFileSystemNumber();
+//public static final native int NSFileSystemSize();
+//public static final native int NSFileType();
+//public static final native int NSFileTypeBlockSpecial();
+//public static final native int NSFileTypeCharacterSpecial();
+//public static final native int NSFileTypeDirectory();
+//public static final native int NSFileTypeRegular();
+//public static final native int NSFileTypeSocket();
+//public static final native int NSFileTypeSymbolicLink();
+//public static final native int NSFileTypeUnknown();
+//public static final native int NSFoundationVersionNumber();
+//public static final native int NSGenericException();
+//public static final native int NSGlobalDomain();
+//public static final native int NSGrammarCorrections();
+//public static final native int NSGrammarRange();
+//public static final native int NSGrammarUserDescription();
+//public static final native int NSGregorianCalendar();
+//public static final native int NSHTTPCookieComment();
+//public static final native int NSHTTPCookieCommentURL();
+//public static final native int NSHTTPCookieDiscard();
+//public static final native int NSHTTPCookieDomain();
+//public static final native int NSHTTPCookieExpires();
+//public static final native int NSHTTPCookieManagerAcceptPolicyChangedNotification();
+//public static final native int NSHTTPCookieManagerCookiesChangedNotification();
+//public static final native int NSHTTPCookieMaximumAge();
+//public static final native int NSHTTPCookieName();
+//public static final native int NSHTTPCookieOriginURL();
+//public static final native int NSHTTPCookiePath();
+//public static final native int NSHTTPCookiePort();
+//public static final native int NSHTTPCookieSecure();
+//public static final native int NSHTTPCookieValue();
+//public static final native int NSHTTPCookieVersion();
+//public static final native int NSHangOnUncaughtException();
+//public static final native int NSHebrewCalendar();
+//public static final native int NSInconsistentArchiveException();
+//public static final native int NSIntegerHashCallBacks();
+//public static final native int NSIntegerMapKeyCallBacks();
+//public static final native int NSIntegerMapValueCallBacks();
+//public static final native int NSInternalInconsistencyException();
+//public static final native int NSInvalidArchiveOperationException();
+//public static final native int NSInvalidArgumentException();
+//public static final native int NSInvalidReceivePortException();
+//public static final native int NSInvalidSendPortException();
+//public static final native int NSInvalidUnarchiveOperationException();
+//public static final native int NSInvocationOperationCancelledException();
+//public static final native int NSInvocationOperationVoidResultException();
+//public static final native int NSIsNilTransformerName();
+//public static final native int NSIsNotNilTransformerName();
+//public static final native int NSIslamicCalendar();
+//public static final native int NSIslamicCivilCalendar();
+//public static final native int NSJapaneseCalendar();
+//public static final native int NSKeepAllocationStatistics();
+//public static final native int NSKeyValueChangeIndexesKey();
+//public static final native int NSKeyValueChangeKindKey();
+//public static final native int NSKeyValueChangeNewKey();
+//public static final native int NSKeyValueChangeNotificationIsPriorKey();
+//public static final native int NSKeyValueChangeOldKey();
+//public static final native int NSKeyedUnarchiveFromDataTransformerName();
+//public static final native int NSLoadedClasses();
+//public static final native int NSLocalNotificationCenterType();
+//public static final native int NSLocaleCalendar();
+//public static final native int NSLocaleCollationIdentifier();
+//public static final native int NSLocaleCountryCode();
+//public static final native int NSLocaleCurrencyCode();
+//public static final native int NSLocaleCurrencySymbol();
+//public static final native int NSLocaleDecimalSeparator();
+//public static final native int NSLocaleExemplarCharacterSet();
+//public static final native int NSLocaleGroupingSeparator();
+//public static final native int NSLocaleIdentifier();
+//public static final native int NSLocaleLanguageCode();
+//public static final native int NSLocaleMeasurementSystem();
+//public static final native int NSLocaleScriptCode();
+//public static final native int NSLocaleUsesMetricSystem();
+//public static final native int NSLocaleVariantCode();
+//public static final native int NSLocalizedDescriptionKey();
+//public static final native int NSLocalizedFailureReasonErrorKey();
+//public static final native int NSLocalizedRecoveryOptionsErrorKey();
+//public static final native int NSLocalizedRecoverySuggestionErrorKey();
+//public static final native int NSMachErrorDomain();
+//public static final native int NSMallocException();
+//public static final native int NSMaximumKeyValueOperator();
+//public static final native int NSMetadataQueryDidFinishGatheringNotification();
+//public static final native int NSMetadataQueryDidStartGatheringNotification();
+//public static final native int NSMetadataQueryDidUpdateNotification();
+//public static final native int NSMetadataQueryGatheringProgressNotification();
+//public static final native int NSMetadataQueryLocalComputerScope();
+//public static final native int NSMetadataQueryNetworkScope();
+//public static final native int NSMetadataQueryResultContentRelevanceAttribute();
+//public static final native int NSMetadataQueryUserHomeScope();
+//public static final native int NSMinimumKeyValueOperator();
+//public static final native int NSNegateBooleanTransformerName();
+//public static final native int NSNetServicesErrorCode();
+//public static final native int NSNetServicesErrorDomain();
+//public static final native int NSNonOwnedPointerHashCallBacks();
+//public static final native int NSNonOwnedPointerMapKeyCallBacks();
+//public static final native int NSNonOwnedPointerMapValueCallBacks();
+//public static final native int NSNonOwnedPointerOrNullMapKeyCallBacks();
+//public static final native int NSNonRetainedObjectHashCallBacks();
+//public static final native int NSNonRetainedObjectMapKeyCallBacks();
+//public static final native int NSNonRetainedObjectMapValueCallBacks();
+//public static final native int NSOSStatusErrorDomain();
+//public static final native int NSObjectHashCallBacks();
+//public static final native int NSObjectInaccessibleException();
+//public static final native int NSObjectMapKeyCallBacks();
+//public static final native int NSObjectMapValueCallBacks();
+//public static final native int NSObjectNotAvailableException();
+//public static final native int NSOldStyleException();
+//public static final native int NSOperationNotSupportedForKeyException();
+//public static final native int NSOwnedObjectIdentityHashCallBacks();
+//public static final native int NSOwnedPointerHashCallBacks();
+//public static final native int NSOwnedPointerMapKeyCallBacks();
+//public static final native int NSOwnedPointerMapValueCallBacks();
+//public static final native int NSPOSIXErrorDomain();
+//public static final native int NSParseErrorException();
+//public static final native int NSPointerToStructHashCallBacks();
+//public static final native int NSPortDidBecomeInvalidNotification();
+//public static final native int NSPortReceiveException();
+//public static final native int NSPortSendException();
+//public static final native int NSPortTimeoutException();
+//public static final native int NSRangeException();
+//public static final native int NSRecoveryAttempterErrorKey();
+//public static final native int NSRegistrationDomain();
+//public static final native int NSRunLoopCommonModes();
+//public static final native int NSStreamDataWrittenToMemoryStreamKey();
+//public static final native int NSStreamFileCurrentOffsetKey();
+//public static final native int NSStreamSOCKSErrorDomain();
+//public static final native int NSStreamSOCKSProxyConfigurationKey();
+//public static final native int NSStreamSOCKSProxyHostKey();
+//public static final native int NSStreamSOCKSProxyPasswordKey();
+//public static final native int NSStreamSOCKSProxyPortKey();
+//public static final native int NSStreamSOCKSProxyUserKey();
+//public static final native int NSStreamSOCKSProxyVersion4();
+//public static final native int NSStreamSOCKSProxyVersion5();
+//public static final native int NSStreamSOCKSProxyVersionKey();
+//public static final native int NSStreamSocketSSLErrorDomain();
+//public static final native int NSStreamSocketSecurityLevelKey();
+//public static final native int NSStreamSocketSecurityLevelNegotiatedSSL();
+//public static final native int NSStreamSocketSecurityLevelNone();
+//public static final native int NSStreamSocketSecurityLevelSSLv2();
+//public static final native int NSStreamSocketSecurityLevelSSLv3();
+//public static final native int NSStreamSocketSecurityLevelTLSv1();
+//public static final native int NSStringEncodingErrorKey();
+//public static final native int NSSumKeyValueOperator();
+//public static final native int NSSystemTimeZoneDidChangeNotification();
+//public static final native int NSTaskDidTerminateNotification();
+//public static final native int NSThreadWillExitNotification();
+//public static final native int NSURLAuthenticationMethodDefault();
+//public static final native int NSURLAuthenticationMethodHTMLForm();
+//public static final native int NSURLAuthenticationMethodHTTPBasic();
+//public static final native int NSURLAuthenticationMethodHTTPDigest();
+//public static final native int NSURLCredentialStorageChangedNotification();
+//public static final native int NSURLErrorDomain();
+//public static final native int NSURLErrorKey();
+//public static final native int NSURLFileScheme();
+//public static final native int NSURLProtectionSpaceFTPProxy();
+//public static final native int NSURLProtectionSpaceHTTPProxy();
+//public static final native int NSURLProtectionSpaceHTTPSProxy();
+//public static final native int NSURLProtectionSpaceSOCKSProxy();
+//public static final native int NSUnarchiveFromDataTransformerName();
+//public static final native int NSUndefinedKeyException();
+//public static final native int NSUnderlyingErrorKey();
+//public static final native int NSUndoManagerCheckpointNotification();
+//public static final native int NSUndoManagerDidOpenUndoGroupNotification();
+//public static final native int NSUndoManagerDidRedoChangeNotification();
+//public static final native int NSUndoManagerDidUndoChangeNotification();
+//public static final native int NSUndoManagerWillCloseUndoGroupNotification();
+//public static final native int NSUndoManagerWillRedoChangeNotification();
+//public static final native int NSUndoManagerWillUndoChangeNotification();
+//public static final native int NSUnionOfArraysKeyValueOperator();
+//public static final native int NSUnionOfObjectsKeyValueOperator();
+//public static final native int NSUnionOfSetsKeyValueOperator();
+//public static final native int NSUserDefaultsDidChangeNotification();
+//public static final native int NSWillBecomeMultiThreadedNotification();
+//public static final native int NSXMLParserErrorDomain();
+//public static final native int NSZeroPoint();
+//public static final native int NSZeroRect();
+//public static final native int NSZeroSize();
+//public static final native int NSZombieEnabled();
+
+/** Functions */
+//public static final native int NSAccessibilityActionDescription(int action);
+//public static final native void NSAccessibilityPostNotification(int element, int notification);
+//public static final native void NSAccessibilityRaiseBadArgumentException(int element, int attribute, int value);
+//public static final native int NSAccessibilityRoleDescription(int role, int subrole);
+//public static final native int NSAccessibilityRoleDescriptionForUIElement(int element);
+//public static final native int NSAccessibilityUnignoredAncestor(int element);
+//public static final native int NSAccessibilityUnignoredChildren(int originalChildren);
+//public static final native int NSAccessibilityUnignoredChildrenForOnlyChild(int originalChild);
+//public static final native int NSAccessibilityUnignoredDescendant(int element);
+//public static final native boolean NSApplicationLoad();
+//public static final native int NSApplicationMain(int argc, int argv);
+//public static final native int NSAvailableWindowDepths();
+//public static final native void NSBeep();
+//public static final native void NSBeginAlertSheet(int title, int defaultButton, int alternateButton, int otherButton, int docWindow, int modalDelegate, int didEndSelector, int didDismissSelector, int contextInfo, int msgFormat);
+//public static final native void NSBeginCriticalAlertSheet(int title, int defaultButton, int alternateButton, int otherButton, int docWindow, int modalDelegate, int didEndSelector, int didDismissSelector, int contextInfo, int msgFormat);
+//public static final native void NSBeginInformationalAlertSheet(int title, int defaultButton, int alternateButton, int otherButton, int docWindow, int modalDelegate, int didEndSelector, int didDismissSelector, int contextInfo, int msgFormat);
+//public static final native int NSBestDepth(int colorSpace, int bps, int bpp, boolean planar, int exactMatch);
+public static final native int NSBitsPerPixelFromDepth(int depth);
+//public static final native int NSBitsPerSampleFromDepth(int depth);
+//public static final native int NSColorSpaceFromDepth(int depth);
+//public static final native int NSConvertGlyphsToPackedGlyphs(int glBuf, int count, int packing, int packedGlyphs);
+//public static final native void NSCopyBits(int srcGState, NSRect srcRect, NSPoint destPoint);
+//public static final native void NSCountWindows(int count);
+//public static final native void NSCountWindowsForContext(int context, int count);
+//public static final native int NSCreateFileContentsPboardType(int fileType);
+//public static final native int NSCreateFilenamePboardType(int fileType);
+//public static final native void NSDisableScreenUpdates();
+//public static final native void NSDottedFrameRect(NSRect aRect);
+//public static final native void NSDrawBitmap(NSRect rect, int width, int height, int bps, int spp, int bpp, int bpr, boolean isPlanar, boolean hasAlpha, int colorSpaceName, int data);
+//public static final native void NSDrawButton(NSRect aRect, NSRect clipRect);
+////public static final native NSRect NSDrawColorTiledRects(NSRect boundsRect, NSRect clipRect, int sides, int colors, int count);
+//public static final native void NSDrawDarkBezel(NSRect aRect, NSRect clipRect);
+//public static final native void NSDrawGrayBezel(NSRect aRect, NSRect clipRect);
+//public static final native void NSDrawGroove(NSRect aRect, NSRect clipRect);
+//public static final native void NSDrawLightBezel(NSRect aRect, NSRect clipRect);
+//public static final native void NSDrawNinePartImage(NSRect frame, int topLeftCorner, int topEdgeFill, int topRightCorner, int leftEdgeFill, int centerFill, int rightEdgeFill, int bottomLeftCorner, int bottomEdgeFill, int bottomRightCorner, int op, float alphaFraction, boolean flipped);
+//public static final native void NSDrawThreePartImage(NSRect frame, int startCap, int centerFill, int endCap, boolean vertical, int op, float alphaFraction, boolean flipped);
+////public static final native NSRect NSDrawTiledRects(NSRect boundsRect, NSRect clipRect, int sides, int grays, int count);
+//public static final native void NSDrawWhiteBezel(NSRect aRect, NSRect clipRect);
+//public static final native void NSDrawWindowBackground(NSRect aRect);
+//public static final native void NSEnableScreenUpdates();
+//public static final native void NSEraseRect(NSRect aRect);
+//public static final native int NSEventMaskFromType(int type);
+//public static final native void NSFrameRect(NSRect aRect);
+//public static final native void NSFrameRectWithWidth(NSRect aRect, float frameWidth);
+//public static final native void NSFrameRectWithWidthUsingOperation(NSRect aRect, float frameWidth, int op);
+//public static final native int NSGetAlertPanel(int title, int msgFormat, int defaultButton, int alternateButton, int otherButton);
+//public static final native int NSGetCriticalAlertPanel(int title, int msgFormat, int defaultButton, int alternateButton, int otherButton);
+//public static final native int NSGetFileType(int pboardType);
+//public static final native int NSGetFileTypes(int pboardTypes);
+//public static final native int NSGetInformationalAlertPanel(int title, int msgFormat, int defaultButton, int alternateButton, int otherButton);
+//public static final native int NSGetWindowServerMemory(int context, int virtualMemory, int windowBackingMemory, int windowDumpString);
+//public static final native void NSHighlightRect(NSRect aRect);
+//public static final native int NSInterfaceStyleForKey(int key, int responder);
+//public static final native boolean NSIsControllerMarker(int object);
+//public static final native int NSNumberOfColorComponents(int colorSpaceName);
+//public static final native void NSOpenGLGetOption(int pname, int param);
+//public static final native void NSOpenGLGetVersion(int major, int minor);
+//public static final native void NSOpenGLSetOption(int pname, int param);
+//public static final native boolean NSPerformService(int itemName, int pboard);
+//public static final native boolean NSPlanarFromDepth(int depth);
+//public static final native int NSReadPixel(NSPoint passedPoint);
+//public static final native void NSRectClip(NSRect aRect);
+//public static final native void NSRectClipList(int rects, int count);
+//public static final native void NSRectFill(NSRect aRect);
+//public static final native void NSRectFillList(int rects, int count);
+//public static final native void NSRectFillListUsingOperation(int rects, int count, int op);
+//public static final native void NSRectFillListWithColors(int rects, int colors, int num);
+//public static final native void NSRectFillListWithColorsUsingOperation(int rects, int colors, int num, int op);
+//public static final native void NSRectFillListWithGrays(int rects, int grays, int num);
+//public static final native void NSRectFillUsingOperation(NSRect aRect, int op);
+//public static final native void NSRegisterServicesProvider(int provider, int name);
+//public static final native void NSReleaseAlertPanel(int panel);
+//public static final native int NSRunAlertPanel(int title, int msgFormat, int defaultButton, int alternateButton, int otherButton);
+//public static final native int NSRunAlertPanelRelativeToWindow(int title, int msgFormat, int defaultButton, int alternateButton, int otherButton, int docWindow);
+//public static final native int NSRunCriticalAlertPanel(int title, int msgFormat, int defaultButton, int alternateButton, int otherButton);
+//public static final native int NSRunCriticalAlertPanelRelativeToWindow(int title, int msgFormat, int defaultButton, int alternateButton, int otherButton, int docWindow);
+//public static final native int NSRunInformationalAlertPanel(int title, int msgFormat, int defaultButton, int alternateButton, int otherButton);
+//public static final native int NSRunInformationalAlertPanelRelativeToWindow(int title, int msgFormat, int defaultButton, int alternateButton, int otherButton, int docWindow);
+//public static final native void NSSetFocusRingStyle(int placement);
+//public static final native int NSSetShowsServicesMenuItem(int itemName, boolean enabled);
+////public static final native void NSShowAnimationEffect(int animationEffect, NSPoint centerLocation, NSSize size, int animationDelegate, int didEndSelector, int contextInfo);
+//public static final native boolean NSShowsServicesMenuItem(int itemName);
+//public static final native void NSUnregisterServicesProvider(int name);
+//public static final native void NSUpdateDynamicServices();
+//public static final native void NSWindowList(int size, int list);
+//public static final native void NSWindowListForContext(int context, int size, int list);
+//public static final native int NSAllHashTableObjects(int table);
+//public static final native int NSAllMapTableKeys(int table);
+//public static final native int NSAllMapTableValues(int table);
+//public static final native int NSAllocateCollectable(int size, int options);
+//public static final native int NSAllocateMemoryPages(int bytes);
+//public static final native int NSAllocateObject(int aClass, int extraBytes, int zone);
+//public static final native int NSClassFromString(int aClassName);
+//public static final native boolean NSCompareHashTables(int table1, int table2);
+//public static final native boolean NSCompareMapTables(int table1, int table2);
+//public static final native boolean NSContainsRect(NSRect aRect, NSRect bRect);
+////public static final native NSSwappedDouble NSConvertHostDoubleToSwapped(double x);
+////public static final native NSSwappedFloat NSConvertHostFloatToSwapped(float x);
+//public static final native double NSConvertSwappedDoubleToHost(NSSwappedDouble x);
+//public static final native float NSConvertSwappedFloatToHost(NSSwappedFloat x);
+//public static final native int NSCopyHashTableWithZone(int table, int zone);
+//public static final native int NSCopyMapTableWithZone(int table, int zone);
+//public static final native void NSCopyMemoryPages(int source, int dest, int bytes);
+//public static final native int NSCopyObject(int object, int extraBytes, int zone);
+//public static final native int NSCountFrames();
+//public static final native int NSCountHashTable(int table);
+//public static final native int NSCountMapTable(int table);
+//public static final native int NSCreateHashTable(NSHashTableCallBacks callBacks, int capacity);
+//public static final native int NSCreateHashTableWithZone(NSHashTableCallBacks callBacks, int capacity, int zone);
+//public static final native int NSCreateMapTable(NSMapTableKeyCallBacks keyCallBacks, NSMapTableValueCallBacks valueCallBacks, int capacity);
+//public static final native int NSCreateMapTableWithZone(NSMapTableKeyCallBacks keyCallBacks, NSMapTableValueCallBacks valueCallBacks, int capacity, int zone);
+//public static final native int NSCreateZone(int startSize, int granularity, boolean canFree);
+//public static final native void NSDeallocateMemoryPages(int ptr, int bytes);
+//public static final native void NSDeallocateObject(int object);
+//public static final native int NSDecimalAdd(int result, int leftOperand, int rightOperand, int roundingMode);
+//public static final native void NSDecimalCompact(int number);
+//public static final native int NSDecimalCompare(int leftOperand, int rightOperand);
+//public static final native void NSDecimalCopy(int destination, int source);
+//public static final native int NSDecimalDivide(int result, int leftOperand, int rightOperand, int roundingMode);
+//public static final native boolean NSDecimalIsNotANumber(int dcm);
+//public static final native int NSDecimalMultiply(int result, int leftOperand, int rightOperand, int roundingMode);
+//public static final native int NSDecimalMultiplyByPowerOf10(int result, int number, short power, int roundingMode);
+//public static final native int NSDecimalNormalize(int number1, int number2, int roundingMode);
+//public static final native int NSDecimalPower(int result, int number, int power, int roundingMode);
+//public static final native void NSDecimalRound(int result, int number, int scale, int roundingMode);
+//public static final native int NSDecimalString(int dcm, int locale);
+//public static final native int NSDecimalSubtract(int result, int leftOperand, int rightOperand, int roundingMode);
+//public static final native boolean NSDecrementExtraRefCountWasZero(int object);
+//public static final native int NSDefaultMallocZone();
+//public static final native void NSDivideRect(NSRect inRect, int slice, int rem, float amount, int edge);
+//public static final native void NSEndHashTableEnumeration(int enumerator);
+//public static final native void NSEndMapTableEnumeration(int enumerator);
+////public static final native NSHashEnumerator NSEnumerateHashTable(int table);
+////public static final native NSMapEnumerator NSEnumerateMapTable(int table);
+//public static final native boolean NSEqualPoints(NSPoint aPoint, NSPoint bPoint);
+//public static final native boolean NSEqualRanges(NSRange range1, NSRange range2);
+//public static final native boolean NSEqualRects(NSRect aRect, NSRect bRect);
+//public static final native boolean NSEqualSizes(NSSize aSize, NSSize bSize);
+//public static final native int NSExtraRefCount(int object);
+//public static final native int NSFileTypeForHFSTypeCode(int hfsFileTypeCode);
+//public static final native int NSFrameAddress(int frame);
+//public static final native void NSFreeHashTable(int table);
+//public static final native void NSFreeMapTable(int table);
+//public static final native int NSFullUserName();
+//public static final native int NSGetSizeAndAlignment(int typePtr, int sizep, int alignp);
+//public static final native int NSGetUncaughtExceptionHandler();
+//public static final native int NSHFSTypeCodeFromFileType(int fileTypeString);
+//public static final native int NSHFSTypeOfFile(int fullFilePath);
+//public static final native int NSHashGet(int table, int pointer);
+//public static final native void NSHashInsert(int table, int pointer);
+//public static final native int NSHashInsertIfAbsent(int table, int pointer);
+//public static final native void NSHashInsertKnownAbsent(int table, int pointer);
+//public static final native void NSHashRemove(int table, int pointer);
+//public static final native float NSHeight(NSRect aRect);
+//public static final native int NSHomeDirectory();
+//public static final native int NSHomeDirectoryForUser(int userName);
+//public static final native int NSHostByteOrder();
+//public static final native void NSIncrementExtraRefCount(int object);
+////public static final native NSRect NSInsetRect(NSRect aRect, float dX, float dY);
+////public static final native NSRect NSIntegralRect(NSRect aRect);
+////public static final native NSRange NSIntersectionRange(NSRange range1, NSRange range2);
+////public static final native NSRect NSIntersectionRect(NSRect aRect, NSRect bRect);
+//public static final native boolean NSIntersectsRect(NSRect aRect, NSRect bRect);
+//public static final native boolean NSIsEmptyRect(NSRect aRect);
+//public static final native boolean NSIsFreedObject(int anObject);
+//public static final native boolean NSLocationInRange(int loc, NSRange range);
+//public static final native void NSLog(int format);
+//public static final native int NSLogPageSize();
+//public static final native void NSLogv(int format, int args);
+//public static final native int NSMakeCollectable(int cf);
+////public static final native NSPoint NSMakePoint(float x, float y);
+////public static final native NSRange NSMakeRange(int loc, int len);
+////public static final native NSRect NSMakeRect(float x, float y, float w, float h);
+////public static final native NSSize NSMakeSize(float w, float h);
+//public static final native int NSMapGet(int table, int key);
+//public static final native void NSMapInsert(int table, int key, int value);
+//public static final native int NSMapInsertIfAbsent(int table, int key, int value);
+//public static final native void NSMapInsertKnownAbsent(int table, int key, int value);
+//public static final native boolean NSMapMember(int table, int key, int originalKey, int value);
+//public static final native void NSMapRemove(int table, int key);
+//public static final native int NSMaxRange(NSRange range);
+//public static final native float NSMaxX(NSRect aRect);
+//public static final native float NSMaxY(NSRect aRect);
+//public static final native float NSMidX(NSRect aRect);
+//public static final native float NSMidY(NSRect aRect);
+//public static final native float NSMinX(NSRect aRect);
+//public static final native float NSMinY(NSRect aRect);
+//public static final native boolean NSMouseInRect(NSPoint aPoint, NSRect aRect, boolean flipped);
+//public static final native int NSNextHashEnumeratorItem(int enumerator);
+//public static final native boolean NSNextMapEnumeratorPair(int enumerator, int key, int value);
+////public static final native NSRect NSOffsetRect(NSRect aRect, float dX, float dY);
+//public static final native int NSOpenStepRootDirectory();
+//public static final native int NSPageSize();
+////public static final native NSPoint NSPointFromCGPoint(CGPoint cgpoint);
+////public static final native NSPoint NSPointFromString(int aString);
+//public static final native boolean NSPointInRect(NSPoint aPoint, NSRect aRect);
+////public static final native CGPoint NSPointToCGPoint(NSPoint nspoint);
+//public static final native int NSProtocolFromString(int namestr);
+////public static final native NSRange NSRangeFromString(int aString);
+//public static final native int NSRealMemoryAvailable();
+//public static final native int NSReallocateCollectable(int ptr, int size, int options);
+//public static final native void NSRecordAllocationEvent(int eventType, int object);
+////public static final native NSRect NSRectFromCGRect(CGRect cgrect);
+////public static final native NSRect NSRectFromString(int aString);
+////public static final native CGRect NSRectToCGRect(NSRect nsrect);
+//public static final native void NSRecycleZone(int zone);
+//public static final native void NSResetHashTable(int table);
+//public static final native void NSResetMapTable(int table);
+//public static final native int NSReturnAddress(int frame);
+//public static final native int NSRoundDownToMultipleOfPageSize(int bytes);
+//public static final native int NSRoundUpToMultipleOfPageSize(int bytes);
+//public static final native int NSSearchPathForDirectoriesInDomains(int directory, int domainMask, boolean expandTilde);
+//public static final native int NSSelectorFromString(int aSelectorName);
+//public static final native void NSSetUncaughtExceptionHandler(int dummy);
+//public static final native void NSSetZoneName(int zone, int name);
+//public static final native boolean NSShouldRetainWithZone(int anObject, int requestedZone);
+////public static final native NSSize NSSizeFromCGSize(CGSize cgsize);
+////public static final native NSSize NSSizeFromString(int aString);
+////public static final native CGSize NSSizeToCGSize(NSSize nssize);
+//public static final native int NSStringFromClass(int aClass);
+//public static final native int NSStringFromHashTable(int table);
+//public static final native int NSStringFromMapTable(int table);
+//public static final native int NSStringFromPoint(NSPoint aPoint);
+//public static final native int NSStringFromProtocol(int proto);
+//public static final native int NSStringFromRange(NSRange range);
+//public static final native int NSStringFromRect(NSRect aRect);
+//public static final native int NSStringFromSelector(int aSelector);
+//public static final native int NSStringFromSize(NSSize aSize);
+//public static final native double NSSwapBigDoubleToHost(NSSwappedDouble x);
+//public static final native float NSSwapBigFloatToHost(NSSwappedFloat x);
+//public static final native int NSSwapBigIntToHost(int x);
+//public static final native long NSSwapBigLongLongToHost(long x);
+//public static final native int NSSwapBigLongToHost(int x);
+//public static final native short NSSwapBigShortToHost(short x);
+////public static final native NSSwappedDouble NSSwapDouble(NSSwappedDouble x);
+////public static final native NSSwappedFloat NSSwapFloat(NSSwappedFloat x);
+////public static final native NSSwappedDouble NSSwapHostDoubleToBig(double x);
+////public static final native NSSwappedDouble NSSwapHostDoubleToLittle(double x);
+////public static final native NSSwappedFloat NSSwapHostFloatToBig(float x);
+////public static final native NSSwappedFloat NSSwapHostFloatToLittle(float x);
+//public static final native int NSSwapHostIntToBig(int x);
+//public static final native int NSSwapHostIntToLittle(int x);
+//public static final native long NSSwapHostLongLongToBig(long x);
+//public static final native long NSSwapHostLongLongToLittle(long x);
+//public static final native int NSSwapHostLongToBig(int x);
+//public static final native int NSSwapHostLongToLittle(int x);
+//public static final native short NSSwapHostShortToBig(short x);
+//public static final native short NSSwapHostShortToLittle(short x);
+//public static final native int NSSwapInt(int inv);
+//public static final native double NSSwapLittleDoubleToHost(NSSwappedDouble x);
+//public static final native float NSSwapLittleFloatToHost(NSSwappedFloat x);
+//public static final native int NSSwapLittleIntToHost(int x);
+//public static final native long NSSwapLittleLongLongToHost(long x);
+//public static final native int NSSwapLittleLongToHost(int x);
+//public static final native short NSSwapLittleShortToHost(short x);
+//public static final native int NSSwapLong(int inv);
+//public static final native long NSSwapLongLong(long inv);
+//public static final native short NSSwapShort(short inv);
+//public static final native int NSTemporaryDirectory();
+//public static final native NSRange NSUnionRange(NSRange range1, NSRange range2);
+//public static final native NSRect NSUnionRect(NSRect aRect, NSRect bRect);
+//public static final native int NSUserName();
+//public static final native float NSWidth(NSRect aRect);
+//public static final native int NSZoneCalloc(int zone, int numElems, int byteSize);
+//public static final native void NSZoneFree(int zone, int ptr);
+//public static final native int NSZoneFromPointer(int ptr);
+//public static final native int NSZoneMalloc(int zone, int size);
+//public static final native int NSZoneName(int zone);
+//public static final native int NSZoneRealloc(int zone, int ptr, int size);
+//public static final native int NXReadNSObjectFromCoder(int decoder);
+
+/** Sends */
+public static final native int objc_msgSend(int id, int sel, int [] arg0, int arg1, int arg2);
+public static final native int objc_msgSend(int id, int sel, NSPoint arg0, int arg1, int arg2);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, NSRange arg1, NSRect arg2);
+public static final native int objc_msgSend(int id, int sel, double arg0, int arg1);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, int arg2, int arg3, int arg4, NSRange arg5, int arg6);
+public static final native void objc_msgSend_stret(NSPoint result, int id, int sel, int arg0, NSRect arg1, int arg2);
+public static final native void objc_msgSend_stret(NSRange result, int id, int sel);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSRect arg1, boolean arg2, int arg3);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, NSRange arg0, int arg1);
+public static final native int objc_msgSend(int id, int sel, NSSize arg0);
+public static final native void objc_msgSend_stret(NSRange result, int id, int sel, int arg0, int arg1, int arg2, int arg3);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, double arg2, int arg3);
+public static final native void objc_msgSend_stret(NSRange result, int id, int sel, NSRect arg0);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, int arg0, NSRect arg1, NSRect arg2, int arg3, NSRange arg4);
+public static final native void objc_msgSend_stret(NSDecimal result, int id, int sel);
+public static final native int objc_msgSend(int id, int sel, NSSize arg0, int arg1, boolean arg2, boolean arg3);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, int arg2, int arg3);
+public static final native void objc_msgSend_stret(NSSize result, int id, int sel, NSRect arg0);
+public static final native int objc_msgSend(int id, int sel, NSPoint arg0, NSRange arg1);
+public static final native int objc_msgSend(int id, int sel, int arg0);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, NSRect arg1, int arg2, float arg3);
+public static final native int objc_msgSend(int id, int sel, NSRange arg0, NSRange arg1);
+public static final native int objc_msgSend(int id, int sel, NSPoint arg0, NSRect arg1, float arg2);
+public static final native int objc_msgSend(int id, int sel, NSRange arg0);
+public static final native int objc_msgSend(int id, int sel, float arg0, int arg1);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, long arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, NSPoint arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, float arg1, int arg2, NSPoint arg3);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSPoint arg1);
+public static final native int objc_msgSend(int id, int sel, NSRange arg0, int arg1, NSRect arg2, NSRange arg3, NSPoint arg4);
+public static final native double objc_msgSend_fpret(int id, int sel, int arg0, float arg1);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, NSPoint arg2, int arg3);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSPoint arg1, int arg2, double arg3, int arg4, int arg5, int arg6, int arg7, float arg8);
+public static final native int objc_msgSend(int id, int sel, NSPoint arg0, float arg1, float arg2, float arg3);
+public static final native double objc_msgSend_fpret(int id, int sel);
+public static final native int objc_msgSend(int id, int sel, NSPoint arg0, int arg1);
+public static final native void objc_msgSend_stret(NSAffineTransformStruct result, int id, int sel);
+public static final native void objc_msgSend_stret(NSRange result, int id, int sel, int arg0, NSRange arg1, NSRange arg2);
+public static final native void objc_msgSend_stret(NSSize result, int id, int sel, int arg0, NSRange arg1, int arg2, int arg3);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, int arg1, int arg2, int arg3, int arg4);
+public static final native void objc_msgSend_stret(NSRange result, int id, int sel, int arg0, int arg1, int arg2);
+public static final native int objc_msgSend(int id, int sel, float arg0, int arg1, float arg2);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, int arg1, int arg2, int arg3);
+public static final native int objc_msgSend(int id, int sel, boolean arg0);
+public static final native int objc_msgSend(int id, int sel, NSDecimal arg0);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, NSRect arg1, int arg2);
+public static final native int objc_msgSend(int id, int sel, NSRange arg0, int arg1, int arg2);
+public static final native void objc_msgSend_stret(NSSize result, int id, int sel);
+public static final native int objc_msgSend(int id, int sel, long arg0, short arg1, boolean arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, int arg2, int arg3, int arg4);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, int arg0, NSRect arg1, NSPoint arg2, int arg3);
+public static final native void objc_msgSend_stret(NSRange result, int id, int sel, int arg0);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, int arg0, NSRect arg1);
+public static final native void objc_msgSend_stret(NSRange result, int id, int sel, NSRange arg0, int arg1, int arg2);
+public static final native int objc_msgSend(int id, int sel, NSPoint arg0, NSRect arg1);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, int arg0, NSRect arg1, int arg2);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, NSSize arg1);
+public static final native int objc_msgSend(int id, int sel, int arg0, float arg1);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, short arg2);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, int arg1, int arg2, boolean arg3);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, NSRect arg2, int arg3);
+public static final native double objc_msgSend_fpret(int id, int sel, NSPoint arg0, int arg1);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, int arg2, short arg3, int arg4);
+public static final native int objc_msgSend(int id, int sel, NSPoint arg0, float arg1, float arg2, float arg3, boolean arg4);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, int arg2, int arg3, int arg4, NSPoint arg5);
+public static final native int objc_msgSend(int id, int sel, boolean arg0, NSRect arg1, int arg2);
+public static final native void objc_msgSend_stret(NSRange result, int id, int sel, NSRange arg0);
+public static final native void objc_msgSend_stret(NSPoint result, int id, int sel, int arg0, int arg1, int arg2, int arg3, int arg4);
+public static final native int objc_msgSend(int id, int sel, double arg0, double arg1);
+public static final native int objc_msgSend(int id, int sel, int arg0, double arg1, int arg2, int arg3, int arg4, boolean arg5);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSRect arg1);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, int arg0, int arg1, NSRect arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, boolean arg1, int arg2, int arg3, int arg4);
+public static final native int objc_msgSend(int id, int sel, float arg0, float arg1);
+public static final native int objc_msgSend(int id, int sel, int arg0, float arg1, int arg2);
+public static final native int objc_msgSend(int id, int sel, NSRange arg0, int arg1, NSRange arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, float arg1, float arg2, float arg3);
+public static final native double objc_msgSend_fpret(int id, int sel, double arg0);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSRange arg1);
+public static final native void objc_msgSend_stret(NSSize result, int id, int sel, boolean arg0);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, NSRange arg2, NSPoint arg3);
+public static final native int objc_msgSend(int id, int sel, NSPoint arg0, int arg1, NSRange arg2);
+public static final native int objc_msgSend(int id, int sel, NSRange arg0, int arg1, int arg2, int arg3, int arg4, int arg5);
+public static final native int objc_msgSend(int id, int sel, NSPoint arg0, NSPoint arg1, int arg2, boolean arg3);
+public static final native int objc_msgSend(int id, int sel, NSRange arg0, NSRange arg1, int arg2, int arg3);
+public static final native int objc_msgSend(int id, int sel, float arg0);
+public static final native int objc_msgSend(int id, int sel, NSPoint arg0, float arg1);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, NSRect arg0, int arg1);
+public static final native int objc_msgSend(int id, int sel, NSPoint arg0);
+public static final native void objc_msgSend_stret(NSPoint result, int id, int sel);
+public static final native void objc_msgSend_stret(NSPoint result, int id, int sel, NSRect arg0);
+public static final native double objc_msgSend_fpret(int id, int sel, float arg0);
+public static final native double objc_msgSend_fpret(int id, int sel, int arg0);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, NSRange arg2, int arg3, NSRange arg4);
+public static final native int objc_msgSend(int id, int sel, double arg0);
+public static final native int objc_msgSend(int id, int sel, NSRange arg0, int arg1, int arg2, int arg3, int arg4);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, NSRect arg0, int arg1, int arg2, int arg3);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, int arg0, int arg1, boolean arg2);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, float arg1, float arg2);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, boolean arg0);
+public static final native int objc_msgSend(int id, int sel, boolean arg0, NSRange arg1);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, int arg2, int arg3, int arg4, boolean arg5, boolean arg6, int arg7, int arg8, int arg9, int arg10);
+public static final native void objc_msgSend_stret(NSPoint result, int id, int sel, int arg0);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, int arg0);
+public static final native int objc_msgSend(int id, int sel, NSRange arg0, NSPoint arg1);
+public static final native int objc_msgSend(int id, int sel, NSRange arg0, boolean arg1, int arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSPoint arg1, int arg2, int arg3);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, float arg1);
+public static final native void objc_msgSend_stret(NSRange result, int id, int sel, int arg0, int arg1, NSRange arg2, int arg3);
+public static final native int objc_msgSend(int id, int sel, NSPoint arg0, NSPoint arg1);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSPoint arg1, NSSize arg2, int arg3, int arg4, int arg5, boolean arg6);
+public static final native int objc_msgSend(int id, int sel, NSSize arg0, NSRange arg1);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, int arg2, boolean arg3, int arg4);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, int arg2);
+public static final native void objc_msgSend_stret(NSPoint result, int id, int sel, NSPoint arg0);
+public static final native int objc_msgSend(int id, int sel, int arg0, boolean arg1, int arg2);
+public static final native double objc_msgSend_fpret(int id, int sel, int arg0, int arg1);
+public static final native void objc_msgSend_stret(NSPoint result, int id, int sel, NSPoint arg0, int arg1);
+public static final native int objc_msgSend(int id, int sel, NSSize arg0, int arg1);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, int arg1, int arg2, int arg3, int arg4, int arg5);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSSize arg1, boolean arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, NSRect arg2, int arg3, int arg4);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, NSRange arg2);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, int arg0, int arg1);
+public static final native void objc_msgSend_stret(NSSize result, int id, int sel, NSSize arg0, boolean arg1, boolean arg2, int arg3);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSRange arg1, NSRange arg2);
+public static final native int objc_msgSend(int id, int sel, float arg0, int arg1, int arg2);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, int arg1, boolean arg2, int arg3);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, boolean arg2, int arg3);
+public static final native int objc_msgSend(int id, int sel, NSRange arg0, int arg1, boolean arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSRect arg1, int arg2, int arg3);
+public static final native double objc_msgSend_fpret(int id, int sel, NSPoint arg0);
+public static final native double objc_msgSend_fpret(int id, int sel, NSRect arg0);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, int arg0, NSRect arg1, NSRect arg2, int arg3);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSPoint arg1, int arg2, double arg3, int arg4, int arg5, short arg6, int arg7, int arg8);
+public static final native int objc_msgSend(int id, int sel, byte arg0);
+public static final native void objc_msgSend_stret(NSRange result, int id, int sel, int arg0, int arg1);
+public static final native double objc_msgSend_fpret(int id, int sel, int arg0, NSRect arg1);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSPoint arg1, int arg2);
+public static final native void objc_msgSend_stret(NSPoint result, int id, int sel, int arg0, short arg1, NSRect arg2);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, NSPoint arg0, NSRect arg1, int arg2, NSRange arg3);
+public static final native void objc_msgSend_stret(NSSize result, int id, int sel, NSSize arg0);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, int arg2, int arg3, int arg4, boolean arg5, boolean arg6, int arg7, int arg8, int arg9);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSRect arg1, int arg2, boolean arg3, int arg4);
+public static final native int objc_msgSend(int id, int sel, long arg0, int arg1);
+public static final native int objc_msgSend(int id, int sel, boolean arg0, boolean arg1);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSRect arg1, int arg2, NSRange arg3, int arg4);
+public static final native int objc_msgSend(int id, int sel, NSRange arg0, int arg1);
+public static final native double objc_msgSend_fpret(int id, int sel, int arg0, int arg1, boolean arg2, float arg3);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, int arg0, NSPoint arg1, NSRect arg2, int arg3, NSRange arg4);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, double arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, NSRange arg2, NSPoint arg3, int arg4, int arg5, NSSize arg6);
+public static final native int objc_msgSend(int id, int sel, int arg0, boolean arg1, int arg2, int arg3);
+public static final native int objc_msgSend(int id, int sel, long arg0);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, int arg1, NSRange arg2);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, int arg1);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, int arg0, int arg1, int arg2);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, int arg1, boolean arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, short arg1, boolean arg2, boolean arg3, boolean arg4, boolean arg5);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, int arg1, int arg2, boolean arg3, int arg4);
+public static final native void objc_msgSend_stret(NSSize result, int id, int sel, NSSize arg0, int arg1);
+public static final native int objc_msgSend(int id, int sel, NSPoint arg0, NSPoint arg1, int arg2);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, int arg1, NSRange arg2, int arg3);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, int arg1, int arg2);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, NSRange arg1, NSRect arg2, float arg3);
+public static final native void objc_msgSend_stret(NSSize result, int id, int sel, int arg0, int arg1);
+public static final native int objc_msgSend(int id, int sel, float arg0, float arg1, float arg2, float arg3);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, NSRange arg0);
+public static final native int objc_msgSend(int id, int sel, NSPoint arg0, NSRect arg1, int arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, boolean arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, float arg2, int arg3, int arg4);
+public static final native int objc_msgSend(int id, int sel, double arg0, int arg1, boolean arg2);
+public static final native int objc_msgSend(int id, int sel);
+public static final native int objc_msgSend(int id, int sel, NSRange arg0, int arg1, float arg2, NSRect arg3, NSRange arg4, NSPoint arg5);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, boolean arg1, boolean arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, int arg2, NSRange arg3, int arg4);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, NSSize arg0, int arg1, int arg2);
+public static final native int objc_msgSend(int id, int sel, NSPoint arg0, float arg1, NSPoint arg2, float arg3, int arg4);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, boolean arg2, int arg3, int arg4);
+public static final native int objc_msgSend(int id, int sel, short arg0);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSRect arg1, int arg2);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, NSRect arg0, NSRect arg1, int arg2, NSRange arg3);
+public static final native int objc_msgSend(int id, int sel, NSRange arg0, int arg1, int arg2, int arg3);
+public static final native int objc_msgSend(int id, int sel, int arg0, boolean arg1, boolean arg2, int arg3, int arg4);
+public static final native void objc_msgSend_stret(NSRange result, int id, int sel, int arg0, int arg1, int arg2, int arg3, boolean arg4);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, NSPoint arg1);
+public static final native void objc_msgSend_stret(NSSize result, int id, int sel, int arg0, NSSize arg1);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, int arg2, NSPoint arg3);
+public static final native double objc_msgSend_fpret(int id, int sel, int arg0, int arg1, float arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, boolean arg1, boolean arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, int arg2, boolean arg3);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, int arg0, int arg1, NSRect arg2, NSPoint arg3, int arg4);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6);
+public static final native void objc_msgSend_stret(NSSize result, int id, int sel, float arg0);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, int arg0, NSRange arg1);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, NSRange arg2, int arg3);
+public static final native void objc_msgSend_stret(NSRange result, int id, int sel, NSRange arg0, int arg1);
+public static final native void objc_msgSend_stret(NSRange result, int id, int sel, int arg0, int arg1, NSRange arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, int arg2, float arg3);
+public static final native void objc_msgSend_stret(NSSize result, int id, int sel, int arg0);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSPoint arg1, boolean arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSRange arg1, int arg2, int arg3);
+public static final native void objc_msgSend_stret(NSPoint result, int id, int sel, int arg0, int arg1, int arg2);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, NSRect arg0);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1);
+public static final native int objc_msgSend(int id, int sel, float arg0, int arg1, int arg2, int arg3);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSRect arg1, int arg2, boolean arg3);
+public static final native int objc_msgSend(int id, int sel, int arg0, boolean arg1);
+public static final native int objc_msgSend(int id, int sel, NSAffineTransformStruct arg0);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, NSRect arg2);
+public static final native int objc_msgSend(int id, int sel, NSPoint arg0, int arg1, float arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, int arg2, NSRange arg3);
+public static final native int objc_msgSend(int id, int sel, boolean arg0, NSRect arg1);
+public static final native int objc_msgSend(int id, int sel, boolean arg0, int arg1);
+public static final native void objc_msgSend_stret(NSRange result, int id, int sel, int arg0, int arg1, int arg2, boolean arg3, int arg4, int arg5);
+public static final native int objc_msgSend(int id, int sel, NSPoint arg0, NSRect arg1, int arg2, float arg3);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSRect arg1, int arg2, int arg3, boolean arg4);
+public static final native double objc_msgSend_fpret(int id, int sel, NSSize arg0);
+public static final native int objc_msgSend(int id, int sel, NSPoint arg0, NSPoint arg1, float arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSPoint arg1, int arg2, double arg3, int arg4, int arg5, int arg6, int arg7, boolean arg8, short arg9);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, int arg2, int arg3, NSRect arg4, float arg5, float arg6, float arg7);
+public static final native int objc_msgSend(int id, int sel, short arg0, int arg1);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSRange arg1, int arg2);
+public static final native void objc_msgSend_stret(NSRange result, int id, int sel, NSRect arg0, int arg1);
+public static final native double objc_msgSend_fpret(int id, int sel, int arg0, float arg1, int arg2);
+public static final native int objc_msgSend(int id, int sel, float arg0, float arg1, float arg2, float arg3, float arg4);
+public static final native int objc_msgSend(int id, int sel, int arg0, short arg1);
+public static final native int objc_msgSend(int id, int sel, NSPoint arg0, NSPoint arg1, NSPoint arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSPoint arg1, int arg2, double arg3, int arg4, int arg5, int arg6, int arg7, int arg8);
+public static final native int objc_msgSend(int id, int sel, double arg0, int arg1, int arg2, int arg3, boolean arg4);
+public static final native int objc_msgSend(int id, int sel, boolean arg0, int arg1, int arg2);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSRange arg1, int arg2, boolean arg3);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSSize arg1);
+public static final native int objc_msgSend(int id, int sel, NSRect arg0, boolean arg1);
+public static final native int objc_msgSend(int id, int sel, int arg0, NSPoint arg1, NSPoint arg2);
+public static final native void objc_msgSend_stret(NSRect result, int id, int sel, NSSize arg0, int arg1);
+public static final native int objc_msgSend(int id, int sel, int arg0, int arg1, float arg2);
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTBox.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTBox.java
new file mode 100644
index 0000000000..d0a40910b3
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTBox.java
@@ -0,0 +1,8 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class SWTBox extends NSBox {
+
+public void setTag(int tag) {
+ OS.objc_msgSend(id, OS.sel_setTag_1, tag);
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTButton.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTButton.java
new file mode 100644
index 0000000000..02bcc2c392
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTButton.java
@@ -0,0 +1,5 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class SWTButton extends NSButton {
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTComboBox.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTComboBox.java
new file mode 100644
index 0000000000..40a88788ec
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTComboBox.java
@@ -0,0 +1,5 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class SWTComboBox extends NSComboBox {
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTDatePicker.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTDatePicker.java
new file mode 100644
index 0000000000..65117c6ea3
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTDatePicker.java
@@ -0,0 +1,5 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class SWTDatePicker extends NSDatePicker {
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTImageView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTImageView.java
new file mode 100644
index 0000000000..07f932f37b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTImageView.java
@@ -0,0 +1,5 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class SWTImageView extends NSImageView {
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTOutlineView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTOutlineView.java
new file mode 100644
index 0000000000..eac43f868a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTOutlineView.java
@@ -0,0 +1,5 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class SWTOutlineView extends NSOutlineView {
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTPanelDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTPanelDelegate.java
new file mode 100644
index 0000000000..2d1f2a0dae
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTPanelDelegate.java
@@ -0,0 +1,21 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class SWTPanelDelegate extends NSObject {
+
+public SWTPanelDelegate() {
+ super(0);
+}
+
+public SWTPanelDelegate(int id) {
+ super(id);
+}
+
+public int tag() {
+ return OS.objc_msgSend(id, OS.sel_tag);
+}
+
+public void setTag(int tag) {
+ OS.objc_msgSend(id, OS.sel_setTag_1, tag);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTPopUpButton.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTPopUpButton.java
new file mode 100644
index 0000000000..8ab754f8e8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTPopUpButton.java
@@ -0,0 +1,5 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class SWTPopUpButton extends NSPopUpButton {
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTProgressIndicator.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTProgressIndicator.java
new file mode 100644
index 0000000000..92fc443241
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTProgressIndicator.java
@@ -0,0 +1,8 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class SWTProgressIndicator extends NSProgressIndicator {
+
+public void setTag(int tag) {
+ OS.objc_msgSend(id, OS.sel_setTag_1, tag);
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTScrollView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTScrollView.java
new file mode 100644
index 0000000000..4286a6190e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTScrollView.java
@@ -0,0 +1,17 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class SWTScrollView extends NSScrollView {
+
+public SWTScrollView() {
+ super(0);
+}
+
+public SWTScrollView(int id) {
+ super(id);
+}
+
+public void setTag(int tag) {
+ OS.objc_msgSend(id, OS.sel_setTag_1, tag);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTScroller.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTScroller.java
new file mode 100644
index 0000000000..4d162c2200
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTScroller.java
@@ -0,0 +1,5 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class SWTScroller extends NSScroller {
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTSlider.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTSlider.java
new file mode 100644
index 0000000000..9dbfd826ef
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTSlider.java
@@ -0,0 +1,5 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class SWTSlider extends NSSlider {
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTStepper.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTStepper.java
new file mode 100644
index 0000000000..43120d2efc
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTStepper.java
@@ -0,0 +1,5 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class SWTStepper extends NSStepper {
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTabView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTabView.java
new file mode 100644
index 0000000000..9d15d59cba
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTabView.java
@@ -0,0 +1,16 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class SWTTabView extends NSTabView {
+
+public SWTTabView() {
+ super(0);
+}
+
+public SWTTabView(int id) {
+ super(id);
+}
+
+public void setTag(int tag) {
+ OS.objc_msgSend(id, OS.sel_setTag_1, tag);
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTableView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTableView.java
new file mode 100644
index 0000000000..a2b4aef3c9
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTableView.java
@@ -0,0 +1,5 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class SWTTableView extends NSTableView {
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTextView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTextView.java
new file mode 100644
index 0000000000..907f5127da
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTextView.java
@@ -0,0 +1,8 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class SWTTextView extends NSTextView {
+
+public void setTag(int tag) {
+ OS.objc_msgSend(id, OS.sel_setTag_1, tag);
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTreeItem.java
new file mode 100644
index 0000000000..d46393f1ac
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTTreeItem.java
@@ -0,0 +1,12 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class SWTTreeItem extends NSObject {
+
+public int tag() {
+ return OS.objc_msgSend(id, OS.sel_tag);
+}
+
+public void setTag(int tag) {
+ OS.objc_msgSend(id, OS.sel_setTag_1, tag);
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTView.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTView.java
new file mode 100644
index 0000000000..ca277466f7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTView.java
@@ -0,0 +1,18 @@
+package org.eclipse.swt.internal.cocoa;
+
+
+public class SWTView extends NSView {
+
+public SWTView() {
+ super(0);
+}
+
+public SWTView(int id) {
+ super(id);
+}
+
+public void setTag(int tag) {
+ OS.objc_msgSend(id, OS.sel_setTag_1, tag);
+}
+
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTWindowDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTWindowDelegate.java
new file mode 100644
index 0000000000..6fa7fb773a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/SWTWindowDelegate.java
@@ -0,0 +1,21 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class SWTWindowDelegate extends NSObject {
+
+public SWTWindowDelegate() {
+ super(0);
+}
+
+public SWTWindowDelegate(int id) {
+ super(id);
+}
+
+public int tag() {
+ return OS.objc_msgSend(id, OS.sel_tag);
+}
+
+public void setTag(int tag) {
+ OS.objc_msgSend(id, OS.sel_setTag_1, tag);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/id.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/id.java
new file mode 100644
index 0000000000..db123c662c
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/id.java
@@ -0,0 +1,12 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class id {
+public int id;
+
+public id() {
+}
+
+public id(int id) {
+ this.id = id;
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/objc_super.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/objc_super.java
new file mode 100644
index 0000000000..7b2273f5f7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/objc_super.java
@@ -0,0 +1,6 @@
+package org.eclipse.swt.internal.cocoa;
+
+public class objc_super {
+public int receiver;
+public int cls;
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/PrintDialog.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/PrintDialog.java
new file mode 100755
index 0000000000..ca47c8648b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/PrintDialog.java
@@ -0,0 +1,305 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.printing;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.internal.carbon.OS;
+
+/**
+ * Instances of this class allow the user to select
+ * a printer and various print-related parameters
+ * prior to starting a print job.
+ * <p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ */
+public class PrintDialog extends Dialog {
+ int scope = PrinterData.ALL_PAGES;
+ int startPage = 1, endPage = 1;
+ boolean printToFile = false;
+
+/**
+ * Constructs a new instance of this class given only its parent.
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public PrintDialog (Shell parent) {
+ this (parent, SWT.PRIMARY_MODAL);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public PrintDialog (Shell parent, int style) {
+ super (parent, style);
+ checkSubclass ();
+}
+
+/**
+ * Makes the receiver visible and brings it to the front
+ * of the display.
+ *
+ * @return a printer data object describing the desired print job parameters
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public PrinterData open() {
+ int[] buffer = new int[1];
+ if (OS.PMCreateSession(buffer) == OS.noErr) {
+ int printSession = buffer[0];
+ if (OS.PMCreatePrintSettings(buffer) == OS.noErr) {
+ int printSettings = buffer[0];
+ OS.PMSessionDefaultPrintSettings(printSession, printSettings);
+ if (OS.PMCreatePageFormat(buffer) == OS.noErr) {
+ int pageFormat = buffer[0];
+ OS.PMSessionDefaultPageFormat(printSession, pageFormat);
+ OS.PMSessionSetDestination(printSession, printSettings, (short) (printToFile ? OS.kPMDestinationFile : OS.kPMDestinationPrinter), 0, 0);
+ if (scope == PrinterData.PAGE_RANGE) {
+ OS.PMSetFirstPage(printSettings, startPage, false);
+ OS.PMSetLastPage(printSettings, endPage, false);
+ OS.PMSetPageRange(printSettings, startPage, endPage);
+ } else {
+ OS.PMSetPageRange(printSettings, 1, OS.kPMPrintAllPages);
+ }
+ boolean[] accepted = new boolean [1];
+ OS.PMSessionPageSetupDialog(printSession, pageFormat, accepted);
+ if (accepted[0]) {
+ OS.PMSessionPrintDialog(printSession, printSettings, pageFormat, accepted);
+ if (accepted[0]) {
+ short[] destType = new short[1];
+ OS.PMSessionGetDestinationType(printSession, printSettings, destType);
+ String name = Printer.getCurrentPrinterName(printSession);
+ String driver = Printer.DRIVER;
+ switch (destType[0]) {
+ case OS.kPMDestinationFax: driver = Printer.FAX_DRIVER; break;
+ case OS.kPMDestinationFile: driver = Printer.FILE_DRIVER; break;
+ case OS.kPMDestinationPreview: driver = Printer.PREVIEW_DRIVER; break;
+ case OS.kPMDestinationPrinter: driver = Printer.PRINTER_DRIVER; break;
+ }
+ PrinterData data = new PrinterData(driver, name);
+ if (destType[0] == OS.kPMDestinationFile) {
+ data.printToFile = true;
+ OS.PMSessionCopyDestinationLocation(printSession, printSettings, buffer);
+ int fileName = OS.CFURLCopyFileSystemPath(buffer[0],OS.kCFURLPOSIXPathStyle);
+ OS.CFRelease(buffer[0]);
+ data.fileName = Printer.getString(fileName);
+ OS.CFRelease(fileName);
+ }
+ OS.PMGetCopies(printSettings, buffer);
+ data.copyCount = buffer[0];
+ OS.PMGetFirstPage(printSettings, buffer);
+ data.startPage = buffer[0];
+ OS.PMGetLastPage(printSettings, buffer);
+ data.endPage = buffer[0];
+ OS.PMGetPageRange(printSettings, null, buffer);
+ if (data.startPage == 1 && data.endPage == OS.kPMPrintAllPages) {
+ data.scope = PrinterData.ALL_PAGES;
+ } else {
+ data.scope = PrinterData.PAGE_RANGE;
+ }
+ boolean[] collate = new boolean[1];
+ OS.PMGetCollate(printSettings, collate);
+ data.collate = collate[0];
+
+ /* Serialize settings */
+ int[] flatSettings = new int[1];
+ OS.PMFlattenPrintSettings(printSettings, flatSettings);
+ int[] flatFormat = new int[1];
+ OS.PMFlattenPageFormat(pageFormat, flatFormat);
+ int settingsLength = OS.GetHandleSize (flatSettings[0]);
+ int formatLength = OS.GetHandleSize (flatFormat[0]);
+ byte[] otherData = data.otherData = new byte[settingsLength + formatLength + 8];
+ int offset = 0;
+ offset = Printer.packData(flatSettings[0], otherData, offset);
+ offset = Printer.packData(flatFormat[0], otherData, offset);
+ OS.DisposeHandle(flatSettings[0]);
+ OS.DisposeHandle(flatFormat[0]);
+
+ scope = data.scope;
+ startPage = data.startPage;
+ endPage = data.endPage;
+ printToFile = data.printToFile;
+ return data;
+ }
+ }
+ OS.PMRelease(pageFormat);
+ }
+ OS.PMRelease(printSettings);
+ }
+ OS.PMRelease(printSession);
+ }
+ return null;
+}
+
+/**
+ * Returns the print job scope that the user selected
+ * before pressing OK in the dialog. This will be one
+ * of the following values:
+ * <dl>
+ * <dt><code>ALL_PAGES</code></dt>
+ * <dd>Print all pages in the current document</dd>
+ * <dt><code>PAGE_RANGE</code></dt>
+ * <dd>Print the range of pages specified by startPage and endPage</dd>
+ * <dt><code>SELECTION</code></dt>
+ * <dd>Print the current selection</dd>
+ * </dl>
+ *
+ * @return the scope setting that the user selected
+ */
+public int getScope() {
+ return scope;
+}
+
+/**
+ * Sets the scope of the print job. The user will see this
+ * setting when the dialog is opened. This can have one of
+ * the following values:
+ * <dl>
+ * <dt><code>ALL_PAGES</code></dt>
+ * <dd>Print all pages in the current document</dd>
+ * <dt><code>PAGE_RANGE</code></dt>
+ * <dd>Print the range of pages specified by startPage and endPage</dd>
+ * <dt><code>SELECTION</code></dt>
+ * <dd>Print the current selection</dd>
+ * </dl>
+ *
+ * @param scope the scope setting when the dialog is opened
+ */
+public void setScope(int scope) {
+ this.scope = scope;
+}
+
+/**
+ * Returns the start page setting that the user selected
+ * before pressing OK in the dialog.
+ * <p>
+ * This value can be from 1 to the maximum number of pages for the platform.
+ * Note that it is only valid if the scope is <code>PAGE_RANGE</code>.
+ * </p>
+ *
+ * @return the start page setting that the user selected
+ */
+public int getStartPage() {
+ return startPage;
+}
+
+/**
+ * Sets the start page that the user will see when the dialog
+ * is opened.
+ * <p>
+ * This value can be from 1 to the maximum number of pages for the platform.
+ * Note that it is only valid if the scope is <code>PAGE_RANGE</code>.
+ * </p>
+ *
+ * @param startPage the startPage setting when the dialog is opened
+ */
+public void setStartPage(int startPage) {
+ this.startPage = startPage;
+}
+
+/**
+ * Returns the end page setting that the user selected
+ * before pressing OK in the dialog.
+ * <p>
+ * This value can be from 1 to the maximum number of pages for the platform.
+ * Note that it is only valid if the scope is <code>PAGE_RANGE</code>.
+ * </p>
+ *
+ * @return the end page setting that the user selected
+ */
+public int getEndPage() {
+ return endPage;
+}
+
+/**
+ * Sets the end page that the user will see when the dialog
+ * is opened.
+ * <p>
+ * This value can be from 1 to the maximum number of pages for the platform.
+ * Note that it is only valid if the scope is <code>PAGE_RANGE</code>.
+ * </p>
+ *
+ * @param endPage the end page setting when the dialog is opened
+ */
+public void setEndPage(int endPage) {
+ this.endPage = endPage;
+}
+
+/**
+ * Returns the 'Print to file' setting that the user selected
+ * before pressing OK in the dialog.
+ *
+ * @return the 'Print to file' setting that the user selected
+ */
+public boolean getPrintToFile() {
+ return printToFile;
+}
+
+/**
+ * Sets the 'Print to file' setting that the user will see
+ * when the dialog is opened.
+ *
+ * @param printToFile the 'Print to file' setting when the dialog is opened
+ */
+public void setPrintToFile(boolean printToFile) {
+ this.printToFile = printToFile;
+}
+
+protected void checkSubclass() {
+ String name = getClass().getName();
+ String validName = PrintDialog.class.getName();
+ if (!validName.equals(name)) {
+ SWT.error(SWT.ERROR_INVALID_SUBCLASS);
+ }
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/Printer.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/Printer.java
new file mode 100755
index 0000000000..daf802a772
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/cocoa/org/eclipse/swt/printing/Printer.java
@@ -0,0 +1,637 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.printing;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.internal.carbon.CFRange;
+import org.eclipse.swt.internal.carbon.OS;
+import org.eclipse.swt.internal.carbon.PMRect;
+import org.eclipse.swt.internal.carbon.PMResolution;
+import org.eclipse.swt.internal.carbon.Rect;
+
+/**
+ * Instances of this class are used to print to a printer.
+ * Applications create a GC on a printer using <code>new GC(printer)</code>
+ * and then draw on the printer GC using the usual graphics calls.
+ * <p>
+ * A <code>Printer</code> object may be constructed by providing
+ * a <code>PrinterData</code> object which identifies the printer.
+ * A <code>PrintDialog</code> presents a print dialog to the user
+ * and returns an initialized instance of <code>PrinterData</code>.
+ * Alternatively, calling <code>new Printer()</code> will construct a
+ * printer object for the user's default printer.
+ * </p><p>
+ * Application code must explicitly invoke the <code>Printer.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ *
+ * @see PrinterData
+ * @see PrintDialog
+ */
+public final class Printer extends Device {
+ PrinterData data;
+ int printSession, printSettings, pageFormat;
+ boolean inPage, isGCCreated;
+ int context;
+ int colorspace;
+
+ static final String DRIVER = "Mac";
+ static final String PRINTER_DRIVER = "Printer";
+ static final String FILE_DRIVER = "File";
+ static final String PREVIEW_DRIVER = "Preview";
+ static final String FAX_DRIVER = "Fax";
+
+/**
+ * Returns an array of <code>PrinterData</code> objects
+ * representing all available printers.
+ *
+ * @return the list of available printers
+ */
+public static PrinterData[] getPrinterList() {
+ PrinterData[] result = null;
+ int[] printSession = new int[1];
+ OS.PMCreateSession(printSession);
+ if (printSession[0] != 0) {
+ int[] printerList = new int[1], currentIndex = new int[1], currentPrinter = new int[1];
+ OS.PMSessionCreatePrinterList(printSession[0], printerList, currentIndex, currentPrinter);
+ if (printerList[0] != 0) {
+ int count = OS.CFArrayGetCount(printerList[0]);
+ result = new PrinterData[count];
+ for (int i=0; i<count; i++) {
+ String name = getString(OS.CFArrayGetValueAtIndex(printerList[0], i));
+ result[i] = new PrinterData(DRIVER, name);
+ }
+ OS.CFRelease(printerList[0]);
+ }
+ OS.PMRelease(printSession[0]);
+ }
+ return result == null ? new PrinterData[0] : result;
+}
+
+/**
+ * Returns a <code>PrinterData</code> object representing
+ * the default printer or <code>null</code> if there is no
+ * printer available on the System.
+ *
+ * @return the default printer data or null
+ *
+ * @since 2.1
+ */
+public static PrinterData getDefaultPrinterData() {
+ PrinterData result = null;
+ int[] printSession = new int[1];
+ OS.PMCreateSession(printSession);
+ if (printSession[0] != 0) {
+ String name = getCurrentPrinterName(printSession[0]);
+ if (name != null) result = new PrinterData(DRIVER, name);
+ OS.PMRelease(printSession[0]);
+ }
+ return result;
+}
+static String getCurrentPrinterName(int printSession) {
+ String result = null;
+ int[] printerList = new int[1], currentIndex = new int[1], currentPrinter = new int[1];
+ OS.PMSessionCreatePrinterList(printSession, printerList, currentIndex, currentPrinter);
+ if (printerList[0] != 0) {
+ int count = OS.CFArrayGetCount(printerList[0]);
+ if (currentIndex[0] >= 0 && currentIndex[0] < count) {
+ result = getString(OS.CFArrayGetValueAtIndex(printerList[0], currentIndex[0]));
+ }
+ OS.CFRelease(printerList[0]);
+ }
+ return result;
+}
+static String getString(int ptr) {
+ int length = OS.CFStringGetLength(ptr);
+ char [] buffer = new char[length];
+ CFRange range = new CFRange();
+ range.length = length;
+ OS.CFStringGetCharacters(ptr, range, buffer);
+ return new String(buffer);
+}
+static int packData(int handle, byte[] buffer, int offset) {
+ int length = OS.GetHandleSize (handle);
+ buffer[offset++] = (byte)((length & 0xFF) >> 0);
+ buffer[offset++] = (byte)((length & 0xFF00) >> 8);
+ buffer[offset++] = (byte)((length & 0xFF0000) >> 16);
+ buffer[offset++] = (byte)((length & 0xFF000000) >> 24);
+ int [] ptr = new int [1];
+ OS.HLock(handle);
+ OS.memmove(ptr, handle, 4);
+ byte[] buffer1 = new byte[length];
+ OS.memmove(buffer1, ptr [0], length);
+ OS.HUnlock(handle);
+ System.arraycopy(buffer1, 0, buffer, offset, length);
+ return offset + length;
+}
+static int unpackData(int[] handle, byte[] buffer, int offset) {
+ int length =
+ ((buffer[offset++] & 0xFF) << 0) |
+ ((buffer[offset++] & 0xFF) << 8) |
+ ((buffer[offset++] & 0xFF) << 16) |
+ ((buffer[offset++] & 0xFF) << 24);
+ handle[0] = OS.NewHandle(length);
+ if (handle[0] == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+ int[] ptr = new int[1];
+ OS.HLock(handle[0]);
+ OS.memmove(ptr, handle[0], 4);
+ byte[] buffer1 = new byte[length];
+ System.arraycopy(buffer, offset, buffer1, 0, length);
+ OS.memmove(ptr[0], buffer1, length);
+ OS.HUnlock(handle[0]);
+ return offset + length;
+}
+
+/**
+ * Constructs a new printer representing the default printer.
+ * <p>
+ * You must dispose the printer when it is no longer required.
+ * </p>
+ *
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES - if there are no valid printers
+ * </ul>
+ *
+ * @see Device#dispose
+ */
+public Printer() {
+ this(null);
+}
+
+/**
+ * Constructs a new printer given a <code>PrinterData</code>
+ * object representing the desired printer.
+ * <p>
+ * You must dispose the printer when it is no longer required.
+ * </p>
+ *
+ * @param data the printer data for the specified printer
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the specified printer data does not represent a valid printer
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES - if there are no valid printers
+ * </ul>
+ *
+ * @see Device#dispose
+ */
+public Printer(PrinterData data) {
+ super (checkNull(data));
+}
+
+/**
+ * Given a desired <em>client area</em> for the receiver
+ * (as described by the arguments), returns the bounding
+ * rectangle which would be required to produce that client
+ * area.
+ * <p>
+ * In other words, it returns a rectangle such that, if the
+ * receiver's bounds were set to that rectangle, the area
+ * of the receiver which is capable of displaying data
+ * (that is, not covered by the "trimmings") would be the
+ * rectangle described by the arguments (relative to the
+ * receiver's parent).
+ * </p><p>
+ * Note that there is no setBounds for a printer. This method
+ * is usually used by passing in the client area (the 'printable
+ * area') of the printer. It can also be useful to pass in 0, 0, 0, 0.
+ * </p>
+ *
+ * @param x the desired x coordinate of the client area
+ * @param y the desired y coordinate of the client area
+ * @param width the desired width of the client area
+ * @param height the desired height of the client area
+ * @return the required bounds to produce the given client area
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getBounds
+ * @see #getClientArea
+ */
+public Rectangle computeTrim(int x, int y, int width, int height) {
+ checkDevice();
+ PMRect pageRect = new PMRect();
+ PMRect paperRect = new PMRect();
+ OS.PMGetAdjustedPageRect(pageFormat, pageRect);
+ OS.PMGetAdjustedPaperRect(pageFormat, paperRect);
+ return new Rectangle(x+(int)paperRect.left, y+(int)paperRect.top, width+(int)(paperRect.right-pageRect.right), height+(int)(paperRect.bottom-pageRect.bottom));
+}
+
+/**
+ * Creates the printer handle.
+ * This method is called internally by the instance creation
+ * mechanism of the <code>Device</code> class.
+ * @param deviceData the device data
+ */
+protected void create(DeviceData deviceData) {
+ data = (PrinterData)deviceData;
+
+ int[] buffer = new int[1];
+ if (OS.PMCreateSession(buffer) != OS.noErr) SWT.error(SWT.ERROR_NO_HANDLES);
+ printSession = buffer[0];
+ if (printSession == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+
+ if (data.otherData != null) {
+ /* Deserialize settings */
+ int offset = 0;
+ byte[] otherData = data.otherData;
+ offset = unpackData(buffer, otherData, offset);
+ int flatSettings = buffer[0];
+ offset = unpackData(buffer, otherData, offset);
+ int flatFormat = buffer[0];
+ if (OS.PMUnflattenPrintSettings(flatSettings, buffer) != OS.noErr) SWT.error(SWT.ERROR_NO_HANDLES);
+ printSettings = buffer[0];
+ if (printSettings == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+ if (OS.PMUnflattenPageFormat(flatFormat, buffer) != OS.noErr) SWT.error(SWT.ERROR_NO_HANDLES);
+ pageFormat = buffer[0];
+ if (pageFormat == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+ OS.DisposeHandle(flatSettings);
+ OS.DisposeHandle(flatFormat);
+ } else {
+ /* Create default settings */
+ if (OS.PMCreatePrintSettings(buffer) != OS.noErr) SWT.error(SWT.ERROR_NO_HANDLES);
+ printSettings = buffer[0];
+ if (printSettings == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+ OS.PMSessionDefaultPrintSettings(printSession, printSettings);
+ if (OS.PMCreatePageFormat(buffer) != OS.noErr) SWT.error(SWT.ERROR_NO_HANDLES);
+ pageFormat = buffer[0];
+ if (pageFormat == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+ OS.PMSessionDefaultPageFormat(printSession, pageFormat);
+ }
+
+ if (PREVIEW_DRIVER.equals(data.driver)) {
+ OS.PMSessionSetDestination(printSession, printSettings, (short) OS.kPMDestinationPreview, 0, 0);
+ }
+ String name = data.name;
+ char[] buffer1 = new char[name.length ()];
+ name.getChars(0, buffer1.length, buffer1, 0);
+ int ptr = OS.CFStringCreateWithCharacters(OS.kCFAllocatorDefault, buffer1, buffer1.length);
+ if (ptr != 0) {
+ OS.PMSessionSetCurrentPrinter(printSession, ptr);
+ OS.CFRelease(ptr);
+ }
+
+ OS.PMSessionValidatePrintSettings(printSession, printSettings, null);
+ OS.PMSessionValidatePageFormat(printSession, pageFormat, null);
+
+ int graphicsContextsArray = OS.CFArrayCreateMutable(OS.kCFAllocatorDefault, 1, 0);
+ if (graphicsContextsArray != 0) {
+ OS.CFArrayAppendValue(graphicsContextsArray, OS.kPMGraphicsContextCoreGraphics());
+ OS.PMSessionSetDocumentFormatGeneration(printSession, OS.kPMDocumentFormatPDF(), graphicsContextsArray, 0);
+ OS.CFRelease(graphicsContextsArray);
+ }
+}
+
+/**
+ * Destroys the printer handle.
+ * This method is called internally by the dispose
+ * mechanism of the <code>Device</code> class.
+ */
+protected void destroy() {
+ if (pageFormat != 0) OS.PMRelease(pageFormat);
+ pageFormat = 0;
+ if (printSettings != 0) OS.PMRelease(printSettings);
+ printSettings = 0;
+ if (printSession != 0) OS.PMRelease(printSession);
+ printSession = 0;
+}
+
+/**
+ * Invokes platform specific functionality to allocate a new GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Printer</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param data the platform specific GC data
+ * @return the platform specific GC handle
+ */
+public int internal_new_GC(GCData data) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ setupNewPage();
+ if (data != null) {
+ if (isGCCreated) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ data.device = this;
+ data.background = getSystemColor(SWT.COLOR_WHITE).handle;
+ data.foreground = getSystemColor(SWT.COLOR_BLACK).handle;
+ data.font = getSystemFont ();
+ PMRect paperRect= new PMRect();
+ OS.PMGetAdjustedPaperRect(pageFormat, paperRect);
+ Rect portRect = new Rect();
+ portRect.left = (short)paperRect.left;
+ portRect.right = (short)paperRect.right;
+ portRect.top = (short)paperRect.top;
+ portRect.bottom = (short)paperRect.bottom;
+ data.portRect = portRect;
+ isGCCreated = true;
+ }
+ return context;
+}
+
+protected void init () {
+ super.init();
+ colorspace = OS.CGColorSpaceCreateDeviceRGB();
+ if (colorspace == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+}
+
+/**
+ * Invokes platform specific functionality to dispose a GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Printer</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param hDC the platform specific GC handle
+ * @param data the platform specific GC data
+ */
+public void internal_dispose_GC(int context, GCData data) {
+ if (data != null) isGCCreated = false;
+}
+
+/**
+ * Releases any internal state prior to destroying this printer.
+ * This method is called internally by the dispose
+ * mechanism of the <code>Device</code> class.
+ */
+protected void release () {
+ if (colorspace != 0) OS.CGColorSpaceRelease(colorspace);
+ colorspace = 0;
+ super.release();
+}
+
+/**
+ * Starts a print job and returns true if the job started successfully
+ * and false otherwise.
+ * <p>
+ * This must be the first method called to initiate a print job,
+ * followed by any number of startPage/endPage calls, followed by
+ * endJob. Calling startPage, endPage, or endJob before startJob
+ * will result in undefined behavior.
+ * </p>
+ *
+ * @param jobName the name of the print job to start
+ * @return true if the job started successfully and false otherwise.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #startPage
+ * @see #endPage
+ * @see #endJob
+ */
+public boolean startJob(String jobName) {
+ checkDevice();
+ if (jobName != null && jobName.length() != 0) {
+ char[] buffer = new char[jobName.length ()];
+ jobName.getChars(0, buffer.length, buffer, 0);
+ int ptr = OS.CFStringCreateWithCharacters(OS.kCFAllocatorDefault, buffer, buffer.length);
+ if (ptr != 0) {
+ OS.PMSetJobNameCFString(printSettings, ptr);
+ OS.CFRelease (ptr);
+ }
+ }
+ return OS.PMSessionBeginDocumentNoDialog(printSession, printSettings, pageFormat) == OS.noErr;
+}
+
+/**
+ * Ends the current print job.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #startJob
+ * @see #startPage
+ * @see #endPage
+ */
+public void endJob() {
+ checkDevice();
+ if (inPage) {
+ OS.PMSessionEndPageNoDialog(printSession);
+ inPage = false;
+ }
+ OS.PMSessionEndDocumentNoDialog(printSession);
+ context = 0;
+}
+
+/**
+ * Cancels a print job in progress.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void cancelJob() {
+ checkDevice();
+ OS.PMSessionSetError(printSession, OS.kPMCancel);
+ if (inPage) {
+ OS.PMSessionEndPageNoDialog(printSession);
+ inPage = false;
+ }
+ OS.PMSessionEndDocumentNoDialog(printSession);
+ context = 0;
+}
+
+static DeviceData checkNull (PrinterData data) {
+ if (data == null) data = new PrinterData();
+ if (data.driver == null || data.name == null) {
+ PrinterData defaultPrinter = getDefaultPrinterData();
+ if (defaultPrinter == null) SWT.error(SWT.ERROR_NO_HANDLES);
+ data.driver = defaultPrinter.driver;
+ data.name = defaultPrinter.name;
+ }
+ return data;
+}
+
+/**
+ * Starts a page and returns true if the page started successfully
+ * and false otherwise.
+ * <p>
+ * After calling startJob, this method may be called any number of times
+ * along with a matching endPage.
+ * </p>
+ *
+ * @return true if the page started successfully and false otherwise.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #endPage
+ * @see #startJob
+ * @see #endJob
+ */
+public boolean startPage() {
+ checkDevice();
+ if (OS.PMSessionError(printSession) != OS.noErr) return false;
+ setupNewPage();
+ return context != 0;
+}
+
+/**
+ * Ends the current page.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #startPage
+ * @see #startJob
+ * @see #endJob
+ */
+public void endPage() {
+ checkDevice();
+ if (inPage) {
+ OS.PMSessionEndPageNoDialog(printSession);
+ inPage = false;
+ }
+}
+
+/**
+ * Returns a point whose x coordinate is the horizontal
+ * dots per inch of the printer, and whose y coordinate
+ * is the vertical dots per inch of the printer.
+ *
+ * @return the horizontal and vertical DPI
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Point getDPI() {
+ checkDevice();
+ PMResolution resolution = new PMResolution();
+ OS.PMGetResolution(pageFormat, resolution);
+ return new Point((int)resolution.hRes, (int)resolution.vRes);
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location.
+ * For a printer, this is the size of a physical page, in pixels.
+ *
+ * @return the bounding rectangle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getClientArea
+ * @see #computeTrim
+ */
+public Rectangle getBounds() {
+ checkDevice();
+ PMRect paperRect = new PMRect();
+ OS.PMGetAdjustedPaperRect(pageFormat, paperRect);
+ return new Rectangle(0, 0, (int)(paperRect.right-paperRect.left), (int)(paperRect.bottom-paperRect.top));
+}
+
+/**
+ * Returns a rectangle which describes the area of the
+ * receiver which is capable of displaying data.
+ * For a printer, this is the size of the printable area
+ * of a page, in pixels.
+ *
+ * @return the client area
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getBounds
+ * @see #computeTrim
+ */
+public Rectangle getClientArea() {
+ checkDevice();
+ PMRect pageRect = new PMRect();
+ OS.PMGetAdjustedPageRect(pageFormat, pageRect);
+ return new Rectangle(0, 0, (int)(pageRect.right-pageRect.left), (int)(pageRect.bottom-pageRect.top));
+}
+
+/**
+ * Returns a <code>PrinterData</code> object representing the
+ * target printer for this print job.
+ *
+ * @return a PrinterData object describing the receiver
+ */
+public PrinterData getPrinterData() {
+ checkDevice();
+ return data;
+}
+
+/**
+ * On the Mac the core graphics context for printing is only valid between PMSessionBeginPage and PMSessionEndPage,
+ * so printing code has to retrieve and initializes a graphic context for every page like this:
+ *
+ * <pre>
+ * PMSessionBeginDocument
+ * PMSessionBeginPage
+ * PMSessionGetGraphicsContext
+ * // ... use context
+ * PMSessionEndPage
+ * PMSessionEndDocument
+ * </pre>
+ *
+ * In SWT it is OK to create a GC once between startJob / endJob and use it for all pages in between:
+ *
+ * <pre>
+ * startJob(...);
+ * GC gc= new GC(printer);
+ * startPage();
+ * // ... use gc
+ * endPage();
+ * gc.dispose();
+ * endJob();
+ * </pre>
+ *
+ * The solution to resolve this difference is to rely on the fact that Mac OS X returns the same but
+ * reinitialized graphics context for every page. So we only have to account for the fact that SWT assumes
+ * that the graphics context keeps it settings across a page break when it actually does not.
+ * So we have to copy some settings that exist in the CGC before a PMSessionEndPage to the CGC after a PMSessionBeginPage.
+ * <p>
+ * In addition to this we have to cope with the situation that in SWT we can create a GC before a call to
+ * PMSessionBeginPage. For this we decouple the call to PMSessionBeginPage from
+ * SWT's method startPage as follows: if a new GC is created before a call to startPage, internal_new_GC
+ * does the PMSessionBeginPage and the next following startPage does nothing.
+ * </p>
+ */
+void setupNewPage() {
+ if (!inPage) {
+ inPage= true;
+ OS.PMSessionBeginPageNoDialog(printSession, pageFormat, null);
+ int[] buffer = new int[1];
+ OS.PMSessionGetGraphicsContext(printSession, 0, buffer);
+ if (context == 0) {
+ context = buffer[0];
+ } else {
+ if (context != buffer[0]) SWT.error(SWT.ERROR_UNSPECIFIED);
+ }
+ PMRect paperRect= new PMRect();
+ OS.PMGetAdjustedPaperRect(pageFormat, paperRect);
+ OS.CGContextScaleCTM(context, 1, -1);
+ OS.CGContextTranslateCTM(context, 0, -(float)(paperRect.bottom-paperRect.top));
+ OS.CGContextSetStrokeColorSpace(context, colorspace);
+ OS.CGContextSetFillColorSpace(context, colorspace);
+ }
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Program/cocoa/org/eclipse/swt/program/Program.java b/bundles/org.eclipse.swt/Eclipse SWT Program/cocoa/org/eclipse/swt/program/Program.java
new file mode 100755
index 0000000000..e0015281c3
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Program/cocoa/org/eclipse/swt/program/Program.java
@@ -0,0 +1,546 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.program;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+
+/**
+ * Instances of this class represent programs and
+ * their associated file extensions in the operating
+ * system.
+ */
+public final class Program {
+ String name;
+ byte[] fsRef;
+
+/**
+ * Prevents uninitialized instances from being created outside the package.
+ */
+Program () {
+}
+
+/**
+ * Finds the program that is associated with an extension.
+ * The extension may or may not begin with a '.'. Note that
+ * a <code>Display</code> must already exist to guarantee that
+ * this method returns an appropriate result.
+ *
+ * @param extension the program extension
+ * @return the program or <code>null</code>
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT when extension is null</li>
+ * </ul>
+ */
+public static Program findProgram (String extension) {
+ if (extension == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ if (extension.length () == 0) return null;
+ char[] chars;
+ if (extension.charAt (0) != '.') {
+ chars = new char[extension.length()];
+ extension.getChars(0, chars.length, chars, 0);
+ } else {
+ chars = new char[extension.length() - 1];
+ extension.getChars(1, extension.length(), chars, 0);
+ }
+ int ext = OS.CFStringCreateWithCharacters(OS.kCFAllocatorDefault, chars, chars.length);
+ Program program = null;
+ if (ext != 0) {
+ byte[] fsRef = new byte[80];
+ if (OS.LSGetApplicationForInfo(OS.kLSUnknownType, OS.kLSUnknownCreator, ext, OS.kLSRolesAll, fsRef, null) == OS.noErr) {
+ program = getProgram(fsRef);
+ }
+ OS.CFRelease(ext);
+ }
+ return program;
+}
+
+/**
+ * Answer all program extensions in the operating system. Note
+ * that a <code>Display</code> must already exist to guarantee
+ * that this method returns an appropriate result.
+ *
+ * @return an array of extensions
+ */
+public static String [] getExtensions () {
+ return new String [] {
+ // From System-Declared Uniform Type Identifiers
+ ".txt",
+ ".rtf",
+ ".html",
+ ".htm",
+ ".xml",
+ ".c",
+ ".m",
+ ".cp", ".cpp", ".c++", ".cc", ".cxx",
+ ".mm",
+ ".h",
+ ".hpp",
+ ".h++",
+ ".hxx",
+ ".java",
+ ".jav",
+ ".s",
+ ".r",
+ ".defs",
+ ".mig",
+ ".exp",
+ ".js",
+ ".jscript",
+ ".javascript",
+ ".sh",
+ ".command",
+ ".csh",
+ ".pl",
+ ".pm",
+ ".py",
+ ".rb",
+ ".rbw",
+ ".php",
+ ".php3",
+ ".php4",
+ ".ph3",
+ ".ph4",
+ ".phtml",
+ ".jnlp",
+ ".applescript",
+ ".scpt",
+ ".o",
+ ".exe",
+ ".dll",
+ ".class",
+ ".jar",
+ ".qtz",
+ ".gtar",
+ ".tar",
+ ".gz",
+ ".gzip",
+ ".tgz",
+ ".hqx",
+ ".bin",
+ ".vcf",
+ ".vcard",
+ ".jpg",
+ ".jpeg",
+ ".jp2",
+ ".tif",
+ ".tiff",
+ ".pic",
+ ".pct",
+ ".pict",
+ ".pntg",
+ ".png",
+ ".xbm",
+ ".qif",
+ ".qtif",
+ ".icns",
+ ".mov",
+ ".qt",
+ ".avi",
+ ".vfw",
+ ".mpg",
+ ".mpeg",
+ ".m75",
+ ".m15",
+ ".mp4",
+ ".3gp",
+ ".3gpp",
+ ".3g2",
+ ".3gp2",
+ ".mp3",
+ ".m4a",
+ ".m4p",
+ ".m4b",
+ ".au",
+ ".ulw",
+ ".snd",
+ ".aifc",
+ ".aiff",
+ ".aif",
+ ".caf",
+ ".bundle",
+ ".app",
+ ".plugin",
+ ".mdimporter",
+ ".wdgt",
+ ".cpio",
+ ".zip",
+ ".framework",
+ ".rtfd",
+ ".dfont",
+ ".otf",
+ ".ttf",
+ ".ttc",
+ ".suit",
+ ".pfb",
+ ".pfa",
+ ".icc",
+ ".icm",
+ ".pf",
+ ".pdf",
+ ".ps",
+ ".eps",
+ ".psd",
+ ".ai",
+ ".gif",
+ ".bmp",
+ ".ico",
+ ".doc",
+ ".xls",
+ ".ppt",
+ ".wav",
+ ".wave",
+ ".asf",
+ ".wm",
+ ".wmv",
+ ".wmp",
+ ".wma",
+ ".asx",
+ ".wmx",
+ ".wvx",
+ ".wax",
+ ".key",
+ ".kth",
+ ".tga",
+ ".sgi",
+ ".exr",
+ ".fpx",
+ ".jfx",
+ ".efx",
+ ".sd2",
+ ".rm",
+ ".ram",
+ ".ra",
+ ".smil",
+ ".sit",
+ ".sitx",
+ // Others
+ ".plist",
+ ".nib",
+ ".lproj",
+ // iChat
+ ".iPhoto",
+ // iChat
+ ".iChat",
+ ".chat",
+ // acrobat reader
+ ".rmf",
+ ".xfdf",
+ ".fdf",
+ // Chess
+ ".game",
+ ".pgn",
+ // iCal
+ ".ics",
+ ".vcs",
+ ".aplmodel",
+ ".icbu",
+ ".icalevent",
+ ".icaltodo",
+ // Mail
+ ".mailhold",
+ ".mbox",
+ ".imapmbox",
+ ".emlx",
+ ".mailextract",
+ // Sherlock
+ ".sherlock",
+ // Stickies
+ ".tpl",
+ // System Preferences
+ ".prefPane",
+ ".sliderSaver",
+ ".saver",
+ // Console
+ ".log",
+ // Grapher
+ ".gcx",
+ };
+}
+
+/**
+ * Answers all available programs in the operating system. Note
+ * that a <code>Display</code> must already exist to guarantee
+ * that this method returns an appropriate result.
+ *
+ * @return an array of programs
+ */
+public static Program [] getPrograms () {
+ Hashtable bundles = new Hashtable();
+ String[] extensions = getExtensions();
+ byte[] fsRef = new byte[80];
+ for (int i = 0; i < extensions.length; i++) {
+ String extension = extensions[i];
+ char[] chars = new char[extension.length() - 1];
+ extension.getChars(1, extension.length(), chars, 0);
+ int ext = OS.CFStringCreateWithCharacters(OS.kCFAllocatorDefault, chars, chars.length);
+ if (ext != 0) {
+ if (OS.LSGetApplicationForInfo(OS.kLSUnknownType, OS.kLSUnknownCreator, ext, OS.kLSRolesAll, fsRef, null) == OS.noErr) {
+ Program program = getProgram(fsRef);
+ if (program != null && bundles.get(program.getName()) == null) {
+ bundles.put(program.getName(), program);
+ fsRef = new byte[80];
+ }
+ }
+ if (OS.VERSION >= 0x1040) {
+ int utis = OS.UTTypeCreateAllIdentifiersForTag(OS.kUTTagClassFilenameExtension(), ext, 0);
+ if (utis != 0) {
+ int utiCount = OS.CFArrayGetCount(utis);
+ for (int j = 0; j < utiCount; j++) {
+ int uti = OS.CFArrayGetValueAtIndex(utis, j);
+ if (uti != 0) {
+ int apps = OS.LSCopyAllRoleHandlersForContentType(uti, OS.kLSRolesAll);
+ if (apps != 0) {
+ int appCount = OS.CFArrayGetCount(apps);
+ for (int k = 0; k < appCount; k++) {
+ int app = OS.CFArrayGetValueAtIndex(apps, k);
+ if (app != 0) {;
+ if (OS.LSFindApplicationForInfo(OS.kLSUnknownCreator, app, 0, fsRef, null) == OS.noErr) {
+ Program program = getProgram(fsRef);
+ if (program != null && bundles.get(program.getName()) == null) {
+ bundles.put(program.getName(), program);
+ fsRef = new byte[80];
+ }
+ }
+ }
+ }
+ OS.CFRelease(apps);
+ }
+ }
+ }
+ OS.CFRelease(utis);
+ }
+ }
+ OS.CFRelease(ext);
+ }
+ }
+ int count = 0;
+ Program[] programs = new Program[bundles.size()];
+ Enumeration values = bundles.elements();
+ while (values.hasMoreElements()) {
+ programs[count++] = (Program)values.nextElement();
+ }
+ return programs;
+}
+
+/**
+ * Launches the executable associated with the file in
+ * the operating system. If the file is an executable,
+ * then the executable is launched. Note that a <code>Display</code>
+ * must already exist to guarantee that this method returns
+ * an appropriate result.
+ *
+ * @param fileName the file or program name
+ * @return <code>true</code> if the file is launched, otherwise <code>false</code>
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT when fileName is null</li>
+ * </ul>
+ */
+public static boolean launch (String fileName) {
+ if (fileName == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ if (fileName.indexOf(':') == -1) fileName = "file://" + fileName;
+ NSWorkspace workspace = NSWorkspace.sharedWorkspace();
+ return workspace.openURL(NSURL.static_URLWithString_(NSString.stringWith(fileName)));
+}
+
+/**
+ * Executes the program with the file as the single argument
+ * in the operating system. It is the responsibility of the
+ * programmer to ensure that the file contains valid data for
+ * this program.
+ *
+ * @param fileName the file or program name
+ * @return <code>true</code> if the file is launched, otherwise <code>false</code>
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT when fileName is null</li>
+ * </ul>
+ */
+public boolean execute (String fileName) {
+ if (fileName == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (OS.VERSION < 0x1040) return launch(fileName);
+ int rc = -1;
+ int fsRefPtr = OS.NewPtr(fsRef.length);
+ if (fsRefPtr != 0) {
+ OS.memmove(fsRefPtr, fsRef, fsRef.length);
+ LSApplicationParameters params = new LSApplicationParameters();
+ params.version = 0;
+ params.flags = 0;
+ params.application = fsRefPtr;
+ if (fileName.length() == 0) {
+ rc = OS.LSOpenApplication(params, null);
+ } else {
+ if (fileName.indexOf(':') == -1) fileName = "file://" + fileName;
+ char[] chars = new char[fileName.length()];
+ fileName.getChars(0, chars.length, chars, 0);
+ int str = OS.CFStringCreateWithCharacters(0, chars, chars.length);
+ if (str != 0) {
+ int unscapedStr = OS.CFStringCreateWithCharacters(0, new char[]{'%'}, 1);
+ int escapedStr = OS.CFURLCreateStringByAddingPercentEscapes(OS.kCFAllocatorDefault, str, unscapedStr, 0, OS.kCFStringEncodingUTF8);
+ if (escapedStr != 0) {
+ int urls = OS.CFArrayCreateMutable(OS.kCFAllocatorDefault, 1, 0);
+ if (urls != 0) {
+ int url = OS.CFURLCreateWithString(OS.kCFAllocatorDefault, escapedStr, 0);
+ if (url != 0) {
+ OS.CFArrayAppendValue(urls, url);
+ rc = OS.LSOpenURLsWithRole(urls, OS.kLSRolesAll, 0, params, null, 0);
+ }
+ OS.CFRelease(urls);
+ }
+ OS.CFRelease(escapedStr);
+ }
+ if (unscapedStr != 0) OS.CFRelease(unscapedStr);
+ OS.CFRelease(str);
+ }
+ }
+ OS.DisposePtr(fsRefPtr);
+ }
+ return rc == OS.noErr;
+}
+
+/**
+ * Returns the receiver's image data. This is the icon
+ * that is associated with the receiver in the operating
+ * system.
+ *
+ * @return the image data for the program, may be null
+ */
+public ImageData getImageData () {
+ int[] iconRef = new int[1];
+ OS.GetIconRefFromFileInfo(fsRef, 0, null, 0, 0, 0, iconRef, null);
+ int[] family = new int[1];
+ int rc = OS.IconRefToIconFamily(iconRef[0], OS.kSelectorAlLAvailableData, family);
+ OS.ReleaseIconRef(iconRef[0]);
+ if (rc != OS.noErr) return null;
+// ImageData result = createImageFromFamily(family[0], OS.kLarge32BitData, OS.kLarge8BitMask, 32, 32);
+ ImageData result = createImageFromFamily(family[0], OS.kSmall32BitData, OS.kSmall8BitMask, 16, 16);
+ OS.DisposeHandle(family[0]);
+ if (result == null) {
+ RGB[] rgbs = new RGB[] {
+ new RGB(0xff, 0xff, 0xff),
+ new RGB(0x5f, 0x5f, 0x5f),
+ new RGB(0x80, 0x80, 0x80),
+ new RGB(0xC0, 0xC0, 0xC0),
+ new RGB(0xDF, 0xDF, 0xBF),
+ new RGB(0xFF, 0xDF, 0x9F),
+ new RGB(0x00, 0x00, 0x00),
+ };
+ result = new ImageData(16, 16, 4, new PaletteData(rgbs) );
+ result.transparentPixel = 6; // use black for transparency
+ String[] p= {
+ "CCCCCCCCGGG",
+ "CFAAAAACBGG",
+ "CAAAAAACFBG",
+ "CAAAAAACBBB",
+ "CAAAAAAAAEB",
+ "CAAAAAAAAEB",
+ "CAAAAAAAAEB",
+ "CAAAAAAAAEB",
+ "CAAAAAAAAEB",
+ "CAAAAAAAAEB",
+ "CAAAAAAAAEB",
+ "CAAAAAAAAEB",
+ "CDDDDDDDDDB",
+ "CBBBBBBBBBB",
+ };
+ for (int y= 0; y < p.length; y++) {
+ for (int x= 0; x < 11; x++) {
+ result.setPixel(x+3, y+1, p[y].charAt(x)-'A');
+ }
+ }
+ }
+ return result;
+}
+
+/**
+ * Returns the receiver's name. This is as short and
+ * descriptive a name as possible for the program. If
+ * the program has no descriptive name, this string may
+ * be the executable name, path or empty.
+ *
+ * @return the name of the program
+ */
+public String getName () {
+ return name;
+}
+
+static Program getProgram(byte[] fsRef) {
+ String name = "";
+ int[] namePtr = new int[1];
+ OS.LSCopyDisplayNameForRef(fsRef, namePtr);
+ if (namePtr[0] != 0) {
+ int length = OS.CFStringGetLength(namePtr[0]);
+ if (length != 0) {
+ char[] buffer= new char[length];
+ CFRange range = new CFRange();
+ range.length = length;
+ OS.CFStringGetCharacters(namePtr[0], range, buffer);
+ name = new String(buffer);
+ }
+ OS.CFRelease(namePtr[0]);
+ }
+ Program program = new Program();
+ program.fsRef = fsRef;
+ program.name = name;
+ return program;
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param other the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode()
+ */
+public boolean equals(Object other) {
+ if (this == other) return true;
+ if (other instanceof Program) {
+ final Program program = (Program) other;
+ return name.equals(program.name);
+ }
+ return false;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals(Object)
+ */
+public int hashCode() {
+ return name.hashCode();
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the program
+ */
+public String toString () {
+ return "Program {" + name + "}";
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Color.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Color.java
new file mode 100755
index 0000000000..63d0d684ee
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Color.java
@@ -0,0 +1,271 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.graphics;
+
+
+import org.eclipse.swt.*;
+
+/**
+ * Instances of this class manage the operating system resources that
+ * implement SWT's RGB color model. To create a color you can either
+ * specify the individual color components as integers in the range
+ * 0 to 255 or provide an instance of an <code>RGB</code>.
+ * <p>
+ * Application code must explicitly invoke the <code>Color.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ *
+ * @see RGB
+ * @see Device#getSystemColor
+ */
+public final class Color extends Resource {
+ /**
+ * the handle to the OS color resource
+ * (Warning: This field is platform dependent)
+ * <p>
+ * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It is not available on all
+ * platforms and should never be accessed from application code.
+ * </p>
+ */
+ public float[] handle;
+
+Color() {
+}
+
+/**
+ * Constructs a new instance of this class given a device and the
+ * desired red, green and blue values expressed as ints in the range
+ * 0 to 255 (where 0 is black and 255 is full brightness). On limited
+ * color devices, the color instance created by this call may not have
+ * the same RGB values as the ones specified by the arguments. The
+ * RGB values on the returned instance will be the color values of
+ * the operating system color.
+ * <p>
+ * You must dispose the color when it is no longer required.
+ * </p>
+ *
+ * @param device the device on which to allocate the color
+ * @param red the amount of red in the color
+ * @param green the amount of green in the color
+ * @param blue the amount of blue in the color
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the red, green or blue argument is not between 0 and 255</li>
+ * </ul>
+ *
+ * @see #dispose
+ */
+public Color(Device device, int red, int green, int blue) {
+ init(device, red, green, blue);
+}
+
+/**
+ * Constructs a new instance of this class given a device and an
+ * <code>RGB</code> describing the desired red, green and blue values.
+ * On limited color devices, the color instance created by this call
+ * may not have the same RGB values as the ones specified by the
+ * argument. The RGB values on the returned instance will be the color
+ * values of the operating system color.
+ * <p>
+ * You must dispose the color when it is no longer required.
+ * </p>
+ *
+ * @param device the device on which to allocate the color
+ * @param rgb the RGB values of the desired color
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * <li>ERROR_NULL_ARGUMENT - if the rgb argument is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the red, green or blue components of the argument are not between 0 and 255</li>
+ * </ul>
+ *
+ * @see #dispose
+ */
+public Color(Device device, RGB rgb) {
+ if (rgb == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ init(device, rgb.red, rgb.green, rgb.blue);
+}
+
+/**
+ * Disposes of the operating system resources associated with
+ * the color. Applications must dispose of all colors which
+ * they allocate.
+ */
+public void dispose() {
+ if (handle == null) return;
+ if (device.isDisposed()) return;
+ device = null;
+ handle = null;
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode
+ */
+public boolean equals(Object object) {
+ if (object == this) return true;
+ if (!(object instanceof Color)) return false;
+ Color color = (Color)object;
+ float[] rgbColor = color.handle;
+ if (handle == rgbColor) return true;
+ return device == color.device &&
+ (int)(handle[0] * 255) == (int)(rgbColor[0] * 255) &&
+ (int)(handle[1] * 255) == (int)(rgbColor[1] * 255) &&
+ (int)(handle[2] * 255) == (int)(rgbColor[2] * 255);
+}
+
+/**
+ * Returns the amount of blue in the color, from 0 to 255.
+ *
+ * @return the blue component of the color
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getBlue() {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return (int)(handle[2] * 255);
+}
+
+/**
+ * Returns the amount of green in the color, from 0 to 255.
+ *
+ * @return the green component of the color
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getGreen() {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return (int)(handle[1] * 255);
+}
+
+/**
+ * Returns the amount of red in the color, from 0 to 255.
+ *
+ * @return the red component of the color
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getRed() {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return (int)(handle[0] * 255);
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals
+ */
+public int hashCode() {
+ if (isDisposed()) return 0;
+ return (int)(handle[0] * 255) ^ (int)(handle[1] * 255) ^ (int)(handle[2] * 255);
+}
+
+/**
+ * Returns an <code>RGB</code> representing the receiver.
+ *
+ * @return the RGB for the color
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public RGB getRGB () {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return new RGB(getRed(), getGreen(), getBlue());
+}
+
+/**
+ * Invokes platform specific functionality to allocate a new color.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Color</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param device the device on which to allocate the color
+ * @param handle the handle for the color
+ *
+ * @private
+ */
+public static Color cocoa_new(Device device, float[] rgbColor) {
+ if (device == null) device = Device.getDevice();
+ Color color = new Color();
+ color.handle = rgbColor;
+ color.device = device;
+ return color;
+}
+
+void init(Device device, int red, int green, int blue) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ this.device = device;
+ if ((red > 255) || (red < 0) ||
+ (green > 255) || (green < 0) ||
+ (blue > 255) || (blue < 0)) {
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ float[] rgbColor = new float[4];
+ rgbColor[0] = red / 255f;
+ rgbColor[1] = green / 255f;
+ rgbColor[2] = blue / 255f;
+ rgbColor[3] = 1;
+ handle = rgbColor;
+}
+
+/**
+ * Returns <code>true</code> if the color has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the color.
+ * When a color has been disposed, it is an error to
+ * invoke any other method using the color.
+ *
+ * @return <code>true</code> when the color is disposed and <code>false</code> otherwise
+ */
+public boolean isDisposed() {
+ return handle == null;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public String toString () {
+ if (isDisposed()) return "Color {*DISPOSED*}";
+ return "Color {" + getRed() + ", " + getGreen() + ", " + getBlue() + "}";
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Cursor.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Cursor.java
new file mode 100755
index 0000000000..d92bc56f75
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Cursor.java
@@ -0,0 +1,418 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.graphics;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+import org.eclipse.swt.*;
+
+/**
+ * Instances of this class manage operating system resources that
+ * specify the appearance of the on-screen pointer. To create a
+ * cursor you specify the device and either a simple cursor style
+ * describing one of the standard operating system provided cursors
+ * or the image and mask data for the desired appearance.
+ * <p>
+ * Application code must explicitly invoke the <code>Cursor.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>
+ * CURSOR_ARROW, CURSOR_WAIT, CURSOR_CROSS, CURSOR_APPSTARTING, CURSOR_HELP,
+ * CURSOR_SIZEALL, CURSOR_SIZENESW, CURSOR_SIZENS, CURSOR_SIZENWSE, CURSOR_SIZEWE,
+ * CURSOR_SIZEN, CURSOR_SIZES, CURSOR_SIZEE, CURSOR_SIZEW, CURSOR_SIZENE, CURSOR_SIZESE,
+ * CURSOR_SIZESW, CURSOR_SIZENW, CURSOR_UPARROW, CURSOR_IBEAM, CURSOR_NO, CURSOR_HAND
+ * </dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the above styles may be specified.
+ * </p>
+ */
+
+public final class Cursor extends Resource {
+
+ /**
+ * the handle to the OS cursor resource
+ * (Warning: This field is platform dependent)
+ * <p>
+ * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It is not available on all
+ * platforms and should never be accessed from application code.
+ * </p>
+ */
+ public NSCursor handle;
+
+/**
+ * Prevents uninitialized instances from being created outside the package.
+ */
+Cursor() {
+}
+
+/**
+ * Constructs a new cursor given a device and a style
+ * constant describing the desired cursor appearance.
+ * <p>
+ * You must dispose the cursor when it is no longer required.
+ * </p>
+ *
+ * @param device the device on which to allocate the cursor
+ * @param style the style of cursor to allocate
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * <li>ERROR_INVALID_ARGUMENT - when an unknown style is specified</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES - if a handle could not be obtained for cursor creation</li>
+ * </ul>
+ *
+ * @see SWT#CURSOR_ARROW
+ * @see SWT#CURSOR_WAIT
+ * @see SWT#CURSOR_CROSS
+ * @see SWT#CURSOR_APPSTARTING
+ * @see SWT#CURSOR_HELP
+ * @see SWT#CURSOR_SIZEALL
+ * @see SWT#CURSOR_SIZENESW
+ * @see SWT#CURSOR_SIZENS
+ * @see SWT#CURSOR_SIZENWSE
+ * @see SWT#CURSOR_SIZEWE
+ * @see SWT#CURSOR_SIZEN
+ * @see SWT#CURSOR_SIZES
+ * @see SWT#CURSOR_SIZEE
+ * @see SWT#CURSOR_SIZEW
+ * @see SWT#CURSOR_SIZENE
+ * @see SWT#CURSOR_SIZESE
+ * @see SWT#CURSOR_SIZESW
+ * @see SWT#CURSOR_SIZENW
+ * @see SWT#CURSOR_UPARROW
+ * @see SWT#CURSOR_IBEAM
+ * @see SWT#CURSOR_NO
+ * @see SWT#CURSOR_HAND
+ */
+public Cursor(Device device, int style) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ this.device = device;
+ switch (style) {
+ case SWT.CURSOR_HAND: handle = NSCursor.pointingHandCursor(); break;
+ case SWT.CURSOR_ARROW: handle = NSCursor.arrowCursor(); break;
+ case SWT.CURSOR_WAIT: handle = NSCursor.crosshairCursor(); break;
+ case SWT.CURSOR_CROSS: handle = NSCursor.crosshairCursor(); break;
+ case SWT.CURSOR_APPSTARTING: handle = NSCursor.arrowCursor(); break;
+ case SWT.CURSOR_HELP: handle = NSCursor.crosshairCursor(); break;
+ case SWT.CURSOR_SIZEALL: handle = NSCursor.crosshairCursor(); break;
+ case SWT.CURSOR_SIZENESW: handle = NSCursor.crosshairCursor(); break;
+ case SWT.CURSOR_SIZENS: handle = NSCursor.resizeUpDownCursor(); break;
+ case SWT.CURSOR_SIZENWSE: handle = NSCursor.crosshairCursor(); break;
+ case SWT.CURSOR_SIZEWE: handle = NSCursor.resizeLeftRightCursor(); break;
+ case SWT.CURSOR_SIZEN: handle = NSCursor.resizeUpCursor(); break;
+ case SWT.CURSOR_SIZES: handle = NSCursor.resizeDownCursor(); break;
+ case SWT.CURSOR_SIZEE: handle = NSCursor.resizeRightCursor(); break;
+ case SWT.CURSOR_SIZEW: handle = NSCursor.resizeLeftCursor(); break;
+ case SWT.CURSOR_SIZENE: handle = NSCursor.crosshairCursor(); break;
+ case SWT.CURSOR_SIZESE: handle = NSCursor.crosshairCursor(); break;
+ case SWT.CURSOR_SIZESW: handle = NSCursor.crosshairCursor(); break;
+ case SWT.CURSOR_SIZENW: handle = NSCursor.crosshairCursor(); break;
+ case SWT.CURSOR_UPARROW: handle = NSCursor.crosshairCursor(); break;
+ case SWT.CURSOR_IBEAM: handle = NSCursor.IBeamCursor(); break;
+ case SWT.CURSOR_NO: handle = NSCursor.crosshairCursor(); break;
+ default:
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ handle.retain();
+ handle.setOnMouseEntered(true);
+}
+
+/**
+ * Constructs a new cursor given a device, image and mask
+ * data describing the desired cursor appearance, and the x
+ * and y coordinates of the <em>hotspot</em> (that is, the point
+ * within the area covered by the cursor which is considered
+ * to be where the on-screen pointer is "pointing").
+ * <p>
+ * The mask data is allowed to be null, but in this case the source
+ * must be an ImageData representing an icon that specifies both
+ * color data and mask data.
+ * <p>
+ * You must dispose the cursor when it is no longer required.
+ * </p>
+ *
+ * @param device the device on which to allocate the cursor
+ * @param source the color data for the cursor
+ * @param mask the mask data for the cursor (or null)
+ * @param hotspotX the x coordinate of the cursor's hotspot
+ * @param hotspotY the y coordinate of the cursor's hotspot
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * <li>ERROR_NULL_ARGUMENT - if the source is null</li>
+ * <li>ERROR_NULL_ARGUMENT - if the mask is null and the source does not have a mask</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the source and the mask are not the same
+ * size, or if the hotspot is outside the bounds of the image</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES - if a handle could not be obtained for cursor creation</li>
+ * </ul>
+ */
+public Cursor(Device device, ImageData source, ImageData mask, int hotspotX, int hotspotY) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ this.device = device;
+ if (source == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (mask == null) {
+ if (source.getTransparencyType() != SWT.TRANSPARENCY_MASK) {
+ SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ }
+ mask = source.getTransparencyMask();
+ }
+ /* Check the bounds. Mask must be the same size as source */
+ if (mask.width != source.width || mask.height != source.height) {
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ /* Check the hotspots */
+ if (hotspotX >= source.width || hotspotX < 0 ||
+ hotspotY >= source.height || hotspotY < 0) {
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ byte[] data = new byte[source.width * source.height * 4];
+ for (int y = 0; y < source.height; y++) {
+ int offset = y * source.width * 4;
+ for (int x = 0; x < source.width; x++) {
+ int pixel = source.getPixel(x, y);
+ int maskPixel = mask.getPixel(x, y);
+ if (pixel == 0 && maskPixel == 0) {
+ // BLACK
+ data[offset] = (byte)0xFF;
+ } else if (pixel == 0 && maskPixel == 1) {
+ // WHITE - cursor color
+ data[offset] = data[offset + 1] = data[offset + 2] = data[offset + 3] = (byte)0xFF;
+ } else if (pixel == 1 && maskPixel == 0) {
+ // SCREEN
+ } else {
+ /*
+ * Feature in the Macintosh. It is not possible to have
+ * the reverse screen case using NSCursor.
+ * Reverse screen will be the same as screen.
+ */
+ // REVERSE SCREEN -> SCREEN
+ }
+ offset += 4;
+ }
+ }
+ createNSCursor(device, hotspotX, hotspotY, data, source.width, source.height);
+}
+
+void createNSCursor(Device device, int hotspotX, int hotspotY, byte[] buffer, int width, int height) {
+ NSImage nsImage = (NSImage)new NSImage().alloc();
+ NSBitmapImageRep nsImageRep = (NSBitmapImageRep)new NSBitmapImageRep().alloc();
+ handle = (NSCursor)new NSCursor().alloc();
+ NSSize size = new NSSize();
+ size.width = width;
+ size.height = height;
+ nsImage = nsImage.initWithSize(size);
+ nsImageRep = nsImageRep.initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bitmapFormat_bytesPerRow_bitsPerPixel_(0, width, height,
+ 8, 4, true, false, new NSString(OS.NSDeviceRGBColorSpace()),
+ OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, width * 4, 32);
+ OS.memmove(nsImageRep.bitmapData(), buffer, buffer.length);
+ nsImage.addRepresentation(nsImageRep);
+ NSPoint point = new NSPoint();
+ point.x = hotspotX;
+ point.y = hotspotY;
+ handle = handle.initWithImage_hotSpot_(nsImage, point);
+ nsImageRep.release();
+ nsImage.release();
+}
+
+/**
+ * Constructs a new cursor given a device, image data describing
+ * the desired cursor appearance, and the x and y coordinates of
+ * the <em>hotspot</em> (that is, the point within the area
+ * covered by the cursor which is considered to be where the
+ * on-screen pointer is "pointing").
+ * <p>
+ * You must dispose the cursor when it is no longer required.
+ * </p>
+ *
+ * @param device the device on which to allocate the cursor
+ * @param source the image data for the cursor
+ * @param hotspotX the x coordinate of the cursor's hotspot
+ * @param hotspotY the y coordinate of the cursor's hotspot
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * <li>ERROR_NULL_ARGUMENT - if the image is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the hotspot is outside the bounds of the
+ * image</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES - if a handle could not be obtained for cursor creation</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Cursor(Device device, ImageData source, int hotspotX, int hotspotY) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ this.device = device;
+ if (source == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (hotspotX >= source.width || hotspotX < 0 ||
+ hotspotY >= source.height || hotspotY < 0) {
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ byte[] data = new byte[source.width * source.height * 4];
+ PaletteData palette = source.palette;
+ if (palette.isDirect) {
+ ImageData.blit(ImageData.BLIT_SRC,
+ source.data, source.depth, source.bytesPerLine, source.getByteOrder(), 0, 0, source.width, source.height, palette.redMask, palette.greenMask, palette.blueMask,
+ ImageData.ALPHA_OPAQUE, null, 0, 0, 0,
+ data, 32, source.width * 4, ImageData.MSB_FIRST, 0, 0, source.width, source.height, 0xFF0000, 0xFF00, 0xFF,
+ false, false);
+ } else {
+ RGB[] rgbs = palette.getRGBs();
+ int length = rgbs.length;
+ byte[] srcReds = new byte[length];
+ byte[] srcGreens = new byte[length];
+ byte[] srcBlues = new byte[length];
+ for (int i = 0; i < rgbs.length; i++) {
+ RGB rgb = rgbs[i];
+ if (rgb == null) continue;
+ srcReds[i] = (byte)rgb.red;
+ srcGreens[i] = (byte)rgb.green;
+ srcBlues[i] = (byte)rgb.blue;
+ }
+ ImageData.blit(ImageData.BLIT_SRC,
+ source.data, source.depth, source.bytesPerLine, source.getByteOrder(), 0, 0, source.width, source.height, srcReds, srcGreens, srcBlues,
+ ImageData.ALPHA_OPAQUE, null, 0, 0, 0,
+ data, 32, source.width * 4, ImageData.MSB_FIRST, 0, 0, source.width, source.height, 0xFF0000, 0xFF00, 0xFF,
+ false, false);
+ }
+ if (source.maskData != null || source.transparentPixel != -1) {
+ ImageData mask = source.getTransparencyMask();
+ byte[] maskData = mask.data;
+ int maskBpl = mask.bytesPerLine;
+ int offset = 0, maskOffset = 0;
+ for (int y = 0; y<source.height; y++) {
+ for (int x = 0; x<source.width; x++) {
+ data[offset] = ((maskData[maskOffset + (x >> 3)]) & (1 << (7 - (x & 0x7)))) != 0 ? (byte)0xff : 0;
+ offset += 4;
+ }
+ maskOffset += maskBpl;
+ }
+ } else if (source.alpha != -1) {
+ byte alpha = (byte)source.alpha;
+ for (int i=0; i<data.length; i+=4) {
+ data[i] = alpha;
+ }
+ } else if (source.alphaData != null) {
+ byte[] alphaData = source.alphaData;
+ for (int i=0; i<data.length; i+=4) {
+ data[i] = alphaData[i/4];
+ }
+ }
+ createNSCursor(device, hotspotX, hotspotY, data, source.width, source.height);
+}
+
+/**
+ * Disposes of the operating system resources associated with
+ * the cursor. Applications must dispose of all cursors which
+ * they allocate.
+ */
+public void dispose () {
+ if (handle == null) return;
+ if (device.isDisposed()) return;
+ handle.release();
+ handle = null;
+ device = null;
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode
+ */
+public boolean equals (Object object) {
+ if (object == this) return true;
+ if (!(object instanceof Cursor)) return false;
+ Cursor cursor = (Cursor) object;
+ return device == cursor.device && handle == cursor.handle;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals
+ */
+public int hashCode () {
+ return handle != null ? handle.id : 0;
+}
+
+/**
+ * Returns <code>true</code> if the cursor has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the cursor.
+ * When a cursor has been disposed, it is an error to
+ * invoke any other method using the cursor.
+ *
+ * @return <code>true</code> when the cursor is disposed and <code>false</code> otherwise
+ */
+public boolean isDisposed() {
+ return handle == null;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public String toString () {
+ if (isDisposed()) return "Cursor {*DISPOSED*}";
+ return "Cursor {" + handle + "}";
+}
+
+/**
+ * Invokes platform specific functionality to allocate a new cursor.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Cursor</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param device the device on which to allocate the color
+ * @param handle the handle for the cursor
+ *
+ * @private
+ */
+public static Cursor cocoa_new(Device device, NSCursor handle) {
+ if (device == null) device = Device.getDevice();
+ Cursor cursor = new Cursor();
+ cursor.handle = handle;
+ cursor.device = device;
+ return cursor;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Device.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Device.java
new file mode 100755
index 0000000000..20a52f4dea
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Device.java
@@ -0,0 +1,623 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.graphics;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.internal.Compatibility;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * This class is the abstract superclass of all device objects,
+ * such as the Display device and the Printer device. Devices
+ * can have a graphics context (GC) created for them, and they
+ * can be drawn on by sending messages to the associated GC.
+ */
+public abstract class Device implements Drawable {
+
+ /* Debugging */
+ public static boolean DEBUG;
+ boolean debug = DEBUG;
+ boolean tracking = DEBUG;
+ Error [] errors;
+ Object [] objects;
+ Object trackingLock;
+
+ /* Disposed flag */
+ boolean disposed, warnings;
+
+ Color COLOR_BLACK, COLOR_DARK_RED, COLOR_DARK_GREEN, COLOR_DARK_YELLOW, COLOR_DARK_BLUE;
+ Color COLOR_DARK_MAGENTA, COLOR_DARK_CYAN, COLOR_GRAY, COLOR_DARK_GRAY, COLOR_RED;
+ Color COLOR_GREEN, COLOR_YELLOW, COLOR_BLUE, COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE;
+
+ /* System Font */
+ Font systemFont;
+
+ /*
+ * TEMPORARY CODE. When a graphics object is
+ * created and the device parameter is null,
+ * the current Display is used. This presents
+ * a problem because SWT graphics does not
+ * reference classes in SWT widgets. The correct
+ * fix is to remove this feature. Unfortunately,
+ * too many application programs rely on this
+ * feature.
+ *
+ * This code will be removed in the future.
+ */
+ protected static Device CurrentDevice;
+ protected static Runnable DeviceFinder;
+ static {
+ try {
+ Class.forName ("org.eclipse.swt.widgets.Display");
+ } catch (Throwable e) {}
+ }
+
+/*
+* TEMPORARY CODE.
+*/
+static synchronized Device getDevice () {
+ if (DeviceFinder != null) DeviceFinder.run();
+ Device device = CurrentDevice;
+ CurrentDevice = null;
+ return device;
+}
+
+/**
+ * Constructs a new instance of this class.
+ * <p>
+ * You must dispose the device when it is no longer required.
+ * </p>
+ *
+ * @see #create
+ * @see #init
+ *
+ * @since 3.1
+ */
+public Device() {
+ this(null);
+}
+
+/**
+ * Constructs a new instance of this class.
+ * <p>
+ * You must dispose the device when it is no longer required.
+ * </p>
+ *
+ * @param data the DeviceData which describes the receiver
+ *
+ * @see #create
+ * @see #init
+ * @see DeviceData
+ */
+public Device(DeviceData data) {
+ synchronized (Device.class) {
+ if (data != null) {
+ debug = data.debug;
+ tracking = data.tracking;
+ }
+ create (data);
+ init ();
+ if (tracking) {
+ errors = new Error [128];
+ objects = new Object [128];
+ trackingLock = new Object ();
+ }
+ }
+}
+
+/**
+ * Throws an <code>SWTException</code> if the receiver can not
+ * be accessed by the caller. This may include both checks on
+ * the state of the receiver and more generally on the entire
+ * execution context. This method <em>should</em> be called by
+ * device implementors to enforce the standard SWT invariants.
+ * <p>
+ * Currently, it is an error to invoke any method (other than
+ * <code>isDisposed()</code> and <code>dispose()</code>) on a
+ * device that has had its <code>dispose()</code> method called.
+ * </p><p>
+ * In future releases of SWT, there may be more or fewer error
+ * checks and exceptions may be thrown for different reasons.
+ * <p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+protected void checkDevice () {
+ if (disposed) SWT.error(SWT.ERROR_DEVICE_DISPOSED);
+}
+
+/**
+ * Creates the device in the operating system. If the device
+ * does not have a handle, this method may do nothing depending
+ * on the device.
+ * <p>
+ * This method is called before <code>init</code>.
+ * </p><p>
+ * Subclasses are supposed to reimplement this method and not
+ * call the <code>super</code> implementation.
+ * </p>
+ *
+ * @param data the DeviceData which describes the receiver
+ *
+ * @see #init
+ */
+protected void create (DeviceData data) {
+}
+
+/**
+ * Disposes of the operating system resources associated with
+ * the receiver. After this method has been invoked, the receiver
+ * will answer <code>true</code> when sent the message
+ * <code>isDisposed()</code>.
+ *
+ * @see #release
+ * @see #destroy
+ * @see #checkDevice
+ */
+public void dispose () {
+ synchronized (Device.class) {
+ if (isDisposed()) return;
+ checkDevice ();
+ release ();
+ destroy ();
+ disposed = true;
+ if (tracking) {
+ synchronized (trackingLock) {
+ objects = null;
+ errors = null;
+ trackingLock = null;
+ }
+ }
+ }
+}
+
+void dispose_Object (Object object) {
+ synchronized (trackingLock) {
+ for (int i=0; i<objects.length; i++) {
+ if (objects [i] == object) {
+ objects [i] = null;
+ errors [i] = null;
+ return;
+ }
+ }
+ }
+}
+
+/**
+ * Destroys the device in the operating system and releases
+ * the device's handle. If the device does not have a handle,
+ * this method may do nothing depending on the device.
+ * <p>
+ * This method is called after <code>release</code>.
+ * </p><p>
+ * Subclasses are supposed to reimplement this method and not
+ * call the <code>super</code> implementation.
+ * </p>
+ *
+ * @see #dispose
+ * @see #release
+ */
+protected void destroy () {
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location.
+ *
+ * @return the bounding rectangle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Rectangle getBounds () {
+ checkDevice ();
+ NSScreen screen = NSScreen.mainScreen();
+ NSRect rect = screen.frame();
+ return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+}
+
+/**
+ * Returns a <code>DeviceData</code> based on the receiver.
+ * Modifications made to this <code>DeviceData</code> will not
+ * affect the receiver.
+ *
+ * @return a <code>DeviceData</code> containing the device's data and attributes
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see DeviceData
+ */
+public DeviceData getDeviceData () {
+ checkDevice();
+ DeviceData data = new DeviceData ();
+ data.debug = debug;
+ data.tracking = tracking;
+ if (tracking) {
+ synchronized (trackingLock) {
+ int count = 0, length = objects.length;
+ for (int i=0; i<length; i++) {
+ if (objects [i] != null) count++;
+ }
+ int index = 0;
+ data.objects = new Object [count];
+ data.errors = new Error [count];
+ for (int i=0; i<length; i++) {
+ if (objects [i] != null) {
+ data.objects [index] = objects [i];
+ data.errors [index] = errors [i];
+ index++;
+ }
+ }
+ }
+ } else {
+ data.objects = new Object [0];
+ data.errors = new Error [0];
+ }
+ return data;
+}
+
+/**
+ * Returns a rectangle which describes the area of the
+ * receiver which is capable of displaying data.
+ *
+ * @return the client area
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getBounds
+ */
+public Rectangle getClientArea () {
+ checkDevice ();
+ NSScreen screen = NSScreen.mainScreen();
+ NSRect rect = screen.visibleFrame();
+ return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+}
+
+/**
+ * Returns the bit depth of the screen, which is the number of
+ * bits it takes to represent the number of unique colors that
+ * the screen is currently capable of displaying. This number
+ * will typically be one of 1, 8, 15, 16, 24 or 32.
+ *
+ * @return the depth of the screen
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getDepth () {
+ checkDevice ();
+ return OS.NSBitsPerPixelFromDepth(NSScreen.mainScreen().depth());
+}
+
+/**
+ * Returns a point whose x coordinate is the horizontal
+ * dots per inch of the display, and whose y coordinate
+ * is the vertical dots per inch of the display.
+ *
+ * @return the horizontal and vertical DPI
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Point getDPI () {
+ checkDevice ();
+ NSDictionary dictionary = NSScreen.mainScreen().deviceDescription();
+ NSValue value = new NSValue(dictionary.objectForKey(new id(OS.NSDeviceResolution())).id);
+ NSSize size = value.sizeValue();
+ return new Point((int)size.width, (int)size.height);
+}
+
+/**
+ * Returns <code>FontData</code> objects which describe
+ * the fonts that match the given arguments. If the
+ * <code>faceName</code> is null, all fonts will be returned.
+ *
+ * @param faceName the name of the font to look for, or null
+ * @param scalable if true only scalable fonts are returned, otherwise only non-scalable fonts are returned.
+ * @return the matching font data
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public FontData[] getFontList (String faceName, boolean scalable) {
+ checkDevice ();
+ if (!scalable) return new FontData[0];
+ NSArray fonts = NSFontManager.sharedFontManager().availableFonts();
+ int count = 0;
+ FontData[] fds = new FontData[fonts.count()];
+ for (int i = 0; i < fds.length; i++) {
+ NSString str = new NSString(fonts.objectAtIndex(i));
+ char[] buffer = new char[str.length()];
+ str.getCharacters_(buffer);
+ String nsName = new String(buffer);
+ String name = nsName;
+ int index = nsName.indexOf('-');
+ if (index != -1) name = name.substring(0, index);
+ int style = SWT.NORMAL;
+ if (nsName.indexOf("Italic") != -1) style |= SWT.ITALIC;
+ if (nsName.indexOf("Bold") != -1) style |= SWT.BOLD;
+ if (faceName == null || Compatibility.equalsIgnoreCase(faceName, name)) {
+ FontData data = new FontData(name, 0, style);
+ data.nsName = nsName;
+ fds[count++] = data;
+ }
+ }
+ if (count == fds.length) return fds;
+ FontData[] result = new FontData[count];
+ System.arraycopy(fds, 0, result, 0, count);
+ return result;
+}
+
+/**
+ * Returns the matching standard color for the given
+ * constant, which should be one of the color constants
+ * specified in class <code>SWT</code>. Any value other
+ * than one of the SWT color constants which is passed
+ * in will result in the color black. This color should
+ * not be freed because it was allocated by the system,
+ * not the application.
+ *
+ * @param id the color constant
+ * @return the matching color
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see SWT
+ */
+public Color getSystemColor (int id) {
+ checkDevice ();
+ switch (id) {
+ case SWT.COLOR_BLACK: return COLOR_BLACK;
+ case SWT.COLOR_DARK_RED: return COLOR_DARK_RED;
+ case SWT.COLOR_DARK_GREEN: return COLOR_DARK_GREEN;
+ case SWT.COLOR_DARK_YELLOW: return COLOR_DARK_YELLOW;
+ case SWT.COLOR_DARK_BLUE: return COLOR_DARK_BLUE;
+ case SWT.COLOR_DARK_MAGENTA: return COLOR_DARK_MAGENTA;
+ case SWT.COLOR_DARK_CYAN: return COLOR_DARK_CYAN;
+ case SWT.COLOR_GRAY: return COLOR_GRAY;
+ case SWT.COLOR_DARK_GRAY: return COLOR_DARK_GRAY;
+ case SWT.COLOR_RED: return COLOR_RED;
+ case SWT.COLOR_GREEN: return COLOR_GREEN;
+ case SWT.COLOR_YELLOW: return COLOR_YELLOW;
+ case SWT.COLOR_BLUE: return COLOR_BLUE;
+ case SWT.COLOR_MAGENTA: return COLOR_MAGENTA;
+ case SWT.COLOR_CYAN: return COLOR_CYAN;
+ case SWT.COLOR_WHITE: return COLOR_WHITE;
+ }
+ return COLOR_BLACK;
+}
+
+/**
+ * Returns a reasonable font for applications to use.
+ * On some platforms, this will match the "default font"
+ * or "system font" if such can be found. This font
+ * should not be freed because it was allocated by the
+ * system, not the application.
+ * <p>
+ * Typically, applications which want the default look
+ * should simply not set the font on the widgets they
+ * create. Widgets are always created with the correct
+ * default font for the class of user-interface component
+ * they represent.
+ * </p>
+ *
+ * @return a font
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Font getSystemFont () {
+ checkDevice ();
+ return systemFont;
+}
+
+/**
+ * Returns <code>true</code> if the underlying window system prints out
+ * warning messages on the console, and <code>setWarnings</code>
+ * had previously been called with <code>true</code>.
+ *
+ * @return <code>true</code>if warnings are being handled, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public boolean getWarnings () {
+ checkDevice ();
+ return warnings;
+}
+
+/**
+ * Initializes any internal resources needed by the
+ * device.
+ * <p>
+ * This method is called after <code>create</code>.
+ * </p><p>
+ * If subclasses reimplement this method, they must
+ * call the <code>super</code> implementation.
+ * </p>
+ *
+ * @see #create
+ */
+protected void init () {
+ /* Create the standard colors */
+ COLOR_BLACK = new Color (this, 0,0,0);
+ COLOR_DARK_RED = new Color (this, 0x80,0,0);
+ COLOR_DARK_GREEN = new Color (this, 0,0x80,0);
+ COLOR_DARK_YELLOW = new Color (this, 0x80,0x80,0);
+ COLOR_DARK_BLUE = new Color (this, 0,0,0x80);
+ COLOR_DARK_MAGENTA = new Color (this, 0x80,0,0x80);
+ COLOR_DARK_CYAN = new Color (this, 0,0x80,0x80);
+ COLOR_GRAY = new Color (this, 0xC0,0xC0,0xC0);
+ COLOR_DARK_GRAY = new Color (this, 0x80,0x80,0x80);
+ COLOR_RED = new Color (this, 0xFF,0,0);
+ COLOR_GREEN = new Color (this, 0,0xFF,0);
+ COLOR_YELLOW = new Color (this, 0xFF,0xFF,0);
+ COLOR_BLUE = new Color (this, 0,0,0xFF);
+ COLOR_MAGENTA = new Color (this, 0xFF,0,0xFF);
+ COLOR_CYAN = new Color (this, 0,0xFF,0xFF);
+ COLOR_WHITE = new Color (this, 0xFF,0xFF,0xFF);
+
+ /* Initialize the system font slot */
+ NSFont font = NSFont.systemFontOfSize(NSFont.systemFontSize());
+ systemFont = Font.cocoa_new(this, font);
+}
+
+/**
+ * Invokes platform specific functionality to allocate a new GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Device</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param data the platform specific GC data
+ * @return the platform specific GC handle
+ */
+public abstract int internal_new_GC (GCData data);
+
+/**
+ * Invokes platform specific functionality to dispose a GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Device</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param hDC the platform specific GC handle
+ * @param data the platform specific GC data
+ */
+public abstract void internal_dispose_GC (int handle, GCData data);
+
+/**
+ * Returns <code>true</code> if the device has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the device.
+ * When a device has been disposed, it is an error to
+ * invoke any other method using the device.
+ *
+ * @return <code>true</code> when the device is disposed and <code>false</code> otherwise
+ */
+public boolean isDisposed () {
+ synchronized (Device.class) {
+ return disposed;
+ }
+}
+
+/**
+ * Loads the font specified by a file. The font will be
+ * present in the list of fonts available to the application.
+ *
+ * @param path the font file path
+ * @return whether the font was successfully loaded
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if path is null</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Font
+ *
+ * @since 3.3
+ */
+public boolean loadFont (String path) {
+ checkDevice();
+ if (path == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ boolean result = false;
+ char [] chars = new char [path.length ()];
+ path.getChars (0, chars.length, chars, 0);
+ return result;
+}
+
+void new_Object (Object object) {
+ synchronized (trackingLock) {
+ for (int i=0; i<objects.length; i++) {
+ if (objects [i] == null) {
+ objects [i] = object;
+ errors [i] = new Error ();
+ return;
+ }
+ }
+ Object [] newObjects = new Object [objects.length + 128];
+ System.arraycopy (objects, 0, newObjects, 0, objects.length);
+ newObjects [objects.length] = object;
+ objects = newObjects;
+ Error [] newErrors = new Error [errors.length + 128];
+ System.arraycopy (errors, 0, newErrors, 0, errors.length);
+ newErrors [errors.length] = new Error ();
+ errors = newErrors;
+ }
+}
+
+/**
+ * Releases any internal resources back to the operating
+ * system and clears all fields except the device handle.
+ * <p>
+ * When a device is destroyed, resources that were acquired
+ * on behalf of the programmer need to be returned to the
+ * operating system. For example, if the device allocated a
+ * font to be used as the system font, this font would be
+ * freed in <code>release</code>. Also,to assist the garbage
+ * collector and minimize the amount of memory that is not
+ * reclaimed when the programmer keeps a reference to a
+ * disposed device, all fields except the handle are zero'd.
+ * The handle is needed by <code>destroy</code>.
+ * </p>
+ * This method is called before <code>destroy</code>.
+ * </p><p>
+ * If subclasses reimplement this method, they must
+ * call the <code>super</code> implementation.
+ * </p>
+ *
+ * @see #dispose
+ * @see #destroy
+ */
+protected void release () {
+ COLOR_BLACK = COLOR_DARK_RED = COLOR_DARK_GREEN = COLOR_DARK_YELLOW = COLOR_DARK_BLUE =
+ COLOR_DARK_MAGENTA = COLOR_DARK_CYAN = COLOR_GRAY = COLOR_DARK_GRAY = COLOR_RED =
+ COLOR_GREEN = COLOR_YELLOW = COLOR_BLUE = COLOR_MAGENTA = COLOR_CYAN = COLOR_WHITE = null;
+}
+
+/**
+ * If the underlying window system supports printing warning messages
+ * to the console, setting warnings to <code>false</code> prevents these
+ * messages from being printed. If the argument is <code>true</code> then
+ * message printing is not blocked.
+ *
+ * @param warnings <code>true</code>if warnings should be printed, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setWarnings (boolean warnings) {
+ checkDevice ();
+ this.warnings = warnings;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/DeviceData.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/DeviceData.java
new file mode 100755
index 0000000000..593b25584d
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/DeviceData.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.graphics;
+
+
+public class DeviceData {
+ /*
+ * Debug fields - may not be honoured
+ * on some SWT platforms.
+ */
+ public boolean debug;
+ public boolean tracking;
+ public Error [] errors;
+ public Object [] objects;
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Font.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Font.java
new file mode 100755
index 0000000000..715da8ff48
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Font.java
@@ -0,0 +1,291 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.graphics;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+import org.eclipse.swt.*;
+
+/**
+ * Instances of this class manage operating system resources that
+ * define how text looks when it is displayed. Fonts may be constructed
+ * by providing a device and either name, size and style information
+ * or a <code>FontData</code> object which encapsulates this data.
+ * <p>
+ * Application code must explicitly invoke the <code>Font.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ *
+ * @see FontData
+ */
+public final class Font extends Resource {
+
+ /**
+ * the handle to the OS font resource
+ * (Warning: This field is platform dependent)
+ * <p>
+ * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It is not available on all
+ * platforms and should never be accessed from application code.
+ * </p>
+ */
+ public NSFont handle;
+
+Font() {
+}
+
+/**
+ * Constructs a new font given a device and font data
+ * which describes the desired font's appearance.
+ * <p>
+ * You must dispose the font when it is no longer required.
+ * </p>
+ *
+ * @param device the device to create the font on
+ * @param fd the FontData that describes the desired font (must not be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * <li>ERROR_NULL_ARGUMENT - if the fd argument is null</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES - if a font could not be created from the given font data</li>
+ * </ul>
+ */
+public Font(Device device, FontData fd) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (fd == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ init(device, fd.getName(), fd.getHeightF(), fd.getStyle(), fd.nsName);
+}
+
+/**
+ * Constructs a new font given a device and an array
+ * of font data which describes the desired font's
+ * appearance.
+ * <p>
+ * You must dispose the font when it is no longer required.
+ * </p>
+ *
+ * @param device the device to create the font on
+ * @param fds the array of FontData that describes the desired font (must not be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * <li>ERROR_NULL_ARGUMENT - if the fds argument is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the length of fds is zero</li>
+ * <li>ERROR_NULL_ARGUMENT - if any fd in the array is null</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES - if a font could not be created from the given font data</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public Font(Device device, FontData[] fds) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (fds == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (fds.length == 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ for (int i=0; i<fds.length; i++) {
+ if (fds[i] == null) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ FontData fd = fds[0];
+ init(device,fd.getName(), fd.getHeightF(), fd.getStyle(), fd.nsName);
+}
+
+/**
+ * Constructs a new font given a device, a font name,
+ * the height of the desired font in points, and a font
+ * style.
+ * <p>
+ * You must dispose the font when it is no longer required.
+ * </p>
+ *
+ * @param device the device to create the font on
+ * @param name the name of the font (must not be null)
+ * @param height the font height in points
+ * @param style a bit or combination of NORMAL, BOLD, ITALIC
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * <li>ERROR_NULL_ARGUMENT - if the name argument is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the height is negative</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES - if a font could not be created from the given arguments</li>
+ * </ul>
+ */
+public Font(Device device, String name, int height, int style) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ init(device, name, height, style, null);
+}
+
+/*public*/ Font(Device device, String name, float height, int style) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ init(device, name, height, style, null);
+}
+
+/**
+ * Disposes of the operating system resources associated with
+ * the font. Applications must dispose of all fonts which
+ * they allocate.
+ */
+public void dispose() {
+ if (handle == null) return;
+ handle.release();
+ handle = null;
+ device = null;
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode
+ */
+public boolean equals(Object object) {
+ if (object == this) return true;
+ if (!(object instanceof Font)) return false;
+ Font font = (Font)object;
+ return handle == font.handle;
+}
+
+/**
+ * Returns an array of <code>FontData</code>s representing the receiver.
+ * On Windows, only one FontData will be returned per font. On X however,
+ * a <code>Font</code> object <em>may</em> be composed of multiple X
+ * fonts. To support this case, we return an array of font data objects.
+ *
+ * @return an array of font data objects describing the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public FontData[] getFontData() {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ NSString family = handle.familyName();
+ char[] buffer1 = new char[family.length()];
+ family.getCharacters_(buffer1);
+ String name = new String(buffer1);
+ NSString str = handle.fontName();
+ char[] buffer = new char[str.length()];
+ str.getCharacters_(buffer);
+ String nsName = new String(buffer);
+ int style = SWT.NORMAL;
+ if (nsName.indexOf("Italic") != -1) style |= SWT.ITALIC;
+ if (nsName.indexOf("Bold") != -1) style |= SWT.BOLD;
+ FontData data = new FontData(name, handle.pointSize(), style);
+ data.nsName = nsName;
+ return new FontData[]{data};
+}
+
+/**
+ * Invokes platform specific functionality to allocate a new font.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Font</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param device the device on which to allocate the color
+ * @param handle the handle for the font
+ * @param style the style for the font
+ * @param size the size for the font
+ *
+ * @private
+ */
+public static Font cocoa_new(Device device, NSFont handle) {
+ if (device == null) device = Device.getDevice();
+ Font font = new Font();
+ font.handle = handle;
+ font.device = device;
+ return font;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals
+ */
+public int hashCode() {
+ return handle != null ? handle.id : 0;
+}
+
+void init(Device device, String name, float height, int style, String nsName) {
+ if (name == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ this.device = device;
+ if (nsName != null) {
+ handle = NSFont.static_fontWithName_size_(NSString.stringWith(nsName), height);
+ } else {
+ nsName = name;
+ if ((style & SWT.BOLD) != 0) nsName += " Bold";
+ if ((style & SWT.ITALIC) != 0) nsName += " Italic";
+ handle = NSFont.static_fontWithName_size_(NSString.stringWith(nsName), height);
+ if (handle == null && (style & SWT.ITALIC) != 0) {
+ nsName = name;
+ if ((style & SWT.BOLD) != 0) nsName += " Bold";
+ handle = NSFont.static_fontWithName_size_(NSString.stringWith(nsName), height);
+ }
+ if (handle == null && (style & SWT.BOLD) != 0) {
+ nsName = name;
+ handle = NSFont.static_fontWithName_size_(NSString.stringWith(nsName), height);
+ }
+ }
+ if (handle == null) {
+ handle = device.systemFont.handle;
+ }
+ handle.retain();
+}
+
+/**
+ * Returns <code>true</code> if the font has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the font.
+ * When a font has been disposed, it is an error to
+ * invoke any other method using the font.
+ *
+ * @return <code>true</code> when the font is disposed and <code>false</code> otherwise
+ */
+public boolean isDisposed() {
+ return handle == null;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public String toString () {
+ if (isDisposed()) return "Font {*DISPOSED*}";
+ return "Font {" + handle + "}";
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/FontData.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/FontData.java
new file mode 100755
index 0000000000..92131da6aa
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/FontData.java
@@ -0,0 +1,446 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.graphics;
+
+
+import org.eclipse.swt.*;
+
+/**
+ * Instances of this class describe operating system fonts.
+ * <p>
+ * For platform-independent behaviour, use the get and set methods
+ * corresponding to the following properties:
+ * <dl>
+ * <dt>height</dt><dd>the height of the font in points</dd>
+ * <dt>name</dt><dd>the face name of the font, which may include the foundry</dd>
+ * <dt>style</dt><dd>A bitwise combination of NORMAL, ITALIC and BOLD</dd>
+ * </dl>
+ * If extra, platform-dependent functionality is required:
+ * <ul>
+ * <li>On <em>Windows</em>, the data member of the <code>FontData</code>
+ * corresponds to a Windows <code>LOGFONT</code> structure whose fields
+ * may be retrieved and modified.</li>
+ * <li>On <em>X</em>, the fields of the <code>FontData</code> correspond
+ * to the entries in the font's XLFD name and may be retrieved and modified.
+ * </ul>
+ * Application code does <em>not</em> need to explicitly release the
+ * resources managed by each instance when those instances are no longer
+ * required, and thus no <code>dispose()</code> method is provided.
+ *
+ * @see Font
+ */
+public final class FontData {
+ /**
+ * the font name
+ * (Warning: This field is platform dependent)
+ * <p>
+ * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It is not available on all
+ * platforms and should never be accessed from application code.
+ * </p>
+ */
+ public String name;
+
+ /**
+ * The height of the font data in points
+ * (Warning: This field is platform dependent)
+ * <p>
+ * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It is not available on all
+ * platforms and should never be accessed from application code.
+ * </p>
+ */
+ public float height;
+
+ /**
+ * the font style
+ * (Warning: This field is platform dependent)
+ * <p>
+ * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It is not available on all
+ * platforms and should never be accessed from application code.
+ * </p>
+ */
+ public int style;
+
+ /**
+ * the NSFont font name
+ * (Warning: This field is platform dependent)
+ * <p>
+ * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It is not available on all
+ * platforms and should never be accessed from application code.
+ * </p>
+ */
+ public String nsName;
+
+ /**
+ * The locales of the font
+ */
+ String lang, country, variant;
+
+/**
+ * Constructs a new uninitialized font data.
+ */
+public FontData () {
+ this("", 12, SWT.NORMAL);
+}
+
+/**
+ * Constructs a new FontData given a string representation
+ * in the form generated by the <code>FontData.toString</code>
+ * method.
+ * <p>
+ * Note that the representation varies between platforms,
+ * and a FontData can only be created from a string that was
+ * generated on the same platform.
+ * </p>
+ *
+ * @param string the string representation of a <code>FontData</code> (must not be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument does not represent a valid description</li>
+ * </ul>
+ *
+ * @see #toString
+ */
+public FontData(String string) {
+ if (string == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ int start = 0;
+ int end = string.indexOf('|');
+ if (end == -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ String version1 = string.substring(start, end);
+ try {
+ if (Integer.parseInt(version1) != 1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ } catch (NumberFormatException e) {
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+
+ start = end + 1;
+ end = string.indexOf('|', start);
+ if (end == -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ String name = string.substring(start, end);
+
+ start = end + 1;
+ end = string.indexOf('|', start);
+ if (end == -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ float height = 0;
+ try {
+ height = Float.parseFloat(string.substring(start, end));
+ } catch (NumberFormatException e) {
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+
+ start = end + 1;
+ end = string.indexOf('|', start);
+ if (end == -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ int style = 0;
+ try {
+ style = Integer.parseInt(string.substring(start, end));
+ } catch (NumberFormatException e) {
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+
+ start = end + 1;
+ end = string.indexOf('|', start);
+ setName(name);
+ setHeight(height);
+ setStyle(style);
+ if (end == -1) return;
+ String platform = string.substring(start, end);
+
+ start = end + 1;
+ end = string.indexOf('|', start);
+ if (end == -1) return;
+ String version2 = string.substring(start, end);
+
+ if (platform.equals("COCOA") && version2.equals("1")) {
+ start = end + 1;
+ end = string.length();
+ if (start < end) nsName = string.substring(start, end);
+ }
+}
+
+/**
+ * Constructs a new font data given a font name,
+ * the height of the desired font in points,
+ * and a font style.
+ *
+ * @param name the name of the font (must not be null)
+ * @param height the font height in points
+ * @param style a bit or combination of NORMAL, BOLD, ITALIC
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - when the font name is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the height is negative</li>
+ * </ul>
+ */
+public FontData(String name, int height, int style) {
+ setName(name);
+ setHeight(height);
+ setStyle(style);
+}
+
+/*public*/ FontData(String name, float height, int style) {
+ setName(name);
+ setHeight(height);
+ setStyle(style);
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode
+ */
+public boolean equals (Object object) {
+ if (object == this) return true;
+ if (!(object instanceof FontData)) return false;
+ FontData data = (FontData)object;
+ return name.equals(data.name) && height == data.height && style == data.style;
+}
+
+/**
+ * Returns the height of the receiver in points.
+ *
+ * @return the height of this FontData
+ *
+ * @see #setHeight(int)
+ */
+public int getHeight() {
+ return (int)height;
+}
+
+/*public*/ float getHeightF() {
+ return height;
+}
+
+/**
+ * Returns the locale of the receiver.
+ * <p>
+ * The locale determines which platform character set this
+ * font is going to use. Widgets and graphics operations that
+ * use this font will convert UNICODE strings to the platform
+ * character set of the specified locale.
+ * </p>
+ * <p>
+ * On platforms where there are multiple character sets for a
+ * given language/country locale, the variant portion of the
+ * locale will determine the character set.
+ * </p>
+ *
+ * @return the <code>String</code> representing a Locale object
+ * @since 3.0
+ */
+public String getLocale () {
+ StringBuffer buffer = new StringBuffer ();
+ char sep = '_';
+ if (lang != null) {
+ buffer.append (lang);
+ buffer.append (sep);
+ }
+ if (country != null) {
+ buffer.append (country);
+ buffer.append (sep);
+ }
+ if (variant != null) {
+ buffer.append (variant);
+ }
+
+ String result = buffer.toString ();
+ int length = result.length ();
+ if (length > 0) {
+ if (result.charAt (length - 1) == sep) {
+ result = result.substring (0, length - 1);
+ }
+ }
+ return result;
+}
+
+/**
+ * Returns the name of the receiver.
+ * On platforms that support font foundries, the return value will
+ * be the foundry followed by a dash ("-") followed by the face name.
+ *
+ * @return the name of this <code>FontData</code>
+ *
+ * @see #setName
+ */
+public String getName() {
+ return name;
+}
+
+/**
+ * Returns the style of the receiver which is a bitwise OR of
+ * one or more of the <code>SWT</code> constants NORMAL, BOLD
+ * and ITALIC.
+ *
+ * @return the style of this <code>FontData</code>
+ *
+ * @see #setStyle
+ */
+public int getStyle() {
+ return style;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals
+ */
+public int hashCode () {
+ return name.hashCode() ^ getHeight() ^ style;
+}
+
+/**
+ * Sets the height of the receiver. The parameter is
+ * specified in terms of points, where a point is one
+ * seventy-second of an inch.
+ *
+ * @param height the height of the <code>FontData</code>
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the height is negative</li>
+ * </ul>
+ *
+ * @see #getHeight
+ */
+public void setHeight(int height) {
+ if (height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ this.height = height;
+}
+
+/*public*/ void setHeight(float height) {
+ if (height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ this.height = height;
+}
+
+/**
+ * Sets the locale of the receiver.
+ * <p>
+ * The locale determines which platform character set this
+ * font is going to use. Widgets and graphics operations that
+ * use this font will convert UNICODE strings to the platform
+ * character set of the specified locale.
+ * </p>
+ * <p>
+ * On platforms where there are multiple character sets for a
+ * given language/country locale, the variant portion of the
+ * locale will determine the character set.
+ * </p>
+ *
+ * @param locale the <code>String</code> representing a Locale object
+ * @see java.util.Locale#toString
+ */
+public void setLocale(String locale) {
+ lang = country = variant = null;
+ if (locale != null) {
+ char sep = '_';
+ int length = locale.length();
+ int firstSep, secondSep;
+
+ firstSep = locale.indexOf(sep);
+ if (firstSep == -1) {
+ firstSep = secondSep = length;
+ } else {
+ secondSep = locale.indexOf(sep, firstSep + 1);
+ if (secondSep == -1) secondSep = length;
+ }
+ if (firstSep > 0) lang = locale.substring(0, firstSep);
+ if (secondSep > firstSep + 1) country = locale.substring(firstSep + 1, secondSep);
+ if (length > secondSep + 1) variant = locale.substring(secondSep + 1);
+ }
+}
+
+/**
+ * Sets the name of the receiver.
+ * <p>
+ * Some platforms support font foundries. On these platforms, the name
+ * of the font specified in setName() may have one of the following forms:
+ * <ol>
+ * <li>a face name (for example, "courier")</li>
+ * <li>a foundry followed by a dash ("-") followed by a face name (for example, "adobe-courier")</li>
+ * </ol>
+ * In either case, the name returned from getName() will include the
+ * foundry.
+ * </p>
+ * <p>
+ * On platforms that do not support font foundries, only the face name
+ * (for example, "courier") is used in <code>setName()</code> and
+ * <code>getName()</code>.
+ * </p>
+ *
+ * @param name the name of the font data (must not be null)
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - when the font name is null</li>
+ * </ul>
+ *
+ * @see #getName
+ */
+public void setName(String name) {
+ if (name == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ this.name = name;
+ nsName = null;
+}
+
+/**
+ * Sets the style of the receiver to the argument which must
+ * be a bitwise OR of one or more of the <code>SWT</code>
+ * constants NORMAL, BOLD and ITALIC. All other style bits are
+ * ignored.
+ *
+ * @param style the new style for this <code>FontData</code>
+ *
+ * @see #getStyle
+ */
+public void setStyle(int style) {
+ this.style = style;
+ nsName = null;
+}
+
+/**
+ * Returns a string representation of the receiver which is suitable
+ * for constructing an equivalent instance using the
+ * <code>FontData(String)</code> constructor.
+ *
+ * @return a string representation of the FontData
+ *
+ * @see FontData
+ */
+public String toString() {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("1|");
+ buffer.append(getName());
+ buffer.append("|");
+ buffer.append(getHeightF());
+ buffer.append("|");
+ buffer.append(getStyle());
+ buffer.append("|");
+ buffer.append("COCOA|1|");
+ if (nsName != null) buffer.append(nsName);
+ return buffer.toString();
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/FontMetrics.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/FontMetrics.java
new file mode 100755
index 0000000000..71286fd40b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/FontMetrics.java
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.graphics;
+
+
+/**
+ * Instances of this class provide measurement information
+ * about fonts including ascent, descent, height, leading
+ * space between rows, and average character width.
+ * <code>FontMetrics</code> are obtained from <code>GC</code>s
+ * using the <code>getFontMetrics()</code> method.
+ *
+ * @see GC#getFontMetrics
+ */
+public final class FontMetrics {
+ int ascent, descent, averageCharWidth, leading, height;
+
+FontMetrics() {
+}
+
+public static FontMetrics cocoa_new(int ascent, int descent, int averageCharWidth, int leading, int height) {
+ FontMetrics fontMetrics = new FontMetrics();
+ fontMetrics.ascent = ascent;
+ fontMetrics.descent = descent;
+ fontMetrics.averageCharWidth = averageCharWidth;
+ fontMetrics.leading = leading;
+ fontMetrics.height = height;
+ return fontMetrics;
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode
+ */
+public boolean equals (Object object) {
+ if (object == this) return true;
+ if (!(object instanceof FontMetrics)) return false;
+ FontMetrics metrics = (FontMetrics)object;
+ return ascent == metrics.ascent && descent == metrics.descent &&
+ averageCharWidth == metrics.averageCharWidth && leading == metrics.leading &&
+ height == metrics.height;
+}
+
+/**
+ * Returns the ascent of the font described by the receiver. A
+ * font's <em>ascent</em> is the distance from the baseline to the
+ * top of actual characters, not including any of the leading area,
+ * measured in pixels.
+ *
+ * @return the ascent of the font
+ */
+public int getAscent() {
+ return ascent;
+}
+
+/**
+ * Returns the average character width, measured in pixels,
+ * of the font described by the receiver.
+ *
+ * @return the average character width of the font
+ */
+public int getAverageCharWidth() {
+ return averageCharWidth;
+}
+
+/**
+ * Returns the descent of the font described by the receiver. A
+ * font's <em>descent</em> is the distance from the baseline to the
+ * bottom of actual characters, not including any of the leading area,
+ * measured in pixels.
+ *
+ * @return the descent of the font
+ */
+public int getDescent() {
+ return descent;
+}
+
+/**
+ * Returns the height of the font described by the receiver,
+ * measured in pixels. A font's <em>height</em> is the sum of
+ * its ascent, descent and leading area.
+ *
+ * @return the height of the font
+ *
+ * @see #getAscent
+ * @see #getDescent
+ * @see #getLeading
+ */
+public int getHeight() {
+ return height;
+}
+
+/**
+ * Returns the leading area of the font described by the
+ * receiver. A font's <em>leading area</em> is the space
+ * above its ascent which may include accents or other marks.
+ *
+ * @return the leading space of the font
+ */
+public int getLeading() {
+ return leading;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals
+ */
+public int hashCode() {
+ return ascent ^ descent ^ averageCharWidth ^ leading ^ height;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
new file mode 100755
index 0000000000..93a9d7996d
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java
@@ -0,0 +1,3362 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.graphics;
+
+import org.eclipse.swt.internal.Compatibility;
+import org.eclipse.swt.internal.cocoa.*;
+import org.eclipse.swt.*;
+
+/**
+ * Class <code>GC</code> is where all of the drawing capabilities that are
+ * supported by SWT are located. Instances are used to draw on either an
+ * <code>Image</code>, a <code>Control</code>, or directly on a <code>Display</code>.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>LEFT_TO_RIGHT, RIGHT_TO_LEFT</dd>
+ * </dl>
+ *
+ * <p>
+ * The SWT drawing coordinate system is the two-dimensional space with the origin
+ * (0,0) at the top left corner of the drawing area and with (x,y) values increasing
+ * to the right and downward respectively.
+ * </p>
+ *
+ * <p>
+ * Application code must explicitly invoke the <code>GC.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required. This is <em>particularly</em>
+ * important on Windows95 and Windows98 where the operating system has a limited
+ * number of device contexts available.
+ * </p>
+ *
+ * <p>
+ * Note: Only one of LEFT_TO_RIGHT and RIGHT_TO_LEFT may be specified.
+ * </p>
+ *
+ * @see org.eclipse.swt.events.PaintEvent
+ */
+public final class GC extends Resource {
+ /**
+ * the handle to the OS device context
+ * (Warning: This field is platform dependent)
+ * <p>
+ * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It is not available on all
+ * platforms and should never be accessed from application code.
+ * </p>
+ */
+ public NSGraphicsContext handle;
+
+ Drawable drawable;
+ GCData data;
+
+ static final int TAB_COUNT = 32;
+
+ final static int FOREGROUND = 1 << 0;
+ final static int BACKGROUND = 1 << 1;
+ final static int FONT = 1 << 2;
+ final static int LINE_STYLE = 1 << 3;
+ final static int LINE_CAP = 1 << 4;
+ final static int LINE_JOIN = 1 << 5;
+ final static int LINE_WIDTH = 1 << 6;
+ final static int LINE_MITERLIMIT = 1 << 7;
+ final static int FOREGROUND_FILL = 1 << 8;
+ final static int DRAW_OFFSET = 1 << 9;
+ final static int CLIPPING = 1 << 10;
+ final static int TRANSFORM = 1 << 11;
+ final static int DRAW = CLIPPING | TRANSFORM | FOREGROUND | LINE_WIDTH | LINE_STYLE | LINE_CAP | LINE_JOIN | LINE_MITERLIMIT | DRAW_OFFSET;
+ final static int FILL = CLIPPING | TRANSFORM | BACKGROUND;
+
+ static final float[] LINE_DOT = new float[]{1, 1};
+ static final float[] LINE_DASH = new float[]{3, 1};
+ static final float[] LINE_DASHDOT = new float[]{3, 1, 1, 1};
+ static final float[] LINE_DASHDOTDOT = new float[]{3, 1, 1, 1, 1, 1};
+ static final float[] LINE_DOT_ZERO = new float[]{3, 3};
+ static final float[] LINE_DASH_ZERO = new float[]{18, 6};
+ static final float[] LINE_DASHDOT_ZERO = new float[]{9, 6, 3, 6};
+ static final float[] LINE_DASHDOTDOT_ZERO = new float[]{9, 3, 3, 3, 3, 3};
+
+GC() {
+}
+
+/**
+ * Constructs a new instance of this class which has been
+ * configured to draw on the specified drawable. Sets the
+ * foreground color, background color and font in the GC
+ * to match those in the drawable.
+ * <p>
+ * You must dispose the graphics context when it is no longer required.
+ * </p>
+ * @param drawable the drawable to draw on
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the drawable is null</li>
+ * <li>ERROR_NULL_ARGUMENT - if there is no current device</li>
+ * <li>ERROR_INVALID_ARGUMENT
+ * - if the drawable is an image that is not a bitmap or an icon
+ * - if the drawable is an image or printer that is already selected
+ * into another graphics context</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES if a handle could not be obtained for GC creation</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS if not called from the thread that created the drawable</li>
+ * </ul>
+ */
+public GC(Drawable drawable) {
+ this(drawable, 0);
+}
+
+/**
+ * Constructs a new instance of this class which has been
+ * configured to draw on the specified drawable. Sets the
+ * foreground color, background color and font in the GC
+ * to match those in the drawable.
+ * <p>
+ * You must dispose the graphics context when it is no longer required.
+ * </p>
+ *
+ * @param drawable the drawable to draw on
+ * @param style the style of GC to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the drawable is null</li>
+ * <li>ERROR_NULL_ARGUMENT - if there is no current device</li>
+ * <li>ERROR_INVALID_ARGUMENT
+ * - if the drawable is an image that is not a bitmap or an icon
+ * - if the drawable is an image or printer that is already selected
+ * into another graphics context</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES if a handle could not be obtained for GC creation</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS if not called from the thread that created the drawable</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public GC(Drawable drawable, int style) {
+ if (drawable == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ GCData data = new GCData();
+ data.style = checkStyle(style);
+ int gdkGC = drawable.internal_new_GC(data);
+ Device device = data.device;
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ this.device = data.device = device;
+ init(drawable, data, gdkGC);
+}
+
+static int checkStyle (int style) {
+ if ((style & SWT.LEFT_TO_RIGHT) != 0) style &= ~SWT.RIGHT_TO_LEFT;
+ return style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT);
+}
+
+/**
+ * Invokes platform specific functionality to allocate a new graphics context.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>GC</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param drawable the Drawable for the receiver.
+ * @param data the data for the receiver.
+ *
+ * @return a new <code>GC</code>
+ *
+ * @private
+ */
+public static GC carbon_new(Drawable drawable, GCData data) {
+ GC gc = new GC();
+ int context = drawable.internal_new_GC(data);
+ gc.device = data.device;
+ gc.init(drawable, data, context);
+ return gc;
+}
+
+/**
+ * Invokes platform specific functionality to wrap a graphics context.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>GC</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param context the Quartz context.
+ * @param data the data for the receiver.
+ *
+ * @return a new <code>GC</code>
+ */
+public static GC carbon_new(int context, GCData data) {
+ GC gc = new GC();
+ gc.device = data.device;
+ gc.init(null, data, context);
+ return gc;
+}
+
+void checkGC (int mask) {
+// NSGraphicsContext.setCurrentContext(handle);
+
+ if ((data.state & CLIPPING) == 0 || (data.state & TRANSFORM) == 0) {
+ handle.restoreGraphicsState();
+ handle.saveGraphicsState();
+ if (data.clipPath != null) data.clipPath.addClip();
+ if (data.transform != null) data.transform.concat();
+ mask &= ~(TRANSFORM | CLIPPING);
+ data.state |= TRANSFORM | CLIPPING;
+ data.state &= ~(BACKGROUND | FOREGROUND);
+ }
+
+ int state = data.state;
+ if ((state & mask) == mask) return;
+ state = (state ^ mask) & mask;
+ data.state |= mask;
+
+ if ((state & FOREGROUND) != 0) {
+ Pattern pattern = data.foregroundPattern;
+ if (pattern != null) {
+ if (pattern.color != null) pattern.color.setStroke();
+ } else {
+ float[] color = data.foreground;
+ NSColor.colorWithDeviceRed(color[0], color[1], color[2], data.alpha / 255f).setStroke();
+ }
+ }
+ if ((state & FOREGROUND_FILL) != 0) {
+ Pattern pattern = data.foregroundPattern;
+ if (pattern != null) {
+ if (pattern.color != null) pattern.color.setFill();
+ } else {
+ float[] color = data.foreground;
+ NSColor.colorWithDeviceRed(color[0], color[1], color[2], data.alpha / 255f).setFill();
+ }
+ data.state &= ~BACKGROUND;
+ }
+ if ((state & BACKGROUND) != 0) {
+ Pattern pattern = data.backgroundPattern;
+ if (pattern != null) {
+ if (pattern.color != null) pattern.color.setFill();
+ } else {
+ float[] color = data.background;
+ NSColor.colorWithDeviceRed(color[0], color[1], color[2], data.alpha / 255f).setFill();
+ }
+ data.state &= ~FOREGROUND_FILL;
+ }
+ NSBezierPath path = data.path;
+ if ((state & LINE_WIDTH) != 0) {
+ path.setLineWidth(data.lineWidth == 0 ? 1 : data.lineWidth);
+ switch (data.lineStyle) {
+ case SWT.LINE_DOT:
+ case SWT.LINE_DASH:
+ case SWT.LINE_DASHDOT:
+ case SWT.LINE_DASHDOTDOT:
+ state |= LINE_STYLE;
+ }
+ }
+ if ((state & LINE_STYLE) != 0) {
+ float[] dashes = null;
+ float width = data.lineWidth;
+ switch (data.lineStyle) {
+ case SWT.LINE_SOLID: break;
+ case SWT.LINE_DASH: dashes = width != 0 ? LINE_DASH : LINE_DASH_ZERO; break;
+ case SWT.LINE_DOT: dashes = width != 0 ? LINE_DOT : LINE_DOT_ZERO; break;
+ case SWT.LINE_DASHDOT: dashes = width != 0 ? LINE_DASHDOT : LINE_DASHDOT_ZERO; break;
+ case SWT.LINE_DASHDOTDOT: dashes = width != 0 ? LINE_DASHDOTDOT : LINE_DASHDOTDOT_ZERO; break;
+ case SWT.LINE_CUSTOM: dashes = data.lineDashes; break;
+ }
+ if (dashes != null) {
+ float[] lengths = new float[dashes.length];
+ for (int i = 0; i < lengths.length; i++) {
+ lengths[i] = width == 0 || data.lineStyle == SWT.LINE_CUSTOM ? dashes[i] : dashes[i] * width;
+ }
+ path.setLineDash(lengths, lengths.length, data.lineDashesOffset);
+ } else {
+ path.setLineDash(null, 0, 0);
+ }
+ }
+ if ((state & LINE_MITERLIMIT) != 0) {
+ path.setMiterLimit(data.lineMiterLimit);
+ }
+ if ((state & LINE_JOIN) != 0) {
+ int joinStyle = 0;
+ switch (data.lineJoin) {
+ case SWT.JOIN_MITER: joinStyle = OS.NSMiterLineJoinStyle; break;
+ case SWT.JOIN_ROUND: joinStyle = OS.NSRoundLineJoinStyle; break;
+ case SWT.JOIN_BEVEL: joinStyle = OS.NSBevelLineJoinStyle; break;
+ }
+ path.setLineJoinStyle(joinStyle);
+ }
+ if ((state & LINE_CAP) != 0) {
+ int capStyle = 0;
+ switch (data.lineCap) {
+ case SWT.CAP_ROUND: capStyle = OS.NSRoundLineCapStyle; break;
+ case SWT.CAP_FLAT: capStyle = OS.NSButtLineCapStyle; break;
+ case SWT.CAP_SQUARE: capStyle = OS.NSSquareLineCapStyle; break;
+ }
+ path.setLineCapStyle(capStyle);
+ }
+ if ((state & DRAW_OFFSET) != 0) {
+ data.drawXOffset = data.drawYOffset = 0;
+ float sx = 1, sy = 1;
+ if (data.transform != null) {
+ NSAffineTransformStruct struct = data.transform.transformStruct();
+ sx = struct.m11;
+ sy = struct.m22;
+ }
+ float scaling = sx;
+ if (scaling < 0) scaling = -scaling;
+ float strokeWidth = data.lineWidth * scaling;
+ if (strokeWidth == 0 || ((int)strokeWidth % 2) == 1) {
+ data.drawXOffset = 0.5f / scaling;
+ }
+ scaling = sy;
+ if (scaling < 0) scaling = -scaling;
+ strokeWidth = data.lineWidth * scaling;
+ if (strokeWidth == 0 || ((int)strokeWidth % 2) == 1) {
+ data.drawYOffset = 0.5f / scaling;
+ }
+ }
+}
+
+/**
+ * Copies a rectangular area of the receiver at the specified
+ * position into the image, which must be of type <code>SWT.BITMAP</code>.
+ *
+ * @param image the image to copy into
+ * @param x the x coordinate in the receiver of the area to be copied
+ * @param y the y coordinate in the receiver of the area to be copied
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the image is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the image is not a bitmap or has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void copyArea(Image image, int x, int y) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (image == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (image.type != SWT.BITMAP || image.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+// if (data.image != null) {
+// copyArea(image, x, y, data.image.handle);
+// } else if (data.control != 0) {
+// int imageHandle = image.handle;
+// int width = OS.CGImageGetWidth(imageHandle);
+// int height = OS.CGImageGetHeight(imageHandle);
+// int window = OS.GetControlOwner(data.control);
+// Rect srcRect = new Rect ();
+// CGPoint pt = new CGPoint ();
+// int[] contentView = new int[1];
+// OS.HIViewFindByID(OS.HIViewGetRoot(window), OS.kHIViewWindowContentID(), contentView);
+// OS.HIViewConvertPoint (pt, data.control, contentView[0]);
+// x += (int) pt.x;
+// y += (int) pt.y;
+// Rect inset = data.insetRect;
+// x -= inset.left;
+// y -= inset.top;
+// srcRect.left = (short)x;
+// srcRect.top = (short)y;
+// srcRect.right = (short)(x + width);
+// srcRect.bottom = (short)(y + height);
+// Rect destRect = new Rect();
+// destRect.right = (short)width;
+// destRect.bottom = (short)height;
+// int bpl = width * 4;
+// int[] gWorld = new int[1];
+// int port = OS.GetWindowPort(window);
+// OS.NewGWorldFromPtr(gWorld, OS.k32ARGBPixelFormat, destRect, 0, 0, 0, image.data, bpl);
+// OS.CopyBits(OS.GetPortBitMapForCopyBits(port), OS.GetPortBitMapForCopyBits(gWorld[0]), srcRect, destRect, (short)OS.srcCopy, 0);
+// OS.DisposeGWorld(gWorld [0]);
+// } else if (data.window != 0) {
+// int imageHandle = image.handle;
+// CGRect rect = new CGRect();
+// rect.x = x;
+// rect.y = y;
+// rect.width = OS.CGImageGetWidth(imageHandle);
+// rect.height = OS.CGImageGetHeight(imageHandle);
+// int[] displays = new int[16];
+// int[] count = new int[1];
+// if (OS.CGGetDisplaysWithRect(rect, displays.length, displays, count) != 0) return;
+// for (int i = 0; i < count[0]; i++) {
+// int display = displays[i];
+// int address = OS.CGDisplayBaseAddress(display);
+// if (address != 0) {
+// int width = OS.CGDisplayPixelsWide(display);
+// int height = OS.CGDisplayPixelsHigh(display);
+// int bpr = OS.CGDisplayBytesPerRow(display);
+// int bpp = OS.CGDisplayBitsPerPixel(display);
+// int bps = OS.CGDisplayBitsPerSample(display);
+// int bitmapInfo = OS.kCGImageAlphaNoneSkipFirst;
+// switch (bpp) {
+// case 16: bitmapInfo |= OS.kCGBitmapByteOrder16Host; break;
+// case 32: bitmapInfo |= OS.kCGBitmapByteOrder32Host; break;
+// }
+// int srcImage = 0;
+// if (OS.__BIG_ENDIAN__() && OS.VERSION >= 0x1040) {
+// int context = OS.CGBitmapContextCreate(address, width, height, bps, bpr, data.device.colorspace, bitmapInfo);
+// srcImage = OS.CGBitmapContextCreateImage(context);
+// OS.CGContextRelease(context);
+// } else {
+// int provider = OS.CGDataProviderCreateWithData(0, address, bpr * height, 0);
+// srcImage = OS.CGImageCreate(width, height, bps, bpp, bpr, data.device.colorspace, bitmapInfo, provider, null, true, 0);
+// OS.CGDataProviderRelease(provider);
+// }
+// copyArea(image, x, y, srcImage);
+// if (srcImage != 0) OS.CGImageRelease(srcImage);
+// }
+// }
+// }
+}
+
+void copyArea (Image image, int x, int y, int srcImage) {
+ if (srcImage == 0) return;
+// int imageHandle = image.handle;
+// int bpc = OS.CGImageGetBitsPerComponent(imageHandle);
+// int width = OS.CGImageGetWidth(imageHandle);
+// int height = OS.CGImageGetHeight(imageHandle);
+// int bpr = OS.CGImageGetBytesPerRow(imageHandle);
+// int alphaInfo = OS.CGImageGetAlphaInfo(imageHandle);
+// int context = OS.CGBitmapContextCreate(image.data, width, height, bpc, bpr, data.device.colorspace, alphaInfo);
+// if (context != 0) {
+// CGRect rect = new CGRect();
+// rect.x = -x;
+// rect.y = y;
+// rect.width = OS.CGImageGetWidth(srcImage);
+// rect.height = OS.CGImageGetHeight(srcImage);
+// OS.CGContextTranslateCTM(context, 0, -(rect.height - height));
+// OS.CGContextDrawImage(context, rect, srcImage);
+// OS.CGContextRelease(context);
+// }
+}
+
+/**
+ * Copies a rectangular area of the receiver at the source
+ * position onto the receiver at the destination position.
+ *
+ * @param srcX the x coordinate in the receiver of the area to be copied
+ * @param srcY the y coordinate in the receiver of the area to be copied
+ * @param width the width of the area to copy
+ * @param height the height of the area to copy
+ * @param destX the x coordinate in the receiver of the area to copy to
+ * @param destY the y coordinate in the receiver of the area to copy to
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void copyArea(int srcX, int srcY, int width, int height, int destX, int destY) {
+ copyArea(srcX, srcY, width, height, destX, destY, true);
+}
+/**
+ * Copies a rectangular area of the receiver at the source
+ * position onto the receiver at the destination position.
+ *
+ * @param srcX the x coordinate in the receiver of the area to be copied
+ * @param srcY the y coordinate in the receiver of the area to be copied
+ * @param width the width of the area to copy
+ * @param height the height of the area to copy
+ * @param destX the x coordinate in the receiver of the area to copy to
+ * @param destY the y coordinate in the receiver of the area to copy to
+ * @param paint if <code>true</code> paint events will be generated for old and obscured areas
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void copyArea(int srcX, int srcY, int width, int height, int destX, int destY, boolean paint) {
+// if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+// if (data.updateClip) setCGClipping();
+// if (width <= 0 || height <= 0) return;
+// int deltaX = destX - srcX, deltaY = destY - srcY;
+// if (deltaX == 0 && deltaY == 0) return;
+// if (data.image != null) {
+// OS.CGContextSaveGState(handle);
+// OS.CGContextScaleCTM(handle, 1, -1);
+// OS.CGContextTranslateCTM(handle, 0, -(height + 2 * destY));
+// CGRect rect = new CGRect();
+// rect.x = destX;
+// rect.y = destY;
+// rect.width = width;
+// rect.height = height;
+// int h = OS.CGImageGetHeight(data.image.handle);
+// int bpr = OS.CGImageGetBytesPerRow(data.image.handle);
+// int provider = OS.CGDataProviderCreateWithData(0, data.image.data, bpr * h, 0);
+// if (provider != 0) {
+// int colorspace = device.colorspace;
+// int img = OS.CGImageCreate(width, height, 8, 32, bpr, colorspace, OS.kCGImageAlphaNoneSkipFirst, provider, null, true, 0);
+// OS.CGDataProviderRelease(provider);
+// OS.CGContextDrawImage(handle, rect, img);
+// OS.CGImageRelease(img);
+// }
+// OS.CGContextRestoreGState(handle);
+// return;
+// }
+// if (data.control != 0) {
+// int port = data.port;
+// int window = OS.GetControlOwner(data.control);
+// if (port == 0) port = OS.GetWindowPort(window);
+//
+// /* Calculate src and dest rectangles/regions */
+// Rect rect = new Rect();
+// OS.GetControlBounds(data.control, rect);
+// int convertX = 0, convertY = 0;
+// CGPoint pt = new CGPoint ();
+// int[] contentView = new int[1];
+// OS.HIViewFindByID(OS.HIViewGetRoot(window), OS.kHIViewWindowContentID(), contentView);
+// OS.HIViewConvertPoint(pt, OS.HIViewGetSuperview(data.control), contentView[0]);
+// convertX = rect.left + (int) pt.x;
+// convertY = rect.top + (int) pt.y;
+// rect.left += (int) pt.x;
+// rect.top += (int) pt.y;
+// rect.right += (int) pt.x;
+// rect.bottom += (int) pt.y;
+// Rect srcRect = new Rect();
+// int left = rect.left + srcX;
+// int top = rect.top + srcY;
+// OS.SetRect(srcRect, (short)left, (short)top, (short)(left + width), (short)(top + height));
+// int srcRgn = OS.NewRgn();
+// OS.RectRgn(srcRgn, srcRect);
+// OS.SectRect(rect, srcRect, srcRect);
+// Rect destRect = new Rect ();
+// OS.SetRect(destRect, srcRect.left, srcRect.top, srcRect.right, srcRect.bottom);
+// OS.OffsetRect(destRect, (short)deltaX, (short)deltaY);
+// int destRgn = OS.NewRgn();
+// OS.RectRgn(destRgn, destRect);
+//
+// /* Copy bits with appropriated clipping region */
+// if (!OS.EmptyRect(srcRect)) {
+// if (data.visibleRgn == 0 || OS.RectInRgn(srcRect, data.visibleRgn)) {
+// int clipRgn = data.visibleRgn;
+// if (data.clipRgn != 0) {
+// clipRgn = OS.NewRgn();
+// OS.SectRgn(data.clipRgn, data.visibleRgn, clipRgn);
+// }
+//
+// /*
+// * Feature in the Macintosh. ScrollRect() only copies bits
+// * that are inside the specified rectangle. This means that
+// * it is not possible to copy non overlaping bits without
+// * copying the bits in between the source and destination
+// * rectangles. The fix is to check if the source and
+// * destination rectangles are disjoint and use CopyBits()
+// * instead.
+// */
+// if (!OS.EmptyRgn(clipRgn)) {
+// boolean disjoint = (destX + width < srcX) || (srcX + width < destX) || (destY + height < srcY) || (srcY + height < destY);
+// if (!disjoint && (deltaX == 0 || deltaY == 0)) {
+// int[] currentPort = new int[1];
+// OS.GetPort(currentPort);
+// OS.SetPort(port);
+// int oldClip = OS.NewRgn();
+// OS.GetClip(oldClip);
+// OS.SetClip(clipRgn);
+// OS.UnionRect(srcRect, destRect, rect);
+// OS.ScrollRect(rect, (short)deltaX, (short)deltaY, 0);
+// OS.SetClip(oldClip);
+// OS.DisposeRgn(oldClip);
+// OS.SetPort(currentPort[0]);
+// } else {
+// int portBitMap = OS.GetPortBitMapForCopyBits (port);
+// OS.CopyBits(portBitMap, portBitMap, srcRect, destRect, (short)OS.srcCopy, clipRgn);
+// OS.QDFlushPortBuffer(port, destRgn);
+// }
+// }
+//
+// if (clipRgn != data.visibleRgn) OS.DisposeRgn(clipRgn);
+// }
+// }
+//
+// /* Invalidate src and obscured areas */
+// if (paint) {
+// int invalRgn = OS.NewRgn();
+// OS.DiffRgn(srcRgn, data.visibleRgn, invalRgn);
+// OS.OffsetRgn(invalRgn, (short)deltaX, (short)deltaY);
+// OS.DiffRgn(srcRgn, destRgn, srcRgn);
+// OS.UnionRgn(srcRgn, invalRgn, invalRgn);
+// OS.SectRgn(data.visibleRgn, invalRgn, invalRgn);
+// OS.OffsetRgn(invalRgn, (short)-convertX, (short)-convertY);
+// OS.HIViewSetNeedsDisplayInRegion(data.control, invalRgn, true);
+// OS.DisposeRgn(invalRgn);
+// }
+//
+// /* Dispose src and dest regions */
+// OS.DisposeRgn(destRgn);
+// OS.DisposeRgn(srcRgn);
+// }
+}
+
+NSAttributedString createString(String string, int flags) {
+ NSMutableDictionary dict = NSMutableDictionary.dictionaryWithCapacity(4);
+ float[] foreground = data.foreground;
+ NSColor color = NSColor.colorWithDeviceRed(foreground[0], foreground[1], foreground[2], data.alpha / 255f);
+ dict.setObject(color, OS.NSForegroundColorAttributeName());
+ dict.setObject(data.font.handle, OS.NSFontAttributeName());
+ if ((flags & SWT.DRAW_TRANSPARENT) == 0) {
+ float[] background = data.background;
+ color = NSColor.colorWithDeviceRed(background[0], background[1], background[2], data.alpha / 255f);
+ dict.setObject(color, OS.NSBackgroundColorAttributeName());
+ }
+ int length = string.length();
+ char[] chars = new char[length];
+ string.getChars(0, length, chars, 0);
+// int breakCount = 0;
+// int[] breaks = null;
+// if ((flags & (SWT.DRAW_MNEMONIC | SWT.DRAW_DELIMITER)) != 0) {
+// int i=0, j=0;
+// while (i < chars.length) {
+// char c = chars [j++] = chars [i++];
+// switch (c) {
+// case '&': {
+// if ((flags & SWT.DRAW_MNEMONIC) != 0) {
+// if (i == chars.length) {continue;}
+// if (chars [i] == '&') {i++; continue;}
+// j--;
+// }
+// break;
+// }
+// case '\r':
+// case '\n': {
+// if ((flags & SWT.DRAW_DELIMITER) != 0) {
+// if (c == '\r' && i != chars.length && chars[i] == '\n') i++;
+// j--;
+// if (breaks == null) {
+// breaks = new int[4];
+// } else if (breakCount == breaks.length) {
+// int[] newBreaks = new int[breaks.length + 4];
+// System.arraycopy(breaks, 0, newBreaks, 0, breaks.length);
+// breaks = newBreaks;
+// }
+// breaks[breakCount++] = j;
+// }
+// break;
+// }
+// }
+// }
+// length = j;
+// }
+ NSString str = NSString.stringWithCharacters(chars, length);
+ return ((NSAttributedString)new NSAttributedString().alloc()).initWithString_attributes_(str, dict);
+}
+
+/**
+ * Disposes of the operating system resources associated with
+ * the graphics context. Applications must dispose of all GCs
+ * which they allocate.
+ *
+ * @exception SWTError <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS if not called from the thread that created the drawable</li>
+ * </ul>
+ */
+public void dispose() {
+ if (handle == null) return;
+ if (data.device.isDisposed()) return;
+
+ /* Free resources */
+ Image image = data.image;
+ if (image != null) {
+ image.memGC = null;
+ image.createAlpha();
+ }
+ handle.restoreGraphicsState();
+ if (data.clipPath != null) data.clipPath.release();
+ if (data.transform != null) data.transform.release();
+ if (data.inverseTransform != null) data.inverseTransform.release();
+ data.path = data.clipPath = null;
+ data.transform = data.inverseTransform = null;
+
+ /* Dispose the GC */
+ if (drawable != null) drawable.internal_dispose_GC(handle.id, data);
+
+ drawable = null;
+ data.image = null;
+ data = null;
+ handle = null;
+}
+
+/**
+ * Draws the outline of a circular or elliptical arc
+ * within the specified rectangular area.
+ * <p>
+ * The resulting arc begins at <code>startAngle</code> and extends
+ * for <code>arcAngle</code> degrees, using the current color.
+ * Angles are interpreted such that 0 degrees is at the 3 o'clock
+ * position. A positive value indicates a counter-clockwise rotation
+ * while a negative value indicates a clockwise rotation.
+ * </p><p>
+ * The center of the arc is the center of the rectangle whose origin
+ * is (<code>x</code>, <code>y</code>) and whose size is specified by the
+ * <code>width</code> and <code>height</code> arguments.
+ * </p><p>
+ * The resulting arc covers an area <code>width + 1</code> pixels wide
+ * by <code>height + 1</code> pixels tall.
+ * </p>
+ *
+ * @param x the x coordinate of the upper-left corner of the arc to be drawn
+ * @param y the y coordinate of the upper-left corner of the arc to be drawn
+ * @param width the width of the arc to be drawn
+ * @param height the height of the arc to be drawn
+ * @param startAngle the beginning angle
+ * @param arcAngle the angular extent of the arc, relative to the start angle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ checkGC(DRAW);
+ if (width < 0) {
+ x = x + width;
+ width = -width;
+ }
+ if (height < 0) {
+ y = y + height;
+ height = -height;
+ }
+ if (width == 0 || height == 0 || arcAngle == 0) return;
+ handle.saveGraphicsState();
+ NSAffineTransform transform = NSAffineTransform.transform();
+ float xOffset = data.drawXOffset, yOffset = data.drawYOffset;
+ transform.translateXBy(x + xOffset + width / 2f, y + yOffset + height / 2f);
+ transform.scaleXBy(width / 2f, height / 2f);
+ NSBezierPath path = data.path;
+ if (arcAngle < 0) {
+ path.appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_(new NSPoint(), 1, -(startAngle + arcAngle) * (float)Compatibility.PI / 180, -startAngle * (float)Compatibility.PI / 180);
+ } else {
+ path.appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_(new NSPoint(), 1, -startAngle * (float)Compatibility.PI / 180, -(startAngle + arcAngle) * (float)Compatibility.PI / 180);
+ }
+ path.transformUsingAffineTransform(transform);
+ path.stroke();
+ path.removeAllPoints();
+ handle.restoreGraphicsState();
+}
+
+/**
+ * Draws a rectangle, based on the specified arguments, which has
+ * the appearance of the platform's <em>focus rectangle</em> if the
+ * platform supports such a notion, and otherwise draws a simple
+ * rectangle in the receiver's foreground color.
+ *
+ * @param x the x coordinate of the rectangle
+ * @param y the y coordinate of the rectangle
+ * @param width the width of the rectangle
+ * @param height the height of the rectangle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #drawRectangle(int, int, int, int)
+ */
+public void drawFocus(int x, int y, int width, int height) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ checkGC(CLIPPING | TRANSFORM);
+// int[] metric = new int[1];
+// OS.GetThemeMetric(OS.kThemeMetricFocusRectOutset, metric);
+// CGRect rect = new CGRect ();
+// rect.x = x + metric[0];
+// rect.y = y + metric[0];
+// rect.width = width - metric[0] * 2;
+// rect.height = height - metric[0] * 2;
+// OS.HIThemeDrawFocusRect(rect, true, handle, OS.kHIThemeOrientationNormal);
+// flush();
+}
+
+/**
+ * Draws the given image in the receiver at the specified
+ * coordinates.
+ *
+ * @param image the image to draw
+ * @param x the x coordinate of where to draw
+ * @param y the y coordinate of where to draw
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the image is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the given coordinates are outside the bounds of the image</li>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES - if no handles are available to perform the operation</li>
+ * </ul>
+ */
+public void drawImage(Image image, int x, int y) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (image == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (image.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ drawImage(image, 0, 0, -1, -1, x, y, -1, -1, true);
+}
+
+/**
+ * Copies a rectangular area from the source image into a (potentially
+ * different sized) rectangular area in the receiver. If the source
+ * and destination areas are of differing sizes, then the source
+ * area will be stretched or shrunk to fit the destination area
+ * as it is copied. The copy fails if any part of the source rectangle
+ * lies outside the bounds of the source image, or if any of the width
+ * or height arguments are negative.
+ *
+ * @param image the source image
+ * @param srcX the x coordinate in the source image to copy from
+ * @param srcY the y coordinate in the source image to copy from
+ * @param srcWidth the width in pixels to copy from the source
+ * @param srcHeight the height in pixels to copy from the source
+ * @param destX the x coordinate in the destination to copy to
+ * @param destY the y coordinate in the destination to copy to
+ * @param destWidth the width in pixels of the destination rectangle
+ * @param destHeight the height in pixels of the destination rectangle
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the image is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * <li>ERROR_INVALID_ARGUMENT - if any of the width or height arguments are negative.
+ * <li>ERROR_INVALID_ARGUMENT - if the source rectangle is not contained within the bounds of the source image</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES - if no handles are available to perform the operation</li>
+ * </ul>
+ */
+public void drawImage(Image image, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (srcWidth == 0 || srcHeight == 0 || destWidth == 0 || destHeight == 0) return;
+ if (srcX < 0 || srcY < 0 || srcWidth < 0 || srcHeight < 0 || destWidth < 0 || destHeight < 0) {
+ SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ if (image == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (image.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ drawImage(image, srcX, srcY, srcWidth, srcHeight, destX, destY, destWidth, destHeight, false);
+}
+
+void drawImage(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, int destX, int destY, int destWidth, int destHeight, boolean simple) {
+ checkGC(CLIPPING | TRANSFORM);
+ NSImage imageHandle = srcImage.handle;
+ NSSize size = imageHandle.size();
+ int imgWidth = (int)size.width;
+ int imgHeight = (int)size.height;
+ if (simple) {
+ srcWidth = destWidth = imgWidth;
+ srcHeight = destHeight = imgHeight;
+ } else {
+ simple = srcX == 0 && srcY == 0 &&
+ srcWidth == destWidth && destWidth == imgWidth &&
+ srcHeight == destHeight && destHeight == imgHeight;
+ if (srcX + srcWidth > imgWidth || srcY + srcHeight > imgHeight) {
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ }
+ if (srcImage.memGC != null) srcImage.createAlpha();
+ if (data.paintRect == null) {
+ handle.saveGraphicsState();
+ NSAffineTransform transform = NSAffineTransform.transform();
+ transform.scaleXBy(1, -1);
+ transform.translateXBy(0, -(destHeight + 2 * destY));
+ transform.concat();
+ }
+ NSRect srcRect = new NSRect();
+ srcRect.x = srcX;
+ srcRect.y = srcY;
+ srcRect.width = srcWidth;
+ srcRect.height = srcHeight;
+ NSRect destRect = new NSRect();
+ destRect.x = destX;
+ destRect.y = destY;
+ destRect.width = destWidth;
+ destRect.height = destHeight;
+ imageHandle.drawInRect(destRect, srcRect, OS.NSCompositeSourceOver, 1);
+ if (data.paintRect == null) {
+ handle.restoreGraphicsState();
+ }
+}
+
+/**
+ * Draws a line, using the foreground color, between the points
+ * (<code>x1</code>, <code>y1</code>) and (<code>x2</code>, <code>y2</code>).
+ *
+ * @param x1 the first point's x coordinate
+ * @param y1 the first point's y coordinate
+ * @param x2 the second point's x coordinate
+ * @param y2 the second point's y coordinate
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawLine(int x1, int y1, int x2, int y2) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ checkGC(DRAW);
+ NSBezierPath path = data.path;
+ NSPoint pt = new NSPoint();
+ pt.x = x1 + data.drawXOffset;
+ pt.y = y1 + data.drawYOffset;
+ path.moveToPoint(pt);
+ pt.x = x2 + data.drawXOffset;
+ pt.y = y2 + data.drawYOffset;
+ path.lineToPoint(pt);
+ path.stroke();
+ path.removeAllPoints();
+}
+
+/**
+ * Draws the outline of an oval, using the foreground color,
+ * within the specified rectangular area.
+ * <p>
+ * The result is a circle or ellipse that fits within the
+ * rectangle specified by the <code>x</code>, <code>y</code>,
+ * <code>width</code>, and <code>height</code> arguments.
+ * </p><p>
+ * The oval covers an area that is <code>width + 1</code>
+ * pixels wide and <code>height + 1</code> pixels tall.
+ * </p>
+ *
+ * @param x the x coordinate of the upper left corner of the oval to be drawn
+ * @param y the y coordinate of the upper left corner of the oval to be drawn
+ * @param width the width of the oval to be drawn
+ * @param height the height of the oval to be drawn
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawOval(int x, int y, int width, int height) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ checkGC(DRAW);
+ if (width < 0) {
+ x = x + width;
+ width = -width;
+ }
+ if (height < 0) {
+ y = y + height;
+ height = -height;
+ }
+ NSBezierPath path = data.path;
+ NSRect rect = new NSRect();
+ rect.x = x + data.drawXOffset;
+ rect.y = y + data.drawXOffset;
+ rect.width = width;
+ rect.height = height;
+ path.appendBezierPathWithOvalInRect(rect);
+ path.stroke();
+ path.removeAllPoints();
+}
+
+/**
+ * Draws the path described by the parameter.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param path the path to draw
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parameter is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see Path
+ *
+ * @since 3.1
+ */
+public void drawPath(Path path) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (path == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (path.handle == null) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ checkGC(DRAW);
+ handle.saveGraphicsState();
+ NSAffineTransform transform = NSAffineTransform.transform();
+ transform.translateXBy(data.drawXOffset, data.drawYOffset);
+ transform.concat();
+ NSBezierPath drawPath = data.path;
+ drawPath.appendBezierPath(path.handle);
+ drawPath.stroke();
+ drawPath.removeAllPoints();
+ handle.restoreGraphicsState();
+}
+
+/**
+ * Draws a pixel, using the foreground color, at the specified
+ * point (<code>x</code>, <code>y</code>).
+ * <p>
+ * Note that the receiver's line attributes do not affect this
+ * operation.
+ * </p>
+ *
+ * @param x the point's x coordinate
+ * @param y the point's y coordinate
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void drawPoint(int x, int y) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ checkGC(FOREGROUND_FILL);
+ NSRect rect = new NSRect();
+ rect.x = x;
+ rect.y = y;
+ rect.width = 1;
+ rect.height = 1;
+ NSBezierPath path = data.path;
+ path.appendBezierPathWithRect(rect);
+ path.fill();
+ path.removeAllPoints();
+}
+
+/**
+ * Draws the closed polygon which is defined by the specified array
+ * of integer coordinates, using the receiver's foreground color. The array
+ * contains alternating x and y values which are considered to represent
+ * points which are the vertices of the polygon. Lines are drawn between
+ * each consecutive pair, and between the first pair and last pair in the
+ * array.
+ *
+ * @param pointArray an array of alternating x and y values which are the vertices of the polygon
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT if pointArray is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawPolygon(int[] pointArray) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ checkGC(DRAW);
+ if (pointArray.length < 4) return;
+ float xOffset = data.drawXOffset, yOffset = data.drawYOffset;
+ NSBezierPath path = data.path;
+ NSPoint pt = new NSPoint();
+ pt.x = pointArray[0] + xOffset;
+ pt.y = pointArray[1] + yOffset;
+ path.moveToPoint(pt);
+ int end = pointArray.length / 2 * 2;
+ for (int i = 2; i < end; i+=2) {
+ pt.x = pointArray[i] + xOffset;
+ pt.y = pointArray[i+1] + yOffset;
+ path.lineToPoint(pt);
+ }
+ path.closePath();
+ path.stroke();
+ path.removeAllPoints();
+}
+
+/**
+ * Draws the polyline which is defined by the specified array
+ * of integer coordinates, using the receiver's foreground color. The array
+ * contains alternating x and y values which are considered to represent
+ * points which are the corners of the polyline. Lines are drawn between
+ * each consecutive pair, but not between the first pair and last pair in
+ * the array.
+ *
+ * @param pointArray an array of alternating x and y values which are the corners of the polyline
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the point array is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawPolyline(int[] pointArray) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ checkGC(DRAW);
+ if (pointArray.length < 4) return;
+ float xOffset = data.drawXOffset, yOffset = data.drawYOffset;
+ NSBezierPath path = data.path;
+ NSPoint pt = new NSPoint();
+ pt.x = pointArray[0] + xOffset;
+ pt.y = pointArray[1] + yOffset;
+ path.moveToPoint(pt);
+ int end = pointArray.length / 2 * 2;
+ for (int i = 2; i < end; i+=2) {
+ pt.x = pointArray[i] + xOffset;
+ pt.y = pointArray[i+1] + yOffset;
+ path.lineToPoint(pt);
+ }
+ path.stroke();
+ path.removeAllPoints();}
+
+/**
+ * Draws the outline of the rectangle specified by the arguments,
+ * using the receiver's foreground color. The left and right edges
+ * of the rectangle are at <code>x</code> and <code>x + width</code>.
+ * The top and bottom edges are at <code>y</code> and <code>y + height</code>.
+ *
+ * @param x the x coordinate of the rectangle to be drawn
+ * @param y the y coordinate of the rectangle to be drawn
+ * @param width the width of the rectangle to be drawn
+ * @param height the height of the rectangle to be drawn
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawRectangle(int x, int y, int width, int height) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ checkGC(DRAW);
+ if (width < 0) {
+ x = x + width;
+ width = -width;
+ }
+ if (height < 0) {
+ y = y + height;
+ height = -height;
+ }
+ NSRect rect = new NSRect();
+ rect.x = x + data.drawXOffset;
+ rect.y = y + data.drawYOffset;
+ rect.width = width;
+ rect.height = height;
+ NSBezierPath path = data.path;
+ path.appendBezierPathWithRect(rect);
+ path.stroke();
+ path.removeAllPoints();
+}
+
+/**
+ * Draws the outline of the specified rectangle, using the receiver's
+ * foreground color. The left and right edges of the rectangle are at
+ * <code>rect.x</code> and <code>rect.x + rect.width</code>. The top
+ * and bottom edges are at <code>rect.y</code> and
+ * <code>rect.y + rect.height</code>.
+ *
+ * @param rect the rectangle to draw
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the rectangle is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawRectangle(Rectangle rect) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (rect == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ drawRectangle (rect.x, rect.y, rect.width, rect.height);
+}
+
+/**
+ * Draws the outline of the round-cornered rectangle specified by
+ * the arguments, using the receiver's foreground color. The left and
+ * right edges of the rectangle are at <code>x</code> and <code>x + width</code>.
+ * The top and bottom edges are at <code>y</code> and <code>y + height</code>.
+ * The <em>roundness</em> of the corners is specified by the
+ * <code>arcWidth</code> and <code>arcHeight</code> arguments, which
+ * are respectively the width and height of the ellipse used to draw
+ * the corners.
+ *
+ * @param x the x coordinate of the rectangle to be drawn
+ * @param y the y coordinate of the rectangle to be drawn
+ * @param width the width of the rectangle to be drawn
+ * @param height the height of the rectangle to be drawn
+ * @param arcWidth the width of the arc
+ * @param arcHeight the height of the arc
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawRoundRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ checkGC(DRAW);
+ if (arcWidth == 0 || arcHeight == 0) {
+ drawRectangle(x, y, width, height);
+ return;
+ }
+ NSBezierPath path = data.path;
+ NSRect rect = new NSRect();
+ rect.x = x + data.drawXOffset;
+ rect.y = y + data.drawYOffset;
+ rect.width = width;
+ rect.height = height;
+ path.appendBezierPathWithRoundedRect(rect, arcWidth, arcHeight);
+ path.stroke();
+ path.removeAllPoints();
+}
+
+/**
+ * Draws the given string, using the receiver's current font and
+ * foreground color. No tab expansion or carriage return processing
+ * will be performed. The background of the rectangular area where
+ * the string is being drawn will be filled with the receiver's
+ * background color.
+ *
+ * @param string the string to be drawn
+ * @param x the x coordinate of the top left corner of the rectangular area where the string is to be drawn
+ * @param y the y coordinate of the top left corner of the rectangular area where the string is to be drawn
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawString (String string, int x, int y) {
+ drawString(string, x, y, false);
+}
+
+/**
+ * Draws the given string, using the receiver's current font and
+ * foreground color. No tab expansion or carriage return processing
+ * will be performed. If <code>isTransparent</code> is <code>true</code>,
+ * then the background of the rectangular area where the string is being
+ * drawn will not be modified, otherwise it will be filled with the
+ * receiver's background color.
+ *
+ * @param string the string to be drawn
+ * @param x the x coordinate of the top left corner of the rectangular area where the string is to be drawn
+ * @param y the y coordinate of the top left corner of the rectangular area where the string is to be drawn
+ * @param isTransparent if <code>true</code> the background will be transparent, otherwise it will be opaque
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawString(String string, int x, int y, boolean isTransparent) {
+ drawText(string, x, y, isTransparent ? SWT.DRAW_TRANSPARENT : 0);
+}
+
+/**
+ * Draws the given string, using the receiver's current font and
+ * foreground color. Tab expansion and carriage return processing
+ * are performed. The background of the rectangular area where
+ * the text is being drawn will be filled with the receiver's
+ * background color.
+ *
+ * @param string the string to be drawn
+ * @param x the x coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawText(String string, int x, int y) {
+ drawText(string, x, y, SWT.DRAW_DELIMITER | SWT.DRAW_TAB);
+}
+
+/**
+ * Draws the given string, using the receiver's current font and
+ * foreground color. Tab expansion and carriage return processing
+ * are performed. If <code>isTransparent</code> is <code>true</code>,
+ * then the background of the rectangular area where the text is being
+ * drawn will not be modified, otherwise it will be filled with the
+ * receiver's background color.
+ *
+ * @param string the string to be drawn
+ * @param x the x coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param isTransparent if <code>true</code> the background will be transparent, otherwise it will be opaque
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawText(String string, int x, int y, boolean isTransparent) {
+ int flags = SWT.DRAW_DELIMITER | SWT.DRAW_TAB;
+ if (isTransparent) flags |= SWT.DRAW_TRANSPARENT;
+ drawText(string, x, y, flags);
+}
+
+/**
+ * Draws the given string, using the receiver's current font and
+ * foreground color. Tab expansion, line delimiter and mnemonic
+ * processing are performed according to the specified flags. If
+ * <code>flags</code> includes <code>DRAW_TRANSPARENT</code>,
+ * then the background of the rectangular area where the text is being
+ * drawn will not be modified, otherwise it will be filled with the
+ * receiver's background color.
+ * <p>
+ * The parameter <code>flags</code> may be a combination of:
+ * <dl>
+ * <dt><b>DRAW_DELIMITER</b></dt>
+ * <dd>draw multiple lines</dd>
+ * <dt><b>DRAW_TAB</b></dt>
+ * <dd>expand tabs</dd>
+ * <dt><b>DRAW_MNEMONIC</b></dt>
+ * <dd>underline the mnemonic character</dd>
+ * <dt><b>DRAW_TRANSPARENT</b></dt>
+ * <dd>transparent background</dd>
+ * </dl>
+ * </p>
+ *
+ * @param string the string to be drawn
+ * @param x the x coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param flags the flags specifying how to process the text
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawText (String string, int x, int y, int flags) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (string == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ checkGC(CLIPPING | TRANSFORM | FONT | FOREGROUND_FILL);
+ NSAttributedString str = createString(string, flags);
+ if (data.paintRect == null) {
+ handle.saveGraphicsState();
+ NSAffineTransform transform = NSAffineTransform.transform();
+ transform.scaleXBy(1, -1);
+ transform.translateXBy(0, -(str.size().height + 2 * y));
+ transform.concat();
+ }
+ NSPoint pt = new NSPoint();
+ pt.x = x;
+ pt.y = y;
+ str.drawAtPoint(pt);
+ str.release();
+ if (data.paintRect == null) {
+ handle.restoreGraphicsState();
+ }
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode
+ */
+public boolean equals(Object object) {
+ if (object == this) return true;
+ if (!(object instanceof GC)) return false;
+ return handle == ((GC)object).handle;
+}
+
+/**
+ * Fills the interior of a circular or elliptical arc within
+ * the specified rectangular area, with the receiver's background
+ * color.
+ * <p>
+ * The resulting arc begins at <code>startAngle</code> and extends
+ * for <code>arcAngle</code> degrees, using the current color.
+ * Angles are interpreted such that 0 degrees is at the 3 o'clock
+ * position. A positive value indicates a counter-clockwise rotation
+ * while a negative value indicates a clockwise rotation.
+ * </p><p>
+ * The center of the arc is the center of the rectangle whose origin
+ * is (<code>x</code>, <code>y</code>) and whose size is specified by the
+ * <code>width</code> and <code>height</code> arguments.
+ * </p><p>
+ * The resulting arc covers an area <code>width + 1</code> pixels wide
+ * by <code>height + 1</code> pixels tall.
+ * </p>
+ *
+ * @param x the x coordinate of the upper-left corner of the arc to be filled
+ * @param y the y coordinate of the upper-left corner of the arc to be filled
+ * @param width the width of the arc to be filled
+ * @param height the height of the arc to be filled
+ * @param startAngle the beginning angle
+ * @param arcAngle the angular extent of the arc, relative to the start angle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #drawArc
+ */
+public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ checkGC(FILL);
+ if (width < 0) {
+ x = x + width;
+ width = -width;
+ }
+ if (height < 0) {
+ y = y + height;
+ height = -height;
+ }
+ if (width == 0 || height == 0 || arcAngle == 0) return;
+ handle.saveGraphicsState();
+ NSAffineTransform transform = NSAffineTransform.transform();
+ float xOffset = data.drawXOffset, yOffset = data.drawYOffset;
+ transform.translateXBy(x + xOffset + width / 2f, y + yOffset + height / 2f);
+ transform.scaleXBy(width / 2f, height / 2f);
+ NSBezierPath path = data.path;
+ NSPoint center = new NSPoint();
+ path.moveToPoint(center);
+ if (arcAngle < 0) {
+ path.appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_(center, 1, -(startAngle + arcAngle) * (float)Compatibility.PI / 180, -startAngle * (float)Compatibility.PI / 180);
+ } else {
+ path.appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_(center, 1, -startAngle * (float)Compatibility.PI / 180, -(startAngle + arcAngle) * (float)Compatibility.PI / 180);
+ }
+ path.closePath();
+ path.transformUsingAffineTransform(transform);
+ path.stroke();
+ path.removeAllPoints();
+ handle.restoreGraphicsState();
+}
+
+/**
+ * Fills the interior of the specified rectangle with a gradient
+ * sweeping from left to right or top to bottom progressing
+ * from the receiver's foreground color to its background color.
+ *
+ * @param x the x coordinate of the rectangle to be filled
+ * @param y the y coordinate of the rectangle to be filled
+ * @param width the width of the rectangle to be filled, may be negative
+ * (inverts direction of gradient if horizontal)
+ * @param height the height of the rectangle to be filled, may be negative
+ * (inverts direction of gradient if vertical)
+ * @param vertical if true sweeps from top to bottom, else
+ * sweeps from left to right
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #drawRectangle(int, int, int, int)
+ */
+public void fillGradientRectangle(int x, int y, int width, int height, boolean vertical) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if ((width == 0) || (height == 0)) return;
+
+ RGB backgroundRGB, foregroundRGB;
+ backgroundRGB = getBackground().getRGB();
+ foregroundRGB = getForeground().getRGB();
+
+ RGB fromRGB, toRGB;
+ fromRGB = foregroundRGB;
+ toRGB = backgroundRGB;
+ boolean swapColors = false;
+ if (width < 0) {
+ x += width; width = -width;
+ if (! vertical) swapColors = true;
+ }
+ if (height < 0) {
+ y += height; height = -height;
+ if (vertical) swapColors = true;
+ }
+ if (swapColors) {
+ fromRGB = backgroundRGB;
+ toRGB = foregroundRGB;
+ }
+ if (fromRGB.equals(toRGB)) {
+ fillRectangle(x, y, width, height);
+ return;
+ }
+
+ NSColor startingColor = NSColor.colorWithDeviceRed(foregroundRGB.red / 255f, foregroundRGB.green / 255f, foregroundRGB.blue / 255f, data.alpha / 255f);
+ NSColor endingColor = NSColor.colorWithDeviceRed(backgroundRGB.red / 255f, backgroundRGB.green / 255f, backgroundRGB.blue / 255f, data.alpha / 255f);
+ NSGradient gradient = ((NSGradient)new NSGradient().alloc()).initWithStartingColor(startingColor, endingColor);
+ NSRect rect = new NSRect();
+ rect.x = x;
+ rect.y = y;
+ rect.width = width;
+ rect.height = height;
+ gradient.drawInRect_angle_(rect, vertical ? 90 : 0);
+ gradient.release();
+}
+
+/**
+ * Fills the interior of an oval, within the specified
+ * rectangular area, with the receiver's background
+ * color.
+ *
+ * @param x the x coordinate of the upper left corner of the oval to be filled
+ * @param y the y coordinate of the upper left corner of the oval to be filled
+ * @param width the width of the oval to be filled
+ * @param height the height of the oval to be filled
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #drawOval
+ */
+public void fillOval(int x, int y, int width, int height) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ checkGC(FILL);
+ if (width < 0) {
+ x = x + width;
+ width = -width;
+ }
+ if (height < 0) {
+ y = y + height;
+ height = -height;
+ }
+ NSBezierPath path = data.path;
+ NSRect rect = new NSRect();
+ rect.x = x;
+ rect.y = y;
+ rect.width = width;
+ rect.height = height;
+ path.appendBezierPathWithOvalInRect(rect);
+ Pattern pattern = data.backgroundPattern;
+ if (pattern != null && pattern.gradient != null) {
+ fillPattern(path, pattern);
+ } else {
+ path.fill();
+ }
+ path.removeAllPoints();
+}
+
+void fillPattern(NSBezierPath path, Pattern pattern) {
+ handle.saveGraphicsState();
+ path.addClip();
+ pattern.gradient.drawFromPoint(pattern.pt1, pattern.pt2, OS.NSGradientDrawsAfterEndingLocation | OS.NSGradientDrawsBeforeStartingLocation);
+ handle.restoreGraphicsState();
+}
+
+/**
+ * Fills the path described by the parameter.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param path the path to fill
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parameter is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see Path
+ *
+ * @since 3.1
+ */
+public void fillPath(Path path) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (path == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (path.handle == null) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ checkGC(FILL);
+ NSBezierPath drawPath = data.path;
+ drawPath.appendBezierPath(path.handle);
+ Pattern pattern = data.backgroundPattern;
+ if (pattern != null && pattern.gradient != null) {
+ fillPattern(drawPath, pattern);
+ } else {
+ drawPath.fill();
+ }
+}
+
+/**
+ * Fills the interior of the closed polygon which is defined by the
+ * specified array of integer coordinates, using the receiver's
+ * background color. The array contains alternating x and y values
+ * which are considered to represent points which are the vertices of
+ * the polygon. Lines are drawn between each consecutive pair, and
+ * between the first pair and last pair in the array.
+ *
+ * @param pointArray an array of alternating x and y values which are the vertices of the polygon
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT if pointArray is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #drawPolygon
+ */
+public void fillPolygon(int[] pointArray) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ checkGC(FILL);
+ if (pointArray.length < 4) return;
+ NSBezierPath path = data.path;
+ NSPoint pt = new NSPoint();
+ pt.x = pointArray[0];
+ pt.y = pointArray[1];
+ path.moveToPoint(pt);
+ int end = pointArray.length / 2 * 2;
+ for (int i = 2; i < end; i+=2) {
+ pt.x = pointArray[i];
+ pt.y = pointArray[i+1];
+ path.lineToPoint(pt);
+ }
+ path.closePath();
+ Pattern pattern = data.backgroundPattern;
+ if (pattern != null && pattern.gradient != null) {
+ fillPattern(path, pattern);
+ } else {
+ path.fill();
+ }
+ path.removeAllPoints();
+}
+
+/**
+ * Fills the interior of the rectangle specified by the arguments,
+ * using the receiver's background color.
+ *
+ * @param x the x coordinate of the rectangle to be filled
+ * @param y the y coordinate of the rectangle to be filled
+ * @param width the width of the rectangle to be filled
+ * @param height the height of the rectangle to be filled
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #drawRectangle(int, int, int, int)
+ */
+public void fillRectangle(int x, int y, int width, int height) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ checkGC(FILL);
+ if (width < 0) {
+ x = x + width;
+ width = -width;
+ }
+ if (height < 0) {
+ y = y + height;
+ height = -height;
+ }
+ NSRect rect = new NSRect();
+ rect.x = x;
+ rect.y = y;
+ rect.width = width;
+ rect.height = height;
+ NSBezierPath path = data.path;
+ path.appendBezierPathWithRect(rect);
+ Pattern pattern = data.backgroundPattern;
+ if (pattern != null && pattern.gradient != null) {
+ fillPattern(path, pattern);
+ } else {
+ path.fill();
+ }
+ path.removeAllPoints();
+
+}
+
+/**
+ * Fills the interior of the specified rectangle, using the receiver's
+ * background color.
+ *
+ * @param rect the rectangle to be filled
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the rectangle is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #drawRectangle(int, int, int, int)
+ */
+public void fillRectangle(Rectangle rect) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (rect == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ fillRectangle(rect.x, rect.y, rect.width, rect.height);
+}
+
+/**
+ * Fills the interior of the round-cornered rectangle specified by
+ * the arguments, using the receiver's background color.
+ *
+ * @param x the x coordinate of the rectangle to be filled
+ * @param y the y coordinate of the rectangle to be filled
+ * @param width the width of the rectangle to be filled
+ * @param height the height of the rectangle to be filled
+ * @param arcWidth the width of the arc
+ * @param arcHeight the height of the arc
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #drawRoundRectangle
+ */
+public void fillRoundRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ checkGC(FILL);
+ if (arcWidth == 0 || arcHeight == 0) {
+ fillRectangle(x, y, width, height);
+ return;
+ }
+ NSBezierPath path = data.path;
+ NSRect rect = new NSRect();
+ rect.x = x;
+ rect.y = y;
+ rect.width = width;
+ rect.height = height;
+ path.appendBezierPathWithRoundedRect(rect, arcWidth, arcHeight);
+ Pattern pattern = data.backgroundPattern;
+ if (pattern != null && pattern.gradient != null) {
+ fillPattern(path, pattern);
+ } else {
+ path.fill();
+ }
+ path.removeAllPoints();
+}
+
+void flush () {
+}
+
+/**
+ * Returns the <em>advance width</em> of the specified character in
+ * the font which is currently selected into the receiver.
+ * <p>
+ * The advance width is defined as the horizontal distance the cursor
+ * should move after printing the character in the selected font.
+ * </p>
+ *
+ * @param ch the character to measure
+ * @return the distance in the x direction to move past the character before painting the next
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getAdvanceWidth(char ch) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ //NOT DONE
+ return stringExtent(new String(new char[]{ch})).x;
+}
+
+/**
+ * Returns the background color.
+ *
+ * @return the receiver's background color
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Color getBackground() {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return Color.cocoa_new (data.device, data.background);
+}
+
+/**
+ * Returns the background pattern. The default value is
+ * <code>null</code>.
+ *
+ * @return the receiver's background pattern
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Pattern
+ *
+ * @since 3.1
+ */
+public Pattern getBackgroundPattern() {
+ if (handle == null) SWT.error(SWT.ERROR_WIDGET_DISPOSED);
+ return data.backgroundPattern;
+}
+
+/**
+ * Returns <code>true</code> if receiver is using the operating system's
+ * advanced graphics subsystem. Otherwise, <code>false</code> is returned
+ * to indicate that normal graphics are in use.
+ * <p>
+ * Advanced graphics may not be installed for the operating system. In this
+ * case, <code>false</code> is always returned. Some operating system have
+ * only one graphics subsystem. If this subsystem supports advanced graphics,
+ * then <code>true</code> is always returned. If any graphics operation such
+ * as alpha, antialias, patterns, interpolation, paths, clipping or transformation
+ * has caused the receiver to switch from regular to advanced graphics mode,
+ * <code>true</code> is returned. If the receiver has been explicitly switched
+ * to advanced mode and this mode is supported, <code>true</code> is returned.
+ * </p>
+ *
+ * @return the advanced value
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #setAdvanced
+ *
+ * @since 3.1
+ */
+public boolean getAdvanced() {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return true;
+}
+
+/**
+ * Returns the receiver's alpha value.
+ *
+ * @return the alpha value
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int getAlpha() {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return data.alpha;
+}
+
+/**
+ * Returns the receiver's anti-aliasing setting value, which will be
+ * one of <code>SWT.DEFAULT</code>, <code>SWT.OFF</code> or
+ * <code>SWT.ON</code>. Note that this controls anti-aliasing for all
+ * <em>non-text drawing</em> operations.
+ *
+ * @return the anti-aliasing setting
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getTextAntialias
+ *
+ * @since 3.1
+ */
+public int getAntialias() {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return data.antialias;
+}
+
+/**
+ * Returns the width of the specified character in the font
+ * selected into the receiver.
+ * <p>
+ * The width is defined as the space taken up by the actual
+ * character, not including the leading and tailing whitespace
+ * or overhang.
+ * </p>
+ *
+ * @param ch the character to measure
+ * @return the width of the character
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getCharWidth(char ch) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ //NOT DONE
+ return stringExtent(new String(new char[]{ch})).x;
+}
+
+/**
+ * Returns the bounding rectangle of the receiver's clipping
+ * region. If no clipping region is set, the return value
+ * will be a rectangle which covers the entire bounds of the
+ * object the receiver is drawing on.
+ *
+ * @return the bounding rectangle of the clipping region
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Rectangle getClipping() {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ NSRect rect = null;
+ if (data.view != null) {
+ rect = data.view.bounds();
+ } else {
+ rect = new NSRect();
+ if (data.image != null) {
+ NSSize size = data.image.handle.size();
+ rect.width = size.width;
+ rect.height = size.height;
+ } else if (data.size != null) {
+ rect.width = data.size.width;
+ rect.height = data.size.height;
+ }
+ }
+ if (data.paintRect != null || data.clipPath != null || data.inverseTransform != null) {
+ if (data.paintRect != null) {
+ OS.NSIntersectionRect(rect, rect, data.paintRect);
+ }
+ if (data.clipPath != null) {
+ NSRect clip = data.clipPath.bounds();
+ OS.NSIntersectionRect(rect, rect, clip);
+ }
+ if (data.inverseTransform != null && rect.width > 0 && rect.height > 0) {
+ NSPoint pt = new NSPoint();
+ pt.x = rect.x;
+ pt.y = rect.y;
+ NSSize size = new NSSize();
+ size.width = rect.width;
+ size.height = rect.height;
+ pt = data.inverseTransform.transformPoint(pt);
+ size = data.inverseTransform.transformSize(size);
+ rect.x = pt.x;
+ rect.y = pt.y;
+ rect.width = size.width;
+ rect.height = size.height;
+ }
+ }
+ return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+}
+
+/**
+ * Sets the region managed by the argument to the current
+ * clipping region of the receiver.
+ *
+ * @param region the region to fill with the clipping region
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the region is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the region is disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void getClipping(Region region) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (region == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (region.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ region.subtract(region);
+ NSRect rect = null;
+ if (data.view != null) {
+ rect = data.view.bounds();
+ } else {
+ rect = new NSRect();
+ if (data.image != null) {
+ NSSize size = data.image.handle.size();
+ rect.width = size.width;
+ rect.height = size.height;
+ } else if (data.size != null) {
+ rect.width = data.size.width;
+ rect.height = data.size.height;
+ }
+ }
+ region.add((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+ NSRect paintRect = data.paintRect;
+ if (paintRect != null) {
+ region.intersect((int)paintRect.x, (int)paintRect.y, (int)paintRect.width, (int)paintRect.height);
+ }
+ if (data.clipPath != null) {
+ NSBezierPath clip = data.clipPath.bezierPathByFlatteningPath();
+ int count = clip.elementCount();
+ int pointCount = 0;
+ Region clipRgn = new Region(device);
+ int[] pointArray = new int[count * 2];
+ int points = OS.malloc(NSPoint.sizeof);
+ if (points == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+ NSPoint pt = new NSPoint();
+ for (int i = 0; i < count; i++) {
+ int element = clip.elementAtIndex_associatedPoints_(i, points);
+ switch (element) {
+ case OS.NSMoveToBezierPathElement:
+ if (pointCount != 0) clipRgn.add(pointArray, pointCount);
+ pointCount = 0;
+ OS.memmove(pt, points, NSPoint.sizeof);
+ pointArray[pointCount++] = (int)pt.x;
+ pointArray[pointCount++] = (int)pt.y;
+ break;
+ case OS.NSLineToBezierPathElement:
+ OS.memmove(pt, points, NSPoint.sizeof);
+ pointArray[pointCount++] = (int)pt.x;
+ pointArray[pointCount++] = (int)pt.y;
+ break;
+ case OS.NSClosePathBezierPathElement:
+ if (pointCount != 0) clipRgn.add(pointArray, pointCount);
+ pointCount = 0;
+ break;
+ }
+ }
+ if (pointCount != 0) clipRgn.add(pointArray, pointCount);
+ OS.free(points);
+ region.intersect(clipRgn);
+ clipRgn.dispose();
+ }
+ if (data.inverseTransform != null) {
+ region.convertRgn(data.inverseTransform);
+ }
+}
+
+/**
+ * Returns the receiver's fill rule, which will be one of
+ * <code>SWT.FILL_EVEN_ODD</code> or <code>SWT.FILL_WINDING</code>.
+ *
+ * @return the receiver's fill rule
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int getFillRule() {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return data.fillRule;
+}
+
+/**
+ * Returns the font currently being used by the receiver
+ * to draw and measure text.
+ *
+ * @return the receiver's font
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Font getFont() {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return data.font;
+}
+
+/**
+ * Returns a FontMetrics which contains information
+ * about the font currently being used by the receiver
+ * to draw and measure text.
+ *
+ * @return font metrics for the receiver's font
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public FontMetrics getFontMetrics() {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ checkGC(FONT);
+ NSFont font = data.font.handle;
+ int ascent = (int)(0.5f + font.ascender());
+ int descent = (int)(0.5f + (-font.descender() + font.leading()));
+ String s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+ int averageCharWidth = stringExtent(s).x / s.length();
+ return FontMetrics.cocoa_new(ascent, descent, averageCharWidth, 0, ascent + descent);
+}
+
+/**
+ * Returns the receiver's foreground color.
+ *
+ * @return the color used for drawing foreground things
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Color getForeground() {
+ if (handle == null) SWT.error(SWT.ERROR_WIDGET_DISPOSED);
+ return Color.cocoa_new(data.device, data.foreground);
+}
+
+/**
+ * Returns the foreground pattern. The default value is
+ * <code>null</code>.
+ *
+ * @return the receiver's foreground pattern
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Pattern
+ *
+ * @since 3.1
+ */
+public Pattern getForegroundPattern() {
+ if (handle == null) SWT.error(SWT.ERROR_WIDGET_DISPOSED);
+ return data.foregroundPattern;
+}
+
+/**
+ * Returns the GCData.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>GC</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @return the receiver's GCData
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see GCData
+ *
+ * @since 3.2
+ */
+public GCData getGCData() {
+ if (handle == null) SWT.error(SWT.ERROR_WIDGET_DISPOSED);
+ return data;
+}
+
+/**
+ * Returns the receiver's interpolation setting, which will be one of
+ * <code>SWT.DEFAULT</code>, <code>SWT.NONE</code>,
+ * <code>SWT.LOW</code> or <code>SWT.HIGH</code>.
+ *
+ * @return the receiver's interpolation setting
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int getInterpolation() {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ int interpolation = handle.imageInterpolation();
+ switch (interpolation) {
+ case OS.NSImageInterpolationDefault: return SWT.DEFAULT;
+ case OS.NSImageInterpolationNone: return SWT.NONE;
+ case OS.NSImageInterpolationLow: return SWT.LOW;
+ case OS.NSImageInterpolationHigh: return SWT.HIGH;
+ }
+ return SWT.DEFAULT;
+}
+
+/**
+ * Returns the receiver's line attributes.
+ *
+ * @return the line attributes used for drawing lines
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public LineAttributes getLineAttributes() {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ float[] dashes = null;
+ if (data.lineDashes != null) {
+ dashes = new float[data.lineDashes.length];
+ System.arraycopy(data.lineDashes, 0, dashes, 0, dashes.length);
+ }
+ return new LineAttributes(data.lineWidth, data.lineCap, data.lineJoin, data.lineStyle, dashes, data.lineDashesOffset, data.lineMiterLimit);
+}
+
+/**
+ * Returns the receiver's line cap style, which will be one
+ * of the constants <code>SWT.CAP_FLAT</code>, <code>SWT.CAP_ROUND</code>,
+ * or <code>SWT.CAP_SQUARE</code>.
+ *
+ * @return the cap style used for drawing lines
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int getLineCap() {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return data.lineCap;
+}
+
+/**
+ * Returns the receiver's line dash style. The default value is
+ * <code>null</code>.
+ *
+ * @return the line dash style used for drawing lines
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int[] getLineDash() {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (data.lineDashes == null) return null;
+ int[] lineDashes = new int[data.lineDashes.length];
+ for (int i = 0; i < lineDashes.length; i++) {
+ lineDashes[i] = (int)data.lineDashes[i];
+ }
+ return lineDashes;
+}
+
+/**
+ * Returns the receiver's line join style, which will be one
+ * of the constants <code>SWT.JOIN_MITER</code>, <code>SWT.JOIN_ROUND</code>,
+ * or <code>SWT.JOIN_BEVEL</code>.
+ *
+ * @return the join style used for drawing lines
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int getLineJoin() {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return data.lineJoin;
+}
+
+/**
+ * Returns the receiver's line style, which will be one
+ * of the constants <code>SWT.LINE_SOLID</code>, <code>SWT.LINE_DASH</code>,
+ * <code>SWT.LINE_DOT</code>, <code>SWT.LINE_DASHDOT</code> or
+ * <code>SWT.LINE_DASHDOTDOT</code>.
+ *
+ * @return the style used for drawing lines
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getLineStyle() {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return data.lineStyle;
+}
+
+/**
+ * Returns the width that will be used when drawing lines
+ * for all of the figure drawing operations (that is,
+ * <code>drawLine</code>, <code>drawRectangle</code>,
+ * <code>drawPolyline</code>, and so forth.
+ *
+ * @return the receiver's line width
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getLineWidth() {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return (int)data.lineWidth;
+}
+
+/**
+ * Returns the receiver's style information.
+ * <p>
+ * Note that the value which is returned by this method <em>may
+ * not match</em> the value which was provided to the constructor
+ * when the receiver was created. This can occur when the underlying
+ * operating system does not support a particular combination of
+ * requested styles.
+ * </p>
+ *
+ * @return the style bits
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public int getStyle () {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return data.style;
+}
+
+/**
+ * Returns the receiver's text drawing anti-aliasing setting value,
+ * which will be one of <code>SWT.DEFAULT</code>, <code>SWT.OFF</code> or
+ * <code>SWT.ON</code>. Note that this controls anti-aliasing
+ * <em>only</em> for text drawing operations.
+ *
+ * @return the anti-aliasing setting
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getAntialias
+ *
+ * @since 3.1
+ */
+public int getTextAntialias() {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return data.textAntialias;
+}
+
+/**
+ * Sets the parameter to the transform that is currently being
+ * used by the receiver.
+ *
+ * @param transform the destination to copy the transform into
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parameter is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Transform
+ *
+ * @since 3.1
+ */
+public void getTransform (Transform transform) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (transform == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (transform.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ NSAffineTransform cmt = data.transform;
+ if (cmt != null) {
+ NSAffineTransformStruct struct = cmt.transformStruct();
+ transform.handle.setTransformStruct(struct);
+ } else {
+ transform.setElements(1, 0, 0, 1, 0, 0);
+ }
+}
+
+/**
+ * Returns <code>true</code> if this GC is drawing in the mode
+ * where the resulting color in the destination is the
+ * <em>exclusive or</em> of the color values in the source
+ * and the destination, and <code>false</code> if it is
+ * drawing in the mode where the destination color is being
+ * replaced with the source color value.
+ *
+ * @return <code>true</code> true if the receiver is in XOR mode, and false otherwise
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public boolean getXORMode() {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return data.xorMode;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #equals
+ */
+public int hashCode() {
+ return handle != null ? handle.id : 0;
+}
+
+void init(Drawable drawable, GCData data, int context) {
+ if (data.foreground != null) data.state &= ~(FOREGROUND | FOREGROUND_FILL);
+ if (data.background != null) data.state &= ~BACKGROUND;
+ if (data.font != null) data.state &= ~FONT;
+ data.state &= ~DRAW_OFFSET;
+
+ Image image = data.image;
+ if (image != null) image.memGC = this;
+ this.drawable = drawable;
+ this.data = data;
+ handle = new NSGraphicsContext(context);
+ handle.saveGraphicsState();
+ data.path = NSBezierPath.bezierPath();
+ data.path.retain();
+}
+
+/**
+ * Returns <code>true</code> if the receiver has a clipping
+ * region set into it, and <code>false</code> otherwise.
+ * If this method returns false, the receiver will draw on all
+ * available space in the destination. If it returns true,
+ * it will draw only in the area that is covered by the region
+ * that can be accessed with <code>getClipping(region)</code>.
+ *
+ * @return <code>true</code> if the GC has a clipping region, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public boolean isClipped() {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return data.clipPath != null;
+}
+
+/**
+ * Returns <code>true</code> if the GC has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the GC.
+ * When a GC has been disposed, it is an error to
+ * invoke any other method using the GC.
+ *
+ * @return <code>true</code> when the GC is disposed and <code>false</code> otherwise
+ */
+public boolean isDisposed() {
+ return handle == null;
+}
+
+boolean isIdentity(float[] transform) {
+ return transform[0] == 1 && transform[1] == 0 && transform[2] == 0
+ && transform[3] == 1 && transform[4] == 0 && transform[5] == 0;
+}
+
+/**
+ * Sets the receiver to always use the operating system's advanced graphics
+ * subsystem for all graphics operations if the argument is <code>true</code>.
+ * If the argument is <code>false</code>, the advanced graphics subsystem is
+ * no longer used, advanced graphics state is cleared and the normal graphics
+ * subsystem is used from now on.
+ * <p>
+ * Normally, the advanced graphics subsystem is invoked automatically when
+ * any one of the alpha, antialias, patterns, interpolation, paths, clipping
+ * or transformation operations in the receiver is requested. When the receiver
+ * is switched into advanced mode, the advanced graphics subsystem performs both
+ * advanced and normal graphics operations. Because the two subsystems are
+ * different, their output may differ. Switching to advanced graphics before
+ * any graphics operations are performed ensures that the output is consistent.
+ * </p><p>
+ * Advanced graphics may not be installed for the operating system. In this
+ * case, this operation does nothing. Some operating system have only one
+ * graphics subsystem, so switching from normal to advanced graphics does
+ * nothing. However, switching from advanced to normal graphics will always
+ * clear the advanced graphics state, even for operating systems that have
+ * only one graphics subsystem.
+ * </p>
+ *
+ * @param advanced the new advanced graphics state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #setAlpha
+ * @see #setAntialias
+ * @see #setBackgroundPattern
+ * @see #setClipping(Path)
+ * @see #setForegroundPattern
+ * @see #setLineAttributes
+ * @see #setInterpolation
+ * @see #setTextAntialias
+ * @see #setTransform
+ * @see #getAdvanced
+ *
+ * @since 3.1
+ */
+public void setAdvanced(boolean advanced) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (!advanced) {
+ setAlpha(0xFF);
+ setAntialias(SWT.DEFAULT);
+ setBackgroundPattern(null);
+ setClipping((Rectangle)null);
+ setForegroundPattern(null);
+ setInterpolation(SWT.DEFAULT);
+ setTextAntialias(SWT.DEFAULT);
+ setTransform(null);
+ }
+}
+
+/**
+ * Sets the receiver's alpha value.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ * @param alpha the alpha value
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see #getAdvanced
+ * @see #setAdvanced
+ *
+ * @since 3.1
+ */
+public void setAlpha(int alpha) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ data.alpha = alpha & 0xFF;
+ data.state &= ~(BACKGROUND | FOREGROUND | FOREGROUND_FILL);
+
+}
+
+/**
+ * Sets the receiver's anti-aliasing value to the parameter,
+ * which must be one of <code>SWT.DEFAULT</code>, <code>SWT.OFF</code>
+ * or <code>SWT.ON</code>. Note that this controls anti-aliasing for all
+ * <em>non-text drawing</em> operations.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param antialias the anti-aliasing setting
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the parameter is not one of <code>SWT.DEFAULT</code>,
+ * <code>SWT.OFF</code> or <code>SWT.ON</code></li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see #getAdvanced
+ * @see #setAdvanced
+ * @see #setTextAntialias
+ *
+ * @since 3.1
+ */
+public void setAntialias(int antialias) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ boolean mode = true;
+ switch (antialias) {
+ case SWT.DEFAULT:
+ /* Printer is off by default */
+// if (data.window == 0 && data.control == 0 && data.image == null) mode = false;
+ mode = true;
+ break;
+ case SWT.OFF: mode = false; break;
+ case SWT.ON: mode = true; break;
+ default:
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ data.antialias = antialias;
+ handle.setShouldAntialias(mode);
+}
+
+/**
+ * Sets the background color. The background color is used
+ * for fill operations and as the background color when text
+ * is drawn.
+ *
+ * @param color the new background color for the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the color is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the color has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setBackground(Color color) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (color == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (color.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ data.background = color.handle;
+ data.backgroundPattern = null;
+ data.state &= ~BACKGROUND;
+}
+
+/**
+ * Sets the background pattern. The default value is <code>null</code>.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param pattern the new background pattern
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see Pattern
+ * @see #getAdvanced
+ * @see #setAdvanced
+ *
+ * @since 3.1
+ */
+public void setBackgroundPattern(Pattern pattern) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (pattern != null && pattern.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ if (data.backgroundPattern == pattern) return;
+ data.backgroundPattern = pattern;
+ data.state &= ~BACKGROUND;
+}
+
+/**
+ * Sets the area of the receiver which can be changed
+ * by drawing operations to the rectangular area specified
+ * by the arguments.
+ *
+ * @param x the x coordinate of the clipping rectangle
+ * @param y the y coordinate of the clipping rectangle
+ * @param width the width of the clipping rectangle
+ * @param height the height of the clipping rectangle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setClipping(int x, int y, int width, int height) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (width < 0) {
+ x = x + width;
+ width = -width;
+ }
+ if (height < 0) {
+ y = y + height;
+ height = -height;
+ }
+ NSRect rect = new NSRect();
+ rect.x = x;
+ rect.y = y;
+ rect.width = width;
+ rect.height = height;
+ NSBezierPath path = NSBezierPath.bezierPathWithRect(rect);
+ path.retain();
+ setClipping(path);
+}
+
+/**
+ * Sets the area of the receiver which can be changed
+ * by drawing operations to the path specified
+ * by the argument.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param path the clipping path.
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the path has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see Path
+ * @see #getAdvanced
+ * @see #setAdvanced
+ *
+ * @since 3.1
+ */
+public void setClipping(Path path) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (path != null && path.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ setClipping(new NSBezierPath(path.handle.copy().id));
+}
+
+/**
+ * Sets the area of the receiver which can be changed
+ * by drawing operations to the rectangular area specified
+ * by the argument. Specifying <code>null</code> for the
+ * rectangle reverts the receiver's clipping area to its
+ * original value.
+ *
+ * @param rect the clipping rectangle or <code>null</code>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setClipping(Rectangle rect) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (rect == null) {
+ setClipping((NSBezierPath)null);
+ } else {
+ setClipping(rect.x, rect.y, rect.width, rect.height);
+ }
+}
+
+/**
+ * Sets the area of the receiver which can be changed
+ * by drawing operations to the region specified
+ * by the argument. Specifying <code>null</code> for the
+ * region reverts the receiver's clipping area to its
+ * original value.
+ *
+ * @param region the clipping region or <code>null</code>
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the region has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setClipping(Region region) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (region != null && region.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ setClipping(region != null ? region.getPath() : null);
+}
+
+void setClipping(NSBezierPath path) {
+ if (data.clipPath != null) {
+ data.clipPath.release();
+ data.clipPath = null;
+ }
+ if (path != null) {
+ data.clipPath = path;
+ if (data.transform != null) {
+ data.clipPath.transformUsingAffineTransform(data.transform);
+ }
+ }
+ data.state &= ~CLIPPING;
+}
+
+/**
+ * Sets the receiver's fill rule to the parameter, which must be one of
+ * <code>SWT.FILL_EVEN_ODD</code> or <code>SWT.FILL_WINDING</code>.
+ *
+ * @param rule the new fill rule
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the rule is not one of <code>SWT.FILL_EVEN_ODD</code>
+ * or <code>SWT.FILL_WINDING</code></li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setFillRule(int rule) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ switch (rule) {
+ case SWT.FILL_WINDING:
+ case SWT.FILL_EVEN_ODD: break;
+ default:
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ data.fillRule = rule;
+ data.path.setWindingRule(rule == SWT.FILL_WINDING ? OS.NSNonZeroWindingRule : OS.NSEvenOddWindingRule);
+}
+
+/**
+ * Sets the font which will be used by the receiver
+ * to draw and measure text to the argument. If the
+ * argument is null, then a default font appropriate
+ * for the platform will be used instead.
+ *
+ * @param font the new font for the receiver, or null to indicate a default font
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the font has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setFont(Font font) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (font == null) font = data.device.systemFont;
+ if (font.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ data.font = font;
+ data.state &= ~FONT;
+}
+
+/**
+ * Sets the foreground color. The foreground color is used
+ * for drawing operations including when text is drawn.
+ *
+ * @param color the new foreground color for the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the color is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the color has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setForeground(Color color) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (color == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (color.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ data.foreground = color.handle;
+ data.foregroundPattern = null;
+ data.state &= ~(FOREGROUND | FOREGROUND_FILL);
+}
+
+/**
+ * Sets the foreground pattern. The default value is <code>null</code>.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ * @param pattern the new foreground pattern
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see Pattern
+ * @see #getAdvanced
+ * @see #setAdvanced
+ *
+ * @since 3.1
+ */
+public void setForegroundPattern(Pattern pattern) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (pattern != null && pattern.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ if (data.foregroundPattern == pattern) return;
+ data.foregroundPattern = pattern;
+ data.state &= ~(FOREGROUND | FOREGROUND_FILL);
+}
+
+/**
+ * Sets the receiver's interpolation setting to the parameter, which
+ * must be one of <code>SWT.DEFAULT</code>, <code>SWT.NONE</code>,
+ * <code>SWT.LOW</code> or <code>SWT.HIGH</code>.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param interpolation the new interpolation setting
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the rule is not one of <code>SWT.DEFAULT</code>,
+ * <code>SWT.NONE</code>, <code>SWT.LOW</code> or <code>SWT.HIGH</code>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see #getAdvanced
+ * @see #setAdvanced
+ *
+ * @since 3.1
+ */
+public void setInterpolation(int interpolation) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ int quality = 0;
+ switch (interpolation) {
+ case SWT.DEFAULT: quality = OS.NSImageInterpolationDefault; break;
+ case SWT.NONE: quality = OS.NSImageInterpolationNone; break;
+ case SWT.LOW: quality = OS.NSImageInterpolationLow; break;
+ case SWT.HIGH: quality = OS.NSImageInterpolationHigh; break;
+ default:
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ handle.setImageInterpolation(quality);
+}
+
+/**
+ * Sets the receiver's line attributes.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ * @param attributes the line attributes
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the attributes is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if any of the line attributes is not valid</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see LineAttributes
+ * @see #getAdvanced
+ * @see #setAdvanced
+ *
+ * @since 3.3
+ */
+public void setLineAttributes(LineAttributes attributes) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (attributes == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ int mask = 0;
+ float lineWidth = attributes.width;
+ if (lineWidth != data.lineWidth) {
+ mask |= LINE_WIDTH | DRAW_OFFSET;
+ }
+ int lineStyle = attributes.style;
+ if (lineStyle != data.lineStyle) {
+ mask |= LINE_STYLE;
+ switch (lineStyle) {
+ case SWT.LINE_SOLID:
+ case SWT.LINE_DASH:
+ case SWT.LINE_DOT:
+ case SWT.LINE_DASHDOT:
+ case SWT.LINE_DASHDOTDOT:
+ break;
+ case SWT.LINE_CUSTOM:
+ if (attributes.dash == null) lineStyle = SWT.LINE_SOLID;
+ break;
+ default:
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ }
+ int join = attributes.join;
+ if (join != data.lineJoin) {
+ mask |= LINE_JOIN;
+ switch (join) {
+ case SWT.CAP_ROUND:
+ case SWT.CAP_FLAT:
+ case SWT.CAP_SQUARE:
+ break;
+ default:
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ }
+ int cap = attributes.join;
+ if (cap != data.lineCap) {
+ mask |= LINE_CAP;
+ switch (cap) {
+ case SWT.JOIN_MITER:
+ case SWT.JOIN_ROUND:
+ case SWT.JOIN_BEVEL:
+ break;
+ default:
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ }
+ float[] dashes = attributes.dash;
+ float[] lineDashes = data.lineDashes;
+ if (dashes != null && dashes.length > 0) {
+ boolean changed = lineDashes == null || lineDashes.length != dashes.length;
+ for (int i = 0; i < dashes.length; i++) {
+ float dash = dashes[i];
+ if (dash <= 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ if (!changed && lineDashes[i] != dash) changed = true;
+ }
+ if (changed) {
+ float[] newDashes = new float[dashes.length];
+ System.arraycopy(dashes, 0, newDashes, 0, dashes.length);
+ dashes = newDashes;
+ mask |= LINE_STYLE;
+ } else {
+ dashes = lineDashes;
+ }
+ } else {
+ if (lineDashes != null && lineDashes.length > 0) {
+ mask |= LINE_STYLE;
+ } else {
+ dashes = lineDashes;
+ }
+ }
+ float dashOffset = attributes.dashOffset;
+ if (dashOffset != data.lineDashesOffset) {
+ mask |= LINE_STYLE;
+ }
+ float miterLimit = attributes.miterLimit;
+ if (miterLimit != data.lineMiterLimit) {
+ mask |= LINE_MITERLIMIT;
+ }
+ if (mask == 0) return;
+ data.lineWidth = lineWidth;
+ data.lineStyle = lineStyle;
+ data.lineCap = cap;
+ data.lineJoin = join;
+ data.lineDashes = dashes;
+ data.lineDashesOffset = dashOffset;
+ data.lineMiterLimit = miterLimit;
+ data.state &= ~mask;
+}
+
+/**
+ * Sets the receiver's line cap style to the argument, which must be one
+ * of the constants <code>SWT.CAP_FLAT</code>, <code>SWT.CAP_ROUND</code>,
+ * or <code>SWT.CAP_SQUARE</code>.
+ *
+ * @param cap the cap style to be used for drawing lines
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the style is not valid</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setLineCap(int cap) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (data.lineCap == cap) return;
+ switch (cap) {
+ case SWT.CAP_ROUND:
+ case SWT.CAP_FLAT:
+ case SWT.CAP_SQUARE:
+ break;
+ default:
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ data.lineCap = cap;
+ data.state &= ~LINE_CAP;
+}
+
+/**
+ * Sets the receiver's line dash style to the argument. The default
+ * value is <code>null</code>. If the argument is not <code>null</code>,
+ * the receiver's line style is set to <code>SWT.LINE_CUSTOM</code>, otherwise
+ * it is set to <code>SWT.LINE_SOLID</code>.
+ *
+ * @param dashes the dash style to be used for drawing lines
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if any of the values in the array is less than or equal 0</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setLineDash(int[] dashes) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ float[] lineDashes = data.lineDashes;
+ if (dashes != null && dashes.length > 0) {
+ boolean changed = data.lineStyle != SWT.LINE_CUSTOM || lineDashes == null || lineDashes.length != dashes.length;
+ for (int i = 0; i < dashes.length; i++) {
+ int dash = dashes[i];
+ if (dash <= 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ if (!changed && lineDashes[i] != dash) changed = true;
+ }
+ if (!changed) return;
+ data.lineDashes = new float[dashes.length];
+ for (int i = 0; i < dashes.length; i++) {
+ data.lineDashes[i] = dashes[i];
+ }
+ data.lineStyle = SWT.LINE_CUSTOM;
+ } else {
+ if (data.lineStyle == SWT.LINE_SOLID && (lineDashes == null || lineDashes.length == 0)) return;
+ data.lineDashes = null;
+ data.lineStyle = SWT.LINE_SOLID;
+ }
+ data.state &= ~LINE_STYLE;
+}
+
+/**
+ * Sets the receiver's line join style to the argument, which must be one
+ * of the constants <code>SWT.JOIN_MITER</code>, <code>SWT.JOIN_ROUND</code>,
+ * or <code>SWT.JOIN_BEVEL</code>.
+ *
+ * @param join the join style to be used for drawing lines
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the style is not valid</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setLineJoin(int join) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (data.lineJoin == join) return;
+ switch (join) {
+ case SWT.JOIN_MITER:
+ case SWT.JOIN_ROUND:
+ case SWT.JOIN_BEVEL:
+ break;
+ default:
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ data.lineJoin = join;
+ data.state &= ~LINE_JOIN;
+}
+
+/**
+ * Sets the receiver's line style to the argument, which must be one
+ * of the constants <code>SWT.LINE_SOLID</code>, <code>SWT.LINE_DASH</code>,
+ * <code>SWT.LINE_DOT</code>, <code>SWT.LINE_DASHDOT</code> or
+ * <code>SWT.LINE_DASHDOTDOT</code>.
+ *
+ * @param lineStyle the style to be used for drawing lines
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the style is not valid</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setLineStyle(int lineStyle) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (data.lineStyle == lineStyle) return;
+ switch (lineStyle) {
+ case SWT.LINE_SOLID:
+ case SWT.LINE_DASH:
+ case SWT.LINE_DOT:
+ case SWT.LINE_DASHDOT:
+ case SWT.LINE_DASHDOTDOT:
+ break;
+ case SWT.LINE_CUSTOM:
+ if (data.lineDashes == null) lineStyle = SWT.LINE_SOLID;
+ break;
+ default:
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ data.lineStyle = lineStyle;
+ data.state &= ~LINE_STYLE;
+}
+
+/**
+ * Sets the width that will be used when drawing lines
+ * for all of the figure drawing operations (that is,
+ * <code>drawLine</code>, <code>drawRectangle</code>,
+ * <code>drawPolyline</code>, and so forth.
+ * <p>
+ * Note that line width of zero is used as a hint to
+ * indicate that the fastest possible line drawing
+ * algorithms should be used. This means that the
+ * output may be different from line width one.
+ * </p>
+ *
+ * @param lineWidth the width of a line
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setLineWidth(int lineWidth) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (data.lineWidth == lineWidth) return;
+ data.lineWidth = lineWidth;
+ data.state &= ~(LINE_WIDTH | DRAW_OFFSET);
+}
+
+/**
+ * If the argument is <code>true</code>, puts the receiver
+ * in a drawing mode where the resulting color in the destination
+ * is the <em>exclusive or</em> of the color values in the source
+ * and the destination, and if the argument is <code>false</code>,
+ * puts the receiver in a drawing mode where the destination color
+ * is replaced with the source color value.
+ * <p>
+ * Note that this mode in fundamentally unsupportable on certain
+ * platforms, notably Carbon (Mac OS X). Clients that want their
+ * code to run on all platforms need to avoid this method.
+ * </p>
+ *
+ * @param xor if <code>true</code>, then <em>xor</em> mode is used, otherwise <em>source copy</em> mode is used
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @deprecated this functionality is not supported on some platforms
+ */
+public void setXORMode(boolean xor) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ data.xorMode = xor;
+}
+
+/**
+ * Sets the receiver's text anti-aliasing value to the parameter,
+ * which must be one of <code>SWT.DEFAULT</code>, <code>SWT.OFF</code>
+ * or <code>SWT.ON</code>. Note that this controls anti-aliasing only
+ * for all <em>text drawing</em> operations.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param antialias the anti-aliasing setting
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the parameter is not one of <code>SWT.DEFAULT</code>,
+ * <code>SWT.OFF</code> or <code>SWT.ON</code></li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see #getAdvanced
+ * @see #setAdvanced
+ * @see #setAntialias
+ *
+ * @since 3.1
+ */
+public void setTextAntialias(int antialias) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ switch (antialias) {
+ case SWT.DEFAULT:
+ case SWT.OFF:
+ case SWT.ON:
+ break;
+ default:
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ data.textAntialias = antialias;
+}
+
+/**
+ * Sets the transform that is currently being used by the receiver. If
+ * the argument is <code>null</code>, the current transform is set to
+ * the identity transform.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param transform the transform to set
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ *
+ * @see Transform
+ * @see #getAdvanced
+ * @see #setAdvanced
+ *
+ * @since 3.1
+ */
+public void setTransform(Transform transform) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (transform != null && transform.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ if (transform != null) {
+ if (data.transform != null) data.transform.release();
+ if (data.inverseTransform != null) data.inverseTransform.release();
+ data.transform = ((NSAffineTransform)new NSAffineTransform().alloc()).initWithTransform(transform.handle);
+ data.inverseTransform = ((NSAffineTransform)new NSAffineTransform().alloc()).initWithTransform(transform.handle);
+ data.inverseTransform.invert();
+ } else {
+ data.transform = data.inverseTransform = null;
+ }
+ data.state &= ~(TRANSFORM | DRAW_OFFSET);
+}
+
+/**
+ * Returns the extent of the given string. No tab
+ * expansion or carriage return processing will be performed.
+ * <p>
+ * The <em>extent</em> of a string is the width and height of
+ * the rectangular area it would cover if drawn in a particular
+ * font (in this case, the current font in the receiver).
+ * </p>
+ *
+ * @param string the string to measure
+ * @return a point containing the extent of the string
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Point stringExtent(String string) {
+ return textExtent(string, 0);
+}
+
+/**
+ * Returns the extent of the given string. Tab expansion and
+ * carriage return processing are performed.
+ * <p>
+ * The <em>extent</em> of a string is the width and height of
+ * the rectangular area it would cover if drawn in a particular
+ * font (in this case, the current font in the receiver).
+ * </p>
+ *
+ * @param string the string to measure
+ * @return a point containing the extent of the string
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Point textExtent(String string) {
+ return textExtent(string, SWT.DRAW_DELIMITER | SWT.DRAW_TAB);
+}
+
+/**
+ * Returns the extent of the given string. Tab expansion, line
+ * delimiter and mnemonic processing are performed according to
+ * the specified flags, which can be a combination of:
+ * <dl>
+ * <dt><b>DRAW_DELIMITER</b></dt>
+ * <dd>draw multiple lines</dd>
+ * <dt><b>DRAW_TAB</b></dt>
+ * <dd>expand tabs</dd>
+ * <dt><b>DRAW_MNEMONIC</b></dt>
+ * <dd>underline the mnemonic character</dd>
+ * <dt><b>DRAW_TRANSPARENT</b></dt>
+ * <dd>transparent background</dd>
+ * </dl>
+ * <p>
+ * The <em>extent</em> of a string is the width and height of
+ * the rectangular area it would cover if drawn in a particular
+ * font (in this case, the current font in the receiver).
+ * </p>
+ *
+ * @param string the string to measure
+ * @param flags the flags specifying how to process the text
+ * @return a point containing the extent of the string
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Point textExtent(String string, int flags) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (string == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ checkGC(FONT);
+ NSAttributedString str = createString(string, flags);
+ NSSize size = str.size();
+ return new Point((int)size.width, (int)size.height);
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public String toString () {
+ if (isDisposed()) return "GC {*DISPOSED*}";
+ return "GC {" + handle + "}";
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GCData.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GCData.java
new file mode 100755
index 0000000000..8a35053279
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GCData.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.graphics;
+
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * Instances of this class are descriptions of GCs in terms
+ * of unallocated platform-specific data fields.
+ * <p>
+ * <b>IMPORTANT:</b> This class is <em>not</em> part of the public
+ * API for SWT. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It is not available on all
+ * platforms, and should never be called from application code.
+ * </p>
+ */
+public final class GCData {
+ public Device device;
+ public int style, state = -1;
+ public float[] foreground;
+ public float[] background;
+ public Pattern foregroundPattern;
+ public Pattern backgroundPattern;
+ public Font font;
+ public int alpha = 0xFF;
+ public float lineWidth;
+ public int lineStyle = SWT.LINE_SOLID;
+ public int lineCap = SWT.CAP_FLAT;
+ public int lineJoin = SWT.JOIN_MITER;
+ public float lineDashesOffset;
+ public float[] lineDashes;
+ public float lineMiterLimit = 10;
+ public boolean xorMode;
+ public int antialias = SWT.DEFAULT;
+ public int textAntialias = SWT.DEFAULT;
+ public int fillRule = SWT.FILL_EVEN_ODD;
+
+ public Image image;
+
+ public float drawXOffset, drawYOffset;
+ public NSRect paintRect;
+ public NSBezierPath path;
+ public NSAffineTransform transform, inverseTransform;
+ public NSBezierPath clipPath;
+ public NSView view;
+ public NSSize size;
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java
new file mode 100755
index 0000000000..6a9dbe4cfc
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java
@@ -0,0 +1,986 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.graphics;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+import org.eclipse.swt.*;
+import java.io.*;
+
+/**
+ * Instances of this class are graphics which have been prepared
+ * for display on a specific device. That is, they are ready
+ * to paint using methods such as <code>GC.drawImage()</code>
+ * and display on widgets with, for example, <code>Button.setImage()</code>.
+ * <p>
+ * If loaded from a file format that supports it, an
+ * <code>Image</code> may have transparency, meaning that certain
+ * pixels are specified as being transparent when drawn. Examples
+ * of file formats that support transparency are GIF and PNG.
+ * </p><p>
+ * There are two primary ways to use <code>Images</code>.
+ * The first is to load a graphic file from disk and create an
+ * <code>Image</code> from it. This is done using an <code>Image</code>
+ * constructor, for example:
+ * <pre>
+ * Image i = new Image(device, "C:\\graphic.bmp");
+ * </pre>
+ * A graphic file may contain a color table specifying which
+ * colors the image was intended to possess. In the above example,
+ * these colors will be mapped to the closest available color in
+ * SWT. It is possible to get more control over the mapping of
+ * colors as the image is being created, using code of the form:
+ * <pre>
+ * ImageData data = new ImageData("C:\\graphic.bmp");
+ * RGB[] rgbs = data.getRGBs();
+ * // At this point, rgbs contains specifications of all
+ * // the colors contained within this image. You may
+ * // allocate as many of these colors as you wish by
+ * // using the Color constructor Color(RGB), then
+ * // create the image:
+ * Image i = new Image(device, data);
+ * </pre>
+ * <p>
+ * Applications which require even greater control over the image
+ * loading process should use the support provided in class
+ * <code>ImageLoader</code>.
+ * </p><p>
+ * Application code must explicitly invoke the <code>Image.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ *
+ * @see Color
+ * @see ImageData
+ * @see ImageLoader
+ */
+public final class Image extends Resource implements Drawable {
+
+ /**
+ * specifies whether the receiver is a bitmap or an icon
+ * (one of <code>SWT.BITMAP</code>, <code>SWT.ICON</code>)
+ * <p>
+ * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It is not available on all
+ * platforms and should never be accessed from application code.
+ * </p>
+ */
+ public int type;
+
+ /**
+ * the handle to the OS image resource
+ * (Warning: This field is platform dependent)
+ * <p>
+ * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It is not available on all
+ * platforms and should never be accessed from application code.
+ * </p>
+ */
+ public NSImage handle;
+
+ /**
+ * specifies the transparent pixel
+ */
+ int transparentPixel = -1;
+
+ /**
+ * The GC the image is currently selected in.
+ */
+ GC memGC;
+
+ /**
+ * The alpha data of the image.
+ */
+ byte[] alphaData;
+
+ /**
+ * The global alpha value to be used for every pixel.
+ */
+ int alpha = -1;
+
+ /**
+ * The width of the image.
+ */
+ int width = -1;
+
+ /**
+ * The height of the image.
+ */
+ int height = -1;
+
+ /**
+ * Specifies the default scanline padding.
+ */
+ static final int DEFAULT_SCANLINE_PAD = 4;
+
+Image() {
+}
+
+/**
+ * Constructs an empty instance of this class with the
+ * specified width and height. The result may be drawn upon
+ * by creating a GC and using any of its drawing operations,
+ * as shown in the following example:
+ * <pre>
+ * Image i = new Image(device, width, height);
+ * GC gc = new GC(i);
+ * gc.drawRectangle(0, 0, 50, 50);
+ * gc.dispose();
+ * </pre>
+ * <p>
+ * Note: Some platforms may have a limitation on the size
+ * of image that can be created (size depends on width, height,
+ * and depth). For example, Windows 95, 98, and ME do not allow
+ * images larger than 16M.
+ * </p>
+ *
+ * @param device the device on which to create the image
+ * @param width the width of the new image
+ * @param height the height of the new image
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * <li>ERROR_INVALID_ARGUMENT - if either the width or height is negative or zero</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li>
+ * </ul>
+ */
+public Image(Device device, int width, int height) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ init(device, width, height);
+}
+
+/**
+ * Constructs a new instance of this class based on the
+ * provided image, with an appearance that varies depending
+ * on the value of the flag. The possible flag values are:
+ * <dl>
+ * <dt><b>IMAGE_COPY</b></dt>
+ * <dd>the result is an identical copy of srcImage</dd>
+ * <dt><b>IMAGE_DISABLE</b></dt>
+ * <dd>the result is a copy of srcImage which has a <em>disabled</em> look</dd>
+ * <dt><b>IMAGE_GRAY</b></dt>
+ * <dd>the result is a copy of srcImage which has a <em>gray scale</em> look</dd>
+ * </dl>
+ *
+ * @param device the device on which to create the image
+ * @param srcImage the image to use as the source
+ * @param flag the style, either <code>IMAGE_COPY</code>, <code>IMAGE_DISABLE</code> or <code>IMAGE_GRAY</code>
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * <li>ERROR_NULL_ARGUMENT - if srcImage is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the flag is not one of <code>IMAGE_COPY</code>, <code>IMAGE_DISABLE</code> or <code>IMAGE_GRAY</code></li>
+ * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_INVALID_IMAGE - if the image is not a bitmap or an icon, or is otherwise in an invalid state</li>
+ * <li>ERROR_UNSUPPORTED_DEPTH - if the depth of the image is not supported</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li>
+ * </ul>
+ */
+public Image(Device device, Image srcImage, int flag) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (srcImage == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (srcImage.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ switch (flag) {
+ case SWT.IMAGE_COPY:
+ case SWT.IMAGE_DISABLE:
+ case SWT.IMAGE_GRAY:
+ break;
+ default:
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ this.device = device;
+ this.type = srcImage.type;
+
+ /* Get source image size */
+// int width = OS.CGImageGetWidth(srcImage.handle);
+// int height = OS.CGImageGetHeight(srcImage.handle);
+// int bpr = OS.CGImageGetBytesPerRow(srcImage.handle);
+// int bpc = OS.CGImageGetBitsPerComponent(srcImage.handle);
+// int bpp = OS.CGImageGetBitsPerPixel(srcImage.handle);
+// int colorspace = OS.CGImageGetColorSpace(srcImage.handle);
+// int alphaInfo = OS.kCGImageAlphaNoneSkipFirst;
+//
+// /* Copy transparent pixel and alpha data when necessary */
+// alphaInfo = OS.CGImageGetAlphaInfo(srcImage.handle);
+// transparentPixel = srcImage.transparentPixel;
+// alpha = srcImage.alpha;
+// if (srcImage.alphaData != null) {
+// alphaData = new byte[srcImage.alphaData.length];
+// System.arraycopy(srcImage.alphaData, 0, alphaData, 0, alphaData.length);
+// }
+//
+// /* Create the image */
+// int dataSize = height * bpr;
+// data = OS.NewPtr(dataSize);
+// if (data == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+// int provider = OS.CGDataProviderCreateWithData(0, data, dataSize, device.releaseProc);
+// if (provider == 0) {
+// OS.DisposePtr(data);
+// SWT.error(SWT.ERROR_NO_HANDLES);
+// }
+// handle = OS.CGImageCreate(width, height, bpc, bpp, bpr, colorspace, alphaInfo, provider, null, true, 0);
+// OS.CGDataProviderRelease(provider);
+// if (handle == 0) {
+// OS.DisposePtr(data);
+// SWT.error(SWT.ERROR_NO_HANDLES);
+// }
+//
+// OS.memmove(data, srcImage.data, dataSize);
+// if (flag == SWT.IMAGE_COPY) return;
+//
+// /* Apply transformation */
+// switch (flag) {
+// case SWT.IMAGE_DISABLE: {
+// Color zeroColor = device.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
+// RGB zeroRGB = zeroColor.getRGB();
+// byte zeroRed = (byte)zeroRGB.red;
+// byte zeroGreen = (byte)zeroRGB.green;
+// byte zeroBlue = (byte)zeroRGB.blue;
+// Color oneColor = device.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
+// RGB oneRGB = oneColor.getRGB();
+// byte oneRed = (byte)oneRGB.red;
+// byte oneGreen = (byte)oneRGB.green;
+// byte oneBlue = (byte)oneRGB.blue;
+// byte[] line = new byte[bpr];
+// for (int y=0; y<height; y++) {
+// OS.memmove(line, data + (y * bpr), bpr);
+// int offset = 0;
+// for (int x=0; x<width; x++) {
+// int red = line[offset+1] & 0xFF;
+// int green = line[offset+2] & 0xFF;
+// int blue = line[offset+3] & 0xFF;
+// int intensity = red * red + green * green + blue * blue;
+// if (intensity < 98304) {
+// line[offset+1] = zeroRed;
+// line[offset+2] = zeroGreen;
+// line[offset+3] = zeroBlue;
+// } else {
+// line[offset+1] = oneRed;
+// line[offset+2] = oneGreen;
+// line[offset+3] = oneBlue;
+// }
+// offset += 4;
+// }
+// OS.memmove(data + (y * bpr), line, bpr);
+// }
+// break;
+// }
+// case SWT.IMAGE_GRAY: {
+// byte[] line = new byte[bpr];
+// for (int y=0; y<height; y++) {
+// OS.memmove(line, data + (y * bpr), bpr);
+// int offset = 0;
+// for (int x=0; x<width; x++) {
+// int red = line[offset+1] & 0xFF;
+// int green = line[offset+2] & 0xFF;
+// int blue = line[offset+3] & 0xFF;
+// byte intensity = (byte)((red+red+green+green+green+green+green+blue) >> 3);
+// line[offset+1] = line[offset+2] = line[offset+3] = intensity;
+// offset += 4;
+// }
+// OS.memmove(data + (y * bpr), line, bpr);
+// }
+// break;
+// }
+// }
+}
+
+/**
+ * Constructs an empty instance of this class with the
+ * width and height of the specified rectangle. The result
+ * may be drawn upon by creating a GC and using any of its
+ * drawing operations, as shown in the following example:
+ * <pre>
+ * Image i = new Image(device, boundsRectangle);
+ * GC gc = new GC(i);
+ * gc.drawRectangle(0, 0, 50, 50);
+ * gc.dispose();
+ * </pre>
+ * <p>
+ * Note: Some platforms may have a limitation on the size
+ * of image that can be created (size depends on width, height,
+ * and depth). For example, Windows 95, 98, and ME do not allow
+ * images larger than 16M.
+ * </p>
+ *
+ * @param device the device on which to create the image
+ * @param bounds a rectangle specifying the image's width and height (must not be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * <li>ERROR_NULL_ARGUMENT - if the bounds rectangle is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if either the rectangle's width or height is negative</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li>
+ * </ul>
+ */
+public Image(Device device, Rectangle bounds) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (bounds == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ init(device, bounds.width, bounds.height);
+}
+
+/**
+ * Constructs an instance of this class from the given
+ * <code>ImageData</code>.
+ *
+ * @param device the device on which to create the image
+ * @param data the image data to create the image from (must not be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * <li>ERROR_NULL_ARGUMENT - if the image data is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_UNSUPPORTED_DEPTH - if the depth of the ImageData is not supported</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li>
+ * </ul>
+ */
+public Image(Device device, ImageData data) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ init(device, data);
+}
+
+/**
+ * Constructs an instance of this class, whose type is
+ * <code>SWT.ICON</code>, from the two given <code>ImageData</code>
+ * objects. The two images must be the same size. Pixel transparency
+ * in either image will be ignored.
+ * <p>
+ * The mask image should contain white wherever the icon is to be visible,
+ * and black wherever the icon is to be transparent. In addition,
+ * the source image should contain black wherever the icon is to be
+ * transparent.
+ * </p>
+ *
+ * @param device the device on which to create the icon
+ * @param source the color data for the icon
+ * @param mask the mask data for the icon
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * <li>ERROR_NULL_ARGUMENT - if either the source or mask is null </li>
+ * <li>ERROR_INVALID_ARGUMENT - if source and mask are different sizes</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li>
+ * </ul>
+ */
+public Image(Device device, ImageData source, ImageData mask) {
+ if (device == null) device = Device.getDevice();
+ if (source == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (mask == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (source.width != mask.width || source.height != mask.height) {
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ mask = ImageData.convertMask(mask);
+ ImageData image = new ImageData(source.width, source.height, source.depth, source.palette, source.scanlinePad, source.data);
+ image.maskPad = mask.scanlinePad;
+ image.maskData = mask.data;
+ init(device, image);
+}
+
+/**
+ * Constructs an instance of this class by loading its representation
+ * from the specified input stream. Throws an error if an error
+ * occurs while loading the image, or if the result is an image
+ * of an unsupported type. Application code is still responsible
+ * for closing the input stream.
+ * <p>
+ * This constructor is provided for convenience when loading a single
+ * image only. If the stream contains multiple images, only the first
+ * one will be loaded. To load multiple images, use
+ * <code>ImageLoader.load()</code>.
+ * </p><p>
+ * This constructor may be used to load a resource as follows:
+ * </p>
+ * <pre>
+ * static Image loadImage (Display display, Class clazz, String string) {
+ * InputStream stream = clazz.getResourceAsStream (string);
+ * if (stream == null) return null;
+ * Image image = null;
+ * try {
+ * image = new Image (display, stream);
+ * } catch (SWTException ex) {
+ * } finally {
+ * try {
+ * stream.close ();
+ * } catch (IOException ex) {}
+ * }
+ * return image;
+ * }
+ * </pre>
+ *
+ * @param device the device on which to create the image
+ * @param stream the input stream to load the image from
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * <li>ERROR_NULL_ARGUMENT - if the stream is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_IO - if an IO error occurs while reading from the stream</li>
+ * <li>ERROR_INVALID_IMAGE - if the image stream contains invalid data </li>
+ * <li>ERROR_UNSUPPORTED_DEPTH - if the image stream describes an image with an unsupported depth</li>
+ * <li>ERROR_UNSUPPORTED_FORMAT - if the image stream contains an unrecognized format</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li>
+ * </ul>
+ */
+public Image(Device device, InputStream stream) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ init(device, new ImageData(stream));
+}
+
+/**
+ * Constructs an instance of this class by loading its representation
+ * from the file with the specified name. Throws an error if an error
+ * occurs while loading the image, or if the result is an image
+ * of an unsupported type.
+ * <p>
+ * This constructor is provided for convenience when loading
+ * a single image only. If the specified file contains
+ * multiple images, only the first one will be used.
+ *
+ * @param device the device on which to create the image
+ * @param filename the name of the file to load the image from
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * <li>ERROR_NULL_ARGUMENT - if the file name is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_IO - if an IO error occurs while reading from the file</li>
+ * <li>ERROR_INVALID_IMAGE - if the image file contains invalid data </li>
+ * <li>ERROR_UNSUPPORTED_DEPTH - if the image file describes an image with an unsupported depth</li>
+ * <li>ERROR_UNSUPPORTED_FORMAT - if the image file contains an unrecognized format</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES if a handle could not be obtained for image creation</li>
+ * </ul>
+ */
+public Image(Device device, String filename) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ init(device, new ImageData(filename));
+}
+
+void createAlpha () {
+// if (transparentPixel == -1 && alpha == -1 && alphaData == null) return;
+// int height = OS.CGImageGetHeight(handle);
+// int bpr = OS.CGImageGetBytesPerRow(handle);
+// int dataSize = height * bpr;
+// byte[] srcData = new byte[dataSize];
+// OS.memmove(srcData, data, dataSize);
+// if (transparentPixel != -1) {
+// for (int i=0; i<dataSize; i+=4) {
+// int pixel = ((srcData[i+1] & 0xFF) << 16) | ((srcData[i+2] & 0xFF) << 8) | (srcData[i+3] & 0xFF);
+// srcData[i] = (byte)(pixel == transparentPixel ? 0 : 0xFF);
+// }
+// } else if (alpha != -1) {
+// byte a = (byte)this.alpha;
+// for (int i=0; i<dataSize; i+=4) {
+// srcData[i] = a;
+// }
+// } else {
+// int width = OS.CGImageGetWidth(handle);
+// int offset = 0, alphaOffset = 0;
+// for (int y = 0; y<height; y++) {
+// for (int x = 0; x<width; x++) {
+// srcData[offset] = alphaData[alphaOffset];
+// offset += 4;
+// alphaOffset += 1;
+// }
+// }
+// }
+// OS.memmove(data, srcData, dataSize);
+}
+
+/**
+ * Disposes of the operating system resources associated with
+ * the image. Applications must dispose of all images which
+ * they allocate.
+ */
+public void dispose () {
+ if (handle == null) return;
+ if (device.isDisposed()) return;
+ if (memGC != null) memGC.dispose();
+ handle.release();
+ device = null;
+ handle = null;
+ memGC = null;
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode
+ */
+public boolean equals (Object object) {
+ if (object == this) return true;
+ if (!(object instanceof Image)) return false;
+ Image image = (Image)object;
+ return device == image.device && handle == image.handle &&
+ transparentPixel == image.transparentPixel;
+}
+
+/**
+ * Returns the color to which to map the transparent pixel, or null if
+ * the receiver has no transparent pixel.
+ * <p>
+ * There are certain uses of Images that do not support transparency
+ * (for example, setting an image into a button or label). In these cases,
+ * it may be desired to simulate transparency by using the background
+ * color of the widget to paint the transparent pixels of the image.
+ * Use this method to check which color will be used in these cases
+ * in place of transparency. This value may be set with setBackground().
+ * <p>
+ *
+ * @return the background color of the image, or null if there is no transparency in the image
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Color getBackground() {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (transparentPixel == -1) return null;
+ int red = (transparentPixel >> 16) & 0xFF;
+ int green = (transparentPixel >> 8) & 0xFF;
+ int blue = (transparentPixel >> 0) & 0xFF;
+ return Color.cocoa_new(device, new float[]{red / 255f, green / 255f, blue / 255f, 1});
+}
+
+/**
+ * Returns the bounds of the receiver. The rectangle will always
+ * have x and y values of 0, and the width and height of the
+ * image.
+ *
+ * @return a rectangle specifying the image's bounds
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_INVALID_IMAGE - if the image is not a bitmap or an icon</li>
+ * </ul>
+ */
+public Rectangle getBounds() {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (width != -1 && height != -1) {
+ return new Rectangle(0, 0, width, height);
+ }
+ NSSize size = handle.size();
+ return new Rectangle(0, 0, width = (int)size.width, height = (int)size.height);
+}
+
+/**
+ * Returns an <code>ImageData</code> based on the receiver
+ * Modifications made to this <code>ImageData</code> will not
+ * affect the Image.
+ *
+ * @return an <code>ImageData</code> containing the image's data and attributes
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_INVALID_IMAGE - if the image is not a bitmap or an icon</li>
+ * </ul>
+ *
+ * @see ImageData
+ */
+public ImageData getImageData() {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+
+// int width = OS.CGImageGetWidth(handle);
+// int height = OS.CGImageGetHeight(handle);
+// int bpr = OS.CGImageGetBytesPerRow(handle);
+// int bpp = OS.CGImageGetBitsPerPixel(handle);
+// int dataSize = height * bpr;
+// byte[] srcData = new byte[dataSize];
+// OS.memmove(srcData, data, dataSize);
+//
+// PaletteData palette = new PaletteData(0xFF0000, 0xFF00, 0xFF);
+// ImageData data = new ImageData(width, height, bpp, palette);
+// data.data = srcData;
+// data.bytesPerLine = bpr;
+//
+// data.transparentPixel = transparentPixel;
+// if (transparentPixel == -1 && type == SWT.ICON) {
+// /* Get the icon mask data */
+// int maskPad = 2;
+// int maskBpl = (((width + 7) / 8) + (maskPad - 1)) / maskPad * maskPad;
+// byte[] maskData = new byte[height * maskBpl];
+// int offset = 0, maskOffset = 0;
+// for (int y = 0; y<height; y++) {
+// for (int x = 0; x<width; x++) {
+// if (srcData[offset] != 0) {
+// maskData[maskOffset + (x >> 3)] |= (1 << (7 - (x & 0x7)));
+// } else {
+// maskData[maskOffset + (x >> 3)] &= ~(1 << (7 - (x & 0x7)));
+// }
+// offset += 4;
+// }
+// maskOffset += maskBpl;
+// }
+// data.maskData = maskData;
+// data.maskPad = maskPad;
+// }
+// for (int i = 0; i < srcData.length; i+= 4) {
+// srcData[i] = 0;
+// }
+// data.alpha = alpha;
+// if (alpha == -1 && alphaData != null) {
+// data.alphaData = new byte[alphaData.length];
+// System.arraycopy(alphaData, 0, data.alphaData, 0, alphaData.length);
+// }
+// return data;
+ return null;
+}
+
+/**
+ * Invokes platform specific functionality to allocate a new image.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Image</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param device the device on which to allocate the color
+ * @param type the type of the image (<code>SWT.BITMAP</code> or <code>SWT.ICON</code>)
+ * @param handle the OS handle for the image
+ * @param data the OS data for the image
+ *
+ * @private
+ */
+public static Image cocoa_new(Device device, int type, NSImage nsImage) {
+ if (device == null) device = Device.getDevice();
+ Image image = new Image();
+ image.type = type;
+ image.handle = nsImage;
+ image.device = device;
+ return image;
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals
+ */
+public int hashCode () {
+ return handle != null ? handle.id : 0;
+}
+
+void init(Device device, int width, int height) {
+ if (width <= 0 || height <= 0) {
+ SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ this.device = device;
+ this.type = SWT.BITMAP;
+ this.width = width;
+ this.height = height;
+
+ handle = (NSImage)new NSImage().alloc();
+ NSSize size = new NSSize();
+ size.width = width;
+ size.height = height;
+ handle = handle.initWithSize(size);
+ NSBitmapImageRep rep = (NSBitmapImageRep)new NSBitmapImageRep().alloc();
+ rep = rep.initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bitmapFormat_bytesPerRow_bitsPerPixel_(0, width, height, 8, 3, false, false, new NSString(OS.NSDeviceRGBColorSpace()), OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, width * 4, 32);
+ OS.memset(rep.bitmapData(), 0xFF, width * height * 4);
+ handle.addRepresentation(rep);
+ rep.release();
+}
+
+void init(Device device, ImageData image) {
+ if (image == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ this.device = device;
+ this.width = image.width;
+ this.height = image.height;
+ PaletteData palette = image.palette;
+ if (!(((image.depth == 1 || image.depth == 2 || image.depth == 4 || image.depth == 8) && !palette.isDirect) ||
+ ((image.depth == 8) || (image.depth == 16 || image.depth == 24 || image.depth == 32) && palette.isDirect)))
+ SWT.error(SWT.ERROR_UNSUPPORTED_DEPTH);
+
+ /* Create the image */
+ int dataSize = width * height * 4;
+
+ /* Initialize data */
+ int bpr = width * 4;
+ byte[] buffer = new byte[dataSize];
+ if (palette.isDirect) {
+ ImageData.blit(ImageData.BLIT_SRC,
+ image.data, image.depth, image.bytesPerLine, image.getByteOrder(), 0, 0, width, height, palette.redMask, palette.greenMask, palette.blueMask,
+ ImageData.ALPHA_OPAQUE, null, 0, 0, 0,
+ buffer, 32, bpr, ImageData.MSB_FIRST, 0, 0, width, height, 0xFF0000, 0xFF00, 0xFF,
+ false, false);
+ } else {
+ RGB[] rgbs = palette.getRGBs();
+ int length = rgbs.length;
+ byte[] srcReds = new byte[length];
+ byte[] srcGreens = new byte[length];
+ byte[] srcBlues = new byte[length];
+ for (int i = 0; i < rgbs.length; i++) {
+ RGB rgb = rgbs[i];
+ if (rgb == null) continue;
+ srcReds[i] = (byte)rgb.red;
+ srcGreens[i] = (byte)rgb.green;
+ srcBlues[i] = (byte)rgb.blue;
+ }
+ ImageData.blit(ImageData.BLIT_SRC,
+ image.data, image.depth, image.bytesPerLine, image.getByteOrder(), 0, 0, width, height, srcReds, srcGreens, srcBlues,
+ ImageData.ALPHA_OPAQUE, null, 0, 0, 0,
+ buffer, 32, bpr, ImageData.MSB_FIRST, 0, 0, width, height, 0xFF0000, 0xFF00, 0xFF,
+ false, false);
+ }
+
+ /* Initialize transparency */
+ int transparency = image.getTransparencyType();
+ boolean hasAlpha = transparency != SWT.TRANSPARENCY_NONE;
+ if (transparency == SWT.TRANSPARENCY_MASK || image.transparentPixel != -1) {
+ this.type = image.transparentPixel != -1 ? SWT.BITMAP : SWT.ICON;
+ if (image.transparentPixel != -1) {
+ int transRed = 0, transGreen = 0, transBlue = 0;
+ if (palette.isDirect) {
+ RGB rgb = palette.getRGB(image.transparentPixel);
+ transRed = rgb.red;
+ transGreen = rgb.green;
+ transBlue = rgb.blue;
+ } else {
+ RGB[] rgbs = palette.getRGBs();
+ if (image.transparentPixel < rgbs.length) {
+ RGB rgb = rgbs[image.transparentPixel];
+ transRed = rgb.red;
+ transGreen = rgb.green;
+ transBlue = rgb.blue;
+ }
+ }
+ transparentPixel = transRed << 16 | transGreen << 8 | transBlue;
+ }
+ ImageData maskImage = image.getTransparencyMask();
+ byte[] maskData = maskImage.data;
+ int maskBpl = maskImage.bytesPerLine;
+ int offset = 0, maskOffset = 0;
+ for (int y = 0; y<height; y++) {
+ for (int x = 0; x<width; x++) {
+ buffer[offset] = ((maskData[maskOffset + (x >> 3)]) & (1 << (7 - (x & 0x7)))) != 0 ? (byte)0xff : 0;
+ offset += 4;
+ }
+ maskOffset += maskBpl;
+ }
+ } else {
+ this.type = SWT.BITMAP;
+ if (image.alpha != -1) {
+ hasAlpha = true;
+ this.alpha = image.alpha;
+ byte a = (byte)this.alpha;
+ for (int dataIndex=0; dataIndex<buffer.length; dataIndex+=4) {
+ buffer[dataIndex] = a;
+ }
+ } else if (image.alphaData != null) {
+ this.alphaData = new byte[image.alphaData.length];
+ System.arraycopy(image.alphaData, 0, this.alphaData, 0, alphaData.length);
+ int offset = 0, alphaOffset = 0;
+ for (int y = 0; y<height; y++) {
+ for (int x = 0; x<width; x++) {
+ buffer[offset] = alphaData[alphaOffset];
+ offset += 4;
+ alphaOffset += 1;
+ }
+ }
+ }
+ }
+ handle = (NSImage)new NSImage().alloc();
+ NSSize size = new NSSize();
+ size.width = width;
+ size.height = height;
+ handle = handle.initWithSize(size);
+ NSBitmapImageRep rep = (NSBitmapImageRep)new NSBitmapImageRep().alloc();
+ rep = rep.initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bitmapFormat_bytesPerRow_bitsPerPixel_(
+ 0, width, height, 8, hasAlpha ? 4 : 3, hasAlpha, false, new NSString(OS.NSDeviceRGBColorSpace()), OS.NSAlphaFirstBitmapFormat | OS.NSAlphaNonpremultipliedBitmapFormat, bpr, 32);
+ OS.memmove(rep.bitmapData(), buffer, dataSize);
+ handle.addRepresentation(rep);
+ rep.release();
+}
+
+/**
+ * Invokes platform specific functionality to allocate a new GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Image</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param data the platform specific GC data
+ * @return the platform specific GC handle
+ */
+public int internal_new_GC (GCData data) {
+ if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (type != SWT.BITMAP || memGC != null) {
+ SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+
+ handle.lockFocus();
+// NSGraphicsContext context = NSGraphicsContext.graphicsContextWithBitmapImageRep(new NSBitmapImageRep(handle.bestRepresentationForDevice(null).id));
+// NSGraphicsContext.setCurrentContext(context);
+ NSGraphicsContext context = NSGraphicsContext.currentContext();
+ NSAffineTransform transform = NSAffineTransform.transform();
+ NSSize size = handle.size();
+ transform.translateXBy(0, size.height);
+ transform.scaleXBy(1, -1);
+ transform.set();
+ if (data != null) {
+ int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+ if ((data.style & mask) == 0) {
+ data.style |= SWT.LEFT_TO_RIGHT;
+ }
+ data.device = device;
+ data.background = device.COLOR_WHITE.handle;
+ data.foreground = device.COLOR_BLACK.handle;
+ data.font = device.systemFont;
+ data.image = this;
+ }
+ return context.id;
+}
+
+/**
+ * Invokes platform specific functionality to dispose a GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Image</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param hDC the platform specific GC handle
+ * @param data the platform specific GC data
+ */
+public void internal_dispose_GC (int context, GCData data) {
+ handle.unlockFocus();
+}
+
+/**
+ * Returns <code>true</code> if the image has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the image.
+ * When an image has been disposed, it is an error to
+ * invoke any other method using the image.
+ *
+ * @return <code>true</code> when the image is disposed and <code>false</code> otherwise
+ */
+public boolean isDisposed() {
+ return handle == null;
+}
+
+/**
+ * Sets the color to which to map the transparent pixel.
+ * <p>
+ * There are certain uses of <code>Images</code> that do not support
+ * transparency (for example, setting an image into a button or label).
+ * In these cases, it may be desired to simulate transparency by using
+ * the background color of the widget to paint the transparent pixels
+ * of the image. This method specifies the color that will be used in
+ * these cases. For example:
+ * <pre>
+ * Button b = new Button();
+ * image.setBackground(b.getBackground());
+ * b.setImage(image);
+ * </pre>
+ * </p><p>
+ * The image may be modified by this operation (in effect, the
+ * transparent regions may be filled with the supplied color). Hence
+ * this operation is not reversible and it is not legal to call
+ * this function twice or with a null argument.
+ * </p><p>
+ * This method has no effect if the receiver does not have a transparent
+ * pixel value.
+ * </p>
+ *
+ * @param color the color to use when a transparent pixel is specified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the color is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the color has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setBackground(Color color) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (color == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (color.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ if (transparentPixel == -1) return;
+// byte red = (byte)((transparentPixel >> 16) & 0xFF);
+// byte green = (byte)((transparentPixel >> 8) & 0xFF);
+// byte blue = (byte)((transparentPixel >> 0) & 0xFF);
+// byte newRed = (byte)((int)(color.handle[0] * 255) & 0xFF);
+// byte newGreen = (byte)((int)(color.handle[1] * 255) & 0xFF);
+// byte newBlue = (byte)((int)(color.handle[2] * 255) & 0xFF);
+// int height = OS.CGImageGetHeight(handle);
+// int bpl = OS.CGImageGetBytesPerRow(handle);
+// byte[] line = new byte[bpl];
+// for (int i = 0, offset = 0; i < height; i++, offset += bpl) {
+// OS.memmove(line, data + offset, bpl);
+// for (int j = 0; j < line.length; j += 4) {
+// if (line[j+ 1] == red && line[j + 2] == green && line[j + 3] == blue) {
+// line[j + 1] = newRed;
+// line[j + 2] = newGreen;
+// line[j + 3] = newBlue;
+// }
+// }
+// OS.memmove(data + offset, line, bpl);
+// }
+// transparentPixel = (newRed & 0xFF) << 16 | (newGreen & 0xFF) << 8 | (newBlue & 0xFF);
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public String toString () {
+ if (isDisposed()) return "Image {*DISPOSED*}";
+ return "Image {" + handle + "}";
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Path.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Path.java
new file mode 100755
index 0000000000..7c7cfa0692
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Path.java
@@ -0,0 +1,517 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.graphics;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * Instances of this class represent paths through the two-dimensional
+ * coordinate system. Paths do not have to be continuous, and can be
+ * described using lines, rectangles, arcs, cubic or quadratic bezier curves,
+ * glyphs, or other paths.
+ * <p>
+ * Application code must explicitly invoke the <code>Path.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ * <p>
+ * This class requires the operating system's advanced graphics subsystem
+ * which may not be available on some platforms.
+ * </p>
+ *
+ * @since 3.1
+ */
+public class Path extends Resource {
+
+ /**
+ * the OS resource for the Path
+ * (Warning: This field is platform dependent)
+ * <p>
+ * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It is not available on all
+ * platforms and should never be accessed from application code.
+ * </p>
+ */
+ public NSBezierPath handle;
+
+/**
+ * Constructs a new empty Path.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param device the device on which to allocate the path
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES if a handle for the path could not be obtained</li>
+ * </ul>
+ *
+ * @see #dispose()
+ */
+public Path (Device device) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ this.device = device;
+ handle = NSBezierPath.bezierPath();
+ if (handle == null) SWT.error(SWT.ERROR_NO_HANDLES);
+ handle.retain();
+ handle.moveToPoint(new NSPoint());
+ if (device.tracking) device.new_Object(this);
+}
+
+/**
+ * Adds to the receiver a circular or elliptical arc that lies within
+ * the specified rectangular area.
+ * <p>
+ * The resulting arc begins at <code>startAngle</code> and extends
+ * for <code>arcAngle</code> degrees.
+ * Angles are interpreted such that 0 degrees is at the 3 o'clock
+ * position. A positive value indicates a counter-clockwise rotation
+ * while a negative value indicates a clockwise rotation.
+ * </p><p>
+ * The center of the arc is the center of the rectangle whose origin
+ * is (<code>x</code>, <code>y</code>) and whose size is specified by the
+ * <code>width</code> and <code>height</code> arguments.
+ * </p><p>
+ * The resulting arc covers an area <code>width + 1</code> pixels wide
+ * by <code>height + 1</code> pixels tall.
+ * </p>
+ *
+ * @param x the x coordinate of the upper-left corner of the arc
+ * @param y the y coordinate of the upper-left corner of the arc
+ * @param width the width of the arc
+ * @param height the height of the arc
+ * @param startAngle the beginning angle
+ * @param arcAngle the angular extent of the arc, relative to the start angle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void addArc(float x, float y, float width, float height, float startAngle, float arcAngle) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ NSAffineTransform transform = NSAffineTransform.transform();
+ transform.translateXBy(x + width / 2f, y + height / 2f);
+ transform.scaleXBy(width / 2f, height / 2f);
+ NSBezierPath path = NSBezierPath.bezierPath();
+ if (arcAngle < 0) {
+ path.appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_(new NSPoint(), 1, -(startAngle + arcAngle) * (float)Compatibility.PI / 180, -startAngle * (float)Compatibility.PI / 180);
+ } else {
+ path.appendBezierPathWithArcWithCenter_radius_startAngle_endAngle_(new NSPoint(), 1, -startAngle * (float)Compatibility.PI / 180, -(startAngle + arcAngle) * (float)Compatibility.PI / 180);
+ }
+ path.transformUsingAffineTransform(transform);
+ handle.appendBezierPath(path);
+}
+
+/**
+ * Adds to the receiver the path described by the parameter.
+ *
+ * @param path the path to add to the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parameter is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void addPath(Path path) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (path == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (path.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ handle.appendBezierPath(path.handle);
+}
+
+/**
+ * Adds to the receiver the rectangle specified by x, y, width and height.
+ *
+ * @param x the x coordinate of the rectangle to add
+ * @param y the y coordinate of the rectangle to add
+ * @param width the width of the rectangle to add
+ * @param height the height of the rectangle to add
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void addRectangle(float x, float y, float width, float height) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ NSRect rect = new NSRect();
+ rect.x = x;
+ rect.y = y;
+ rect.width = width;
+ rect.height = height;
+ handle.appendBezierPathWithRect(rect);
+}
+
+/**
+ * Adds to the receiver the pattern of glyphs generated by drawing
+ * the given string using the given font starting at the point (x, y).
+ *
+ * @param string the text to use
+ * @param x the x coordinate of the starting point
+ * @param y the y coordinate of the starting point
+ * @param font the font to use
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the font is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the font has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void addString(String string, float x, float y, Font font) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (font == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (font.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ NSString str = NSString.stringWith(string);
+ NSTextStorage textStorage = ((NSTextStorage)new NSTextStorage().alloc());
+ textStorage.initWithString_(str);
+ NSLayoutManager layoutManager = (NSLayoutManager)new NSLayoutManager().alloc().init();
+ NSTextContainer textContainer = (NSTextContainer)new NSTextContainer().alloc();
+ NSSize size = new NSSize();
+ size.width = Float.MAX_VALUE;
+ size.height = Float.MAX_VALUE;
+ textContainer.initWithContainerSize(size);
+ textStorage.addLayoutManager(layoutManager);
+ layoutManager.addTextContainer(textContainer);
+ NSRange range = new NSRange();
+ range.length = str.length();
+ textStorage.beginEditing();
+ textStorage.addAttribute(OS.NSFontAttributeName(), font.handle, range);
+ textStorage.endEditing();
+ range = layoutManager.glyphRangeForTextContainer(textContainer);
+ if (range.length != 0) {
+ int glyphs = OS.malloc(4 * range.length * 2);
+ layoutManager.getGlyphs(glyphs, range);
+ NSBezierPath path = NSBezierPath.bezierPath();
+ NSPoint point = new NSPoint();
+ point.x = x;
+ point.y = y;
+ path.moveToPoint(point);
+ path.appendBezierPathWithGlyphs(glyphs, range.length, font.handle);
+ NSAffineTransform transform = NSAffineTransform.transform();
+ transform.scaleXBy(1, -1);
+ transform.translateXBy(0, -(y + textStorage.size().height));
+ path.transformUsingAffineTransform(transform);
+ OS.free(glyphs);
+ handle.appendBezierPath(path);
+ }
+ textContainer.release();
+ layoutManager.release();
+ textStorage.release();
+}
+
+/**
+ * Closes the current sub path by adding to the receiver a line
+ * from the current point of the path back to the starting point
+ * of the sub path.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void close() {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ handle.closePath();
+}
+
+/**
+ * Returns <code>true</code> if the specified point is contained by
+ * the receiver and false otherwise.
+ * <p>
+ * If outline is <code>true</code>, the point (x, y) checked for containment in
+ * the receiver's outline. If outline is <code>false</code>, the point is
+ * checked to see if it is contained within the bounds of the (closed) area
+ * covered by the receiver.
+ *
+ * @param x the x coordinate of the point to test for containment
+ * @param y the y coordinate of the point to test for containment
+ * @param gc the GC to use when testing for containment
+ * @param outline controls whether to check the outline or contained area of the path
+ * @return <code>true</code> if the path contains the point and <code>false</code> otherwise
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the gc is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the gc has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public boolean contains(float x, float y, GC gc, boolean outline) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (gc == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (gc.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+// gc.checkGC(GC.LINE_CAP | GC.LINE_JOIN | GC.LINE_STYLE | GC.LINE_WIDTH);
+ //TODO outline
+ NSPoint point = new NSPoint();
+ point.x = x;
+ point.y = y;
+ return handle.containsPoint(point);
+}
+
+/**
+ * Adds to the receiver a cubic bezier curve based on the parameters.
+ *
+ * @param cx1 the x coordinate of the first control point of the spline
+ * @param cy1 the y coordinate of the first control of the spline
+ * @param cx2 the x coordinate of the second control of the spline
+ * @param cy2 the y coordinate of the second control of the spline
+ * @param x the x coordinate of the end point of the spline
+ * @param y the y coordinate of the end point of the spline
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void cubicTo(float cx1, float cy1, float cx2, float cy2, float x, float y) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ NSPoint pt = new NSPoint();
+ pt.x = x;
+ pt.y = y;
+ NSPoint ct1 = new NSPoint();
+ ct1.x = cx1;
+ ct1.y = cy1;
+ NSPoint ct2 = new NSPoint();
+ ct2.x = cx2;
+ ct2.y = cy2;
+ handle.curveToPoint(pt, ct1, ct2);
+}
+
+/**
+ * Disposes of the operating system resources associated with
+ * the Path. Applications must dispose of all Paths that
+ * they allocate.
+ */
+public void dispose() {
+ if (handle == null) return;
+ handle.release();
+ handle = null;
+ if (device.tracking) device.dispose_Object(this);
+ device = null;
+}
+
+/**
+ * Replaces the first four elements in the parameter with values that
+ * describe the smallest rectangle that will completely contain the
+ * receiver (i.e. the bounding box).
+ *
+ * @param bounds the array to hold the result
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parameter is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the parameter is too small to hold the bounding box</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void getBounds(float[] bounds) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (bounds == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (bounds.length < 4) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ NSRect rect = handle.controlPointBounds();
+ bounds[0] = rect.x;
+ bounds[1] = rect.y;
+ bounds[2] = rect.width;
+ bounds[3] = rect.height;
+}
+
+/**
+ * Replaces the first two elements in the parameter with values that
+ * describe the current point of the path.
+ *
+ * @param point the array to hold the result
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parameter is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the parameter is too small to hold the end point</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void getCurrentPoint(float[] point) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (point == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (point.length < 2) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ NSPoint pt = handle.currentPoint();
+ point[0] = pt.x;
+ point[1] = pt.y;
+}
+
+/**
+ * Returns a device independent representation of the receiver.
+ *
+ * @return the PathData for the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see PathData
+ */
+public PathData getPathData() {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ int count = handle.elementCount();
+ int pointCount = 0, typeCount = 0;
+ byte[] types = new byte[count];
+ float[] pointArray = new float[count * 6];
+ int points = OS.malloc(3 * NSPoint.sizeof);
+ if (points == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+ NSPoint pt = new NSPoint();
+ for (int i = 0; i < count; i++) {
+ int element = handle.elementAtIndex_associatedPoints_(i, points);
+ switch (element) {
+ case OS.NSMoveToBezierPathElement:
+ types[typeCount++] = SWT.PATH_MOVE_TO;
+ OS.memmove(pt, points, NSPoint.sizeof);
+ pointArray[pointCount++] = (int)pt.x;
+ pointArray[pointCount++] = (int)pt.y;
+ break;
+ case OS.NSLineToBezierPathElement:
+ types[typeCount++] = SWT.PATH_LINE_TO;
+ OS.memmove(pt, points, NSPoint.sizeof);
+ pointArray[pointCount++] = (int)pt.x;
+ pointArray[pointCount++] = (int)pt.y;
+ break;
+ case OS.NSCurveToBezierPathElement:
+ types[typeCount++] = SWT.PATH_CUBIC_TO;
+ OS.memmove(pt, points, NSPoint.sizeof);
+ pointArray[pointCount++] = (int)pt.x;
+ pointArray[pointCount++] = (int)pt.y;
+ OS.memmove(pt, points + NSPoint.sizeof, NSPoint.sizeof);
+ pointArray[pointCount++] = (int)pt.x;
+ pointArray[pointCount++] = (int)pt.y;
+ OS.memmove(pt, points + NSPoint.sizeof + NSPoint.sizeof, NSPoint.sizeof);
+ pointArray[pointCount++] = (int)pt.x;
+ pointArray[pointCount++] = (int)pt.y;
+ break;
+ case OS.NSClosePathBezierPathElement:
+ types[typeCount++] = SWT.PATH_CLOSE;
+ break;
+ }
+ }
+ OS.free(points);
+ if (pointCount != pointArray.length) {
+ float[] temp = new float[pointCount];
+ System.arraycopy(pointArray, 0, temp, 0, pointCount);
+ pointArray = temp;
+ }
+ PathData data = new PathData();
+ data.types = types;
+ data.points = pointArray;
+ return data;
+}
+
+/**
+ * Returns <code>true</code> if the Path has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the Path.
+ * When a Path has been disposed, it is an error to
+ * invoke any other method using the Path.
+ *
+ * @return <code>true</code> when the Path is disposed, and <code>false</code> otherwise
+ */
+public boolean isDisposed() {
+ return handle == null;
+}
+
+/**
+ * Adds to the receiver a line from the current point to
+ * the point specified by (x, y).
+ *
+ * @param x the x coordinate of the end of the line to add
+ * @param y the y coordinate of the end of the line to add
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void lineTo(float x, float y) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ NSPoint pt = new NSPoint();
+ pt.x = x;
+ pt.y = y;
+ handle.lineToPoint(pt);
+}
+
+/**
+ * Sets the current point of the receiver to the point
+ * specified by (x, y). Note that this starts a new
+ * sub path.
+ *
+ * @param x the x coordinate of the new end point
+ * @param y the y coordinate of the new end point
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void moveTo(float x, float y) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ NSPoint pt = new NSPoint();
+ pt.x = x;
+ pt.y = y;
+ handle.moveToPoint(pt);
+
+}
+
+/**
+ * Adds to the receiver a quadratic curve based on the parameters.
+ *
+ * @param cx the x coordinate of the control point of the spline
+ * @param cy the y coordinate of the control point of the spline
+ * @param x the x coordinate of the end point of the spline
+ * @param y the y coordinate of the end point of the spline
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void quadTo(float cx, float cy, float x, float y) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ NSPoint pt = new NSPoint();
+ pt.x = x;
+ pt.y = y;
+ NSPoint ct = new NSPoint();
+ ct.x = cx;
+ ct.y = cy;
+ handle.curveToPoint(pt, ct, ct);
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public String toString () {
+ if (isDisposed()) return "Path {*DISPOSED*}";
+ return "Path {" + handle + "}";
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Pattern.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Pattern.java
new file mode 100755
index 0000000000..1b6b1d2d80
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Pattern.java
@@ -0,0 +1,214 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.graphics;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * Instances of this class represent patterns to use while drawing. Patterns
+ * can be specified either as bitmaps or gradients.
+ * <p>
+ * Application code must explicitly invoke the <code>Pattern.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ * <p>
+ * This class requires the operating system's advanced graphics subsystem
+ * which may not be available on some platforms.
+ * </p>
+ *
+ * @since 3.1
+ */
+public class Pattern extends Resource {
+ NSColor color;
+ NSGradient gradient;
+ NSPoint pt1, pt2;
+ Image image;
+ float[] color1, color2;
+ int alpha1, alpha2;
+
+/**
+ * Constructs a new Pattern given an image. Drawing with the resulting
+ * pattern will cause the image to be tiled over the resulting area.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param device the device on which to allocate the pattern
+ * @param image the image that the pattern will draw
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device, or the image is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES if a handle for the pattern could not be obtained</li>
+ * </ul>
+ *
+ * @see #dispose()
+ */
+public Pattern(Device device, Image image) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (image == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (image.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ this.device = device;
+ this.image = image;
+ color = NSColor.colorWithPatternImage(image.handle);
+ color.retain();
+ if (device.tracking) device.new_Object(this);
+}
+
+/**
+ * Constructs a new Pattern that represents a linear, two color
+ * gradient. Drawing with the pattern will cause the resulting area to be
+ * tiled with the gradient specified by the arguments.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param device the device on which to allocate the pattern
+ * @param x1 the x coordinate of the starting corner of the gradient
+ * @param y1 the y coordinate of the starting corner of the gradient
+ * @param x2 the x coordinate of the ending corner of the gradient
+ * @param y2 the y coordinate of the ending corner of the gradient
+ * @param color1 the starting color of the gradient
+ * @param color2 the ending color of the gradient
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device,
+ * or if either color1 or color2 is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if either color1 or color2 has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES if a handle for the pattern could not be obtained</li>
+ * </ul>
+ *
+ * @see #dispose()
+ */
+public Pattern(Device device, float x1, float y1, float x2, float y2, Color color1, Color color2) {
+ this(device, x1, y1, x2, y2, color1, 0xFF, color2, 0xFF);
+}
+/**
+ * Constructs a new Pattern that represents a linear, two color
+ * gradient. Drawing with the pattern will cause the resulting area to be
+ * tiled with the gradient specified by the arguments.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param device the device on which to allocate the pattern
+ * @param x1 the x coordinate of the starting corner of the gradient
+ * @param y1 the y coordinate of the starting corner of the gradient
+ * @param x2 the x coordinate of the ending corner of the gradient
+ * @param y2 the y coordinate of the ending corner of the gradient
+ * @param color1 the starting color of the gradient
+ * @param alpha1 the starting alpha value of the gradient
+ * @param color2 the ending color of the gradient
+ * @param alpha2 the ending alpha value of the gradient
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the device is null and there is no current device,
+ * or if either color1 or color2 is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if either color1 or color2 has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES if a handle for the pattern could not be obtained</li>
+ * </ul>
+ *
+ * @see #dispose()
+ *
+ * @since 3.2
+ */
+public Pattern(Device device, float x1, float y1, float x2, float y2, Color color1, int alpha1, Color color2, int alpha2) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (color1 == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (color1.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ if (color2 == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (color2.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ this.device = device;
+ pt1 = new NSPoint();
+ pt2 = new NSPoint();
+ pt1.x = x1;
+ pt1.y = y1;
+ pt2.x = x2;
+ pt2.y = y2;
+ this.color1 = color1.handle;
+ this.color2 = color2.handle;
+ this.alpha1 = alpha1;
+ this.alpha2 = alpha2;
+ NSColor start = NSColor.colorWithDeviceRed(color1.handle[0], color1.handle[1], color1.handle[2], alpha1 / 255f);
+ NSColor end = NSColor.colorWithDeviceRed(color2.handle[0], color2.handle[1], color2.handle[2], alpha2 / 255f);
+ gradient = ((NSGradient)new NSGradient().alloc()).initWithStartingColor(start, end);
+ if (device.tracking) device.new_Object(this);
+}
+
+/**
+ * Disposes of the operating system resources associated with
+ * the Pattern. Applications must dispose of all Patterns that
+ * they allocate.
+ */
+public void dispose() {
+ if (device == null) return;
+ if (device.isDisposed()) return;
+ if (color != null) color.release();
+ color = null;
+ if (gradient != null) gradient.release();
+ gradient = null;
+ image = null;
+ color1 = color2 = null;
+ if (device.tracking) device.dispose_Object(this);
+ device = null;
+}
+
+/**
+ * Returns <code>true</code> if the Pattern has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the Pattern.
+ * When a Pattern has been disposed, it is an error to
+ * invoke any other method using the Pattern.
+ *
+ * @return <code>true</code> when the Pattern is disposed, and <code>false</code> otherwise
+ */
+public boolean isDisposed() {
+ return device == null;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public String toString() {
+ if (isDisposed()) return "Pattern {*DISPOSED*}";
+ return "Pattern {" + (color != null ? color.id : gradient.id) + "}";
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Region.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Region.java
new file mode 100755
index 0000000000..73e7535788
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Region.java
@@ -0,0 +1,676 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.graphics;
+
+
+import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.cocoa.*;
+import org.eclipse.swt.*;
+
+/**
+ * Instances of this class represent areas of an x-y coordinate
+ * system that are aggregates of the areas covered by a number
+ * of polygons.
+ * <p>
+ * Application code must explicitly invoke the <code>Region.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ */
+public final class Region extends Resource {
+ /**
+ * the OS resource for the region
+ * (Warning: This field is platform dependent)
+ * <p>
+ * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It is not available on all
+ * platforms and should never be accessed from application code.
+ * </p>
+ */
+ public int handle;
+
+/**
+ * Constructs a new empty region.
+ *
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES if a handle could not be obtained for region creation</li>
+ * </ul>
+ */
+public Region() {
+ this(null);
+}
+
+/**
+ * Constructs a new empty region.
+ * <p>
+ * You must dispose the region when it is no longer required.
+ * </p>
+ *
+ * @param device the device on which to allocate the region
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES if a handle could not be obtained for region creation</li>
+ * </ul>
+ *
+ * @see #dispose
+ *
+ * @since 3.0
+ */
+public Region(Device device) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ this.device = device;
+ handle = OS.NewRgn();
+ if (handle == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+}
+
+Region(Device device, int handle) {
+ this.device = device;
+ this.handle = handle;
+}
+
+/**
+ * Adds the given polygon to the collection of polygons
+ * the receiver maintains to describe its area.
+ *
+ * @param pointArray points that describe the polygon to merge with the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+*
+ */
+public void add (int[] pointArray) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ add(pointArray, pointArray.length);
+}
+
+void add(int[] pointArray, int count) {
+ if (count <= 2) return;
+ int polyRgn = OS.NewRgn();
+ OS.OpenRgn();
+ OS.MoveTo((short)pointArray[0], (short)pointArray[1]);
+ for (int i = 1; i < count / 2; i++) {
+ OS.LineTo((short)pointArray[2 * i], (short)pointArray[2 * i + 1]);
+ }
+ OS.LineTo((short)pointArray[0], (short)pointArray[1]);
+ OS.CloseRgn(polyRgn);
+ OS.UnionRgn(handle, polyRgn, handle);
+ OS.DisposeRgn(polyRgn);
+}
+
+/**
+ * Adds the given rectangle to the collection of polygons
+ * the receiver maintains to describe its area.
+ *
+ * @param rect the rectangle to merge with the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the rectangle's width or height is negative</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void add(Rectangle rect) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (rect == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (rect.width < 0 || rect.height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ add (rect.x, rect.y, rect.width, rect.height);
+}
+
+/**
+ * Adds the given rectangle to the collection of polygons
+ * the receiver maintains to describe its area.
+ *
+ * @param x the x coordinate of the rectangle
+ * @param y the y coordinate of the rectangle
+ * @param width the width coordinate of the rectangle
+ * @param height the height coordinate of the rectangle
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the rectangle's width or height is negative</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void add(int x, int y, int width, int height) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (width < 0 || height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ int rectRgn = OS.NewRgn();
+ short[] r = new short[]{(short)x, (short)y, (short)(x + width),(short)(y + height)};
+ OS.RectRgn(rectRgn, r);
+ OS.UnionRgn(handle, rectRgn, handle);
+ OS.DisposeRgn(rectRgn);
+}
+
+/**
+ * Adds all of the polygons which make up the area covered
+ * by the argument to the collection of polygons the receiver
+ * maintains to describe its area.
+ *
+ * @param region the region to merge
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void add(Region region) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (region == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (region.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ OS.UnionRgn(handle, region.handle, handle);
+}
+
+/**
+ * Returns <code>true</code> if the point specified by the
+ * arguments is inside the area specified by the receiver,
+ * and <code>false</code> otherwise.
+ *
+ * @param x the x coordinate of the point to test for containment
+ * @param y the y coordinate of the point to test for containment
+ * @return <code>true</code> if the region contains the point and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public boolean contains(int x, int y) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ short[] point = new short[]{(short)x, (short)y};
+ return OS.PtInRgn(point, handle);
+}
+
+/**
+ * Returns <code>true</code> if the given point is inside the
+ * area specified by the receiver, and <code>false</code>
+ * otherwise.
+ *
+ * @param pt the point to test for containment
+ * @return <code>true</code> if the region contains the point and <code>false</code> otherwise
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public boolean contains(Point pt) {
+ if (pt == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ return contains(pt.x, pt.y);
+}
+
+NSAffineTransform transform;
+void convertRgn(NSAffineTransform transform) {
+ int newRgn = OS.NewRgn();
+ Callback callback = new Callback(this, "convertRgn", 4);
+ int proc = callback.getAddress();
+ if (proc == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
+ this.transform = transform;
+ OS.QDRegionToRects(handle, OS.kQDParseRegionFromTopLeft, proc, newRgn);
+ this.transform = null;
+ callback.dispose();
+ OS.CopyRgn(newRgn, handle);
+ OS.DisposeRgn(newRgn);
+}
+
+int convertRgn(int message, int rgn, int r, int newRgn) {
+ if (message == OS.kQDRegionToRectsMsgParse) {
+ short[] rect = new short[4];
+ OS.memmove(rect, r, rect.length * 2);
+ NSPoint point = new NSPoint();
+ int polyRgn = OS.NewRgn();
+ OS.OpenRgn();
+ point.x = rect[1];
+ point.y = rect[0];
+ point = transform.transformPoint(point);
+ short startX, startY;
+ OS.MoveTo(startX = (short)point.x, startY = (short)point.y);
+ point.x = rect[3];
+ point.y = rect[0];
+ point = transform.transformPoint(point);
+ OS.LineTo((short)Math.round(point.x), (short)point.y);
+ point.x = rect[3];
+ point.y = rect[2];
+ point = transform.transformPoint(point);
+ OS.LineTo((short)Math.round(point.x), (short)Math.round(point.y));
+ point.x = rect[1];
+ point.y = rect[2];
+ point = transform.transformPoint(point);
+ OS.LineTo((short)point.x, (short)Math.round(point.y));
+ OS.LineTo(startX, startY);
+ OS.CloseRgn(polyRgn);
+ OS.UnionRgn(newRgn, polyRgn, newRgn);
+ OS.DisposeRgn(polyRgn);
+ }
+ return 0;
+}
+
+/**
+ * Disposes of the operating system resources associated with
+ * the region. Applications must dispose of all regions which
+ * they allocate.
+ */
+public void dispose() {
+ if (handle == 0) return;
+ OS.DisposeRgn(handle);
+ handle = 0;
+ device = null;
+}
+
+/**
+ * Compares the argument to the receiver, and returns true
+ * if they represent the <em>same</em> object using a class
+ * specific comparison.
+ *
+ * @param object the object to compare with this object
+ * @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
+ *
+ * @see #hashCode
+ */
+public boolean equals(Object object) {
+ if (this == object) return true;
+ if (!(object instanceof Region)) return false;
+ Region region = (Region)object;
+ return handle == region.handle;
+}
+
+/**
+ * Returns a rectangle which represents the rectangular
+ * union of the collection of polygons the receiver
+ * maintains to describe its area.
+ *
+ * @return a bounding rectangle for the region
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Rectangle#union
+ */
+public Rectangle getBounds() {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ short[] bounds = new short[4];
+ OS.GetRegionBounds(handle, bounds);
+ int width = bounds[3] - bounds[1];
+ int height = bounds[2] - bounds[0];
+ return new Rectangle(bounds[1], bounds[0], width, height);
+}
+
+NSBezierPath getPath() {
+ Callback callback = new Callback(this, "regionToRects", 4);
+ if (callback.getAddress() == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
+ NSBezierPath path = NSBezierPath.bezierPath();
+ OS.QDRegionToRects(handle, OS.kQDParseRegionFromTopLeft, callback.getAddress(), path.id);
+ return path;
+}
+
+NSPoint pt = new NSPoint();
+short[] rect = new short[4];
+int regionToRects(int message, int rgn, int r, int path) {
+ if (message == OS.kQDRegionToRectsMsgParse) {
+ OS.memmove(rect, r, rect.length * 2);
+ pt.x = rect[1];
+ pt.y = rect[0];
+ OS.objc_msgSend(path, OS.sel_moveToPoint_1, pt);
+ pt.x = rect[3];
+ OS.objc_msgSend(path, OS.sel_lineToPoint_1, pt);
+ pt.x = rect[3];
+ pt.y = rect[2];
+ OS.objc_msgSend(path, OS.sel_lineToPoint_1, pt);
+ pt.x = rect[1];
+ OS.objc_msgSend(path, OS.sel_lineToPoint_1, pt);
+ OS.objc_msgSend(path, OS.sel_closePath);
+ }
+ return 0;
+}
+
+public static Region carbon_new(Device device, int handle) {
+ return new Region(device, handle);
+}
+
+/**
+ * Returns an integer hash code for the receiver. Any two
+ * objects that return <code>true</code> when passed to
+ * <code>equals</code> must return the same value for this
+ * method.
+ *
+ * @return the receiver's hash
+ *
+ * @see #equals
+ */
+public int hashCode() {
+ return handle;
+}
+
+/**
+ * Intersects the given rectangle to the collection of polygons
+ * the receiver maintains to describe its area.
+ *
+ * @param rect the rectangle to intersect with the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the rectangle's width or height is negative</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void intersect(Rectangle rect) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (rect == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ intersect (rect.x, rect.y, rect.width, rect.height);
+}
+
+/**
+ * Intersects the given rectangle to the collection of polygons
+ * the receiver maintains to describe its area.
+ *
+ * @param x the x coordinate of the rectangle
+ * @param y the y coordinate of the rectangle
+ * @param width the width coordinate of the rectangle
+ * @param height the height coordinate of the rectangle
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the rectangle's width or height is negative</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void intersect(int x, int y, int width, int height) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (width < 0 || height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ int rectRgn = OS.NewRgn();
+ short[] r = new short[]{(short)x, (short)y, (short)(x + width),(short)(y + height)};
+ OS.RectRgn(rectRgn, r);
+ OS.SectRgn(handle, rectRgn, handle);
+ OS.DisposeRgn(rectRgn);
+}
+
+/**
+ * Intersects all of the polygons which make up the area covered
+ * by the argument to the collection of polygons the receiver
+ * maintains to describe its area.
+ *
+ * @param region the region to intersect
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void intersect(Region region) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (region == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (region.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ OS.SectRgn(handle, region.handle, handle);
+}
+
+/**
+ * Returns <code>true</code> if the rectangle described by the
+ * arguments intersects with any of the polygons the receiver
+ * maintains to describe its area, and <code>false</code> otherwise.
+ *
+ * @param x the x coordinate of the origin of the rectangle
+ * @param y the y coordinate of the origin of the rectangle
+ * @param width the width of the rectangle
+ * @param height the height of the rectangle
+ * @return <code>true</code> if the rectangle intersects with the receiver, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Rectangle#intersects(Rectangle)
+ */
+public boolean intersects (int x, int y, int width, int height) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ short[] rect = new short[]{(short)x, (short)y, (short)(x + width),(short)(y + height)};
+ return OS.RectInRgn(rect, handle);
+}
+
+/**
+ * Returns <code>true</code> if the given rectangle intersects
+ * with any of the polygons the receiver maintains to describe
+ * its area and <code>false</code> otherwise.
+ *
+ * @param rect the rectangle to test for intersection
+ * @return <code>true</code> if the rectangle intersects with the receiver, and <code>false</code> otherwise
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Rectangle#intersects(Rectangle)
+ */
+public boolean intersects(Rectangle rect) {
+ if (rect == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ return intersects(rect.x, rect.y, rect.width, rect.height);
+}
+
+/**
+ * Returns <code>true</code> if the region has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the region.
+ * When a region has been disposed, it is an error to
+ * invoke any other method using the region.
+ *
+ * @return <code>true</code> when the region is disposed, and <code>false</code> otherwise
+ */
+public boolean isDisposed() {
+ return handle == 0;
+}
+
+/**
+ * Returns <code>true</code> if the receiver does not cover any
+ * area in the (x, y) coordinate plane, and <code>false</code> if
+ * the receiver does cover some area in the plane.
+ *
+ * @return <code>true</code> if the receiver is empty, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public boolean isEmpty() {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ return OS.EmptyRgn(handle);
+}
+
+/**
+ * Subtracts the given polygon from the collection of polygons
+ * the receiver maintains to describe its area.
+ *
+ * @param pointArray points that describe the polygon to merge with the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void subtract (int[] pointArray) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (pointArray.length < 2) return;
+ int polyRgn = OS.NewRgn();
+ OS.OpenRgn();
+ OS.MoveTo((short)pointArray[0], (short)pointArray[1]);
+ for (int i = 1; i < pointArray.length / 2; i++) {
+ OS.LineTo((short)pointArray[2 * i], (short)pointArray[2 * i + 1]);
+ }
+ OS.LineTo((short)pointArray[0], (short)pointArray[1]);
+ OS.CloseRgn(polyRgn);
+ OS.DiffRgn(handle, polyRgn, handle);
+ OS.DisposeRgn(polyRgn);
+}
+
+/**
+ * Subtracts the given rectangle from the collection of polygons
+ * the receiver maintains to describe its area.
+ *
+ * @param rect the rectangle to subtract from the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the rectangle's width or height is negative</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void subtract(Rectangle rect) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (rect == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ subtract (rect.x, rect.y, rect.width, rect.height);
+}
+
+/**
+ * Subtracts the given rectangle from the collection of polygons
+ * the receiver maintains to describe its area.
+ *
+ * @param x the x coordinate of the rectangle
+ * @param y the y coordinate of the rectangle
+ * @param width the width coordinate of the rectangle
+ * @param height the height coordinate of the rectangle
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the rectangle's width or height is negative</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void subtract(int x, int y, int width, int height) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (width < 0 || height < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ int rectRgn = OS.NewRgn();
+ short[] r = new short[]{(short)x, (short)y, (short)(x + width),(short)(y + height)};
+ OS.RectRgn(rectRgn, r);
+ OS.DiffRgn(handle, rectRgn, handle);
+ OS.DisposeRgn(rectRgn);
+}
+
+/**
+ * Subtracts all of the polygons which make up the area covered
+ * by the argument from the collection of polygons the receiver
+ * maintains to describe its area.
+ *
+ * @param region the region to subtract
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void subtract(Region region) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (region == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (region.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ OS.DiffRgn(handle, region.handle, handle);
+}
+
+/**
+ * Translate all of the polygons the receiver maintains to describe
+ * its area by the specified point.
+ *
+ * @param x the x coordinate of the point to translate
+ * @param y the y coordinate of the point to translate
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void translate (int x, int y) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ OS.OffsetRgn (handle, (short)x, (short)y);
+}
+
+/**
+ * Translate all of the polygons the receiver maintains to describe
+ * its area by the specified point.
+ *
+ * @param pt the point to translate
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the argument is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void translate (Point pt) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (pt == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ translate (pt.x, pt.y);
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public String toString () {
+ if (isDisposed()) return "Region {*DISPOSED*}";
+ return "Region {" + handle + "}";
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java
new file mode 100755
index 0000000000..e368f3c95a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java
@@ -0,0 +1,1416 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.graphics;
+
+import org.eclipse.swt.internal.cocoa.*;
+import org.eclipse.swt.*;
+
+/**
+ * <code>TextLayout</code> is a graphic object that represents
+ * styled text.
+ * <p>
+ * Instances of this class provide support for drawing, cursor
+ * navigation, hit testing, text wrapping, alignment, tab expansion
+ * line breaking, etc. These are aspects required for rendering internationalized text.
+ * </p><p>
+ * Application code must explicitly invoke the <code>TextLayout#dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ *
+ * @since 3.0
+ */
+public final class TextLayout extends Resource {
+
+ NSTextStorage textStorage;
+ NSLayoutManager layoutManager;
+ NSTextContainer textContainer;
+ Font font;
+ String text;
+ StyleItem[] styles;
+ int spacing, ascent, descent, indent;
+ boolean justify;
+ int alignment;
+ int[] tabs;
+ int[] segments;
+ int wrapWidth;
+ int orientation;
+
+ static class StyleItem {
+ TextStyle style;
+ int start;
+
+ public String toString () {
+ return "StyleItem {" + start + ", " + style + "}";
+ }
+ }
+
+// static final int TAB_COUNT = 32;
+// static final char ZWS = '\u200B';
+//
+// static final int UNDERLINE_IME_INPUT = 1 << 16;
+// static final int UNDERLINE_IME_TARGET_CONVERTED = 2 << 16;
+// static final int UNDERLINE_IME_CONVERTED = 3 << 16;
+
+/**
+ * Constructs a new instance of this class on the given device.
+ * <p>
+ * You must dispose the text layout when it is no longer required.
+ * </p>
+ *
+ * @param device the device on which to allocate the text layout
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * </ul>
+ *
+ * @see #dispose()
+ */
+public TextLayout (Device device) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ this.device = device;
+ wrapWidth = ascent = descent = -1;
+ alignment = SWT.LEFT;
+ orientation = SWT.LEFT_TO_RIGHT;
+ text = "";
+ styles = new StyleItem[2];
+ styles[0] = new StyleItem();
+ styles[1] = new StyleItem();
+}
+
+void checkLayout() {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+}
+
+void computeRuns() {
+ if (textStorage != null) return;
+ NSString str = NSString.stringWith(text);
+ textStorage = ((NSTextStorage)new NSTextStorage().alloc());
+ textStorage.initWithString_(str);
+ layoutManager = (NSLayoutManager)new NSLayoutManager().alloc().init();
+ textContainer = (NSTextContainer)new NSTextContainer().alloc();
+ NSSize size = new NSSize();
+ size.width = wrapWidth != -1 ? wrapWidth : Float.MAX_VALUE;
+ size.height = Float.MAX_VALUE;
+ textContainer.initWithContainerSize(size);
+ textStorage.addLayoutManager(layoutManager);
+ layoutManager.addTextContainer(textContainer);
+
+ textStorage.beginEditing();
+ Font defaultFont = font != null ? font : device.systemFont;
+ NSRange range = new NSRange();
+ range.length = str.length();
+ textStorage.addAttribute(OS.NSFontAttributeName(), defaultFont.handle, range);
+
+ NSMutableParagraphStyle paragraph = (NSMutableParagraphStyle)new NSMutableParagraphStyle().alloc().init();
+ int align = OS.NSLeftTextAlignment;
+ if (justify) {
+ align = OS.NSJustifiedTextAlignment;
+ } else {
+ switch (alignment) {
+ case SWT.CENTER:
+ align = OS.NSCenterTextAlignment;
+ break;
+ case SWT.RIGHT:
+ align = OS.NSRightTextAlignment;
+ }
+ }
+ paragraph.setAlignment(align);
+ paragraph.setLineSpacing(spacing);
+ paragraph.setFirstLineHeadIndent(indent);
+
+ //TODO tabs ascend descent wrap
+
+ textStorage.addAttribute(OS.NSParagraphStyleAttributeName(), paragraph, range);
+ paragraph.release();
+
+ int textLength = str.length();
+ for (int i = 0; i < styles.length - 1; i++) {
+ StyleItem run = styles[i];
+ if (run.style == null) continue;
+ TextStyle style = run.style;
+ range.location = textLength != 0 ? translateOffset(run.start) : 0;
+ range.length = translateOffset(styles[i + 1].start) - range.location;
+ Font font = style.font;
+ if (font != null) {
+ textStorage.addAttribute(OS.NSFontAttributeName(), font.handle, range);
+ }
+ Color foreground = style.foreground;
+ if (foreground != null) {
+ NSColor color = NSColor.colorWithDeviceRed(foreground.handle[0], foreground.handle[1], foreground.handle[2], 1);
+ textStorage.addAttribute(OS.NSForegroundColorAttributeName(), color, range);
+ }
+ Color background = style.background;
+ if (background != null) {
+ NSColor color = NSColor.colorWithDeviceRed(background.handle[0], background.handle[1], background.handle[2], 1);
+ textStorage.addAttribute(OS.NSBackgroundColorAttributeName(), color, range);
+ }
+ if (style.strikeout) {
+ textStorage.addAttribute(OS.NSStrikethroughStyleAttributeName(), NSNumber.numberWithInt(OS.NSUnderlineStyleSingle), range);
+ Color strikeColor = style.strikeoutColor;
+ if (strikeColor != null) {
+ NSColor color = NSColor.colorWithDeviceRed(strikeColor.handle[0], strikeColor.handle[1], strikeColor.handle[2], 1);
+ textStorage.addAttribute(OS.NSStrikethroughColorAttributeName(), color, range);
+ }
+ }
+ if (style.underline) {
+ //TODO - IME - thick
+ int underlineStyle = 0;
+ switch (style.underlineStyle) {
+ case SWT.UNDERLINE_SINGLE:
+ underlineStyle = OS.NSUnderlineStyleSingle;
+ break;
+ case SWT.UNDERLINE_DOUBLE:
+ underlineStyle = OS.NSUnderlineStyleDouble;
+ break;
+ }
+ if (underlineStyle != 0) {
+ textStorage.addAttribute(OS.NSUnderlineStyleAttributeName(), NSNumber.numberWithInt(underlineStyle), range);
+ Color underlineColor = style.underlineColor;
+ if (underlineColor != null) {
+ NSColor color = NSColor.colorWithDeviceRed(underlineColor.handle[0], underlineColor.handle[1], underlineColor.handle[2], 1);
+ textStorage.addAttribute(OS.NSUnderlineColorAttributeName(), color, range);
+ }
+ }
+ }
+ if (style.rise != 0) {
+ textStorage.addAttribute(OS.NSBaselineOffsetAttributeName(), NSNumber.numberWithInt(style.rise), range);
+ }
+ if (style.metrics != null) {
+ //TODO
+ }
+ }
+ textStorage.endEditing();
+
+ textContainer.setLineFragmentPadding(0);
+
+ layoutManager.glyphRangeForTextContainer(textContainer);
+}
+
+/**
+ * Disposes of the operating system resources associated with
+ * the text layout. Applications must dispose of all allocated text layouts.
+ */
+public void dispose() {
+ if (device == null) return;
+ freeRuns();
+ font = null;
+ text = null;
+ styles = null;
+ device = null;
+}
+
+/**
+ * Draws the receiver's text using the specified GC at the specified
+ * point.
+ *
+ * @param gc the GC to draw
+ * @param x the x coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the gc is null</li>
+ * </ul>
+ */
+public void draw(GC gc, int x, int y) {
+ draw(gc, x, y, -1, -1, null, null);
+}
+
+/**
+ * Draws the receiver's text using the specified GC at the specified
+ * point.
+ *
+ * @param gc the GC to draw
+ * @param x the x coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param selectionStart the offset where the selections starts, or -1 indicating no selection
+ * @param selectionEnd the offset where the selections ends, or -1 indicating no selection
+ * @param selectionForeground selection foreground, or NULL to use the system default color
+ * @param selectionBackground selection background, or NULL to use the system default color
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the gc is null</li>
+ * </ul>
+ */
+public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Color selectionForeground, Color selectionBackground) {
+ draw(gc, x, y, selectionStart, selectionEnd, selectionForeground, selectionBackground, 0);
+}
+
+/**
+ * Draws the receiver's text using the specified GC at the specified
+ * point.
+ * <p>
+ * The parameter <code>flags</code> can include one of <code>SWT.DELIMITER_SELECTION</code>
+ * or <code>SWT.FULL_SELECTION</code> to specify the selection behavior on all lines except
+ * for the last line, and can also include <code>SWT.LAST_LINE_SELECTION</code> to extend
+ * the specified selection behavior to the last line.
+ * </p>
+ * @param gc the GC to draw
+ * @param x the x coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param selectionStart the offset where the selections starts, or -1 indicating no selection
+ * @param selectionEnd the offset where the selections ends, or -1 indicating no selection
+ * @param selectionForeground selection foreground, or NULL to use the system default color
+ * @param selectionBackground selection background, or NULL to use the system default color
+ * @param flags drawing options
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the gc is null</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Color selectionForeground, Color selectionBackground, int flags) {
+ checkLayout ();
+ computeRuns();
+ if (gc == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (gc.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ if (selectionForeground != null && selectionForeground.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ if (selectionBackground != null && selectionBackground.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+// NSPoint pt = new NSPoint();
+// pt.x = x;
+// pt.y = y;
+// NSColor selectionColor = NSColor.colorWithDeviceRed(1, 0, 0, 1);
+// selectionColor.set();
+// NSRange range = new NSRange();
+// range.length = layoutManager.numberOfGlyphs();
+// layoutManager.drawBackgroundForGlyphRange(range, pt);
+// textStorage.drawAtPoint(pt);
+ NSRect rect = new NSRect();
+ rect.x = x;
+ rect.y = y;
+ NSSize size = textContainer.containerSize();
+ rect.width = size.width;
+ rect.height = size.height;
+ textStorage.drawInRect(rect);
+}
+
+void freeRuns() {
+ if (textStorage == null) return;
+ if (textStorage != null) {
+ textStorage.release();
+ }
+ if (layoutManager != null) {
+ layoutManager.release();
+ }
+ if (textContainer != null) {
+ textContainer.release();
+ }
+ textStorage = null;
+ layoutManager = null;
+ textContainer = null;
+}
+
+/**
+ * Returns the receiver's horizontal text alignment, which will be one
+ * of <code>SWT.LEFT</code>, <code>SWT.CENTER</code> or
+ * <code>SWT.RIGHT</code>.
+ *
+ * @return the alignment used to positioned text horizontally
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getAlignment() {
+ checkLayout();
+ return alignment;
+}
+
+/**
+ * Returns the ascent of the receiver.
+ *
+ * @return the ascent
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getDescent()
+ * @see #setDescent(int)
+ * @see #setAscent(int)
+ * @see #getLineMetrics(int)
+ */
+public int getAscent () {
+ checkLayout();
+ return ascent;
+}
+
+/**
+ * Returns the bounds of the receiver.
+ *
+ * @return the bounds of the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Rectangle getBounds() {
+ checkLayout();
+ computeRuns();
+ NSSize size = textStorage.size();
+ return new Rectangle(0, 0, (int)size.width, (int)size.height);
+}
+
+/**
+ * Returns the bounds for the specified range of characters. The
+ * bounds is the smallest rectangle that encompasses all characters
+ * in the range. The start and end offsets are inclusive and will be
+ * clamped if out of range.
+ *
+ * @param start the start offset
+ * @param end the end offset
+ * @return the bounds of the character range
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Rectangle getBounds(int start, int end) {
+ checkLayout();
+ computeRuns();
+ //TODO
+ return getBounds();
+}
+
+/**
+ * Returns the descent of the receiver.
+ *
+ * @return the descent
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getAscent()
+ * @see #setAscent(int)
+ * @see #setDescent(int)
+ * @see #getLineMetrics(int)
+ */
+public int getDescent () {
+ checkLayout();
+ return descent;
+}
+
+/**
+ * Returns the default font currently being used by the receiver
+ * to draw and measure text.
+ *
+ * @return the receiver's font
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Font getFont () {
+ checkLayout();
+ return font;
+}
+
+/**
+* Returns the receiver's indent.
+*
+* @return the receiver's indent
+*
+* @exception SWTException <ul>
+* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+* </ul>
+*
+* @since 3.2
+*/
+public int getIndent () {
+ checkLayout();
+ return indent;
+}
+
+/**
+* Returns the receiver's justification.
+*
+* @return the receiver's justification
+*
+* @exception SWTException <ul>
+* <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+* </ul>
+*
+* @since 3.2
+*/
+public boolean getJustify () {
+ checkLayout();
+ return justify;
+}
+
+/**
+ * Returns the embedding level for the specified character offset. The
+ * embedding level is usually used to determine the directionality of a
+ * character in bidirectional text.
+ *
+ * @param offset the character offset
+ * @return the embedding level
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the character offset is out of range</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ */
+public int getLevel(int offset) {
+ checkLayout();
+ computeRuns();
+ int length = text.length();
+ if (!(0 <= offset && offset <= length)) SWT.error(SWT.ERROR_INVALID_RANGE);
+ offset = translateOffset(offset);
+ int level = 0;
+ //TODO
+ return level;
+}
+
+/**
+ * Returns the line offsets. Each value in the array is the
+ * offset for the first character in a line except for the last
+ * value, which contains the length of the text.
+ *
+ * @return the line offsets
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int[] getLineOffsets() {
+ checkLayout ();
+ computeRuns();
+ int numberOfLines, index, numberOfGlyphs = layoutManager.numberOfGlyphs();
+ int rangePtr = OS.malloc(NSRange.sizeof);
+ NSRange lineRange = new NSRange();
+ for (numberOfLines = 0, index = 0; index < numberOfGlyphs; numberOfLines++){
+ layoutManager.lineFragmentRectForGlyphAtIndex_effectiveRange_(index, rangePtr);
+ OS.memmove(lineRange, rangePtr, NSRange.sizeof);
+ index = lineRange.location + lineRange.length;
+ }
+ int[] offsets = new int[numberOfLines + 1];
+ for (numberOfLines = 0, index = 0; index < numberOfGlyphs; numberOfLines++){
+ layoutManager.lineFragmentRectForGlyphAtIndex_effectiveRange_(index, rangePtr);
+ OS.memmove(lineRange, rangePtr, NSRange.sizeof);
+ offsets[numberOfLines] = lineRange.location;
+ index = lineRange.location + lineRange.length;
+ }
+ OS.free(rangePtr);
+ offsets[numberOfLines] = textStorage.length();
+ return offsets;
+}
+
+/**
+ * Returns the index of the line that contains the specified
+ * character offset.
+ *
+ * @param offset the character offset
+ * @return the line index
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the character offset is out of range</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getLineIndex(int offset) {
+ checkLayout ();
+ computeRuns();
+ int length = text.length();
+ if (!(0 <= offset && offset <= length)) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ int numberOfLines, index, numberOfGlyphs = layoutManager.numberOfGlyphs();
+ int rangePtr = OS.malloc(NSRange.sizeof);
+ NSRange lineRange = new NSRange();
+ for (numberOfLines = 0, index = 0; index < numberOfGlyphs; numberOfLines++){
+ layoutManager.lineFragmentRectForGlyphAtIndex_effectiveRange_(index, rangePtr);
+ OS.memmove(lineRange, rangePtr, NSRange.sizeof);
+ if (offset < lineRange.location) break;
+ index = lineRange.location + lineRange.length;
+ }
+ OS.free(rangePtr);
+ return numberOfLines;
+}
+
+/**
+ * Returns the bounds of the line for the specified line index.
+ *
+ * @param lineIndex the line index
+ * @return the line bounds
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the line index is out of range</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Rectangle getLineBounds(int lineIndex) {
+ checkLayout();
+ computeRuns();
+ NSRect rect = null;
+ int numberOfLines, index, numberOfGlyphs = layoutManager.numberOfGlyphs();
+ int rangePtr = OS.malloc(NSRange.sizeof);
+ NSRange lineRange = new NSRange();
+ for (numberOfLines = 0, index = 0; index < numberOfGlyphs; numberOfLines++){
+ NSRect r = layoutManager.lineFragmentUsedRectForGlyphAtIndex_effectiveRange_withoutAdditionalLayout_(index, rangePtr, false);
+ OS.memmove(lineRange, rangePtr, NSRange.sizeof);
+ if (lineIndex == numberOfLines) {
+ rect = r;
+ break;
+ }
+ index = lineRange.location + lineRange.length;
+ }
+ OS.free(rangePtr);
+ if (rect == null) SWT.error(SWT.ERROR_INVALID_RANGE);
+ return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+}
+
+/**
+ * Returns the receiver's line count. This includes lines caused
+ * by wrapping.
+ *
+ * @return the line count
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getLineCount() {
+ checkLayout ();
+ computeRuns();
+ int numberOfLines, index, numberOfGlyphs = layoutManager.numberOfGlyphs();
+ int rangePtr = OS.malloc(NSRange.sizeof);
+ NSRange lineRange = new NSRange();
+ for (numberOfLines = 0, index = 0; index < numberOfGlyphs; numberOfLines++){
+ layoutManager.lineFragmentRectForGlyphAtIndex_effectiveRange_(index, rangePtr);
+ OS.memmove(lineRange, rangePtr, NSRange.sizeof);
+ index = lineRange.location + lineRange.length;
+ }
+ OS.free(rangePtr);
+ return numberOfLines;
+}
+
+/**
+ * Returns the font metrics for the specified line index.
+ *
+ * @param lineIndex the line index
+ * @return the font metrics
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the line index is out of range</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public FontMetrics getLineMetrics (int lineIndex) {
+ checkLayout ();
+ computeRuns();
+ int lineCount = getLineCount();
+ if (!(0 <= lineIndex && lineIndex < lineCount)) SWT.error(SWT.ERROR_INVALID_RANGE);
+ int length = text.length();
+ if (length == 0) {
+ Font font = this.font != null ? this.font : device.systemFont;
+ NSFont nsFont = font.handle;
+ int ascent = (int)(0.5f + nsFont.ascender());
+ int descent = (int)(0.5f + (-nsFont.descender() + nsFont.leading()));
+ ascent = Math.max(ascent, this.ascent);
+ descent = Math.max(descent, this.descent);
+ return FontMetrics.cocoa_new(ascent, descent, 0, 0, ascent + descent);
+ }
+ Rectangle rect = getLineBounds(lineIndex);
+ int baseline = (int)layoutManager.typesetter().baselineOffsetInLayoutManager(layoutManager, getLineOffsets()[lineIndex]);
+ return FontMetrics.cocoa_new(rect.height - baseline, baseline, 0, 0, rect.height);
+}
+
+/**
+ * Returns the location for the specified character offset. The
+ * <code>trailing</code> argument indicates whether the offset
+ * corresponds to the leading or trailing edge of the cluster.
+ *
+ * @param offset the character offset
+ * @param trailing the trailing flag
+ * @return the location of the character offset
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getOffset(Point, int[])
+ * @see #getOffset(int, int, int[])
+ */
+public Point getLocation(int offset, boolean trailing) {
+ checkLayout();
+ computeRuns();
+ int length = text.length();
+ if (!(0 <= offset && offset <= length)) SWT.error(SWT.ERROR_INVALID_RANGE);
+ if (length == 0) return new Point(0, 0);
+ offset = translateOffset(offset);
+ int glyphIndex = layoutManager.glyphIndexForCharacterAtIndex(offset);
+ NSRect rect = layoutManager.lineFragmentUsedRectForGlyphAtIndex_effectiveRange_(glyphIndex, 0);
+ NSPoint point = layoutManager.locationForGlyphAtIndex(glyphIndex);
+ //TODO trailing
+ return new Point((int)point.x, (int)rect.y);
+}
+
+/**
+ * Returns the next offset for the specified offset and movement
+ * type. The movement is one of <code>SWT.MOVEMENT_CHAR</code>,
+ * <code>SWT.MOVEMENT_CLUSTER</code>, <code>SWT.MOVEMENT_WORD</code>,
+ * <code>SWT.MOVEMENT_WORD_END</code> or <code>SWT.MOVEMENT_WORD_START</code>.
+ *
+ * @param offset the start offset
+ * @param movement the movement type
+ * @return the next offset
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the offset is out of range</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getPreviousOffset(int, int)
+ */
+public int getNextOffset (int offset, int movement) {
+ return _getOffset(offset, movement, true);
+}
+
+int _getOffset (int offset, int movement, boolean forward) {
+ checkLayout();
+ computeRuns();
+ int length = text.length();
+ if (!(0 <= offset && offset <= length)) SWT.error(SWT.ERROR_INVALID_RANGE);
+ if (length == 0) return 0;
+ offset = translateOffset(offset);
+ switch (movement) {
+ case SWT.MOVEMENT_CLUSTER://TODO cluster
+ case SWT.MOVEMENT_CHAR: {
+ if (forward) {
+ offset++;
+ } else {
+ offset--;
+ }
+ return untranslateOffset(offset);
+ }
+ case SWT.MOVEMENT_WORD: {
+ return untranslateOffset(textStorage.nextWordFromIndex(offset, forward));
+ }
+ case SWT.MOVEMENT_WORD_END: {
+ NSRange range = textStorage.doubleClickAtIndex(offset);
+ return untranslateOffset(range.location + range.length);
+ }
+ case SWT.MOVEMENT_WORD_START: {
+ NSRange range = textStorage.doubleClickAtIndex(offset);
+ return untranslateOffset(range.location);
+ }
+ default:
+ break;
+ }
+ return -1;
+}
+
+/**
+ * Returns the character offset for the specified point.
+ * For a typical character, the trailing argument will be filled in to
+ * indicate whether the point is closer to the leading edge (0) or
+ * the trailing edge (1). When the point is over a cluster composed
+ * of multiple characters, the trailing argument will be filled with the
+ * position of the character in the cluster that is closest to
+ * the point.
+ *
+ * @param point the point
+ * @param trailing the trailing buffer
+ * @return the character offset
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the trailing length is less than <code>1</code></li>
+ * <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getLocation(int, boolean)
+ */
+public int getOffset(Point point, int[] trailing) {
+ checkLayout();
+ computeRuns();
+ if (point == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ return getOffset(point.x, point.y, trailing);
+}
+
+/**
+ * Returns the character offset for the specified point.
+ * For a typical character, the trailing argument will be filled in to
+ * indicate whether the point is closer to the leading edge (0) or
+ * the trailing edge (1). When the point is over a cluster composed
+ * of multiple characters, the trailing argument will be filled with the
+ * position of the character in the cluster that is closest to
+ * the point.
+ *
+ * @param x the x coordinate of the point
+ * @param y the y coordinate of the point
+ * @param trailing the trailing buffer
+ * @return the character offset
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the trailing length is less than <code>1</code></li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getLocation(int, boolean)
+ */
+public int getOffset(int x, int y, int[] trailing) {
+ checkLayout();
+ computeRuns();
+ if (trailing != null && trailing.length < 1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ int length = text.length();
+ if (length == 0) return 0;
+ NSPoint pt = new NSPoint();
+ pt.x = x;
+ pt.y = y;
+ //TODO trailing
+ //float[] partialFration = new float[1];
+ int glyphIndex = layoutManager.glyphIndexForPoint_inTextContainer_fractionOfDistanceThroughGlyph_(pt, textContainer, 0);
+ int offset = layoutManager.characterIndexForGlyphAtIndex(glyphIndex);
+ return Math.min(untranslateOffset(offset), length - 1);
+}
+
+/**
+ * Returns the orientation of the receiver.
+ *
+ * @return the orientation style
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getOrientation() {
+ checkLayout();
+ return orientation;
+}
+
+/**
+ * Returns the previous offset for the specified offset and movement
+ * type. The movement is one of <code>SWT.MOVEMENT_CHAR</code>,
+ * <code>SWT.MOVEMENT_CLUSTER</code> or <code>SWT.MOVEMENT_WORD</code>,
+ * <code>SWT.MOVEMENT_WORD_END</code> or <code>SWT.MOVEMENT_WORD_START</code>.
+ *
+ * @param offset the start offset
+ * @param movement the movement type
+ * @return the previous offset
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the offset is out of range</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getNextOffset(int, int)
+ */
+public int getPreviousOffset (int index, int movement) {
+ return _getOffset(index, movement, false);
+}
+
+/**
+ * Gets the ranges of text that are associated with a <code>TextStyle</code>.
+ *
+ * @return the ranges, an array of offsets representing the start and end of each
+ * text style.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getStyles()
+ *
+ * @since 3.2
+ */
+public int[] getRanges () {
+ checkLayout();
+ int[] result = new int[styles.length * 2];
+ int count = 0;
+ for (int i=0; i<styles.length - 1; i++) {
+ if (styles[i].style != null) {
+ result[count++] = styles[i].start;
+ result[count++] = styles[i + 1].start - 1;
+ }
+ }
+ if (count != result.length) {
+ int[] newResult = new int[count];
+ System.arraycopy(result, 0, newResult, 0, count);
+ result = newResult;
+ }
+ return result;
+}
+
+/**
+ * Returns the text segments offsets of the receiver.
+ *
+ * @return the text segments offsets
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int[] getSegments() {
+ checkLayout();
+ return segments;
+}
+
+/**
+ * Returns the line spacing of the receiver.
+ *
+ * @return the line spacing
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getSpacing () {
+ checkLayout();
+ return spacing;
+}
+
+/**
+ * Gets the style of the receiver at the specified character offset.
+ *
+ * @param offset the text offset
+ * @return the style or <code>null</code> if not set
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the character offset is out of range</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public TextStyle getStyle (int offset) {
+ checkLayout();
+ int length = text.length();
+ if (!(0 <= offset && offset < length)) SWT.error(SWT.ERROR_INVALID_RANGE);
+ for (int i=1; i<styles.length; i++) {
+ StyleItem item = styles[i];
+ if (item.start > offset) {
+ return styles[i - 1].style;
+ }
+ }
+ return null;
+}
+
+/**
+ * Gets all styles of the receiver.
+ *
+ * @return the styles
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getRanges()
+ *
+ * @since 3.2
+ */
+public TextStyle[] getStyles () {
+ checkLayout();
+ TextStyle[] result = new TextStyle[styles.length];
+ int count = 0;
+ for (int i=0; i<styles.length; i++) {
+ if (styles[i].style != null) {
+ result[count++] = styles[i].style;
+ }
+ }
+ if (count != result.length) {
+ TextStyle[] newResult = new TextStyle[count];
+ System.arraycopy(result, 0, newResult, 0, count);
+ result = newResult;
+ }
+ return result;
+}
+
+/**
+ * Returns the tab list of the receiver.
+ *
+ * @return the tab list
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int[] getTabs() {
+ checkLayout();
+ return tabs;
+}
+
+/**
+ * Gets the receiver's text, which will be an empty
+ * string if it has never been set.
+ *
+ * @return the receiver's text
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public String getText () {
+ checkLayout ();
+ return text;
+}
+
+/**
+ * Returns the width of the receiver.
+ *
+ * @return the width
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getWidth () {
+ checkLayout();
+ return wrapWidth;
+}
+
+/**
+ * Returns <code>true</code> if the text layout has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the text layout.
+ * When a text layout has been disposed, it is an error to
+ * invoke any other method using the text layout.
+ * </p>
+ *
+ * @return <code>true</code> when the text layout is disposed and <code>false</code> otherwise
+ */
+public boolean isDisposed () {
+ return device == null;
+}
+
+/**
+ * Sets the text alignment for the receiver. The alignment controls
+ * how a line of text is positioned horizontally. The argument should
+ * be one of <code>SWT.LEFT</code>, <code>SWT.RIGHT</code> or <code>SWT.CENTER</code>.
+ * <p>
+ * The default alignment is <code>SWT.LEFT</code>. Note that the receiver's
+ * width must be set in order to use <code>SWT.RIGHT</code> or <code>SWT.CENTER</code>
+ * alignment.
+ * </p>
+ *
+ * @param alignment the new alignment
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #setWidth(int)
+ */
+public void setAlignment (int alignment) {
+ checkLayout();
+ int mask = SWT.LEFT | SWT.CENTER | SWT.RIGHT;
+ alignment &= mask;
+ if (alignment == 0) return;
+ if ((alignment & SWT.LEFT) != 0) alignment = SWT.LEFT;
+ if ((alignment & SWT.RIGHT) != 0) alignment = SWT.RIGHT;
+ if (this.alignment == alignment) return;
+ freeRuns();
+ this.alignment = alignment;
+}
+
+/**
+ * Sets the ascent of the receiver. The ascent is distance in pixels
+ * from the baseline to the top of the line and it is applied to all
+ * lines. The default value is <code>-1</code> which means that the
+ * ascent is calculated from the line fonts.
+ *
+ * @param ascent the new ascent
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the ascent is less than <code>-1</code></li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #setDescent(int)
+ * @see #getLineMetrics(int)
+ */
+public void setAscent (int ascent) {
+ checkLayout ();
+ if (ascent < -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ if (this.ascent == ascent) return;
+ freeRuns();
+ this.ascent = ascent;
+}
+
+/**
+ * Sets the descent of the receiver. The descent is distance in pixels
+ * from the baseline to the bottom of the line and it is applied to all
+ * lines. The default value is <code>-1</code> which means that the
+ * descent is calculated from the line fonts.
+ *
+ * @param descent the new descent
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the descent is less than <code>-1</code></li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #setAscent(int)
+ * @see #getLineMetrics(int)
+ */
+public void setDescent (int descent) {
+ checkLayout ();
+ if (descent < -1) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ if (this.descent == descent) return;
+ freeRuns();
+ this.descent = descent;
+}
+
+/**
+ * Sets the default font which will be used by the receiver
+ * to draw and measure text. If the
+ * argument is null, then a default font appropriate
+ * for the platform will be used instead. Note that a text
+ * style can override the default font.
+ *
+ * @param font the new font for the receiver, or null to indicate a default font
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the font has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setFont (Font font) {
+ checkLayout ();
+ if (font != null && font.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ if (this.font == font) return;
+ if (font != null && font.equals(this.font)) return;
+ freeRuns();
+ this.font = font;
+}
+
+/**
+ * Sets the indent of the receiver. This indent it applied of the first line of
+ * each paragraph.
+ *
+ * @param indent new indent
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setIndent (int indent) {
+ checkLayout ();
+ if (indent < 0) return;
+ if (this.indent == indent) return;
+ freeRuns();
+ this.indent = indent;
+}
+
+/**
+ * Sets the justification of the receiver. Note that the receiver's
+ * width must be set in order to use justification.
+ *
+ * @param justify new justify
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setJustify (boolean justify) {
+ checkLayout ();
+ if (justify == this.justify) return;
+ freeRuns();
+ this.justify = justify;
+}
+
+/**
+ * Sets the orientation of the receiver, which must be one
+ * of <code>SWT.LEFT_TO_RIGHT</code> or <code>SWT.RIGHT_TO_LEFT</code>.
+ *
+ * @param orientation new orientation style
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setOrientation(int orientation) {
+ checkLayout();
+ int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+ orientation &= mask;
+ if (orientation == 0) return;
+ if ((orientation & SWT.LEFT_TO_RIGHT) != 0) orientation = SWT.LEFT_TO_RIGHT;
+ if (this.orientation == orientation) return;
+ this.orientation = orientation;
+ freeRuns();
+}
+
+/**
+ * Sets the offsets of the receiver's text segments. Text segments are used to
+ * override the default behaviour of the bidirectional algorithm.
+ * Bidirectional reordering can happen within a text segment but not
+ * between two adjacent segments.
+ * <p>
+ * Each text segment is determined by two consecutive offsets in the
+ * <code>segments</code> arrays. The first element of the array should
+ * always be zero and the last one should always be equals to length of
+ * the text.
+ * </p>
+ *
+ * @param segments the text segments offset
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setSegments(int[] segments) {
+ checkLayout();
+ if (this.segments == null && segments == null) return;
+ if (this.segments != null && segments !=null) {
+ if (this.segments.length == segments.length) {
+ int i;
+ for (i = 0; i <segments.length; i++) {
+ if (this.segments[i] != segments[i]) break;
+ }
+ if (i == segments.length) return;
+ }
+ }
+ freeRuns();
+ this.segments = segments;
+}
+
+/**
+ * Sets the line spacing of the receiver. The line spacing
+ * is the space left between lines.
+ *
+ * @param spacing the new line spacing
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the spacing is negative</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setSpacing (int spacing) {
+ checkLayout();
+ if (spacing < 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ if (this.spacing == spacing) return;
+ freeRuns();
+ this.spacing = spacing;
+}
+
+/**
+ * Sets the style of the receiver for the specified range. Styles previously
+ * set for that range will be overwritten. The start and end offsets are
+ * inclusive and will be clamped if out of range.
+ *
+ * @param style the style
+ * @param start the start offset
+ * @param end the end offset
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setStyle (TextStyle style, int start, int end) {
+ checkLayout();
+ int length = text.length();
+ if (length == 0) return;
+ if (start > end) return;
+ start = Math.min(Math.max(0, start), length - 1);
+ end = Math.min(Math.max(0, end), length - 1);
+ int low = -1;
+ int high = styles.length;
+ while (high - low > 1) {
+ int index = (high + low) / 2;
+ if (styles[index + 1].start > start) {
+ high = index;
+ } else {
+ low = index;
+ }
+ }
+ if (0 <= high && high < styles.length) {
+ StyleItem item = styles[high];
+ if (item.start == start && styles[high + 1].start - 1 == end) {
+ if (style == null) {
+ if (item.style == null) return;
+ } else {
+ if (style.equals(item.style)) return;
+ }
+ }
+ }
+ freeRuns();
+ int modifyStart = high;
+ int modifyEnd = modifyStart;
+ while (modifyEnd < styles.length) {
+ if (styles[modifyEnd + 1].start > end) break;
+ modifyEnd++;
+ }
+ if (modifyStart == modifyEnd) {
+ int styleStart = styles[modifyStart].start;
+ int styleEnd = styles[modifyEnd + 1].start - 1;
+ if (styleStart == start && styleEnd == end) {
+ styles[modifyStart].style = style;
+ return;
+ }
+ if (styleStart != start && styleEnd != end) {
+ StyleItem[] newStyles = new StyleItem[styles.length + 2];
+ System.arraycopy(styles, 0, newStyles, 0, modifyStart + 1);
+ StyleItem item = new StyleItem();
+ item.start = start;
+ item.style = style;
+ newStyles[modifyStart + 1] = item;
+ item = new StyleItem();
+ item.start = end + 1;
+ item.style = styles[modifyStart].style;
+ newStyles[modifyStart + 2] = item;
+ System.arraycopy(styles, modifyEnd + 1, newStyles, modifyEnd + 3, styles.length - modifyEnd - 1);
+ styles = newStyles;
+ return;
+ }
+ }
+ if (start == styles[modifyStart].start) modifyStart--;
+ if (end == styles[modifyEnd + 1].start - 1) modifyEnd++;
+ int newLength = styles.length + 1 - (modifyEnd - modifyStart - 1);
+ StyleItem[] newStyles = new StyleItem[newLength];
+ System.arraycopy(styles, 0, newStyles, 0, modifyStart + 1);
+ StyleItem item = new StyleItem();
+ item.start = start;
+ item.style = style;
+ newStyles[modifyStart + 1] = item;
+ styles[modifyEnd].start = end + 1;
+ System.arraycopy(styles, modifyEnd, newStyles, modifyStart + 2, styles.length - modifyEnd);
+ styles = newStyles;
+}
+
+/**
+ * Sets the receiver's tab list. Each value in the tab list specifies
+ * the space in pixels from the origin of the text layout to the respective
+ * tab stop. The last tab stop width is repeated continuously.
+ *
+ * @param tabs the new tab list
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setTabs(int[] tabs) {
+ checkLayout();
+ if (this.tabs == null && tabs == null) return;
+ if (this.tabs != null && tabs !=null) {
+ if (this.tabs.length == tabs.length) {
+ int i;
+ for (i = 0; i < tabs.length; i++) {
+ if (this.tabs[i] != tabs[i]) break;
+ }
+ if (i == tabs.length) return;
+ }
+ }
+ freeRuns();
+ this.tabs = tabs;
+}
+
+/**
+ * Sets the receiver's text.
+ *
+ * @param text the new text
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setText (String text) {
+ checkLayout ();
+ if (text == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (text.equals(this.text)) return;
+ freeRuns();
+ this.text = text;
+ styles = new StyleItem[2];
+ styles[0] = new StyleItem();
+ styles[1] = new StyleItem();
+ styles[styles.length - 1].start = text.length();
+}
+
+/**
+ * Sets the line width of the receiver, which determines how
+ * text should be wrapped and aligned. The default value is
+ * <code>-1</code> which means wrapping is disabled.
+ *
+ * @param width the new width
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the width is <code>0</code> or less than <code>-1</code></li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #setAlignment(int)
+ */
+public void setWidth (int width) {
+ checkLayout();
+ if (width < -1 || width == 0) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ if (this.wrapWidth == width) return;
+ freeRuns();
+ this.wrapWidth = width;
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public String toString () {
+ if (isDisposed()) return "TextLayout {*DISPOSED*}";
+ return "TextLayout {" + text + "}";
+}
+
+/*
+ * Translate a client offset to an internal offset
+ */
+int translateOffset (int offset) {
+ return offset;
+}
+
+/*
+ * Translate an internal offset to a client offset
+ */
+int untranslateOffset (int offset) {
+ return offset;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Transform.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Transform.java
new file mode 100755
index 0000000000..50cec5ca52
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Transform.java
@@ -0,0 +1,370 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.graphics;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * Instances of this class represent transformation matrices for
+ * points expressed as (x, y) pairs of floating point numbers.
+ * <p>
+ * Application code must explicitly invoke the <code>Transform.dispose()</code>
+ * method to release the operating system resources managed by each instance
+ * when those instances are no longer required.
+ * </p>
+ * <p>
+ * This class requires the operating system's advanced graphics subsystem
+ * which may not be available on some platforms.
+ * </p>
+ *
+ * @since 3.1
+ */
+public class Transform extends Resource {
+ /**
+ * the OS resource for the Transform
+ * (Warning: This field is platform dependent)
+ * <p>
+ * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It is not available on all
+ * platforms and should never be accessed from application code.
+ * </p>
+ */
+ public NSAffineTransform handle;
+
+/**
+ * Constructs a new identity Transform.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param device the device on which to allocate the Transform
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES if a handle for the Transform could not be obtained</li>
+ * </ul>
+ *
+ * @see #dispose()
+ */
+public Transform (Device device) {
+ this(device, 1, 0, 0, 1, 0, 0);
+}
+
+/**
+ * Constructs a new Transform given an array of elements that represent the
+ * matrix that describes the transformation.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param device the device on which to allocate the Transform
+ * @param elements an array of floats that describe the transformation matrix
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device, or the elements array is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the elements array is too small to hold the matrix values</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES if a handle for the Transform could not be obtained</li>
+ * </ul>
+ *
+ * @see #dispose()
+ */
+public Transform(Device device, float[] elements) {
+ this (device, checkTransform(elements)[0], elements[1], elements[2], elements[3], elements[4], elements[5]);
+}
+
+/**
+ * Constructs a new Transform given all of the elements that represent the
+ * matrix that describes the transformation.
+ * <p>
+ * This operation requires the operating system's advanced
+ * graphics subsystem which may not be available on some
+ * platforms.
+ * </p>
+ *
+ * @param device the device on which to allocate the Transform
+ * @param m11 the first element of the first row of the matrix
+ * @param m12 the second element of the first row of the matrix
+ * @param m21 the first element of the second row of the matrix
+ * @param m22 the second element of the second row of the matrix
+ * @param dx the third element of the first row of the matrix
+ * @param dy the third element of the second row of the matrix
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if device is null and there is no current device</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_NO_GRAPHICS_LIBRARY - if advanced graphics are not available</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES if a handle for the Transform could not be obtained</li>
+ * </ul>
+ *
+ * @see #dispose()
+ */
+public Transform (Device device, float m11, float m12, float m21, float m22, float dx, float dy) {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ this.device = device;
+ handle = NSAffineTransform.transform();
+ if (handle == null) SWT.error(SWT.ERROR_NO_HANDLES);
+ handle.retain();
+ setElements(m11, m12, m21, m22, dx, dy);
+ if (device.tracking) device.new_Object(this);
+}
+
+static float[] checkTransform(float[] elements) {
+ if (elements == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (elements.length < 6) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ return elements;
+}
+
+/**
+ * Disposes of the operating system resources associated with
+ * the Transform. Applications must dispose of all Transforms that
+ * they allocate.
+ */
+public void dispose() {
+ if (handle == null) return;
+ if (device.isDisposed()) return;
+ handle.release();
+ handle = null;
+ if (device.tracking) device.dispose_Object(this);
+ device = null;
+}
+
+/**
+ * Fills the parameter with the values of the transformation matrix
+ * that the receiver represents, in the order {m11, m12, m21, m22, dx, dy}.
+ *
+ * @param elements array to hold the matrix values
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parameter is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the parameter is too small to hold the matrix values</li>
+ * </ul>
+ */
+public void getElements(float[] elements) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (elements == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (elements.length < 6) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ NSAffineTransformStruct struct = handle.transformStruct();
+ elements[0] = struct.m11;
+ elements[1] = struct.m12;
+ elements[2] = struct.m21;
+ elements[3] = struct.m22;
+ elements[4] = struct.tX;
+ elements[5] = struct.tY;
+}
+
+/**
+ * Modifies the receiver such that the matrix it represents becomes the
+ * the mathematical inverse of the matrix it previously represented.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_CANNOT_INVERT_MATRIX - if the matrix is not invertible</li>
+ * </ul>
+ */
+public void invert() {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ //TODO
+// if ((handle [0] * handle [3] - handle [1] * handle [2]) == 0) {
+// SWT.error(SWT.ERROR_CANNOT_INVERT_MATRIX);
+// }
+ handle.invert();
+}
+
+/**
+ * Returns <code>true</code> if the Transform has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the Transform.
+ * When a Transform has been disposed, it is an error to
+ * invoke any other method using the Transform.
+ *
+ * @return <code>true</code> when the Transform is disposed, and <code>false</code> otherwise
+ */
+public boolean isDisposed() {
+ return handle == null;
+}
+
+/**
+ * Returns <code>true</code> if the Transform represents the identity matrix
+ * and false otherwise.
+ *
+ * @return <code>true</code> if the receiver is an identity Transform, and <code>false</code> otherwise
+ */
+public boolean isIdentity() {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ NSAffineTransformStruct struct = handle.transformStruct();
+ return struct.m11 == 1 && struct.m12 == 0 && struct.m21 == 0 && struct.m22 == 1 && struct.tX == 0 && struct.tY == 0;
+}
+
+/**
+ * Modifies the receiver such that the matrix it represents becomes the
+ * the result of multiplying the matrix it previously represented by the
+ * argument.
+ *
+ * @param matrix the matrix to multiply the receiver by
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parameter is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the parameter has been disposed</li>
+ * </ul>
+ */
+public void multiply(Transform matrix) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (matrix == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (matrix.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ handle.prependTransform(matrix.handle);
+}
+
+/**
+ * Modifies the receiver so that it represents a transformation that is
+ * equivalent to its previous transformation rotated by the specified angle.
+ * The angle is specified in degrees and for the identity transform 0 degrees
+ * is at the 3 o'clock position. A positive value indicates a clockwise rotation
+ * while a negative value indicates a counter-clockwise rotation.
+ *
+ * @param angle the angle to rotate the transformation by
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void rotate(float angle) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ handle.rotateByDegrees(angle);
+}
+
+/**
+ * Modifies the receiver so that it represents a transformation that is
+ * equivalent to its previous transformation scaled by (scaleX, scaleY).
+ *
+ * @param scaleX the amount to scale in the X direction
+ * @param scaleY the amount to scale in the Y direction
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void scale(float scaleX, float scaleY) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ handle.scaleXBy(scaleX, scaleY);
+}
+
+/**
+ * Modifies the receiver to represent a new transformation given all of
+ * the elements that represent the matrix that describes that transformation.
+ *
+ * @param m11 the first element of the first row of the matrix
+ * @param m12 the second element of the first row of the matrix
+ * @param m21 the first element of the second row of the matrix
+ * @param m22 the second element of the second row of the matrix
+ * @param dx the third element of the first row of the matrix
+ * @param dy the third element of the second row of the matrix
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void setElements(float m11, float m12, float m21, float m22, float dx, float dy) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ NSAffineTransformStruct struct = new NSAffineTransformStruct();
+ struct.m11 = m11;
+ struct.m12 = m12;
+ struct.m21 = m21;
+ struct.m22 = m22;
+ struct.tX = dx;
+ struct.tY = dy;
+ handle.setTransformStruct(struct);
+}
+
+/**
+ * Given an array containing points described by alternating x and y values,
+ * modify that array such that each point has been replaced with the result of
+ * applying the transformation represented by the receiver to that point.
+ *
+ * @param pointArray an array of alternating x and y values to be transformed
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the point array is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void transform(float[] pointArray) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ if (pointArray == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ NSPoint point = new NSPoint();
+ int length = pointArray.length / 2;
+ for (int i = 0, j = 0; i < length; i++, j += 2) {
+ point.x = pointArray[j];
+ point.y = pointArray[j + 1];
+ point = handle.transformPoint(point);
+ pointArray[j] = point.x;
+ pointArray[j + 1] = point.y;
+ }
+}
+
+/**
+ * Modifies the receiver so that it represents a transformation that is
+ * equivalent to its previous transformation translated by (offsetX, offsetY).
+ *
+ * @param offsetX the distance to translate in the X direction
+ * @param offsetY the distance to translate in the Y direction
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void translate(float offsetX, float offsetY) {
+ if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
+ handle.translateXBy(offsetX, offsetY);
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public String toString() {
+ if (isDisposed()) return "Transform {*DISPOSED*}";
+ float[] elements = new float[6];
+ getElements(elements);
+ return "Transform {" + elements [0] + ", " + elements [1] + ", " +elements [2] + ", " +elements [3] + ", " +elements [4] + ", " +elements [5] + "}";
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java
new file mode 100755
index 0000000000..7e620a539d
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Button.java
@@ -0,0 +1,499 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * Instances of this class represent a selectable user interface object that
+ * issues notification when pressed and released.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>ARROW, CHECK, PUSH, RADIO, TOGGLE, FLAT</dd>
+ * <dd>UP, DOWN, LEFT, RIGHT, CENTER</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles ARROW, CHECK, PUSH, RADIO, and TOGGLE
+ * may be specified.
+ * </p><p>
+ * Note: Only one of the styles LEFT, RIGHT, and CENTER may be specified.
+ * </p><p>
+ * Note: Only one of the styles UP, DOWN, LEFT, and RIGHT may be specified
+ * when the ARROW style is specified.
+ * </p><p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ */
+public class Button extends Control {
+ String text = "";
+ Image image;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#ARROW
+ * @see SWT#CHECK
+ * @see SWT#PUSH
+ * @see SWT#RADIO
+ * @see SWT#TOGGLE
+ * @see SWT#FLAT
+ * @see SWT#LEFT
+ * @see SWT#RIGHT
+ * @see SWT#CENTER
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Button (Composite parent, int style) {
+ super (parent, checkStyle (style));
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the control is selected by the user.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener(listener);
+ addListener(SWT.Selection,typedListener);
+ addListener(SWT.DefaultSelection,typedListener);
+}
+
+static int checkStyle (int style) {
+ style = checkBits (style, SWT.PUSH, SWT.ARROW, SWT.CHECK, SWT.RADIO, SWT.TOGGLE, 0);
+ if ((style & (SWT.PUSH | SWT.TOGGLE)) != 0) {
+ return checkBits (style, SWT.CENTER, SWT.LEFT, SWT.RIGHT, 0, 0, 0);
+ }
+ if ((style & (SWT.CHECK | SWT.RADIO)) != 0) {
+ return checkBits (style, SWT.LEFT, SWT.RIGHT, SWT.CENTER, 0, 0, 0);
+ }
+ if ((style & SWT.ARROW) != 0) {
+ style |= SWT.NO_FOCUS;
+ return checkBits (style, SWT.UP, SWT.DOWN, SWT.LEFT, SWT.RIGHT, 0, 0);
+ }
+ return style;
+}
+
+void click () {
+ postEvent (SWT.Selection);
+}
+
+void createHandle () {
+ NSButton widget = (NSButton)new SWTButton().alloc();
+ widget.initWithFrame(new NSRect());
+ int type = OS.NSMomentaryPushButton;
+ if ((style & SWT.PUSH) != 0) {
+ widget.setBezelStyle(OS.NSRoundedBezelStyle);
+ } else if ((style & SWT.CHECK) != 0) {
+ type = OS.NSSwitchButton;
+ } else if ((style & SWT.RADIO) != 0) {
+ type = OS.NSRadioButton;
+ } else if ((style & SWT.TOGGLE) != 0) {
+ type = OS.NSPushOnPushOffButton;
+ widget.setBezelStyle(OS.NSRegularSquareBezelStyle);
+ } else if ((style & SWT.ARROW) != 0) {
+ widget.setBezelStyle(OS.NSRoundedDisclosureBezelStyle);
+ }
+ widget.setButtonType(type);
+ widget.setTitle(NSString.stringWith(""));
+ widget.setImagePosition(OS.NSImageLeft);
+ widget.setTarget(widget);
+ widget.setAction(OS.sel_sendSelection);
+ widget.setTag(jniRef);
+ view = widget;
+ parent.contentView().addSubview_(widget);
+ _setAlignment(style);
+}
+
+/**
+ * Returns a value which describes the position of the
+ * text or image in the receiver. The value will be one of
+ * <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code>
+ * unless the receiver is an <code>ARROW</code> button, in
+ * which case, the alignment will indicate the direction of
+ * the arrow (one of <code>LEFT</code>, <code>RIGHT</code>,
+ * <code>UP</code> or <code>DOWN</code>).
+ *
+ * @return the alignment
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getAlignment () {
+ checkWidget ();
+ if ((style & SWT.ARROW) != 0) {
+ if ((style & SWT.UP) != 0) return SWT.UP;
+ if ((style & SWT.DOWN) != 0) return SWT.DOWN;
+ if ((style & SWT.LEFT) != 0) return SWT.LEFT;
+ if ((style & SWT.RIGHT) != 0) return SWT.RIGHT;
+ return SWT.UP;
+ }
+ if ((style & SWT.LEFT) != 0) return SWT.LEFT;
+ if ((style & SWT.CENTER) != 0) return SWT.CENTER;
+ if ((style & SWT.RIGHT) != 0) return SWT.RIGHT;
+ return SWT.LEFT;
+}
+
+/**
+ * Returns the receiver's image if it has one, or null
+ * if it does not.
+ *
+ * @return the receiver's image
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Image getImage () {
+ checkWidget();
+ return image;
+}
+
+String getNameText () {
+ return getText ();
+}
+
+/**
+ * Returns <code>true</code> if the receiver is selected,
+ * and false otherwise.
+ * <p>
+ * When the receiver is of type <code>CHECK</code> or <code>RADIO</code>,
+ * it is selected when it is checked. When it is of type <code>TOGGLE</code>,
+ * it is selected when it is pushed in. If the receiver is of any other type,
+ * this method returns false.
+ *
+ * @return the selection state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getSelection () {
+ checkWidget ();
+ if ((style & (SWT.CHECK | SWT.RADIO | SWT.TOGGLE)) == 0) return false;
+ return ((NSButton)view).state() == OS.NSOnState;
+}
+
+/**
+ * Returns the receiver's text, which will be an empty
+ * string if it has never been set or if the receiver is
+ * an <code>ARROW</code> button.
+ *
+ * @return the receiver's text
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+ checkWidget ();
+ return text;
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ image = null;
+ text = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook(SWT.Selection, listener);
+ eventTable.unhook(SWT.DefaultSelection,listener);
+}
+
+void selectRadio () {
+ /*
+ * This code is intentionally commented. When two groups
+ * of radio buttons with the same parent are separated by
+ * another control, the correct behavior should be that
+ * the two groups act independently. This is consistent
+ * with radio tool and menu items. The commented code
+ * implements this behavior.
+ */
+// int index = 0;
+// Control [] children = parent._getChildren ();
+// while (index < children.length && children [index] != this) index++;
+// int i = index - 1;
+// while (i >= 0 && children [i].setRadioSelection (false)) --i;
+// int j = index + 1;
+// while (j < children.length && children [j].setRadioSelection (false)) j++;
+// setSelection (true);
+ Control [] children = parent._getChildren ();
+ for (int i=0; i<children.length; i++) {
+ Control child = children [i];
+ if (this != child) child.setRadioSelection (false);
+ }
+ setSelection (true);
+}
+
+void sendSelection () {
+ //TODO post
+ if ((style & SWT.RADIO) != 0) {
+ if ((parent.getStyle () & SWT.NO_RADIO_GROUP) == 0) {
+ selectRadio ();
+ }
+ }
+ sendEvent (SWT.Selection);
+}
+
+
+/**
+ * Controls how text, images and arrows will be displayed
+ * in the receiver. The argument should be one of
+ * <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code>
+ * unless the receiver is an <code>ARROW</code> button, in
+ * which case, the argument indicates the direction of
+ * the arrow (one of <code>LEFT</code>, <code>RIGHT</code>,
+ * <code>UP</code> or <code>DOWN</code>).
+ *
+ * @param alignment the new alignment
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setAlignment (int alignment) {
+ checkWidget ();
+ _setAlignment (alignment);
+ redraw ();
+}
+
+void _setAlignment (int alignment) {
+ if ((style & SWT.ARROW) != 0) {
+ if ((style & (SWT.UP | SWT.DOWN | SWT.LEFT | SWT.RIGHT)) == 0) return;
+ style &= ~(SWT.UP | SWT.DOWN | SWT.LEFT | SWT.RIGHT);
+ style |= alignment & (SWT.UP | SWT.DOWN | SWT.LEFT | SWT.RIGHT);
+// int orientation = OS.kThemeDisclosureRight;
+// if ((style & SWT.UP) != 0) orientation = OS.kThemeDisclosureDown;
+// if ((style & SWT.DOWN) != 0) orientation = OS.kThemeDisclosureDown;
+// if ((style & SWT.LEFT) != 0) orientation = OS.kThemeDisclosureLeft;
+// OS.SetControl32BitValue (handle, orientation);
+ return;
+ }
+// if ((alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER)) == 0) return;
+// style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+// style |= alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+// /* Alignment not honoured when image and text is visible */
+// boolean bothVisible = text != null && text.length () > 0 && image != null;
+// if (bothVisible) {
+// if ((style & (SWT.RADIO | SWT.CHECK)) != 0) alignment = SWT.LEFT;
+// if ((style & (SWT.PUSH | SWT.TOGGLE)) != 0) alignment = SWT.CENTER;
+// }
+// int textAlignment = 0;
+// int graphicAlignment = 0;
+// if ((alignment & SWT.LEFT) != 0) {
+// textAlignment = OS.kControlBevelButtonAlignTextFlushLeft;
+// graphicAlignment = OS.kControlBevelButtonAlignLeft;
+// }
+// if ((alignment & SWT.CENTER) != 0) {
+// textAlignment = OS.kControlBevelButtonAlignTextCenter;
+// graphicAlignment = OS.kControlBevelButtonAlignCenter;
+// }
+// if ((alignment & SWT.RIGHT) != 0) {
+// textAlignment = OS.kControlBevelButtonAlignTextFlushRight;
+// graphicAlignment = OS.kControlBevelButtonAlignRight;
+// }
+// OS.SetControlData (handle, OS.kControlEntireControl, OS.kControlBevelButtonTextAlignTag, 2, new short [] {(short)textAlignment});
+// OS.SetControlData (handle, OS.kControlEntireControl, OS.kControlBevelButtonGraphicAlignTag, 2, new short [] {(short)graphicAlignment});
+// if (bothVisible) {
+// OS.SetControlData (handle, OS.kControlEntireControl, OS.kControlBevelButtonTextPlaceTag, 2, new short [] {(short)OS.kControlBevelButtonPlaceToRightOfGraphic});
+// }
+}
+
+void setDefault (boolean value) {
+ if ((style & SWT.PUSH) == 0) return;
+// int window = OS.GetControlOwner (handle);
+// OS.SetWindowDefaultButton (window, value ? handle : 0);
+}
+
+/**
+ * Sets the receiver's image to the argument, which may be
+ * <code>null</code> indicating that no image should be displayed.
+ * <p>
+ * Note that a Button can display an image and text simultaneously
+ * on Windows (starting with XP), GTK+ and OSX. On other platforms,
+ * a Button that has an image and text set into it will display the
+ * image or text that was set most recently.
+ * </p>
+ * @param image the image to display on the receiver (may be <code>null</code>)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setImage (Image image) {
+ checkWidget();
+ if ((style & SWT.ARROW) != 0) return;
+ if (image != null && image.isDisposed ()) {
+ error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ this.image = image;
+ ((NSButton)view).setImage(image.handle);
+}
+
+boolean setRadioSelection (boolean value){
+ if ((style & SWT.RADIO) == 0) return false;
+ if (getSelection () != value) {
+ setSelection (value);
+ postEvent (SWT.Selection);
+ }
+ return true;
+}
+
+/**
+ * Sets the selection state of the receiver, if it is of type <code>CHECK</code>,
+ * <code>RADIO</code>, or <code>TOGGLE</code>.
+ *
+ * <p>
+ * When the receiver is of type <code>CHECK</code> or <code>RADIO</code>,
+ * it is selected when it is checked. When it is of type <code>TOGGLE</code>,
+ * it is selected when it is pushed in.
+ *
+ * @param selected the new selection state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (boolean selected) {
+ checkWidget();
+ if ((style & (SWT.CHECK | SWT.RADIO | SWT.TOGGLE)) == 0) return;
+ ((NSButton)view).setState(selected ? OS.NSOnState : OS.NSOffState);
+}
+
+/**
+ * Sets the receiver's text.
+ * <p>
+ * This method sets the button label. The label may include
+ * the mnemonic character but must not contain line delimiters.
+ * </p>
+ * <p>
+ * Mnemonics are indicated by an '&amp;' that causes the next
+ * character to be the mnemonic. When the user presses a
+ * key sequence that matches the mnemonic, a selection
+ * event occurs. On most platforms, the mnemonic appears
+ * underlined but may be emphasized in a platform specific
+ * manner. The mnemonic indicator character '&amp;' can be
+ * escaped by doubling it in the string, causing a single
+ * '&amp;' to be displayed.
+ * </p><p>
+ * Note that a Button can display an image and text simultaneously
+ * on Windows (starting with XP), GTK+ and OSX. On other platforms,
+ * a Button that has an image and text set into it will display the
+ * image or text that was set most recently.
+ * </p>
+ * @param string the new text
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+ checkWidget();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if ((style & SWT.ARROW) != 0) return;
+ text = string;
+ char [] buffer = new char [text.length ()];
+ text.getChars (0, buffer.length, buffer, 0);
+ int length = fixMnemonic (buffer);
+ ((NSButton)view).setTitle(NSString.stringWithCharacters(buffer, length));
+}
+
+int traversalCode (int key, int theEvent) {
+ int code = super.traversalCode (key, theEvent);
+ if ((style & SWT.RADIO) != 0) code |= SWT.TRAVERSE_ARROW_NEXT | SWT.TRAVERSE_ARROW_PREVIOUS;
+ return code;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java
new file mode 100755
index 0000000000..332f08c6f6
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Canvas.java
@@ -0,0 +1,320 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * Instances of this class provide a surface for drawing
+ * arbitrary graphics.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * This class may be subclassed by custom control implementors
+ * who are building controls that are <em>not</em> constructed
+ * from aggregates of other controls. That is, they are either
+ * painted using SWT graphics calls or are handled by native
+ * methods.
+ * </p>
+ *
+ * @see Composite
+ */
+public class Canvas extends Composite {
+ Caret caret;
+ IME ime;
+
+Canvas () {
+ /* Do nothing */
+}
+
+boolean becomeFirstResponder () {
+ if (caret != null) caret.setFocus ();
+ return super.becomeFirstResponder();
+}
+
+boolean resignFirstResponder () {
+ if (caret != null) caret.killFocus ();
+ return super.resignFirstResponder();
+}
+
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Canvas (Composite parent, int style) {
+ super (parent, style);
+}
+
+/**
+ * Fills the interior of the rectangle specified by the arguments,
+ * with the receiver's background.
+ *
+ * @param gc the gc where the rectangle is to be filled
+ * @param x the x coordinate of the rectangle to be filled
+ * @param y the y coordinate of the rectangle to be filled
+ * @param width the width of the rectangle to be filled
+ * @param height the height of the rectangle to be filled
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the gc is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the gc has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void drawBackground (GC gc, int x, int y, int width, int height) {
+ checkWidget ();
+ if (gc == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (gc.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+// Control control = findBackgroundControl ();
+// if (control != null) {
+// control.fillBackground (handle, gc.handle, new Rectangle (x, y, width, height));
+// } else {
+// gc.fillRectangle (x, y, width, height);
+// }
+}
+
+void drawRect(int id, NSRect rect) {
+ super.drawRect(id, rect);
+ if (caret == null) return;
+ if (caret.isShowing) {
+ NSGraphicsContext context = NSGraphicsContext.currentContext();
+
+ Image image = caret.image;
+ if (image != null) {
+ NSRect fromRect = new NSRect ();
+ NSSize size = image.handle.size();
+ fromRect.width = size.width;
+ fromRect.height = size.height;
+ NSPoint point = new NSPoint();
+ point.x = caret.x;
+ point.y = caret.y;
+ image.handle.drawAtPoint(point, rect, OS.NSCompositeXOR, 1);
+ } else {
+ context.saveGraphicsState();
+ context.setCompositingOperation(OS.NSCompositeXOR);
+ NSRect drawRect = new NSRect();
+ drawRect.x = caret.x;
+ drawRect.y = caret.y;
+ drawRect.width = caret.width != 0 ? caret.width : Caret.DEFAULT_WIDTH;
+ drawRect.height = caret.height;
+ context.setShouldAntialias(false);
+ NSColor color = NSColor.colorWithDeviceRed(1, 1, 1, 1);
+ color.set();
+ NSBezierPath.fillRect(drawRect);
+ context.restoreGraphicsState();
+ }
+ }
+}
+
+/**
+ * Returns the caret.
+ * <p>
+ * The caret for the control is automatically hidden
+ * and shown when the control is painted or resized,
+ * when focus is gained or lost and when an the control
+ * is scrolled. To avoid drawing on top of the caret,
+ * the programmer must hide and show the caret when
+ * drawing in the window any other time.
+ * </p>
+ *
+ * @return the caret
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Caret getCaret () {
+ checkWidget();
+ return caret;
+}
+
+public IME getIME () {
+ checkWidget();
+ return ime;
+}
+
+//void redrawWidget (int control, boolean children) {
+// boolean isFocus = OS.VERSION < 0x1040 && caret != null && caret.isFocusCaret ();
+// if (isFocus) caret.killFocus ();
+// super.redrawWidget (control, children);
+// if (isFocus) caret.setFocus ();
+//}
+//
+//void redrawWidget (int control, int x, int y, int width, int height, boolean all) {
+// boolean isFocus = OS.VERSION < 0x1040 && caret != null && caret.isFocusCaret ();
+// if (isFocus) caret.killFocus ();
+// super.redrawWidget (control, x, y, width, height, all);
+// if (isFocus) caret.setFocus ();
+//}
+
+void releaseChildren (boolean destroy) {
+ if (caret != null) {
+ caret.release (false);
+ caret = null;
+ }
+ if (ime != null) {
+ ime.release (false);
+ ime = null;
+ }
+ super.releaseChildren (destroy);
+}
+
+/**
+ * Scrolls a rectangular area of the receiver by first copying
+ * the source area to the destination and then causing the area
+ * of the source which is not covered by the destination to
+ * be repainted. Children that intersect the rectangle are
+ * optionally moved during the operation. In addition, outstanding
+ * paint events are flushed before the source area is copied to
+ * ensure that the contents of the canvas are drawn correctly.
+ *
+ * @param destX the x coordinate of the destination
+ * @param destY the y coordinate of the destination
+ * @param x the x coordinate of the source
+ * @param y the y coordinate of the source
+ * @param width the width of the area
+ * @param height the height of the area
+ * @param all <code>true</code>if children should be scrolled, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void scroll (int destX, int destY, int x, int y, int width, int height, boolean all) {
+ checkWidget();
+ if (width <= 0 || height <= 0) return;
+ int deltaX = destX - x, deltaY = destY - y;
+ if (deltaX == 0 && deltaY == 0) return;
+// if (!isDrawing (handle)) return;
+ boolean isFocus = caret != null && caret.isFocusCaret ();
+ if (isFocus) caret.killFocus ();
+ Rectangle clientRect = getClientArea ();
+ Rectangle sourceRect = new Rectangle (x, y, width, height);
+ if (sourceRect.intersects (clientRect)) {
+ update (all);
+ }
+ NSRect damage = new NSRect();
+ damage.x = x;
+ damage.y = y;
+ damage.width = width;
+ damage.height = height;
+ view.setNeedsDisplayInRect(damage);
+ damage.x = destX;
+ damage.y = destY;
+ view.setNeedsDisplayInRect(damage);
+// Control control = findBackgroundControl ();
+// if ((control != null && control.backgroundImage != null)) {
+// redrawWidget (handle, x, y, width, height, false);
+// redrawWidget (handle, destX, destY, width, height, false);
+// } else {
+// GC gc = new GC (this);
+// gc.copyArea (x, y, width, height, destX, destY);
+// gc.dispose ();
+// }
+ if (all) {
+ Control [] children = _getChildren ();
+ for (int i=0; i<children.length; i++) {
+ Control child = children [i];
+ Rectangle rect = child.getBounds ();
+ if (Math.min(x + width, rect.x + rect.width) >= Math.max (x, rect.x) &&
+ Math.min(y + height, rect.y + rect.height) >= Math.max (y, rect.y)) {
+ child.setLocation (rect.x + deltaX, rect.y + deltaY);
+ }
+ }
+ }
+ if (isFocus) caret.setFocus ();
+}
+
+/**
+ * Sets the receiver's caret.
+ * <p>
+ * The caret for the control is automatically hidden
+ * and shown when the control is painted or resized,
+ * when focus is gained or lost and when an the control
+ * is scrolled. To avoid drawing on top of the caret,
+ * the programmer must hide and show the caret when
+ * drawing in the window any other time.
+ * </p>
+ * @param caret the new caret for the receiver, may be null
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the caret has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setCaret (Caret caret) {
+ checkWidget();
+ Caret newCaret = caret;
+ Caret oldCaret = this.caret;
+ this.caret = newCaret;
+ if (hasFocus ()) {
+ if (oldCaret != null) oldCaret.killFocus ();
+ if (newCaret != null) {
+ if (newCaret.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
+ newCaret.setFocus ();
+ }
+ }
+}
+
+public void setFont (Font font) {
+ checkWidget ();
+ if (caret != null) caret.setFont (font);
+ super.setFont (font);
+}
+
+public void setIME (IME ime) {
+ checkWidget ();
+ if (ime != null && ime.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
+ this.ime = ime;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Caret.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Caret.java
new file mode 100755
index 0000000000..cd201b8dcf
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Caret.java
@@ -0,0 +1,500 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+
+/**
+ * Instances of this class provide an i-beam that is typically used
+ * as the insertion point for text.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ */
+public class Caret extends Widget {
+ Canvas parent;
+ int x, y, width, height;
+ boolean isVisible, isShowing;
+ int blinkRate;
+ Image image;
+ Font font;
+
+ static final int DEFAULT_WIDTH = 1;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Caret (Canvas parent, int style) {
+ super (parent, style);
+ this.parent = parent;
+ createWidget ();
+}
+
+boolean blinkCaret () {
+ if (!isVisible) return true;
+ if (!isShowing) return showCaret ();
+ if (blinkRate == 0) return true;
+ return hideCaret ();
+}
+
+void createWidget () {
+ super.createWidget ();
+ blinkRate = display.getCaretBlinkTime ();
+ isVisible = true;
+ if (parent.getCaret () == null) {
+ parent.setCaret (this);
+ }
+}
+
+boolean drawCaret () {
+ if (parent == null) return false;
+ if (parent.isDisposed ()) return false;
+ int nWidth = width, nHeight = height;
+ if (nWidth <= 0) nWidth = DEFAULT_WIDTH;
+ if (image != null) {
+ NSSize size = image.handle.size();
+ nWidth = (int)size.width;
+ nHeight = (int)size.height;
+ }
+ NSRect rect = new NSRect();
+ rect.x = x;
+ rect.y = y;
+ rect.width = nWidth;
+ rect.height = nHeight;
+ parent.view.setNeedsDisplayInRect(rect);
+ return true;
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent (or its display if its parent is null).
+ *
+ * @return the receiver's bounding rectangle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Rectangle getBounds () {
+ checkWidget();
+ if (image != null) {
+ Rectangle rect = image.getBounds ();
+ return new Rectangle (x, y, rect.width, rect.height);
+ } else {
+ if (width == 0) {
+ return new Rectangle (x, y, DEFAULT_WIDTH, height);
+ }
+ }
+ return new Rectangle (x, y, width, height);
+}
+
+/**
+ * Returns the font that the receiver will use to paint textual information.
+ *
+ * @return the receiver's font
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Font getFont () {
+ checkWidget();
+ if (font != null) return font;
+ return parent.getFont ();
+}
+
+/**
+ * Returns the image that the receiver will use to paint the caret.
+ *
+ * @return the receiver's image
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Image getImage () {
+ checkWidget();
+ return image;
+}
+
+/**
+ * Returns a point describing the receiver's location relative
+ * to its parent (or its display if its parent is null).
+ *
+ * @return the receiver's location
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getLocation () {
+ checkWidget();
+ return new Point (x, y);
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Canvas</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Canvas getParent () {
+ checkWidget();
+ return parent;
+}
+
+/**
+ * Returns a point describing the receiver's size.
+ *
+ * @return the receiver's size
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getSize () {
+ checkWidget();
+ if (image != null) {
+ Rectangle rect = image.getBounds ();
+ return new Point (rect.width, rect.height);
+ } else {
+ if (width == 0) {
+ return new Point (DEFAULT_WIDTH, height);
+ }
+ }
+ return new Point (width, height);
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible, and
+ * <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getVisible () {
+ checkWidget();
+ return isVisible;
+}
+
+boolean hideCaret () {
+ if (!isShowing) return true;
+ isShowing = false;
+ return drawCaret ();
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible and all
+ * of the receiver's ancestors are visible and <code>false</code>
+ * otherwise.
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getVisible
+ */
+public boolean isVisible () {
+ checkWidget();
+ return isVisible && parent.isVisible () && parent.hasFocus ();
+}
+
+boolean isFocusCaret () {
+ return this == display.currentCaret;
+}
+
+void killFocus () {
+ if (display.currentCaret != this) return;
+ display.setCurrentCaret (null);
+ if (isVisible) hideCaret ();
+}
+
+void releaseParent () {
+ super.releaseParent ();
+ if (this == parent.getCaret ()) parent.setCaret (null);
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ if (display.currentCaret == this) {
+ hideCaret ();
+ display.setCurrentCaret (null);
+ }
+ parent = null;
+ image = null;
+}
+
+/**
+ * Sets the receiver's size and location to the rectangular
+ * area specified by the arguments. The <code>x</code> and
+ * <code>y</code> arguments are relative to the receiver's
+ * parent (or its display if its parent is null).
+ *
+ * @param x the new x coordinate for the receiver
+ * @param y the new y coordinate for the receiver
+ * @param width the new width for the receiver
+ * @param height the new height for the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setBounds (int x, int y, int width, int height) {
+ checkWidget();
+ if (this.x == x && this.y == y && this.width == width && this.height == height) return;
+ boolean isFocus = isFocusCaret ();
+ if (isFocus && isVisible) hideCaret ();
+ this.x = x;
+ this.y = y;
+ this.width = width;
+ this.height = height;
+ if (isFocus && isVisible) showCaret ();
+}
+
+/**
+ * Sets the receiver's size and location to the rectangular
+ * area specified by the argument. The <code>x</code> and
+ * <code>y</code> fields of the rectangle are relative to
+ * the receiver's parent (or its display if its parent is null).
+ *
+ * @param rect the new bounds for the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setBounds (Rectangle rect) {
+ checkWidget();
+ if (rect == null) error (SWT.ERROR_NULL_ARGUMENT);
+ setBounds (rect.x, rect.y, rect.width, rect.height);
+}
+
+void setFocus () {
+ if (display.currentCaret == this) return;
+ display.setCurrentCaret (this);
+ if (isVisible) showCaret ();
+}
+
+/**
+ * Sets the font that the receiver will use to paint textual information
+ * to the font specified by the argument, or to the default font for that
+ * kind of control if the argument is null.
+ *
+ * @param font the new font (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the font has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setFont (Font font) {
+ checkWidget();
+ if (font != null && font.isDisposed ()) {
+ error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ this.font = font;
+}
+
+/**
+ * Sets the image that the receiver will use to paint the caret
+ * to the image specified by the argument, or to the default
+ * which is a filled rectangle if the argument is null
+ *
+ * @param image the new image (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setImage (Image image) {
+ checkWidget();
+ if (image != null && image.isDisposed ()) {
+ error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ boolean isFocus = isFocusCaret ();
+ if (isFocus && isVisible) hideCaret ();
+ this.image = image;
+ if (isFocus && isVisible) showCaret ();
+}
+
+/**
+ * Sets the receiver's location to the point specified by
+ * the arguments which are relative to the receiver's
+ * parent (or its display if its parent is null).
+ *
+ * @param x the new x coordinate for the receiver
+ * @param y the new y coordinate for the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLocation (int x, int y) {
+ checkWidget();
+ setBounds (x, y, width, height);
+}
+
+/**
+ * Sets the receiver's location to the point specified by
+ * the argument which is relative to the receiver's
+ * parent (or its display if its parent is null).
+ *
+ * @param location the new location for the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLocation (Point location) {
+ checkWidget();
+ if (location == null) error (SWT.ERROR_NULL_ARGUMENT);
+ setLocation (location.x, location.y);
+}
+
+/**
+ * Sets the receiver's size to the point specified by the arguments.
+ *
+ * @param width the new width for the receiver
+ * @param height the new height for the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSize (int width, int height) {
+ checkWidget();
+ setBounds (x, y, width, height);
+}
+
+/**
+ * Sets the receiver's size to the point specified by the argument.
+ *
+ * @param size the new extent for the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSize (Point size) {
+ checkWidget();
+ if (size == null) error (SWT.ERROR_NULL_ARGUMENT);
+ setSize (size.x, size.y);
+}
+
+/**
+ * Marks the receiver as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param visible the new visibility state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setVisible (boolean visible) {
+ checkWidget();
+ if (visible == isVisible) return;
+ isVisible = visible;
+ if (!isFocusCaret ()) return;
+ if (isVisible) {
+ showCaret ();
+ } else {
+ hideCaret ();
+ }
+}
+
+boolean showCaret () {
+ if (isShowing) return true;
+ isShowing = true;
+ return drawCaret ();
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ColorDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ColorDialog.java
new file mode 100755
index 0000000000..8164c136c5
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ColorDialog.java
@@ -0,0 +1,156 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * Instances of this class allow the user to select a color
+ * from a predefined set of available colors.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ */
+public class ColorDialog extends Dialog {
+ RGB rgb;
+
+/**
+ * Constructs a new instance of this class given only its parent.
+ *
+ * @param parent a composite control which will be the parent of the new instance
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public ColorDialog(Shell parent) {
+ this(parent, SWT.APPLICATION_MODAL);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public ColorDialog(Shell parent, int style) {
+ super(parent, style);
+ checkSubclass ();
+}
+
+void changeColor(int sender) {
+ //TODO
+}
+
+/**
+ * Returns the currently selected color in the receiver.
+ *
+ * @return the RGB value for the selected color, may be null
+ *
+ * @see PaletteData#getRGBs
+ */
+public RGB getRGB() {
+ return rgb;
+}
+
+/**
+ * Makes the receiver visible and brings it to the front
+ * of the display.
+ *
+ * @return the selected color, or null if the dialog was
+ * cancelled, no color was selected, or an error
+ * occurred
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public RGB open() {
+ NSColorPanel panel = NSColorPanel.sharedColorPanel();
+ if (rgb != null) {
+ NSColor color = NSColor.colorWithDeviceRed(rgb.red / 255f, rgb.green / 255f, rgb.blue / 255f, 1);
+ panel.setColor(color);
+ }
+ SWTPanelDelegate delegate = (SWTPanelDelegate)new SWTPanelDelegate().alloc().init();
+ int jniRef = OS.NewGlobalRef(this);
+ if (jniRef == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+ delegate.setTag(jniRef);
+ panel.setDelegate(delegate);
+ rgb = null;
+ panel.orderFront(null);
+ NSApplication.sharedApplication().runModalForWindow_(panel);
+ panel.setDelegate(null);
+ delegate.release();
+ OS.DeleteGlobalRef(jniRef);
+ NSColor color = panel.color();
+ if (color != null) {
+ rgb = new RGB((int)(color.redComponent() * 255), (int)(color.greenComponent() * 255), (int)(color.blueComponent() * 255));
+ }
+ return rgb;
+}
+
+/**
+ * Sets the receiver's selected color to be the argument.
+ *
+ * @param rgb the new RGB value for the selected color, may be
+ * null to let the platform select a default when
+ * open() is called
+ * @see PaletteData#getRGBs
+ */
+public void setRGB(RGB rgb) {
+ this.rgb = rgb;
+}
+
+void windowWillClose(int sender) {
+ NSApplication.sharedApplication().stop(null);
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java
new file mode 100755
index 0000000000..a025bdfd65
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Combo.java
@@ -0,0 +1,1349 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * Instances of this class are controls that allow the user
+ * to choose an item from a list of items, or optionally
+ * enter a new value by typing it into an editable text
+ * field. Often, <code>Combo</code>s are used in the same place
+ * where a single selection <code>List</code> widget could
+ * be used but space is limited. A <code>Combo</code> takes
+ * less space than a <code>List</code> widget and shows
+ * similar information.
+ * <p>
+ * Note: Since <code>Combo</code>s can contain both a list
+ * and an editable text field, it is possible to confuse methods
+ * which access one versus the other (compare for example,
+ * <code>clearSelection()</code> and <code>deselectAll()</code>).
+ * The API documentation is careful to indicate either "the
+ * receiver's list" or the "the receiver's text field" to
+ * distinguish between the two cases.
+ * </p><p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to add children to it, or set a layout on it.
+ * </p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>DROP_DOWN, READ_ONLY, SIMPLE</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>DefaultSelection, Modify, Selection, Verify</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles DROP_DOWN and SIMPLE may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see List
+ */
+public class Combo extends Composite {
+ int textLimit = LIMIT;
+
+ /**
+ * the operating system limit for the number of characters
+ * that the text field in an instance of this class can hold
+ */
+ public static final int LIMIT;
+
+ /*
+ * These values can be different on different platforms.
+ * Therefore they are not initialized in the declaration
+ * to stop the compiler from inlining.
+ */
+ static {
+ LIMIT = 0x7FFFFFFF;
+ }
+
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#DROP_DOWN
+ * @see SWT#READ_ONLY
+ * @see SWT#SIMPLE
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Combo (Composite parent, int style) {
+ super (parent, checkStyle (style));
+}
+
+/**
+ * Adds the argument to the end of the receiver's list.
+ *
+ * @param string the new item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #add(String,int)
+ */
+public void add (String string) {
+ checkWidget ();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ NSString str = NSString.stringWith(string);
+ if ((style & SWT.READ_ONLY) != 0) {
+ NSMenu nsMenu = ((NSPopUpButton)view).menu();
+ NSMenuItem nsItem = (NSMenuItem)new NSMenuItem().alloc();
+ nsItem.initWithTitle(str, 0, NSString.stringWith(""));
+ nsMenu.addItem(nsItem);
+ nsItem.release();
+ } else {
+ ((NSComboBox)view).addItemWithObjectValue(str);
+ }
+}
+
+/**
+ * Adds the argument to the receiver's list at the given
+ * zero-relative index.
+ * <p>
+ * Note: To add an item at the end of the list, use the
+ * result of calling <code>getItemCount()</code> as the
+ * index or use <code>add(String)</code>.
+ * </p>
+ *
+ * @param string the new item
+ * @param index the index for the item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #add(String)
+ */
+public void add (String string, int index) {
+ checkWidget ();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ int count = getItemCount ();
+ if (0 > index || index > count) error (SWT.ERROR_INVALID_RANGE);
+ NSString str = NSString.stringWith(string);
+ if ((style & SWT.READ_ONLY) != 0) {
+ NSMenu nsMenu = ((NSPopUpButton)view).menu();
+ NSMenuItem nsItem = (NSMenuItem)new NSMenuItem().alloc();
+ nsItem.initWithTitle(str, 0, NSString.stringWith(""));
+ nsMenu.insertItem(nsItem, index);
+ nsItem.release();
+ } else {
+ ((NSComboBox)view).insertItemWithObjectValue(str, index);
+ }
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver's text is modified, by sending
+ * it one of the messages defined in the <code>ModifyListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ModifyListener
+ * @see #removeModifyListener
+ */
+public void addModifyListener (ModifyListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Modify, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's selection, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the user changes the combo's list selection.
+ * <code>widgetDefaultSelected</code> is typically called when ENTER is pressed the combo's text area.
+ * </p>
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Selection,typedListener);
+ addListener (SWT.DefaultSelection,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver's text is verified, by sending
+ * it one of the messages defined in the <code>VerifyListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see VerifyListener
+ * @see #removeVerifyListener
+ *
+ * @since 3.1
+ */
+public void addVerifyListener (VerifyListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Verify, typedListener);
+}
+
+static int checkStyle (int style) {
+ /*
+ * Feature in Windows. It is not possible to create
+ * a combo box that has a border using Windows style
+ * bits. All combo boxes draw their own border and
+ * do not use the standard Windows border styles.
+ * Therefore, no matter what style bits are specified,
+ * clear the BORDER bits so that the SWT style will
+ * match the Windows widget.
+ *
+ * The Windows behavior is currently implemented on
+ * all platforms.
+ */
+ style &= ~SWT.BORDER;
+
+ /*
+ * Even though it is legal to create this widget
+ * with scroll bars, they serve no useful purpose
+ * because they do not automatically scroll the
+ * widget's client area. The fix is to clear
+ * the SWT style.
+ */
+ style &= ~(SWT.H_SCROLL | SWT.V_SCROLL);
+ style = checkBits (style, SWT.DROP_DOWN, SWT.SIMPLE, 0, 0, 0, 0);
+ if ((style & SWT.SIMPLE) != 0) return style & ~SWT.READ_ONLY;
+ return style;
+}
+
+protected void checkSubclass () {
+ if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+/**
+ * Sets the selection in the receiver's text field to an empty
+ * selection starting just before the first character. If the
+ * text field is editable, this has the effect of placing the
+ * i-beam at the start of the text.
+ * <p>
+ * Note: To clear the selected items in the receiver's list,
+ * use <code>deselectAll()</code>.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #deselectAll
+ */
+public void clearSelection () {
+ checkWidget();
+ if ((style & SWT.READ_ONLY) == 0) {
+ Point selection = getSelection ();
+ selection.y = selection.x;
+ setSelection (selection);
+ }
+}
+
+void comboBoxSelectionDidChange(int notification) {
+ sendSelection();
+}
+
+public Point computeSize (int wHint, int hHint, boolean changed) {
+ checkWidget ();
+ int width = 0, height = 0;
+ NSControl widget = (NSControl)view;
+ NSRect oldRect = widget.frame();
+ widget.sizeToFit();
+ NSRect newRect = widget.frame();
+ widget.setFrame (oldRect);
+ width = (int)newRect.width;
+ height = (int)newRect.height;
+ if (wHint != SWT.DEFAULT) width = wHint;
+ if (hHint != SWT.DEFAULT) height = hHint;
+ return new Point (width, height);
+}
+
+/**
+ * Copies the selected text.
+ * <p>
+ * The current selection is copied to the clipboard.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public void copy () {
+ checkWidget ();
+ Point selection = getSelection ();
+ if (selection.x == selection.y) return;
+// copyToClipboard (getText (selection.x, selection.y));
+}
+
+void createHandle () {
+ if ((style & SWT.READ_ONLY) != 0) {
+ NSPopUpButton widget = (NSPopUpButton)new SWTPopUpButton().alloc();
+ widget.initWithFrame(new NSRect(), false);
+ widget.menu().setAutoenablesItems(false);
+ widget.setTarget(widget);
+ widget.setAction(OS.sel_sendSelection);
+ widget.setTag(jniRef);
+ view = widget;
+ parent.view.addSubview_(widget);
+ } else {
+ NSComboBox widget = (NSComboBox)new SWTComboBox().alloc();
+ widget.initWithFrame(new NSRect());
+ widget.setTag(jniRef);
+ widget.setDelegate(widget);
+ view = widget;
+ parent.contentView().addSubview_(widget);
+ }
+}
+
+/**
+ * Cuts the selected text.
+ * <p>
+ * The current selection is first copied to the
+ * clipboard and then deleted from the widget.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public void cut () {
+ checkWidget ();
+ if ((style & SWT.READ_ONLY) != 0) return;
+// Point selection = getSelection ();
+// if (selection.x == selection.y) return;
+// int start = selection.x, end = selection.y;
+// String text = getText ();
+// String leftText = text.substring (0, start);
+// String rightText = text.substring (end, text.length ());
+// String oldText = text.substring (start, end);
+// String newText = "";
+// if (hooks (SWT.Verify) || filters (SWT.Verify)) {
+// newText = verifyText (newText, start, end, null);
+// if (newText == null) return;
+// }
+// char [] buffer = new char [oldText.length ()];
+// oldText.getChars (0, buffer.length, buffer, 0);
+// copyToClipboard (buffer);
+// setText (leftText + newText + rightText, false);
+// start += newText.length ();
+// setSelection (new Point (start, start));
+// sendEvent (SWT.Modify);
+}
+
+Color defaultBackground () {
+ return display.getSystemColor (SWT.COLOR_LIST_BACKGROUND);
+}
+
+Color defaultForeground () {
+ return display.getSystemColor (SWT.COLOR_LIST_FOREGROUND);
+}
+
+/**
+ * Deselects the item at the given zero-relative index in the receiver's
+ * list. If the item at the index was already deselected, it remains
+ * deselected. Indices that are out of range are ignored.
+ *
+ * @param index the index of the item to deselect
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselect (int index) {
+ checkWidget ();
+ if (index == -1) return;
+ if (index == getSelectionIndex ()) {
+ if ((style & SWT.READ_ONLY) != 0) {
+ ((NSPopUpButton)view).selectItem(null);
+ sendEvent (SWT.Modify);
+ } else {
+ ((NSComboBox)view).deselectItemAtIndex(index);
+ }
+ }
+}
+
+/**
+ * Deselects all selected items in the receiver's list.
+ * <p>
+ * Note: To clear the selection in the receiver's text field,
+ * use <code>clearSelection()</code>.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #clearSelection
+ */
+public void deselectAll () {
+ checkWidget ();
+ if ((style & SWT.READ_ONLY) != 0) {
+ ((NSPopUpButton)view).selectItem(null);
+ sendEvent (SWT.Modify);
+ } else {
+ setText ("");
+ }
+}
+
+int getCharCount() {
+ NSString str;
+ if ((style & SWT.READ_ONLY) != 0) {
+ str = ((NSPopUpButton)view).titleOfSelectedItem();
+ } else {
+ str = new NSCell(((NSComboBox)view).cell()).title();
+ }
+ return str.length();
+}
+
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver's list. Throws an exception if the index is out
+ * of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getItem (int index) {
+ checkWidget ();
+ int count = getItemCount ();
+ if (0 > index || index >= count) error (SWT.ERROR_INVALID_RANGE);
+ NSString str;
+ if ((style & SWT.READ_ONLY) != 0) {
+ str = ((NSPopUpButton)view).itemTitleAtIndex(index);
+ } else {
+ str = new NSString(((NSComboBox)view).itemObjectValueAtIndex(index));
+ }
+ if (str == null) error(SWT.ERROR_CANNOT_GET_ITEM);
+ char[] buffer = new char[str.length()];
+ str.getCharacters_(buffer);
+ return new String (buffer);
+}
+
+/**
+ * Returns the number of items contained in the receiver's list.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+ checkWidget ();
+ if ((style & SWT.READ_ONLY) != 0) {
+ return ((NSPopUpButton)view).numberOfItems();
+ } else {
+ return ((NSComboBox)view).numberOfItems();
+ }
+}
+
+/**
+ * Returns the height of the area which would be used to
+ * display <em>one</em> of the items in the receiver's list.
+ *
+ * @return the height of one item
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemHeight () {
+ checkWidget ();
+ //TODO - not supported by the OS
+ return 26;
+}
+
+/**
+ * Returns a (possibly empty) array of <code>String</code>s which are
+ * the items in the receiver's list.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items in the receiver's list
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String [] getItems () {
+ checkWidget ();
+ int count = getItemCount ();
+ String [] result = new String [count];
+ for (int i=0; i<count; i++) result [i] = getItem (i);
+ return result;
+}
+
+int getMininumHeight () {
+ return getTextHeight ();
+}
+
+/**
+ * Returns the orientation of the receiver.
+ *
+ * @return the orientation style
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public int getOrientation () {
+ checkWidget();
+ return style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT);
+}
+
+/**
+ * Returns a <code>Point</code> whose x coordinate is the
+ * character position representing the start of the selection
+ * in the receiver's text field, and whose y coordinate is the
+ * character position representing the end of the selection.
+ * An "empty" selection is indicated by the x and y coordinates
+ * having the same value.
+ * <p>
+ * Indexing is zero based. The range of a selection is from
+ * 0..N where N is the number of characters in the widget.
+ * </p>
+ *
+ * @return a point representing the selection start and end
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getSelection () {
+ checkWidget ();
+ if ((style & SWT.READ_ONLY) != 0) {
+ return new Point (0, getCharCount ());
+ } else {
+// ControlEditTextSelectionRec selection;
+// if (this.selection != null) {
+// selection = this.selection;
+// } else {
+// selection = new ControlEditTextSelectionRec ();
+// OS.GetControlData (handle, (short) OS.kHIComboBoxEditTextPart, OS.kControlEditTextSelectionTag, 4, selection, null);
+// }
+// return new Point (selection.selStart, selection.selEnd);
+ return null;
+ }
+}
+
+/**
+ * Returns the zero-relative index of the item which is currently
+ * selected in the receiver's list, or -1 if no item is selected.
+ *
+ * @return the index of the selected item
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelectionIndex () {
+ checkWidget ();
+ if ((style & SWT.READ_ONLY) != 0) {
+ return ((NSPopUpButton)view).indexOfSelectedItem();
+ } else {
+ return ((NSComboBox)view).indexOfSelectedItem();
+ }
+}
+
+/**
+ * Returns a string containing a copy of the contents of the
+ * receiver's text field, or an empty string if there are no
+ * contents.
+ *
+ * @return the receiver's text
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+ checkWidget ();
+ return getText(0, -1);
+}
+
+String getText (int start, int end) {
+ NSString str;
+ if ((style & SWT.READ_ONLY) != 0) {
+ str = ((NSPopUpButton)view).titleOfSelectedItem();
+ } else {
+ str = new NSCell(((NSComboBox)view).cell()).title();
+ }
+ if (str == null) return "";
+ int length = str.length();
+ char[] buffer = new char[length];
+ str.getCharacters_(buffer);
+ String string = new String(buffer);
+ if (end == -1) end = length;
+ start = Math.max(0, Math.min(start, length));
+ end = Math.max(0, Math.min(end, length));
+ return string.substring(start, end);
+}
+
+/**
+ * Returns the height of the receivers's text field.
+ *
+ * @return the text height
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getTextHeight () {
+ checkWidget();
+ //TODO - not supported by the OS
+ return 26;
+}
+
+/**
+ * Returns the maximum number of characters that the receiver's
+ * text field is capable of holding. If this has not been changed
+ * by <code>setTextLimit()</code>, it will be the constant
+ * <code>Combo.LIMIT</code>.
+ *
+ * @return the text limit
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #LIMIT
+ */
+public int getTextLimit () {
+ checkWidget();
+ return textLimit;
+}
+
+/**
+ * Gets the number of items that are visible in the drop
+ * down portion of the receiver's list.
+ * <p>
+ * Note: This operation is a hint and is not supported on
+ * platforms that do not have this concept.
+ * </p>
+ *
+ * @return the number of items that are visible
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public int getVisibleItemCount () {
+ checkWidget ();
+ if ((style & SWT.READ_ONLY) != 0) {
+ return getItemCount ();
+ } else {
+ return ((NSComboBox)view).numberOfVisibleItems();
+ }
+}
+
+/**
+ * Searches the receiver's list starting at the first item
+ * (index 0) until an item is found that is equal to the
+ * argument, and returns the index of that item. If no item
+ * is found, returns -1.
+ *
+ * @param string the search item
+ * @return the index of the item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (String string) {
+ return indexOf (string, 0);
+}
+
+/**
+ * Searches the receiver's list starting at the given,
+ * zero-relative index until an item is found that is equal
+ * to the argument, and returns the index of that item. If
+ * no item is found or the starting index is out of range,
+ * returns -1.
+ *
+ * @param string the search item
+ * @param start the zero-relative index at which to begin the search
+ * @return the index of the item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (String string, int start) {
+ checkWidget();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ int count = getItemCount ();
+ if (!(0 <= start && start < count)) return -1;
+ for (int i=start; i<count; i++) {
+ if (string.equals (getItem (i))) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+/**
+ * Pastes text from clipboard.
+ * <p>
+ * The selected text is deleted from the widget
+ * and new text inserted from the clipboard.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public void paste () {
+ checkWidget ();
+ if ((style & SWT.READ_ONLY) != 0) return;
+// Point selection = getSelection ();
+// int start = selection.x, end = selection.y;
+// String text = getText ();
+// String leftText = text.substring (0, start);
+// String rightText = text.substring (end, text.length ());
+// String newText = getClipboardText ();
+// if (hooks (SWT.Verify) || filters (SWT.Verify)) {
+// newText = verifyText (newText, start, end, null);
+// if (newText == null) return;
+// }
+// if (textLimit != LIMIT) {
+// int charCount = text.length ();
+// if (charCount - (end - start) + newText.length() > textLimit) {
+// newText = newText.substring(0, textLimit - charCount + (end - start));
+// }
+// }
+// setText (leftText + newText + rightText, false);
+// start += newText.length ();
+// setSelection (new Point (start, start));
+// sendEvent (SWT.Modify);
+}
+
+/**
+ * Removes the item from the receiver's list at the given
+ * zero-relative index.
+ *
+ * @param index the index for the item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (int index) {
+ checkWidget ();
+ if (index == -1) error (SWT.ERROR_INVALID_RANGE);
+ int count = getItemCount ();
+ if (0 > index || index >= count) error (SWT.ERROR_INVALID_RANGE);
+ if ((style & SWT.READ_ONLY) != 0) {
+ ((NSPopUpButton)view).removeItemAtIndex(index);
+ } else {
+ ((NSComboBox)view).removeItemAtIndex(index);
+ }
+}
+
+/**
+ * Removes the items from the receiver's list which are
+ * between the given zero-relative start and end
+ * indices (inclusive).
+ *
+ * @param start the start of the range
+ * @param end the end of the range
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if either the start or end are not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (int start, int end) {
+ checkWidget();
+ if (start > end) return;
+ int count = getItemCount ();
+ if (!(0 <= start && start <= end && end < count)) {
+ error (SWT.ERROR_INVALID_RANGE);
+ }
+ int newEnd = Math.min (end, count - 1);
+ for (int i=newEnd; i>=start; i--) {
+ remove(i);
+ }
+}
+
+/**
+ * Searches the receiver's list starting at the first item
+ * until an item is found that is equal to the argument,
+ * and removes that item from the list.
+ *
+ * @param string the item to remove
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the string is not found in the list</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (String string) {
+ checkWidget ();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ int index = indexOf (string, 0);
+ if (index == -1) error (SWT.ERROR_INVALID_ARGUMENT);
+ remove (index);
+}
+
+/**
+ * Removes all of the items from the receiver's list and clear the
+ * contents of receiver's text field.
+ * <p>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void removeAll () {
+ checkWidget ();
+ if ((style & SWT.READ_ONLY) != 0) {
+ ((NSPopUpButton)view).removeAllItems();
+ } else {
+ setText ("", true);
+ ((NSComboBox)view).removeAllItems();
+ }
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the receiver's text is modified.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ModifyListener
+ * @see #addModifyListener
+ */
+public void removeModifyListener (ModifyListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Modify, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's selection.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Selection, listener);
+ eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is verified.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see VerifyListener
+ * @see #addVerifyListener
+ *
+ * @since 3.1
+ */
+public void removeVerifyListener (VerifyListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Verify, listener);
+}
+
+/**
+ * Selects the item at the given zero-relative index in the receiver's
+ * list. If the item at the index was already selected, it remains
+ * selected. Indices that are out of range are ignored.
+ *
+ * @param index the index of the item to select
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void select (int index) {
+ checkWidget ();
+ int count = getItemCount ();
+ if (0 <= index && index < count) {
+ if ((style & SWT.READ_ONLY) != 0) {
+ ((NSPopUpButton)view).selectItemAtIndex(index);
+ sendEvent (SWT.Modify);
+ } else {
+ ((NSComboBox)view).selectItemAtIndex(index);
+ }
+ }
+}
+
+//boolean sendKeyEvent (int type, Event event) {
+// if (!super.sendKeyEvent (type, event)) {
+// return false;
+// }
+// if (type != SWT.KeyDown) return true;
+// if ((style & SWT.READ_ONLY) != 0) return true;
+// if (event.character == 0) return true;
+// if ((event.stateMask & SWT.COMMAND) != 0) return true;
+// String oldText = "", newText = "";
+// if (hooks (SWT.Verify) || filters (SWT.Verify)) {
+// int charCount = getCharCount ();
+// Point selection = getSelection ();
+// int start = selection.x, end = selection.y;
+// switch (event.character) {
+// case SWT.BS:
+// if (start == end) {
+// if (start == 0) return true;
+// start = Math.max (0, start - 1);
+// }
+// break;
+// case SWT.DEL:
+// if (start == end) {
+// if (start == charCount) return true;
+// end = Math.min (end + 1, charCount);
+// }
+// break;
+// case SWT.CR:
+// return true;
+// default:
+// if (event.character != '\t' && event.character < 0x20) return true;
+// oldText = new String (new char [] {event.character});
+// }
+// newText = verifyText (oldText, start, end, event);
+// if (newText == null) return false;
+// if (charCount - (end - start) + newText.length () > textLimit) {
+// return false;
+// }
+// if (newText != oldText) {
+// String text = getText ();
+// String leftText = text.substring (0, start);
+// String rightText = text.substring (end, text.length ());
+// setText (leftText + newText + rightText, false);
+// start += newText.length ();
+// setSelection (new Point (start, start));
+// }
+// }
+// /*
+// * Post the modify event so that the character will be inserted
+// * into the widget when the modify event is delivered. Normally,
+// * modify events are sent but it is safe to post the event here
+// * because this method is called from the event loop.
+// */
+// postEvent (SWT.Modify);
+// return newText == oldText;
+//}
+
+void sendSelection () {
+ //TODO post
+ sendEvent(SWT.Selection);
+}
+
+/**
+ * Sets the text of the item in the receiver's list at the given
+ * zero-relative index to the string argument.
+ *
+ * @param index the index for the item
+ * @param string the new text for the item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setItem (int index, String string) {
+ checkWidget ();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ int count = getItemCount ();
+ if (0 > index || index >= count) error (SWT.ERROR_INVALID_RANGE);
+ NSString str = NSString.stringWith(string);
+ if ((style & SWT.READ_ONLY) != 0) {
+ NSMenuItem nsItem = ((NSPopUpButton)view).itemAtIndex(index);
+ nsItem.setTitle(str);
+ } else {
+ NSComboBox widget = (NSComboBox)view;
+ widget.insertItemWithObjectValue(str, index);
+ widget.removeItemAtIndex(index + 1);
+ }
+}
+
+/**
+ * Sets the receiver's list to be the given array of items.
+ *
+ * @param items the array of items
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the items array is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if an item in the items array is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setItems (String [] items) {
+ checkWidget();
+ if (items == null) error (SWT.ERROR_NULL_ARGUMENT);
+ for (int i=0; i<items.length; i++) {
+ if (items [i] == null) error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ removeAll();
+ if (items.length == 0) return;
+ for (int i= 0; i < items.length; i++) {
+ NSString str = NSString.stringWith(items[i]);
+ if ((style & SWT.READ_ONLY) != 0) {
+ NSMenu nsMenu = ((NSPopUpButton)view).menu();
+ NSMenuItem nsItem = (NSMenuItem)new NSMenuItem().alloc();
+ nsItem.initWithTitle(str, 0, NSString.stringWith(""));
+ nsMenu.addItem(nsItem);
+ nsItem.release();
+ } else {
+ ((NSComboBox)view).addItemWithObjectValue(str);
+ }
+ }
+}
+
+/*public*/ void setListVisible (boolean visible) {
+ checkWidget ();
+ if ((style & SWT.READ_ONLY) != 0) {
+ ((NSPopUpButton)view).setPullsDown(visible);
+ } else {
+ }
+}
+
+/**
+ * Sets the orientation of the receiver, which must be one
+ * of the constants <code>SWT.LEFT_TO_RIGHT</code> or <code>SWT.RIGHT_TO_LEFT</code>.
+ * <p>
+ *
+ * @param orientation new orientation style
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public void setOrientation (int orientation) {
+ checkWidget();
+}
+
+/**
+ * Sets the selection in the receiver's text field to the
+ * range specified by the argument whose x coordinate is the
+ * start of the selection and whose y coordinate is the end
+ * of the selection.
+ *
+ * @param selection a point representing the new selection start and end
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (Point selection) {
+ checkWidget ();
+ if (selection == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if ((style & SWT.READ_ONLY) == 0) {
+// int length = getCharCount ();
+// int start = selection.x, end = selection.y;
+// ControlEditTextSelectionRec sel = new ControlEditTextSelectionRec ();
+// sel.selStart = (short) Math.min (Math.max (Math.min (start, end), 0), length);
+// sel.selEnd = (short) Math.min (Math.max (Math.max (start, end), 0), length);
+// if (hasFocus ()) {
+// OS.SetControlData (handle, OS.kHIComboBoxEditTextPart, OS.kControlEditTextSelectionTag, 4, sel);
+// } else {
+// this.selection = sel;
+// }
+ }
+}
+
+/**
+ * Sets the contents of the receiver's text field to the
+ * given string.
+ * <p>
+ * Note: The text field in a <code>Combo</code> is typically
+ * only capable of displaying a single line of text. Thus,
+ * setting the text to a string containing line breaks or
+ * other special characters will probably cause it to
+ * display incorrectly.
+ * </p>
+ *
+ * @param string the new text
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+ checkWidget ();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ setText (string, true);
+}
+
+void setText (String string, boolean notify) {
+ if (notify) {
+ if (hooks (SWT.Verify) || filters (SWT.Verify)) {
+ string = verifyText (string, 0, getCharCount (), null);
+ if (string == null) return;
+ }
+ }
+ if ((style & SWT.READ_ONLY) != 0) {
+ int index = indexOf (string);
+ if (index != -1 && index != getSelectionIndex ()) {
+ select (index);
+ if (notify) sendEvent (SWT.Modify);
+ }
+ } else {
+ new NSCell(((NSComboBox)view).cell()).setTitle(NSString.stringWith(string));
+ if (notify) sendEvent (SWT.Modify);
+ }
+}
+
+/**
+ * Sets the maximum number of characters that the receiver's
+ * text field is capable of holding to be the argument.
+ * <p>
+ * To reset this value to the default, use <code>setTextLimit(Combo.LIMIT)</code>.
+ * Specifying a limit value larger than <code>Combo.LIMIT</code> sets the
+ * receiver's limit to <code>Combo.LIMIT</code>.
+ * </p>
+ * @param limit new text limit
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_CANNOT_BE_ZERO - if the limit is zero</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #LIMIT
+ */
+public void setTextLimit (int limit) {
+ checkWidget ();
+ if (limit == 0) error (SWT.ERROR_CANNOT_BE_ZERO);
+ textLimit = limit;
+}
+
+/**
+ * Sets the number of items that are visible in the drop
+ * down portion of the receiver's list.
+ * <p>
+ * Note: This operation is a hint and is not supported on
+ * platforms that do not have this concept.
+ * </p>
+ *
+ * @param count the new number of items to be visible
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setVisibleItemCount (int count) {
+ checkWidget ();
+ if (count < 0) return;
+ if ((style & SWT.READ_ONLY) != 0) {
+ //TODO
+ } else {
+ ((NSComboBox)view).setNumberOfVisibleItems(count);
+ }
+}
+
+String verifyText (String string, int start, int end, Event keyEvent) {
+ Event event = new Event ();
+ event.text = string;
+ event.start = start;
+ event.end = end;
+ if (keyEvent != null) {
+ event.character = keyEvent.character;
+ event.keyCode = keyEvent.keyCode;
+ event.stateMask = keyEvent.stateMask;
+ }
+ /*
+ * It is possible (but unlikely), that application
+ * code could have disposed the widget in the verify
+ * event. If this happens, answer null to cancel
+ * the operation.
+ */
+ sendEvent (SWT.Verify, event);
+ if (!event.doit || isDisposed ()) return null;
+ return event.text;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Composite.java
new file mode 100755
index 0000000000..6fe0bba47c
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Composite.java
@@ -0,0 +1,878 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * Instances of this class are controls which are capable
+ * of containing other controls.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>NO_BACKGROUND, NO_FOCUS, NO_MERGE_PAINTS, NO_REDRAW_RESIZE, NO_RADIO_GROUP, EMBEDDED, DOUBLE_BUFFERED</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * Note: The <code>NO_BACKGROUND</code>, <code>NO_FOCUS</code>, <code>NO_MERGE_PAINTS</code>,
+ * and <code>NO_REDRAW_RESIZE</code> styles are intended for use with <code>Canvas</code>.
+ * They can be used with <code>Composite</code> if you are drawing your own, but their
+ * behavior is undefined if they are used with subclasses of <code>Composite</code> other
+ * than <code>Canvas</code>.
+ * </p><p>
+ * Note: The <code>CENTER</code> style, although undefined for composites, has the
+ * same value as <code>EMBEDDED</code> (which is used to embed widgets from other
+ * widget toolkits into SWT). On some operating systems (GTK, Motif), this may cause
+ * the children of this composite to be obscured. The <code>EMBEDDED</code> style
+ * is for use by other widget toolkits and should normally never be used.
+ * </p><p>
+ * This class may be subclassed by custom control implementors
+ * who are building controls that are constructed from aggregates
+ * of other controls.
+ * </p>
+ *
+ * @see Canvas
+ */
+public class Composite extends Scrollable {
+ Layout layout;
+ Control[] tabList;
+ int scrolledVisibleRgn, siblingsVisibleRgn;
+ int layoutCount, backgroundMode;
+
+Composite () {
+ /* Do nothing */
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * </ul>
+ *
+ * @see SWT#NO_BACKGROUND
+ * @see SWT#NO_FOCUS
+ * @see SWT#NO_MERGE_PAINTS
+ * @see SWT#NO_REDRAW_RESIZE
+ * @see SWT#NO_RADIO_GROUP
+ * @see Widget#getStyle
+ */
+public Composite (Composite parent, int style) {
+ super (parent, style);
+}
+
+Control [] _getChildren () {
+ NSArray views = contentView().subviews();
+ int count = views.count();
+ Control [] children = new Control [count];
+ int j = 0;
+ for (int i=0; i<count; i++){
+ int tag = new NSView(views.objectAtIndex(i)).tag();
+ if (tag != 0 && tag != -1) {
+ Object widget = OS.JNIGetObject(tag);
+ if (widget != null && widget != this) {
+ if (widget instanceof Control) {
+ children [j++] = (Control) widget;
+ }
+ }
+ }
+ }
+ if (j == count) return children;
+ Control [] newChildren = new Control [j];
+ System.arraycopy (children, 0, newChildren, 0, j);
+ return newChildren;
+}
+
+Control [] _getTabList () {
+ if (tabList == null) return null;
+ int count = 0;
+ for (int i=0; i<tabList.length; i++) {
+ if (!tabList [i].isDisposed ()) count++;
+ }
+ if (count == tabList.length) return tabList;
+ Control [] newList = new Control [count];
+ int index = 0;
+ for (int i=0; i<tabList.length; i++) {
+ if (!tabList [i].isDisposed ()) {
+ newList [index++] = tabList [i];
+ }
+ }
+ tabList = newList;
+ return tabList;
+}
+
+boolean acceptsFirstResponder () {
+ if ((state & CANVAS) != 0) {
+ return ((style & SWT.NO_FOCUS) == 0);
+ }
+ return acceptsFirstResponder ();
+}
+
+
+/**
+ * Clears any data that has been cached by a Layout for all widgets that
+ * are in the parent hierarchy of the changed control up to and including the
+ * receiver. If an ancestor does not have a layout, it is skipped.
+ *
+ * @param changed an array of controls that changed state and require a recalculation of size
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the changed array is null any of its controls are null or have been disposed</li>
+ * <li>ERROR_INVALID_PARENT - if any control in changed is not in the widget tree of the receiver</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void changed (Control[] changed) {
+ checkWidget ();
+ if (changed == null) error (SWT.ERROR_INVALID_ARGUMENT);
+ for (int i=0; i<changed.length; i++) {
+ Control control = changed [i];
+ if (control == null) error (SWT.ERROR_INVALID_ARGUMENT);
+ if (control.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ boolean ancestor = false;
+ Composite composite = control.parent;
+ while (composite != null) {
+ ancestor = composite == this;
+ if (ancestor) break;
+ composite = composite.parent;
+ }
+ if (!ancestor) error (SWT.ERROR_INVALID_PARENT);
+ }
+ for (int i=0; i<changed.length; i++) {
+ Control child = changed [i];
+ Composite composite = child.parent;
+ while (child != this) {
+ if (composite.layout == null || !composite.layout.flushCache (child)) {
+ composite.state |= LAYOUT_CHANGED;
+ }
+ child = composite;
+ composite = child.parent;
+ }
+ }
+}
+
+public Point computeSize (int wHint, int hHint, boolean changed) {
+ checkWidget();
+ Point size;
+ if (layout != null) {
+ if ((wHint == SWT.DEFAULT) || (hHint == SWT.DEFAULT)) {
+ changed |= (state & LAYOUT_CHANGED) != 0;
+ size = layout.computeSize (this, wHint, hHint, changed);
+ state &= ~LAYOUT_CHANGED;
+ } else {
+ size = new Point (wHint, hHint);
+ }
+ } else {
+ size = minimumSize (wHint, hHint, changed);
+ }
+ if (size.x == 0) size.x = DEFAULT_WIDTH;
+ if (size.y == 0) size.y = DEFAULT_HEIGHT;
+ if (wHint != SWT.DEFAULT) size.x = wHint;
+ if (hHint != SWT.DEFAULT) size.y = hHint;
+ Rectangle trim = computeTrim (0, 0, size.x, size.y);
+ return new Point (trim.width, trim.height);
+}
+
+protected void checkSubclass () {
+ /* Do nothing - Subclassing is allowed */
+}
+
+Control [] computeTabList () {
+ Control result [] = super.computeTabList ();
+ if (result.length == 0) return result;
+ Control [] list = tabList != null ? _getTabList () : _getChildren ();
+ for (int i=0; i<list.length; i++) {
+ Control child = list [i];
+ Control [] childList = child.computeTabList ();
+ if (childList.length != 0) {
+ Control [] newResult = new Control [result.length + childList.length];
+ System.arraycopy (result, 0, newResult, 0, result.length);
+ System.arraycopy (childList, 0, newResult, result.length, childList.length);
+ result = newResult;
+ }
+ }
+ return result;
+}
+
+NSView contentView () {
+ return view;
+}
+
+void createHandle () {
+ createHandle (parent.contentView());
+}
+
+void createHandle (NSView parent) {
+ state |= CANVAS;
+ if ((style & (SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL)) != 0) {
+ SWTScrollView scrollWidget = (SWTScrollView)new SWTScrollView().alloc();
+ scrollWidget.initWithFrame (new NSRect());
+ scrollWidget.setDrawsBackground(false);
+ if ((style & SWT.H_SCROLL) != 0) scrollWidget.setHasHorizontalScroller(true);
+ if ((style & SWT.V_SCROLL) != 0) scrollWidget.setHasVerticalScroller(true);
+ scrollWidget.setBorderType(hasBorder() ? OS.NSBezelBorder : OS.NSNoBorder);
+ scrollWidget.setTag(jniRef);
+ scrollView = scrollWidget;
+ }
+ SWTView widget = (SWTView)new SWTView().alloc();
+ NSRect rect = new NSRect();
+ rect.width = rect.height = 100000;
+ widget.initWithFrame (rect);
+// widget.setFocusRingType(OS.NSFocusRingTypeExterior);
+ widget.setTag(jniRef);
+ view = widget;
+ if (scrollView != null) {
+// view.setAutoresizingMask (OS.NSViewWidthSizable | OS.NSViewHeightSizable);
+ scrollView.setDocumentView(view);
+ if (parent != null) parent.addSubview_(scrollView);
+ } else {
+ if (parent != null) parent.addSubview_(view);
+ }
+}
+
+Composite findDeferredControl () {
+ return layoutCount > 0 ? this : parent.findDeferredControl ();
+}
+
+Menu [] findMenus (Control control) {
+ if (control == this) return new Menu [0];
+ Menu result [] = super.findMenus (control);
+ Control [] children = _getChildren ();
+ for (int i=0; i<children.length; i++) {
+ Control child = children [i];
+ Menu [] menuList = child.findMenus (control);
+ if (menuList.length != 0) {
+ Menu [] newResult = new Menu [result.length + menuList.length];
+ System.arraycopy (result, 0, newResult, 0, result.length);
+ System.arraycopy (menuList, 0, newResult, result.length, menuList.length);
+ result = newResult;
+ }
+ }
+ return result;
+}
+
+void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) {
+ super.fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus);
+ Control [] children = _getChildren ();
+ for (int i=0; i<children.length; i++) {
+ children [i].fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus);
+ }
+}
+
+void fixTabList (Control control) {
+ if (tabList == null) return;
+ int count = 0;
+ for (int i=0; i<tabList.length; i++) {
+ if (tabList [i] == control) count++;
+ }
+ if (count == 0) return;
+ Control [] newList = null;
+ int length = tabList.length - count;
+ if (length != 0) {
+ newList = new Control [length];
+ int index = 0;
+ for (int i=0; i<tabList.length; i++) {
+ if (tabList [i] != control) {
+ newList [index++] = tabList [i];
+ }
+ }
+ }
+ tabList = newList;
+}
+
+/**
+ * Returns the receiver's background drawing mode. This
+ * will be one of the following constants defined in class
+ * <code>SWT</code>:
+ * <code>INHERIT_NONE</code>, <code>INHERIT_DEFAULT</code>,
+ * <code>INHERTIT_FORCE</code>.
+ *
+ * @return the background mode
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT
+ *
+ * @since 3.2
+ */
+public int getBackgroundMode () {
+ checkWidget ();
+ return backgroundMode;
+}
+
+/**
+ * Returns a (possibly empty) array containing the receiver's children.
+ * Children are returned in the order that they are drawn. The topmost
+ * control appears at the beginning of the array. Subsequent controls
+ * draw beneath this control and appear later in the array.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of children, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return an array of children
+ *
+ * @see Control#moveAbove
+ * @see Control#moveBelow
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Control [] getChildren () {
+ checkWidget();
+ return _getChildren ();
+}
+
+int getChildrenCount () {
+ /*
+ * NOTE: The current implementation will count
+ * non-registered children.
+ */
+// short [] count = new short [1];
+// OS.CountSubControls (handle, count);
+// return count [0];
+ return 0;
+}
+
+/**
+ * Returns layout which is associated with the receiver, or
+ * null if one has not been set.
+ *
+ * @return the receiver's layout or null
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Layout getLayout () {
+ checkWidget();
+ return layout;
+}
+
+/**
+ * Returns <code>true</code> if the receiver has deferred
+ * the performing of layout, and <code>false</code> otherwise.
+ *
+ * @return the receiver's deferred layout state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setLayoutDeferred(boolean)
+ * @see #isLayoutDeferred()
+ *
+ * @since 3.1
+ */
+public boolean getLayoutDeferred () {
+ checkWidget ();
+ return layoutCount > 0 ;
+}
+
+/**
+ * Gets the (possibly empty) tabbing order for the control.
+ *
+ * @return tabList the ordered list of controls representing the tab order
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setTabList
+ */
+public Control [] getTabList () {
+ checkWidget ();
+ Control [] tabList = _getTabList ();
+ if (tabList == null) {
+ int count = 0;
+ Control [] list =_getChildren ();
+ for (int i=0; i<list.length; i++) {
+ if (list [i].isTabGroup ()) count++;
+ }
+ tabList = new Control [count];
+ int index = 0;
+ for (int i=0; i<list.length; i++) {
+ if (list [i].isTabGroup ()) {
+ tabList [index++] = list [i];
+ }
+ }
+ }
+ return tabList;
+}
+
+boolean hooksKeys () {
+ return hooks (SWT.KeyDown) || hooks (SWT.KeyUp);
+}
+
+/**
+ * Returns <code>true</code> if the receiver or any ancestor
+ * up to and including the receiver's nearest ancestor shell
+ * has deferred the performing of layouts. Otherwise, <code>false</code>
+ * is returned.
+ *
+ * @return the receiver's deferred layout state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setLayoutDeferred(boolean)
+ * @see #getLayoutDeferred()
+ *
+ * @since 3.1
+ */
+public boolean isLayoutDeferred () {
+ checkWidget ();
+ return findDeferredControl () != null;
+}
+
+boolean isTabGroup () {
+ if ((state & CANVAS) != 0) return true;
+ return super.isTabGroup ();
+}
+
+/**
+ * If the receiver has a layout, asks the layout to <em>lay out</em>
+ * (that is, set the size and location of) the receiver's children.
+ * If the receiver does not have a layout, do nothing.
+ * <p>
+ * This is equivalent to calling <code>layout(true)</code>.
+ * </p>
+ * <p>
+ * Note: Layout is different from painting. If a child is
+ * moved or resized such that an area in the parent is
+ * exposed, then the parent will paint. If no child is
+ * affected, the parent will not paint.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void layout () {
+ checkWidget ();
+ layout (true);
+}
+
+/**
+ * If the receiver has a layout, asks the layout to <em>lay out</em>
+ * (that is, set the size and location of) the receiver's children.
+ * If the argument is <code>true</code> the layout must not rely
+ * on any information it has cached about the immediate children. If it
+ * is <code>false</code> the layout may (potentially) optimize the
+ * work it is doing by assuming that none of the receiver's
+ * children has changed state since the last layout.
+ * If the receiver does not have a layout, do nothing.
+ * <p>
+ * If a child is resized as a result of a call to layout, the
+ * resize event will invoke the layout of the child. The layout
+ * will cascade down through all child widgets in the receiver's widget
+ * tree until a child is encountered that does not resize. Note that
+ * a layout due to a resize will not flush any cached information
+ * (same as <code>layout(false)</code>).
+ * </p>
+ * <p>
+ * Note: Layout is different from painting. If a child is
+ * moved or resized such that an area in the parent is
+ * exposed, then the parent will paint. If no child is
+ * affected, the parent will not paint.
+ * </p>
+ *
+ * @param changed <code>true</code> if the layout must flush its caches, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void layout (boolean changed) {
+ checkWidget ();
+ if (layout == null) return;
+ layout (changed, false);
+}
+
+/**
+ * If the receiver has a layout, asks the layout to <em>lay out</em>
+ * (that is, set the size and location of) the receiver's children.
+ * If the changed argument is <code>true</code> the layout must not rely
+ * on any information it has cached about its children. If it
+ * is <code>false</code> the layout may (potentially) optimize the
+ * work it is doing by assuming that none of the receiver's
+ * children has changed state since the last layout.
+ * If the all argument is <code>true</code> the layout will cascade down
+ * through all child widgets in the receiver's widget tree, regardless of
+ * whether the child has changed size. The changed argument is applied to
+ * all layouts. If the all argument is <code>false</code>, the layout will
+ * <em>not</em> cascade down through all child widgets in the receiver's widget
+ * tree. However, if a child is resized as a result of a call to layout, the
+ * resize event will invoke the layout of the child. Note that
+ * a layout due to a resize will not flush any cached information
+ * (same as <code>layout(false)</code>).
+ * </p>
+ * <p>
+ * Note: Layout is different from painting. If a child is
+ * moved or resized such that an area in the parent is
+ * exposed, then the parent will paint. If no child is
+ * affected, the parent will not paint.
+ * </p>
+ *
+ * @param changed <code>true</code> if the layout must flush its caches, and <code>false</code> otherwise
+ * @param all <code>true</code> if all children in the receiver's widget tree should be laid out, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void layout (boolean changed, boolean all) {
+ checkWidget ();
+ if (layout == null && !all) return;
+ markLayout (changed, all);
+ updateLayout (all);
+}
+
+/**
+ * Forces a lay out (that is, sets the size and location) of all widgets that
+ * are in the parent hierarchy of the changed control up to and including the
+ * receiver. The layouts in the hierarchy must not rely on any information
+ * cached about the changed control or any of its ancestors. The layout may
+ * (potentially) optimize the work it is doing by assuming that none of the
+ * peers of the changed control have changed state since the last layout.
+ * If an ancestor does not have a layout, skip it.
+ * <p>
+ * Note: Layout is different from painting. If a child is
+ * moved or resized such that an area in the parent is
+ * exposed, then the parent will paint. If no child is
+ * affected, the parent will not paint.
+ * </p>
+ *
+ * @param changed a control that has had a state change which requires a recalculation of its size
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the changed array is null any of its controls are null or have been disposed</li>
+ * <li>ERROR_INVALID_PARENT - if any control in changed is not in the widget tree of the receiver</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void layout (Control [] changed) {
+ checkWidget ();
+ if (changed == null) error (SWT.ERROR_INVALID_ARGUMENT);
+ for (int i=0; i<changed.length; i++) {
+ Control control = changed [i];
+ if (control == null) error (SWT.ERROR_INVALID_ARGUMENT);
+ if (control.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ boolean ancestor = false;
+ Composite composite = control.parent;
+ while (composite != null) {
+ ancestor = composite == this;
+ if (ancestor) break;
+ composite = composite.parent;
+ }
+ if (!ancestor) error (SWT.ERROR_INVALID_PARENT);
+ }
+ int updateCount = 0;
+ Composite [] update = new Composite [16];
+ for (int i=0; i<changed.length; i++) {
+ Control child = changed [i];
+ Composite composite = child.parent;
+ while (child != this) {
+ if (composite.layout != null) {
+ composite.state |= LAYOUT_NEEDED;
+ if (!composite.layout.flushCache (child)) {
+ composite.state |= LAYOUT_CHANGED;
+ }
+ }
+ if (updateCount == update.length) {
+ Composite [] newUpdate = new Composite [update.length + 16];
+ System.arraycopy (update, 0, newUpdate, 0, update.length);
+ update = newUpdate;
+ }
+ child = update [updateCount++] = composite;
+ composite = child.parent;
+ }
+ }
+ for (int i=updateCount-1; i>=0; i--) {
+ update [i].updateLayout (false);
+ }
+}
+
+void markLayout (boolean changed, boolean all) {
+ if (layout != null) {
+ state |= LAYOUT_NEEDED;
+ if (changed) state |= LAYOUT_CHANGED;
+ }
+ if (all) {
+ Control [] children = _getChildren ();
+ for (int i=0; i<children.length; i++) {
+ children [i].markLayout (changed, all);
+ }
+ }
+}
+
+Point minimumSize (int wHint, int Hint, boolean changed) {
+ Control [] children = _getChildren ();
+ int width = 0, height = 0;
+ for (int i=0; i<children.length; i++) {
+ Rectangle rect = children [i].getBounds ();
+ width = Math.max (width, rect.x + rect.width);
+ height = Math.max (height, rect.y + rect.height);
+ }
+ return new Point (width, height);
+}
+
+void releaseChildren (boolean destroy) {
+ Control [] children = _getChildren ();
+ for (int i=0; i<children.length; i++) {
+ Control child = children [i];
+ if (child != null && !child.isDisposed ()) {
+ child.release (false);
+ }
+ }
+ super.releaseChildren (destroy);
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ layout = null;
+ tabList = null;
+}
+
+void removeControl (Control control) {
+ fixTabList (control);
+}
+
+/**
+ * Sets the background drawing mode to the argument which should
+ * be one of the following constants defined in class <code>SWT</code>:
+ * <code>INHERIT_NONE</code>, <code>INHERIT_DEFAULT</code>,
+ * <code>INHERIT_FORCE</code>.
+ *
+ * @param mode the new background mode
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT
+ *
+ * @since 3.2
+ */
+public void setBackgroundMode (int mode) {
+ checkWidget ();
+ backgroundMode = mode;
+ Control [] children = _getChildren ();
+ for (int i = 0; i < children.length; i++) {
+ children [i].updateBackgroundMode ();
+ }
+}
+
+int setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
+ int result = super.setBounds (x, y, width, height, move, resize);
+ if (layout != null && (result & RESIZED) != 0) {
+ markLayout (false, false);
+ updateLayout (false);
+ }
+ return result;
+}
+
+public boolean setFocus () {
+ checkWidget ();
+ Control [] children = _getChildren ();
+ for (int i= 0; i < children.length; i++) {
+ if (children [i].setFocus ()) return true;
+ }
+ return super.setFocus ();
+}
+
+/**
+ * Sets the layout which is associated with the receiver to be
+ * the argument which may be null.
+ *
+ * @param layout the receiver's new layout or null
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLayout (Layout layout) {
+ checkWidget();
+ this.layout = layout;
+}
+
+/**
+ * If the argument is <code>true</code>, causes subsequent layout
+ * operations in the receiver or any of its children to be ignored.
+ * No layout of any kind can occur in the receiver or any of its
+ * children until the flag is set to false.
+ * Layout operations that occurred while the flag was
+ * <code>true</code> are remembered and when the flag is set to
+ * <code>false</code>, the layout operations are performed in an
+ * optimized manner. Nested calls to this method are stacked.
+ *
+ * @param defer the new defer state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #layout(boolean)
+ * @see #layout(Control[])
+ *
+ * @since 3.1
+ */
+public void setLayoutDeferred (boolean defer) {
+ if (!defer) {
+ if (--layoutCount == 0) {
+ if ((state & LAYOUT_CHILD) != 0 || (state & LAYOUT_NEEDED) != 0) {
+ updateLayout (true);
+ }
+ }
+ } else {
+ layoutCount++;
+ }
+}
+
+
+boolean setScrollBarVisible (ScrollBar bar, boolean visible) {
+ boolean changed = super.setScrollBarVisible (bar, visible);
+ if (changed && layout != null) {
+ markLayout (false, false);
+ updateLayout (false);
+ }
+ return changed;
+}
+
+boolean setTabGroupFocus () {
+ if (isTabItem ()) return setTabItemFocus ();
+ boolean takeFocus = (style & SWT.NO_FOCUS) == 0;
+ if ((state & CANVAS) != 0) takeFocus = hooksKeys ();
+ if (takeFocus && setTabItemFocus ()) return true;
+ Control [] children = _getChildren ();
+ for (int i=0; i<children.length; i++) {
+ Control child = children [i];
+ if (child.isTabItem () && child.setTabItemFocus ()) return true;
+ }
+ return false;
+}
+
+/**
+ * Sets the tabbing order for the specified controls to
+ * match the order that they occur in the argument list.
+ *
+ * @param tabList the ordered list of controls representing the tab order or null
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if a widget in the tabList is null or has been disposed</li>
+ * <li>ERROR_INVALID_PARENT - if widget in the tabList is not in the same widget tree</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setTabList (Control [] tabList) {
+ checkWidget ();
+ if (tabList != null) {
+ for (int i=0; i<tabList.length; i++) {
+ Control control = tabList [i];
+ if (control == null) error (SWT.ERROR_INVALID_ARGUMENT);
+ if (control.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ if (control.parent != this) error (SWT.ERROR_INVALID_PARENT);
+ }
+ Control [] newList = new Control [tabList.length];
+ System.arraycopy (tabList, 0, newList, 0, tabList.length);
+ tabList = newList;
+ }
+ this.tabList = tabList;
+}
+
+int traversalCode (int key, int theEvent) {
+ if ((state & CANVAS) != 0) {
+ if ((style & SWT.NO_FOCUS) != 0) return 0;
+ if (hooksKeys ()) return 0;
+ }
+ return super.traversalCode (key, theEvent);
+}
+
+void updateBackgroundMode () {
+ super.updateBackgroundMode ();
+ Control [] children = _getChildren ();
+ for (int i = 0; i < children.length; i++) {
+ children [i].updateBackgroundMode ();
+ }
+}
+
+void updateLayout (boolean all) {
+ Composite parent = findDeferredControl ();
+ if (parent != null) {
+ parent.state |= LAYOUT_CHILD;
+ return;
+ }
+ if ((state & LAYOUT_NEEDED) != 0) {
+ boolean changed = (state & LAYOUT_CHANGED) != 0;
+ state &= ~(LAYOUT_NEEDED | LAYOUT_CHANGED);
+ layout.layout (this, changed);
+ }
+ if (all) {
+ state &= ~LAYOUT_CHILD;
+ Control [] children = _getChildren ();
+ for (int i=0; i<children.length; i++) {
+ children [i].updateLayout (all);
+ }
+ }
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
new file mode 100755
index 0000000000..f954ef1785
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
@@ -0,0 +1,3258 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.accessibility.Accessible;
+
+/**
+ * Control is the abstract superclass of all windowed user interface classes.
+ * <p>
+ * <dl>
+ * <dt><b>Styles:</b>
+ * <dd>BORDER</dd>
+ * <dd>LEFT_TO_RIGHT, RIGHT_TO_LEFT</dd>
+ * <dt><b>Events:</b>
+ * <dd>DragDetect, FocusIn, FocusOut, Help, KeyDown, KeyUp, MenuDetect, MouseDoubleClick, MouseDown, MouseEnter,
+ * MouseExit, MouseHover, MouseUp, MouseMove, Move, Paint, Resize, Traverse</dd>
+ * </dl>
+ * </p><p>
+ * Only one of LEFT_TO_RIGHT or RIGHT_TO_LEFT may be specified.
+ * </p><p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ */
+public abstract class Control extends Widget implements Drawable {
+ /**
+ * the handle to the OS resource
+ * (Warning: This field is platform dependent)
+ * <p>
+ * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It is not available on all
+ * platforms and should never be accessed from application code.
+ * </p>
+ */
+ NSView view;
+ Composite parent;
+ String toolTipText;
+ Object layoutData;
+ int drawCount;
+// int visibleRgn;
+ Menu menu;
+ Color foreground, background;
+ Image backgroundImage;
+ Font font;
+ Cursor cursor;
+ Region region;
+// GCData gcs[];
+ Accessible accessible;
+
+// static final String RESET_VISIBLE_REGION = "org.eclipse.swt.internal.resetVisibleRegion";
+
+Control () {
+ /* Do nothing */
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#BORDER
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Control (Composite parent, int style) {
+ super (parent, style);
+ this.parent = parent;
+ createWidget ();
+}
+
+boolean acceptsFirstResponder () {
+ objc_super super_struct = new objc_super();
+ super_struct.receiver = view.id;
+ super_struct.cls = OS.objc_msgSend(view.id, OS.sel_superclass);
+ return OS.objc_msgSendSuper(super_struct, OS.sel_acceptsFirstResponder) != 0;
+}
+
+boolean becomeFirstResponder () {
+//TODO - query focusControl() in SWT.FocusIn/Out is the control
+ sendEvent (SWT.FocusIn);
+ objc_super super_struct = new objc_super();
+ super_struct.receiver = view.id;
+ super_struct.cls = OS.objc_msgSend(view.id, OS.sel_superclass);
+ return OS.objc_msgSendSuper(super_struct, OS.sel_becomeFirstResponder) != 0;
+}
+
+boolean resignFirstResponder () {
+//TODO - query focusControl() in SWT.FocusIn/Out is the control
+ sendEvent (SWT.FocusOut);
+ objc_super super_struct = new objc_super();
+ super_struct.receiver = view.id;
+ super_struct.cls = OS.objc_msgSend(view.id, OS.sel_superclass);
+ return OS.objc_msgSendSuper(super_struct, OS.sel_resignFirstResponder) != 0;
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is moved or resized, by sending
+ * it one of the messages defined in the <code>ControlListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ControlListener
+ * @see #removeControlListener
+ */
+public void addControlListener(ControlListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Resize,typedListener);
+ addListener (SWT.Move,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when a drag gesture occurs, by sending it
+ * one of the messages defined in the <code>DragDetectListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see DragDetectListener
+ * @see #removeDragDetectListener
+ *
+ * @since 3.3
+ */
+public void addDragDetectListener (DragDetectListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.DragDetect,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control gains or loses focus, by sending
+ * it one of the messages defined in the <code>FocusListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see FocusListener
+ * @see #removeFocusListener
+ */
+public void addFocusListener(FocusListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener(SWT.FocusIn,typedListener);
+ addListener(SWT.FocusOut,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when help events are generated for the control,
+ * by sending it one of the messages defined in the
+ * <code>HelpListener</code> interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see HelpListener
+ * @see #removeHelpListener
+ */
+public void addHelpListener (HelpListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Help, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when keys are pressed and released on the system keyboard, by sending
+ * it one of the messages defined in the <code>KeyListener</code>
+ * interface.
+ * <p>
+ * When a key listener is added to a control, the control
+ * will take part in widget traversal. By default, all
+ * traversal keys (such as the tab key and so on) are
+ * delivered to the control. In order for a control to take
+ * part in traversal, it should listen for traversal events.
+ * Otherwise, the user can traverse into a control but not
+ * out. Note that native controls such as table and tree
+ * implement key traversal in the operating system. It is
+ * not necessary to add traversal listeners for these controls,
+ * unless you want to override the default traversal.
+ * </p>
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see KeyListener
+ * @see #removeKeyListener
+ */
+public void addKeyListener(KeyListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener(SWT.KeyUp,typedListener);
+ addListener(SWT.KeyDown,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the platform-specific context menu trigger
+ * has occurred, by sending it one of the messages defined in
+ * the <code>MenuDetectListener</code> interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MenuDetectListener
+ * @see #removeMenuDetectListener
+ *
+ * @since 3.3
+ */
+public void addMenuDetectListener (MenuDetectListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.MenuDetect, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when mouse buttons are pressed and released, by sending
+ * it one of the messages defined in the <code>MouseListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MouseListener
+ * @see #removeMouseListener
+ */
+public void addMouseListener(MouseListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener(SWT.MouseDown,typedListener);
+ addListener(SWT.MouseUp,typedListener);
+ addListener(SWT.MouseDoubleClick,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the mouse passes or hovers over controls, by sending
+ * it one of the messages defined in the <code>MouseTrackListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MouseTrackListener
+ * @see #removeMouseTrackListener
+ */
+public void addMouseTrackListener (MouseTrackListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.MouseEnter,typedListener);
+ addListener (SWT.MouseExit,typedListener);
+ addListener (SWT.MouseHover,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the mouse moves, by sending it one of the
+ * messages defined in the <code>MouseMoveListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MouseMoveListener
+ * @see #removeMouseMoveListener
+ */
+public void addMouseMoveListener(MouseMoveListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener(SWT.MouseMove,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the mouse wheel is scrolled, by sending
+ * it one of the messages defined in the
+ * <code>MouseWheelListener</code> interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MouseWheelListener
+ * @see #removeMouseWheelListener
+ *
+ * @since 3.3
+ */
+public void addMouseWheelListener (MouseWheelListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.MouseWheel, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver needs to be painted, by sending it
+ * one of the messages defined in the <code>PaintListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see PaintListener
+ * @see #removePaintListener
+ */
+public void addPaintListener(PaintListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener(SWT.Paint,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when traversal events occur, by sending it
+ * one of the messages defined in the <code>TraverseListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see TraverseListener
+ * @see #removeTraverseListener
+ */
+public void addTraverseListener (TraverseListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Traverse,typedListener);
+}
+
+void checkBackground () {
+ Shell shell = getShell ();
+ if (this == shell) return;
+ state &= ~PARENT_BACKGROUND;
+ Composite composite = parent;
+ do {
+ int mode = composite.backgroundMode;
+ if (mode != 0) {
+ if (mode == SWT.INHERIT_DEFAULT) {
+ Control control = this;
+ do {
+ if ((control.state & THEME_BACKGROUND) == 0) {
+ return;
+ }
+ control = control.parent;
+ } while (control != composite);
+ }
+ state |= PARENT_BACKGROUND;
+ return;
+ }
+ if (composite == shell) break;
+ composite = composite.parent;
+ } while (true);
+}
+
+void checkBuffered () {
+ style |= SWT.DOUBLE_BUFFERED;
+}
+
+/**
+ * Returns the preferred size of the receiver.
+ * <p>
+ * The <em>preferred size</em> of a control is the size that it would
+ * best be displayed at. The width hint and height hint arguments
+ * allow the caller to ask a control questions such as "Given a particular
+ * width, how high does the control need to be to show all of the contents?"
+ * To indicate that the caller does not wish to constrain a particular
+ * dimension, the constant <code>SWT.DEFAULT</code> is passed for the hint.
+ * </p>
+ *
+ * @param wHint the width hint (can be <code>SWT.DEFAULT</code>)
+ * @param hHint the height hint (can be <code>SWT.DEFAULT</code>)
+ * @return the preferred size of the control
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Layout
+ * @see #getBorderWidth
+ * @see #getBounds
+ * @see #getSize
+ * @see #pack(boolean)
+ * @see "computeTrim, getClientArea for controls that implement them"
+ */
+public Point computeSize (int wHint, int hHint) {
+ return computeSize (wHint, hHint, true);
+}
+
+/**
+ * Returns the preferred size of the receiver.
+ * <p>
+ * The <em>preferred size</em> of a control is the size that it would
+ * best be displayed at. The width hint and height hint arguments
+ * allow the caller to ask a control questions such as "Given a particular
+ * width, how high does the control need to be to show all of the contents?"
+ * To indicate that the caller does not wish to constrain a particular
+ * dimension, the constant <code>SWT.DEFAULT</code> is passed for the hint.
+ * </p><p>
+ * If the changed flag is <code>true</code>, it indicates that the receiver's
+ * <em>contents</em> have changed, therefore any caches that a layout manager
+ * containing the control may have been keeping need to be flushed. When the
+ * control is resized, the changed flag will be <code>false</code>, so layout
+ * manager caches can be retained.
+ * </p>
+ *
+ * @param wHint the width hint (can be <code>SWT.DEFAULT</code>)
+ * @param hHint the height hint (can be <code>SWT.DEFAULT</code>)
+ * @param changed <code>true</code> if the control's contents have changed, and <code>false</code> otherwise
+ * @return the preferred size of the control.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Layout
+ * @see #getBorderWidth
+ * @see #getBounds
+ * @see #getSize
+ * @see #pack(boolean)
+ * @see "computeTrim, getClientArea for controls that implement them"
+ */
+public Point computeSize (int wHint, int hHint, boolean changed) {
+ checkWidget();
+ int width = DEFAULT_WIDTH;
+ int height = DEFAULT_HEIGHT;
+// if (wHint != SWT.DEFAULT) width = wHint;
+// if (hHint != SWT.DEFAULT) height = hHint;
+// int border = getBorderWidth ();
+// width += border * 2;
+// height += border * 2;
+// return new Point (width, height);
+ if (topView() instanceof NSControl) {
+ NSRect oldRect = topView().frame();
+ ((NSControl)topView()).sizeToFit();
+ NSRect newRect = topView().frame();
+ topView().setFrame (oldRect);
+ return new Point ((int)newRect.width, (int)newRect.height);
+ }
+ return new Point (width, height);
+}
+
+Control computeTabGroup () {
+ if (isTabGroup()) return this;
+ return parent.computeTabGroup ();
+}
+
+Control[] computeTabList() {
+ if (isTabGroup()) {
+ if (getVisible() && getEnabled()) {
+ return new Control[] {this};
+ }
+ }
+ return new Control[0];
+}
+
+Control computeTabRoot () {
+ Control[] tabList = parent._getTabList();
+ if (tabList != null) {
+ int index = 0;
+ while (index < tabList.length) {
+ if (tabList [index] == this) break;
+ index++;
+ }
+ if (index == tabList.length) {
+ if (isTabGroup ()) return this;
+ }
+ }
+ return parent.computeTabRoot ();
+}
+
+void createWidget () {
+ state |= DRAG_DETECT;
+ checkOrientation (parent);
+ super.createWidget ();
+ checkBackground ();
+ checkBuffered ();
+ setDefaultFont ();
+ setZOrder ();
+}
+
+Color defaultBackground () {
+ return display.getSystemColor (SWT.COLOR_WIDGET_BACKGROUND);
+}
+
+Font defaultFont () {
+ //TODO - Controls only, does this leak?
+ if (view instanceof NSControl) {
+ NSFont nsFont = ((NSControl)view).font ();
+ if (nsFont != null) {
+ return Font.cocoa_new (display, nsFont);
+ }
+ }
+ return display.getSystemFont ();
+}
+
+Color defaultForeground () {
+ return display.getSystemColor (SWT.COLOR_WIDGET_FOREGROUND);
+}
+
+void destroyWidget () {
+ NSView view = topView ();
+ view.removeFromSuperview ();
+ releaseHandle ();
+}
+
+/**
+ * Detects a drag and drop gesture. This method is used
+ * to detect a drag gesture when called from within a mouse
+ * down listener.
+ *
+ * <p>By default, a drag is detected when the gesture
+ * occurs anywhere within the client area of a control.
+ * Some controls, such as tables and trees, override this
+ * behavior. In addition to the operating system specific
+ * drag gesture, they require the mouse to be inside an
+ * item. Custom widget writers can use <code>setDragDetect</code>
+ * to disable the default detection, listen for mouse down,
+ * and then call <code>dragDetect()</code> from within the
+ * listener to conditionally detect a drag.
+ * </p>
+ *
+ * @param event the mouse down event
+ *
+ * @return <code>true</code> if the gesture occurred, and <code>false</code> otherwise.
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT when the event is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see DragDetectListener
+ * @see #addDragDetectListener
+ *
+ * @see #getDragDetect
+ * @see #setDragDetect
+ *
+ * @since 3.3
+ */
+public boolean dragDetect (Event event) {
+ checkWidget ();
+ if (event == null) error (SWT.ERROR_NULL_ARGUMENT);
+ return dragDetect (event.button, event.count, event.stateMask, event.x, event.y);
+}
+
+/**
+ * Detects a drag and drop gesture. This method is used
+ * to detect a drag gesture when called from within a mouse
+ * down listener.
+ *
+ * <p>By default, a drag is detected when the gesture
+ * occurs anywhere within the client area of a control.
+ * Some controls, such as tables and trees, override this
+ * behavior. In addition to the operating system specific
+ * drag gesture, they require the mouse to be inside an
+ * item. Custom widget writers can use <code>setDragDetect</code>
+ * to disable the default detection, listen for mouse down,
+ * and then call <code>dragDetect()</code> from within the
+ * listener to conditionally detect a drag.
+ * </p>
+ *
+ * @param event the mouse down event
+ *
+ * @return <code>true</code> if the gesture occurred, and <code>false</code> otherwise.
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT when the event is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see DragDetectListener
+ * @see #addDragDetectListener
+ *
+ * @see #getDragDetect
+ * @see #setDragDetect
+ *
+ * @since 3.3
+ */
+public boolean dragDetect (MouseEvent event) {
+ checkWidget ();
+ if (event == null) error (SWT.ERROR_NULL_ARGUMENT);
+ return dragDetect (event.button, event.count, event.stateMask, event.x, event.y);
+}
+
+boolean dragDetect (int button, int count, int stateMask, int x, int y) {
+ if (button != 1 || count != 1) return false;
+ if (!dragDetect (x, y, false, null)) return false;
+ return sendDragEvent (button, stateMask, x, y);
+}
+
+boolean dragDetect (int x, int y, boolean filter, boolean [] consume) {
+// Rect rect = new Rect ();
+// int window = OS.GetControlOwner (handle);
+// CGPoint pt = new CGPoint ();
+// OS.HIViewConvertPoint (pt, handle, 0);
+// x += (int) pt.x;
+// y += (int) pt.y;
+// OS.GetWindowBounds (window, (short) OS.kWindowStructureRgn, rect);
+// x += rect.left;
+// y += rect.top;
+// org.eclipse.swt.internal.carbon.Point pt1 = new org.eclipse.swt.internal.carbon.Point ();
+// pt1.h = (short) x;
+// pt1.v = (short) y;
+// return OS.WaitMouseMoved (pt1);
+ return false;
+}
+
+boolean drawGripper (int x, int y, int width, int height, boolean vertical) {
+ return false;
+}
+
+void drawRect(int id, NSRect rect) {
+ super.drawRect(id, rect);
+ if (!hooks (SWT.Paint) && !filters (SWT.Paint)) return;
+
+ /* Send paint event */
+ GCData data = new GCData ();
+ data.paintRect = rect;
+ GC gc = GC.carbon_new (this, data);
+ Event event = new Event ();
+ event.gc = gc;
+ event.x = (int)rect.x;
+ event.y = (int)rect.y;
+ event.width = (int)rect.width;
+ event.height = (int)rect.height;
+ sendEvent (SWT.Paint, event);
+ event.gc = null;
+ gc.dispose ();
+}
+
+void enableWidget (boolean enabled) {
+// int topHandle = stopHandle ();
+// if (enabled) {
+// OS.EnableControl (topHandle);
+// } else {
+// OS.DisableControl (topHandle);
+// }
+}
+
+Cursor findCursor () {
+ if (cursor != null) return cursor;
+ return parent.findCursor ();
+}
+
+Control findBackgroundControl () {
+ if (backgroundImage != null || background != null) return this;
+ return (state & PARENT_BACKGROUND) != 0 ? parent.findBackgroundControl () : null;
+}
+
+Menu [] findMenus (Control control) {
+ if (menu != null && this != control) return new Menu [] {menu};
+ return new Menu [0];
+}
+
+void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) {
+ oldShell.fixShell (newShell, this);
+ oldDecorations.fixDecorations (newDecorations, this, menus);
+}
+
+void fixFocus (Control focusControl) {
+ Shell shell = getShell ();
+ Control control = this;
+ while (control != shell && (control = control.parent) != null) {
+ if (control.setFocus ()) return;
+ }
+ shell.setSavedFocus (focusControl);
+// int window = OS.GetControlOwner (handle);
+// OS.ClearKeyboardFocus (window);
+}
+
+/**
+ * Forces the receiver to have the <em>keyboard focus</em>, causing
+ * all keyboard events to be delivered to it.
+ *
+ * @return <code>true</code> if the control got focus, and <code>false</code> if it was unable to.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setFocus
+ */
+public boolean forceFocus () {
+ checkWidget();
+// if (display.focusEvent == SWT.FocusOut) return false;
+ Decorations shell = menuShell ();
+ shell.setSavedFocus (this);
+ if (!isEnabled () || !isVisible ()/* || !isActive ()*/) return false;
+ if (isFocusControl ()) return true;
+ shell.setSavedFocus (null);
+ shell.bringToTop (false);
+ if (isDisposed ()) return false;
+ view.window ().makeFirstResponder (view);
+ if (isDisposed ()) return false;
+ shell.setSavedFocus (this);
+ return hasFocus ();
+}
+
+/**
+ * Returns the accessible object for the receiver.
+ * If this is the first time this object is requested,
+ * then the object is created and returned.
+ *
+ * @return the accessible object
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Accessible#addAccessibleListener
+ * @see Accessible#addAccessibleControlListener
+ *
+ * @since 2.0
+ */
+public Accessible getAccessible () {
+ checkWidget ();
+ if (accessible == null) accessible = new_Accessible (this);
+ return accessible;
+}
+
+/**
+ * Returns the receiver's background color.
+ *
+ * @return the background color
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Color getBackground () {
+ checkWidget();
+ Control control = findBackgroundControl ();
+ if (control == null) control = this;
+ return control.getBackgroundColor ();
+}
+
+Color getBackgroundColor () {
+ return background != null ? background : defaultBackground ();
+}
+
+/**
+ * Returns the receiver's background image.
+ *
+ * @return the background image
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public Image getBackgroundImage () {
+ checkWidget();
+ Control control = findBackgroundControl ();
+ if (control == null) control = this;
+ return control.backgroundImage;
+}
+
+/**
+ * Returns the receiver's border width.
+ *
+ * @return the border width
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getBorderWidth () {
+ checkWidget();
+ return 0;
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent (or its display if its parent is null),
+ * unless the receiver is a shell. In this case, the location is
+ * relative to the display.
+ *
+ * @return the receiver's bounding rectangle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Rectangle getBounds () {
+ checkWidget();
+ NSRect rect = topView().frame();
+ return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+}
+
+/**
+ * Returns <code>true</code> if the receiver is detecting
+ * drag gestures, and <code>false</code> otherwise.
+ *
+ * @return the receiver's drag detect state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public boolean getDragDetect () {
+ checkWidget ();
+ return (state & DRAG_DETECT) != 0;
+}
+
+/**
+ * Returns the receiver's cursor, or null if it has not been set.
+ * <p>
+ * When the mouse pointer passes over a control its appearance
+ * is changed to match the control's cursor.
+ * </p>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public Cursor getCursor () {
+ checkWidget();
+ return cursor;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled, and
+ * <code>false</code> otherwise. A disabled control is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #isEnabled
+ */
+public boolean getEnabled () {
+ checkWidget();
+ return (state & DISABLED) == 0;
+}
+
+/**
+ * Returns the font that the receiver will use to paint textual information.
+ *
+ * @return the receiver's font
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Font getFont () {
+ checkWidget();
+ return font != null ? font : defaultFont ();
+}
+
+/**
+ * Returns the foreground color that the receiver will use to draw.
+ *
+ * @return the receiver's foreground color
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Color getForeground () {
+ checkWidget();
+ return getForegroundColor ();
+}
+
+Color getForegroundColor () {
+ return foreground != null ? foreground: defaultForeground ();
+}
+
+/**
+ * Returns layout data which is associated with the receiver.
+ *
+ * @return the receiver's layout data
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Object getLayoutData () {
+ checkWidget();
+ return layoutData;
+}
+
+/**
+ * Returns a point describing the receiver's location relative
+ * to its parent (or its display if its parent is null), unless
+ * the receiver is a shell. In this case, the point is
+ * relative to the display.
+ *
+ * @return the receiver's location
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getLocation () {
+ checkWidget();
+ NSRect rect = topView().frame();
+ return new Point((int)rect.x, (int)rect.y);
+}
+
+/**
+ * Returns the receiver's pop up menu if it has one, or null
+ * if it does not. All controls may optionally have a pop up
+ * menu that is displayed when the user requests one for
+ * the control. The sequence of key strokes, button presses
+ * and/or button releases that are used to request a pop up
+ * menu is platform specific.
+ *
+ * @return the receiver's menu
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Menu getMenu () {
+ checkWidget();
+ return menu;
+}
+
+int getMininumHeight () {
+ return 0;
+}
+
+/**
+ * Returns the receiver's monitor.
+ *
+ * @return the receiver's monitor
+ *
+ * @since 3.0
+ */
+public Monitor getMonitor () {
+ checkWidget();
+ Monitor [] monitors = display.getMonitors ();
+ if (monitors.length == 1) return monitors [0];
+ int index = -1, value = -1;
+ Rectangle bounds = getBounds ();
+ if (this != getShell ()) {
+ bounds = display.map (this.parent, null, bounds);
+ }
+ for (int i=0; i<monitors.length; i++) {
+ Rectangle rect = bounds.intersection (monitors [i].getBounds ());
+ int area = rect.width * rect.height;
+ if (area > 0 && area > value) {
+ index = i;
+ value = area;
+ }
+ }
+ if (index >= 0) return monitors [index];
+ int centerX = bounds.x + bounds.width / 2, centerY = bounds.y + bounds.height / 2;
+ for (int i=0; i<monitors.length; i++) {
+ Rectangle rect = monitors [i].getBounds ();
+ int x = centerX < rect.x ? rect.x - centerX : centerX > rect.x + rect.width ? centerX - rect.x - rect.width : 0;
+ int y = centerY < rect.y ? rect.y - centerY : centerY > rect.y + rect.height ? centerY - rect.y - rect.height : 0;
+ int distance = x * x + y * y;
+ if (index == -1 || distance < value) {
+ index = i;
+ value = distance;
+ }
+ }
+ return monitors [index];
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Composite</code>
+ * or null when the receiver is a shell that was created with null or
+ * a display for a parent.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Composite getParent () {
+ checkWidget();
+ return parent;
+}
+
+Control [] getPath () {
+ int count = 0;
+ Shell shell = getShell ();
+ Control control = this;
+ while (control != shell) {
+ count++;
+ control = control.parent;
+ }
+ control = this;
+ Control [] result = new Control [count];
+ while (control != shell) {
+ result [--count] = control;
+ control = control.parent;
+ }
+ return result;
+}
+
+public Region getRegion () {
+ checkWidget ();
+ return region;
+}
+
+/**
+ * Returns the receiver's shell. For all controls other than
+ * shells, this simply returns the control's nearest ancestor
+ * shell. Shells return themselves, even if they are children
+ * of other shells.
+ *
+ * @return the receiver's shell
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getParent
+ */
+public Shell getShell () {
+ checkWidget();
+ return parent.getShell ();
+}
+
+/**
+ * Returns a point describing the receiver's size. The
+ * x coordinate of the result is the width of the receiver.
+ * The y coordinate of the result is the height of the
+ * receiver.
+ *
+ * @return the receiver's size
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getSize () {
+ checkWidget();
+ NSRect rect = topView().frame();
+ return new Point((int)rect.width, (int)rect.height);
+}
+
+/**
+ * Returns the receiver's tool tip text, or null if it has
+ * not been set.
+ *
+ * @return the receiver's tool tip text
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getToolTipText () {
+ checkWidget();
+ return toolTipText;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible, and
+ * <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getVisible () {
+ checkWidget();
+ return (state & HIDDEN) == 0;
+}
+
+boolean hasBorder () {
+ return (style & SWT.BORDER) != 0;
+}
+
+boolean hasFocus () {
+ return this == display.getFocusControl ();
+}
+
+/**
+ * Invokes platform specific functionality to allocate a new GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Control</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param data the platform specific GC data
+ * @return the platform specific GC handle
+ */
+public int internal_new_GC (GCData data) {
+ checkWidget();
+ int context = 0;
+ if (data != null && data.paintRect != null) {
+ context = NSGraphicsContext.currentContext().id;
+ } else {
+ context = NSGraphicsContext.graphicsContextWithWindow(view.window()).id;
+ }
+ if (data != null) {
+ int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+ if ((data.style & mask) == 0) {
+ data.style |= style & (mask | SWT.MIRRORED);
+ }
+ data.device = display;
+ data.view = view;
+ data.foreground = getForegroundColor ().handle;
+ Control control = findBackgroundControl ();
+ if (control == null) control = this;
+ data.background = control.getBackgroundColor ().handle;
+ data.font = font != null ? font : defaultFont ();
+ }
+ return context;
+}
+
+/**
+ * Invokes platform specific functionality to dispose a GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Control</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param hDC the platform specific GC handle
+ * @param data the platform specific GC data
+ */
+public void internal_dispose_GC (int context, GCData data) {
+ checkWidget ();
+}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled and all
+ * ancestors up to and including the receiver's nearest ancestor
+ * shell are enabled. Otherwise, <code>false</code> is returned.
+ * A disabled control is typically not selectable from the user
+ * interface and draws with an inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getEnabled
+ */
+public boolean isEnabled () {
+ checkWidget();
+ return getEnabled () && parent.isEnabled ();
+}
+
+boolean isEnabledCursor () {
+ return isEnabled ();
+}
+
+boolean isFocusAncestor (Control control) {
+ while (control != null && control != this && !(control instanceof Shell)) {
+ control = control.parent;
+ }
+ return control == this;
+}
+
+/**
+ * Returns <code>true</code> if the receiver has the user-interface
+ * focus, and <code>false</code> otherwise.
+ *
+ * @return the receiver's focus state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean isFocusControl () {
+ checkWidget();
+// Control focusControl = display.focusControl;
+// if (focusControl != null && !focusControl.isDisposed ()) {
+// return this == focusControl;
+// }
+ return hasFocus ();
+}
+
+/**
+ * Returns <code>true</code> if the underlying operating
+ * system supports this reparenting, otherwise <code>false</code>
+ *
+ * @return <code>true</code> if the widget can be reparented, otherwise <code>false</code>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean isReparentable () {
+ checkWidget();
+ return true;
+}
+
+boolean isShowing () {
+ /*
+ * This is not complete. Need to check if the
+ * widget is obscurred by a parent or sibling.
+ */
+ if (!isVisible ()) return false;
+ Control control = this;
+ while (control != null) {
+ Point size = control.getSize ();
+ if (size.x == 0 || size.y == 0) {
+ return false;
+ }
+ control = control.parent;
+ }
+ return true;
+}
+
+boolean isTabGroup () {
+ Control [] tabList = parent._getTabList ();
+ if (tabList != null) {
+ for (int i=0; i<tabList.length; i++) {
+ if (tabList [i] == this) return true;
+ }
+ }
+ int code = traversalCode (0, 0);
+ if ((code & (SWT.TRAVERSE_ARROW_PREVIOUS | SWT.TRAVERSE_ARROW_NEXT)) != 0) return false;
+ return (code & (SWT.TRAVERSE_TAB_PREVIOUS | SWT.TRAVERSE_TAB_NEXT)) != 0;
+}
+
+boolean isTabItem () {
+ Control [] tabList = parent._getTabList ();
+ if (tabList != null) {
+ for (int i=0; i<tabList.length; i++) {
+ if (tabList [i] == this) return false;
+ }
+ }
+ int code = traversalCode (0, 0);
+ return (code & (SWT.TRAVERSE_ARROW_PREVIOUS | SWT.TRAVERSE_ARROW_NEXT)) != 0;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible and all
+ * ancestors up to and including the receiver's nearest ancestor
+ * shell are visible. Otherwise, <code>false</code> is returned.
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getVisible
+ */
+public boolean isVisible () {
+ checkWidget();
+ return getVisible () && parent.isVisible ();
+}
+
+int menuForEvent (int nsEvent) {
+ //TODO = get coordinates
+ int x = 0;
+ int y = 0;
+ Event event = new Event ();
+ event.x = x;
+ event.y = y;
+ sendEvent (SWT.MenuDetect, event);
+ if (!event.doit) return 0;
+ Menu menu = getMenu ();
+ if (menu != null && !menu.isDisposed ()) {
+ if (x != event.x || y != event.y) {
+ menu.setLocation (event.x, event.y);
+ }
+ return menu.nsMenu.id;
+ }
+ objc_super super_struct = new objc_super();
+ super_struct.receiver = view.id;
+ super_struct.cls = OS.objc_msgSend(view.id, OS.sel_superclass);
+ return OS.objc_msgSendSuper(super_struct, OS.sel_menuForEvent_1, nsEvent);
+}
+
+Decorations menuShell () {
+ return parent.menuShell ();
+}
+
+boolean setInputState (Event event, NSEvent nsEvent, int type) {
+ int modifierFlags = nsEvent.modifierFlags();
+ if ((modifierFlags & OS.NSAlternateKeyMask) != 0) event.stateMask |= SWT.ALT;
+ if ((modifierFlags & OS.NSShiftKeyMask) != 0) event.stateMask |= SWT.SHIFT;
+ if ((modifierFlags & OS.NSControlKeyMask) != 0) event.stateMask |= SWT.CONTROL;
+ if ((modifierFlags & OS.NSCommandKeyMask) != 0) event.stateMask |= SWT.COMMAND;
+
+ //WRONG
+ if ((modifierFlags & OS.NSLeftMouseDownMask) != 0) event.stateMask |= SWT.BUTTON1;
+ if ((modifierFlags & OS.NSLeftMouseDraggedMask) != 0) event.stateMask |= SWT.BUTTON1;
+ if ((modifierFlags & OS.NSLeftMouseUpMask) != 0) event.stateMask |= SWT.BUTTON1;
+ if ((modifierFlags & OS.NSOtherMouseDownMask) != 0) event.stateMask |= SWT.BUTTON2;
+ if ((modifierFlags & OS.NSOtherMouseDraggedMask) != 0) event.stateMask |= SWT.BUTTON2;
+ if ((modifierFlags & OS.NSOtherMouseUpMask) != 0) event.stateMask |= SWT.BUTTON1;
+ if ((modifierFlags & OS.NSRightMouseDownMask) != 0) event.stateMask |= SWT.BUTTON3;
+ if ((modifierFlags & OS.NSRightMouseDraggedMask) != 0) event.stateMask |= SWT.BUTTON3;
+ if ((modifierFlags & OS.NSRightMouseUpMask) != 0) event.stateMask |= SWT.BUTTON3;
+
+// if (OS.GetKeyState (OS.VK_XBUTTON1) < 0) event.stateMask |= SWT.BUTTON4;
+// if (OS.GetKeyState (OS.VK_XBUTTON2) < 0) event.stateMask |= SWT.BUTTON5;
+// switch (type) {
+// case SWT.MouseDown:
+// case SWT.MouseDoubleClick:
+// if (event.button == 1) event.stateMask &= ~SWT.BUTTON1;
+// if (event.button == 2) event.stateMask &= ~SWT.BUTTON2;
+// if (event.button == 3) event.stateMask &= ~SWT.BUTTON3;
+// if (event.button == 4) event.stateMask &= ~SWT.BUTTON4;
+// if (event.button == 5) event.stateMask &= ~SWT.BUTTON5;
+// break;
+// case SWT.MouseUp:
+// if (event.button == 1) event.stateMask |= SWT.BUTTON1;
+// if (event.button == 2) event.stateMask |= SWT.BUTTON2;
+// if (event.button == 3) event.stateMask |= SWT.BUTTON3;
+// if (event.button == 4) event.stateMask |= SWT.BUTTON4;
+// if (event.button == 5) event.stateMask |= SWT.BUTTON5;
+// break;
+// case SWT.KeyDown:
+// case SWT.Traverse:
+// if (event.keyCode == SWT.ALT) event.stateMask &= ~SWT.ALT;
+// if (event.keyCode == SWT.SHIFT) event.stateMask &= ~SWT.SHIFT;
+// if (event.keyCode == SWT.CONTROL) event.stateMask &= ~SWT.CONTROL;
+// break;
+// case SWT.KeyUp:
+// if (event.keyCode == SWT.ALT) event.stateMask |= SWT.ALT;
+// if (event.keyCode == SWT.SHIFT) event.stateMask |= SWT.SHIFT;
+// if (event.keyCode == SWT.CONTROL) event.stateMask |= SWT.CONTROL;
+// break;
+// }
+ return true;
+}
+
+void sendMouseEvent (NSEvent nsEvent, int type, int button) {
+ Event event = new Event ();
+ event.button = button;
+// event.detail = detail;
+ event.count = nsEvent.clickCount();
+ NSPoint location = nsEvent.locationInWindow();
+ NSPoint point = view.convertPoint_fromView_(location, null);
+ event.x = (int) point.x;
+ event.y = (int) point.y;
+ setInputState (event, nsEvent, type);
+ sendEvent (type, event);
+}
+
+void mouseDown(int theEvent) {
+ NSEvent nsEvent = new NSEvent (theEvent);
+ sendMouseEvent (nsEvent, SWT.MouseDown, 1);
+}
+
+void mouseDragged(int theEvent) {
+ NSEvent nsEvent = new NSEvent (theEvent);
+ sendMouseEvent (nsEvent, SWT.MouseMove, 1);
+}
+
+void mouseUp(int theEvent) {
+ NSEvent nsEvent = new NSEvent (theEvent);
+ sendMouseEvent (nsEvent, SWT.MouseUp, 1);
+}
+
+boolean sendKeyEvent (Event event) {
+ sendEvent (event);
+ return event.doit;
+}
+
+//TODO - missing modifier keys (see flagsChanged:)
+void sendKeyEvent (NSEvent nsEvent, int type) {
+ int count = 0;
+ NSString keys = nsEvent.characters();
+ //TODO - check lowercase doesn't mangle char codes
+ NSString keyCodes = nsEvent.charactersIgnoringModifiers().lowercaseString();
+ char [] chars = new char [keys.length()];
+ for (int i=0; i<keys.length(); i++) {
+ Event event = new Event ();
+ int keyCode = Display.translateKey (keys.characterAtIndex (i) & 0xFFFF);
+ if (keyCode != 0) {
+ event.keyCode = keyCode;
+ } else {
+ event.character = (char) keys.characterAtIndex (i);
+ //TODO - get unshifted vaules for Shift+1
+ event.keyCode = keyCodes.characterAtIndex (i);
+ }
+ setInputState (event, nsEvent, type);
+ if (sendKeyEvent (type, event)) {
+ chars [count++] = chars [i];
+ }
+ }
+// if (count == 0) return false;
+ if (count != keys.length () - 1) {
+// OS.SetEventParameter (theEvent, OS.kEventParamKeyUnicodes, OS.typeUnicodeText, count * 2, chars);
+ }
+}
+
+void keyDown(int theEvent) {
+ NSEvent nsEvent = new NSEvent (theEvent);
+ sendKeyEvent (nsEvent, SWT.KeyDown);
+}
+
+void keyUp(int theEvent) {
+ NSEvent nsEvent = new NSEvent (theEvent);
+ sendKeyEvent (nsEvent, SWT.KeyUp);
+}
+
+void markLayout (boolean changed, boolean all) {
+ /* Do nothing */
+}
+
+/**
+ * Moves the receiver above the specified control in the
+ * drawing order. If the argument is null, then the receiver
+ * is moved to the top of the drawing order. The control at
+ * the top of the drawing order will not be covered by other
+ * controls even if they occupy intersecting areas.
+ *
+ * @param control the sibling control (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Control#moveBelow
+ * @see Composite#getChildren
+ */
+public void moveAbove (Control control) {
+ checkWidget();
+ if (control != null) {
+ if (control.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ if (parent != control.parent) return;
+ }
+ setZOrder (control, true);
+}
+
+/**
+ * Moves the receiver below the specified control in the
+ * drawing order. If the argument is null, then the receiver
+ * is moved to the bottom of the drawing order. The control at
+ * the bottom of the drawing order will be covered by all other
+ * controls which occupy intersecting areas.
+ *
+ * @param control the sibling control (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Control#moveAbove
+ * @see Composite#getChildren
+ */
+public void moveBelow (Control control) {
+ checkWidget();
+ if (control != null) {
+ if (control.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ if (parent != control.parent) return;
+ }
+ setZOrder (control, false);
+}
+
+Accessible new_Accessible (Control control) {
+ return Accessible.internal_new_Accessible (this);
+}
+
+/**
+ * Causes the receiver to be resized to its preferred size.
+ * For a composite, this involves computing the preferred size
+ * from its layout, if there is one.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #computeSize(int, int, boolean)
+ */
+public void pack () {
+ checkWidget();
+ pack (true);
+}
+
+/**
+ * Causes the receiver to be resized to its preferred size.
+ * For a composite, this involves computing the preferred size
+ * from its layout, if there is one.
+ * <p>
+ * If the changed flag is <code>true</code>, it indicates that the receiver's
+ * <em>contents</em> have changed, therefore any caches that a layout manager
+ * containing the control may have been keeping need to be flushed. When the
+ * control is resized, the changed flag will be <code>false</code>, so layout
+ * manager caches can be retained.
+ * </p>
+ *
+ * @param changed whether or not the receiver's contents have changed
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #computeSize(int, int, boolean)
+ */
+public void pack (boolean changed) {
+ checkWidget();
+ setSize (computeSize (SWT.DEFAULT, SWT.DEFAULT, changed));
+}
+
+public boolean print (GC gc) {
+ checkWidget ();
+ if (gc == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (gc.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+// int [] outImage = new int [1];
+// CGRect outFrame = new CGRect ();
+// if (OS.HIViewCreateOffscreenImage (handle, 0, outFrame, outImage) == OS.noErr) {
+// int width = OS.CGImageGetWidth (outImage [0]);
+// int height = OS.CGImageGetHeight (outImage [0]);
+// CGRect rect = new CGRect();
+// rect.width = width;
+// rect.height = height;
+// //TODO - does not draw the browser (cocoa widgets?)
+// OS.HIViewDrawCGImage (gc.handle, rect, outImage [0]);
+// OS.CGImageRelease (outImage [0]);
+// }
+// return true;
+ return false;
+}
+
+/**
+ * Causes the entire bounds of the receiver to be marked
+ * as needing to be redrawn. The next time a paint request
+ * is processed, the control will be completely painted,
+ * including the background.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #update()
+ * @see PaintListener
+ * @see SWT#Paint
+ * @see SWT#NO_BACKGROUND
+ * @see SWT#NO_REDRAW_RESIZE
+ * @see SWT#NO_MERGE_PAINTS
+ * @see SWT#DOUBLE_BUFFERED
+ */
+public void redraw () {
+ checkWidget();
+ view.setNeedsDisplay(true);
+}
+
+void redraw (boolean children) {
+// checkWidget();
+
+}
+
+/**
+ * Causes the rectangular area of the receiver specified by
+ * the arguments to be marked as needing to be redrawn.
+ * The next time a paint request is processed, that area of
+ * the receiver will be painted, including the background.
+ * If the <code>all</code> flag is <code>true</code>, any
+ * children of the receiver which intersect with the specified
+ * area will also paint their intersecting areas. If the
+ * <code>all</code> flag is <code>false</code>, the children
+ * will not be painted.
+ *
+ * @param x the x coordinate of the area to draw
+ * @param y the y coordinate of the area to draw
+ * @param width the width of the area to draw
+ * @param height the height of the area to draw
+ * @param all <code>true</code> if children should redraw, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #update()
+ * @see PaintListener
+ * @see SWT#Paint
+ * @see SWT#NO_BACKGROUND
+ * @see SWT#NO_REDRAW_RESIZE
+ * @see SWT#NO_MERGE_PAINTS
+ * @see SWT#DOUBLE_BUFFERED
+ */
+public void redraw (int x, int y, int width, int height, boolean all) {
+ checkWidget ();
+ NSRect rect = new NSRect();
+ rect.x = x;
+ rect.y = y;
+ rect.width = width;
+ rect.height = height;
+ view.setNeedsDisplayInRect(rect);
+}
+
+void releaseHandle () {
+ super.releaseHandle ();
+ if (view != null) {
+ OS.objc_msgSend(view.id, OS.sel_setTag_1, -1);
+ view.release();
+ }
+ view = null;
+ parent = null;
+}
+
+void releaseParent () {
+// setVisible (topHandle (), false);
+ parent.removeControl (this);
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ if (menu != null && !menu.isDisposed ()) {
+ menu.dispose ();
+ }
+ menu = null;
+ layoutData = null;
+ if (accessible != null) {
+ accessible.internal_dispose_Accessible ();
+ }
+ accessible = null;
+ region = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is moved or resized.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ControlListener
+ * @see #addControlListener
+ */
+public void removeControlListener (ControlListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Move, listener);
+ eventTable.unhook (SWT.Resize, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when a drag gesture occurs.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see DragDetectListener
+ * @see #addDragDetectListener
+ *
+ * @since 3.3
+ */
+public void removeDragDetectListener(DragDetectListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.DragDetect, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control gains or loses focus.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see FocusListener
+ * @see #addFocusListener
+ */
+public void removeFocusListener(FocusListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook(SWT.FocusIn, listener);
+ eventTable.unhook(SWT.FocusOut, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the help events are generated for the control.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see HelpListener
+ * @see #addHelpListener
+ */
+public void removeHelpListener (HelpListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Help, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when keys are pressed and released on the system keyboard.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see KeyListener
+ * @see #addKeyListener
+ */
+public void removeKeyListener(KeyListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook(SWT.KeyUp, listener);
+ eventTable.unhook(SWT.KeyDown, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the platform-specific context menu trigger has
+ * occurred.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MenuDetectListener
+ * @see #addMenuDetectListener
+ *
+ * @since 3.3
+ */
+public void removeMenuDetectListener (MenuDetectListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.MenuDetect, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when mouse buttons are pressed and released.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MouseListener
+ * @see #addMouseListener
+ */
+public void removeMouseListener(MouseListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook(SWT.MouseDown, listener);
+ eventTable.unhook(SWT.MouseUp, listener);
+ eventTable.unhook(SWT.MouseDoubleClick, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the mouse moves.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MouseMoveListener
+ * @see #addMouseMoveListener
+ */
+public void removeMouseMoveListener(MouseMoveListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook(SWT.MouseMove, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the mouse passes or hovers over controls.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MouseTrackListener
+ * @see #addMouseTrackListener
+ */
+public void removeMouseTrackListener(MouseTrackListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.MouseEnter, listener);
+ eventTable.unhook (SWT.MouseExit, listener);
+ eventTable.unhook (SWT.MouseHover, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the mouse wheel is scrolled.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MouseWheelListener
+ * @see #addMouseWheelListener
+ *
+ * @since 3.3
+ */
+public void removeMouseWheelListener (MouseWheelListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.MouseWheel, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the receiver needs to be painted.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see PaintListener
+ * @see #addPaintListener
+ */
+public void removePaintListener(PaintListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook(SWT.Paint, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when traversal events occur.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see TraverseListener
+ * @see #addTraverseListener
+ */
+public void removeTraverseListener(TraverseListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Traverse, listener);
+}
+
+boolean sendDragEvent (int button, int stateMask, int x, int y) {
+ Event event = new Event ();
+ event.button = button;
+ event.x = x;
+ event.y = y;
+ event.stateMask = stateMask;
+ postEvent (SWT.DragDetect, event);
+ return event.doit;
+}
+
+boolean sendDragEvent (int button, int chord, int modifiers, int x, int y) {
+ Event event = new Event ();
+ switch (button) {
+ case 1: event.button = 1; break;
+ case 2: event.button = 3; break;
+ case 3: event.button = 2; break;
+ case 4: event.button = 4; break;
+ case 5: event.button = 5; break;
+ }
+ event.x = x;
+ event.y = y;
+ setInputState (event, SWT.DragDetect, chord, modifiers);
+ postEvent (SWT.DragDetect, event);
+ return event.doit;
+}
+
+void sendFocusEvent (int type, boolean post) {
+ Display display = this.display;
+ Shell shell = getShell ();
+ /*
+ * Feature in the Macintosh. GetKeyboardFocus() returns NULL during
+ * kEventControlSetFocusPart if the focus part is not kControlFocusNoPart.
+ * The fix is to remember the focus control and return it during
+ * kEventControlSetFocusPart.
+ */
+// display.focusControl = this;
+// display.focusEvent = type;
+ if (post) {
+ postEvent (type);
+ } else {
+ sendEvent (type);
+ }
+ /*
+ * It is possible that the shell may be
+ * disposed at this point. If this happens
+ * don't send the activate and deactivate
+ * events.
+ */
+ if (!shell.isDisposed ()) {
+ switch (type) {
+ case SWT.FocusIn:
+ shell.setActiveControl (this);
+ break;
+ case SWT.FocusOut:
+ if (shell != display.getActiveShell ()) {
+ shell.setActiveControl (null);
+ }
+ break;
+ }
+ }
+// display.focusEvent = SWT.None;
+// display.focusControl = null;
+}
+
+boolean sendMouseEvent (int type, short button, int count, int detail, boolean send, int theEvent) {
+// CGPoint pt = new CGPoint ();
+// OS.GetEventParameter (theEvent, OS.kEventParamWindowMouseLocation, OS.typeHIPoint, null, CGPoint.sizeof, null, pt);
+// OS.HIViewConvertPoint (pt, 0, handle);
+// int x = (int) pt.x;
+// int y = (int) pt.y;
+// display.lastX = x;
+// display.lastY = y;
+// int [] chord = new int [1];
+// OS.GetEventParameter (theEvent, OS.kEventParamMouseChord, OS.typeUInt32, null, 4, null, chord);
+// int [] modifiers = new int [1];
+// OS.GetEventParameter (theEvent, OS.kEventParamKeyModifiers, OS.typeUInt32, null, 4, null, modifiers);
+// return sendMouseEvent (type, button, count, detail, send, chord [0], (short) x, (short) y, modifiers [0]);
+ return false;
+}
+
+boolean sendMouseEvent (int type, short button, int count, boolean send, int chord, short x, short y, int modifiers) {
+ return sendMouseEvent (type, button, count, 0, send, chord, x, y, modifiers);
+}
+
+boolean sendMouseEvent (int type, short button, int count, int detail, boolean send, int chord, short x, short y, int modifiers) {
+ if (!hooks (type) && !filters (type)) return true;
+ Event event = new Event ();
+ switch (button) {
+ case 1: event.button = 1; break;
+ case 2: event.button = 3; break;
+ case 3: event.button = 2; break;
+ case 4: event.button = 4; break;
+ case 5: event.button = 5; break;
+ }
+ event.x = x;
+ event.y = y;
+ event.count = count;
+ event.detail = detail;
+ setInputState (event, type, chord, modifiers);
+ if (send) {
+ sendEvent (type, event);
+ if (isDisposed ()) return false;
+ } else {
+ postEvent (type, event);
+ }
+ return event.doit;
+}
+
+boolean sendMouseWheel (short wheelAxis, int wheelDelta) {
+ return false;
+}
+
+void setBackground () {
+// redrawWidget (handle, false);
+}
+
+/**
+ * Sets the receiver's background color to the color specified
+ * by the argument, or to the default system color for the control
+ * if the argument is null.
+ * <p>
+ * Note: This operation is a hint and may be overridden by the platform.
+ * For example, on Windows the background of a Button cannot be changed.
+ * </p>
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setBackground (Color color) {
+ checkWidget();
+ if (color != null) {
+ if (color.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+// if (equals (background, this.background)) return;
+ this.background = color;
+ setBackground (color != null ? color.handle : null);
+// redrawWidget (handle, false);
+}
+
+/**
+ * Sets the receiver's background image to the image specified
+ * by the argument, or to the default system color for the control
+ * if the argument is null. The background image is tiled to fill
+ * the available space.
+ * <p>
+ * Note: This operation is a hint and may be overridden by the platform.
+ * For example, on Windows the background of a Button cannot be changed.
+ * </p>
+ * @param image the new image (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument is not a bitmap</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setBackgroundImage (Image image) {
+ checkWidget();
+ if (image != null && image.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ if (image == backgroundImage) return;
+ backgroundImage = image;
+// redrawWidget (handle, false);
+}
+
+void setBackground (float [] color) {
+}
+
+void setBackground (int control, float [] color) {
+// ControlFontStyleRec fontStyle = new ControlFontStyleRec ();
+// OS.GetControlData (control, (short) OS.kControlEntireControl, OS.kControlFontStyleTag, ControlFontStyleRec.sizeof, fontStyle, null);
+// if (color != null) {
+// fontStyle.backColor_red = (short) (color [0] * 0xffff);
+// fontStyle.backColor_green = (short) (color [1] * 0xffff);
+// fontStyle.backColor_blue = (short) (color [2] * 0xffff);
+// fontStyle.flags |= OS.kControlUseBackColorMask;
+// } else {
+// fontStyle.flags &= ~OS.kControlUseBackColorMask;
+// }
+// OS.SetControlFontStyle (control, fontStyle);
+}
+
+/**
+ * Sets the receiver's size and location to the rectangular
+ * area specified by the arguments. The <code>x</code> and
+ * <code>y</code> arguments are relative to the receiver's
+ * parent (or its display if its parent is null), unless
+ * the receiver is a shell. In this case, the <code>x</code>
+ * and <code>y</code> arguments are relative to the display.
+ * <p>
+ * Note: Attempting to set the width or height of the
+ * receiver to a negative number will cause that
+ * value to be set to zero instead.
+ * </p>
+ *
+ * @param x the new x coordinate for the receiver
+ * @param y the new y coordinate for the receiver
+ * @param width the new width for the receiver
+ * @param height the new height for the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setBounds (int x, int y, int width, int height) {
+ checkWidget();
+ setBounds (x, y, Math.max (0, width), Math.max (0, height), true, true);
+}
+
+int setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
+ int result = 0;
+ NSView topView = topView();
+ NSRect rect = topView.frame();
+ if (move && resize) {
+ if (rect.x != x || rect.y != y) result |= MOVED;
+ if (rect.width != width || rect.height != height) result |= RESIZED;
+ if (result != 0) {
+ rect.x = x;
+ rect.y = y;
+ rect.width = width;
+ rect.height = height;
+ topView.setFrame (rect);
+ }
+ } else if (move) {
+ if (rect.x != x || rect.y != y) {
+ result |= MOVED;
+ NSPoint point = new NSPoint();
+ point.x = x;
+ point.y = y;
+ topView.setFrameOrigin(point);
+ }
+ } else if (resize) {
+ if (rect.width != width || rect.height != height) {
+ result |= RESIZED;
+ NSSize size = new NSSize();
+ size.width = width;
+ size.height = height;
+ topView.setFrameSize(size);
+ }
+ }
+ if ((result & MOVED) != 0) {
+ sendEvent(SWT.Move);
+ }
+ if ((result & RESIZED) != 0) {
+ sendEvent(SWT.Resize);
+ }
+ return result;
+}
+
+/**
+ * Sets the receiver's size and location to the rectangular
+ * area specified by the argument. The <code>x</code> and
+ * <code>y</code> fields of the rectangle are relative to
+ * the receiver's parent (or its display if its parent is null).
+ * <p>
+ * Note: Attempting to set the width or height of the
+ * receiver to a negative number will cause that
+ * value to be set to zero instead.
+ * </p>
+ *
+ * @param rect the new bounds for the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setBounds (Rectangle rect) {
+ checkWidget ();
+ if (rect == null) error (SWT.ERROR_NULL_ARGUMENT);
+ setBounds (rect.x, rect.y, Math.max (0, rect.width), Math.max (0, rect.height), true, true);
+}
+
+/**
+ * If the argument is <code>true</code>, causes the receiver to have
+ * all mouse events delivered to it until the method is called with
+ * <code>false</code> as the argument.
+ *
+ * @param capture <code>true</code> to capture the mouse, and <code>false</code> to release it
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setCapture (boolean capture) {
+ checkWidget();
+}
+
+/**
+ * Sets the receiver's cursor to the cursor specified by the
+ * argument, or to the default cursor for that kind of control
+ * if the argument is null.
+ * <p>
+ * When the mouse pointer passes over a control its appearance
+ * is changed to match the control's cursor.
+ * </p>
+ *
+ * @param cursor the new cursor (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setCursor (Cursor cursor) {
+ checkWidget();
+ if (cursor != null && cursor.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ this.cursor = cursor;
+ //TODO null
+ view.addCursorRect(view.frame(), cursor.handle);
+}
+
+void setDefaultFont () {
+// if (display.smallFonts) setFontStyle (defaultFont ());
+}
+
+/**
+ * Sets the receiver's drag detect state. If the argument is
+ * <code>true</code>, the receiver will detect drag gestures,
+ * otherwise these gestures will be ignored.
+ *
+ * @param dragDetect the new drag detect state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public void setDragDetect (boolean dragDetect) {
+ checkWidget ();
+ if (dragDetect) {
+ state |= DRAG_DETECT;
+ } else {
+ state &= ~DRAG_DETECT;
+ }
+}
+
+/**
+ * Enables the receiver if the argument is <code>true</code>,
+ * and disables it otherwise. A disabled control is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ *
+ * @param enabled the new enabled state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setEnabled (boolean enabled) {
+ checkWidget();
+ if (((state & DISABLED) == 0) == enabled) return;
+ Control control = null;
+ boolean fixFocus = false;
+ if (!enabled) {
+// if (display.focusEvent != SWT.FocusOut) {
+ control = display.getFocusControl ();
+ fixFocus = isFocusAncestor (control);
+// }
+ }
+ if (enabled) {
+ state &= ~DISABLED;
+ } else {
+ state |= DISABLED;
+ }
+ enableWidget (enabled);
+ if (fixFocus) fixFocus (control);
+}
+
+/**
+ * Causes the receiver to have the <em>keyboard focus</em>,
+ * such that all keyboard events will be delivered to it. Focus
+ * reassignment will respect applicable platform constraints.
+ *
+ * @return <code>true</code> if the control got focus, and <code>false</code> if it was unable to.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #forceFocus
+ */
+public boolean setFocus () {
+ checkWidget();
+ if ((style & SWT.NO_FOCUS) != 0) return false;
+ return forceFocus ();
+}
+
+/**
+ * Sets the font that the receiver will use to paint textual information
+ * to the font specified by the argument, or to the default font for that
+ * kind of control if the argument is null.
+ *
+ * @param font the new font (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setFont (Font font) {
+ checkWidget();
+ if (font != null) {
+ if (font.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ this.font = font;
+ setFont (font != null ? font.handle : defaultFont().handle);
+}
+
+void setFont (NSFont font) {
+ //TODO - bad cast
+ if (view instanceof NSControl) {
+ ((NSControl)view).setFont(font);
+ }
+}
+
+/**
+ * Sets the receiver's foreground color to the color specified
+ * by the argument, or to the default system color for the control
+ * if the argument is null.
+ * <p>
+ * Note: This operation is a hint and may be overridden by the platform.
+ * </p>
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setForeground (Color color) {
+ checkWidget();
+ if (color != null) {
+ if (color.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+// if (equals (foreground, this.foreground)) return;
+ this.foreground = color;
+ setForeground (color != null ? color.handle : null);
+// redrawWidget (handle, false);
+}
+
+void setForeground (float [] color) {
+}
+
+void setForeground (int control, float [] color) {
+// ControlFontStyleRec fontStyle = new ControlFontStyleRec ();
+// OS.GetControlData (control, (short) OS.kControlEntireControl, OS.kControlFontStyleTag, ControlFontStyleRec.sizeof, fontStyle, null);
+// if (color != null) {
+// fontStyle.foreColor_red = (short) (color [0] * 0xffff);
+// fontStyle.foreColor_green = (short) (color [1] * 0xffff);
+// fontStyle.foreColor_blue = (short) (color [2] * 0xffff);
+// fontStyle.flags |= OS.kControlUseForeColorMask;
+// } else {
+// fontStyle.flags &= ~OS.kControlUseForeColorMask;
+// }
+// OS.SetControlFontStyle (control, fontStyle);
+}
+
+/**
+ * Sets the layout data associated with the receiver to the argument.
+ *
+ * @param layoutData the new layout data for the receiver.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLayoutData (Object layoutData) {
+ checkWidget();
+ this.layoutData = layoutData;
+}
+
+/**
+ * Sets the receiver's location to the point specified by
+ * the arguments which are relative to the receiver's
+ * parent (or its display if its parent is null), unless
+ * the receiver is a shell. In this case, the point is
+ * relative to the display.
+ *
+ * @param x the new x coordinate for the receiver
+ * @param y the new y coordinate for the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLocation (int x, int y) {
+ checkWidget();
+ setBounds (x, y, 0, 0, true, false);
+}
+
+/**
+ * Sets the receiver's location to the point specified by
+ * the arguments which are relative to the receiver's
+ * parent (or its display if its parent is null), unless
+ * the receiver is a shell. In this case, the point is
+ * relative to the display.
+ *
+ * @param location the new location for the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLocation (Point location) {
+ checkWidget();
+ if (location == null) error (SWT.ERROR_NULL_ARGUMENT);
+ setBounds (location.x, location.y, 0, 0, true, false);
+}
+
+/**
+ * Sets the receiver's pop up menu to the argument.
+ * All controls may optionally have a pop up
+ * menu that is displayed when the user requests one for
+ * the control. The sequence of key strokes, button presses
+ * and/or button releases that are used to request a pop up
+ * menu is platform specific.
+ * <p>
+ * Note: Disposing of a control that has a pop up menu will
+ * dispose of the menu. To avoid this behavior, set the
+ * menu to null before the control is disposed.
+ * </p>
+ *
+ * @param menu the new pop up menu
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_MENU_NOT_POP_UP - the menu is not a pop up menu</li>
+ * <li>ERROR_INVALID_PARENT - if the menu is not in the same widget tree</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the menu has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMenu (Menu menu) {
+ checkWidget();
+ if (menu != null) {
+ if (menu.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ if ((menu.style & SWT.POP_UP) == 0) {
+ error (SWT.ERROR_MENU_NOT_POP_UP);
+ }
+ if (menu.parent != menuShell ()) {
+ error (SWT.ERROR_INVALID_PARENT);
+ }
+ }
+ this.menu = menu;
+ NSMenu nsMenu = menu != null ? menu.nsMenu : null;
+ ((NSView)view).setMenu(nsMenu);
+}
+
+/**
+ * Changes the parent of the widget to be the one provided if
+ * the underlying operating system supports this feature.
+ * Returns <code>true</code> if the parent is successfully changed.
+ *
+ * @param parent the new parent for the control.
+ * @return <code>true</code> if the parent is changed and <code>false</code> otherwise.
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is <code>null</code></li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean setParent (Composite parent) {
+ checkWidget();
+ if (parent == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (parent.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
+ if (this.parent == parent) return true;
+ if (!isReparentable ()) return false;
+ releaseParent ();
+ Shell newShell = parent.getShell (), oldShell = getShell ();
+ Decorations newDecorations = parent.menuShell (), oldDecorations = menuShell ();
+ if (oldShell != newShell || oldDecorations != newDecorations) {
+ Menu [] menus = oldShell.findMenus (this);
+ fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus);
+ }
+// int topHandle = topHandle ();
+// OS.HIViewAddSubview (parent.handle, topHandle);
+// OS.HIViewSetVisible (topHandle, (state & HIDDEN) == 0);
+// OS.HIViewSetZOrder (topHandle, OS.kHIViewZOrderBelow, 0);
+ this.parent = parent;
+ return true;
+}
+
+/**
+ * If the argument is <code>false</code>, causes subsequent drawing
+ * operations in the receiver to be ignored. No drawing of any kind
+ * can occur in the receiver until the flag is set to true.
+ * Graphics operations that occurred while the flag was
+ * <code>false</code> are lost. When the flag is set to <code>true</code>,
+ * the entire widget is marked as needing to be redrawn. Nested calls
+ * to this method are stacked.
+ * <p>
+ * Note: This operation is a hint and may not be supported on some
+ * platforms or for some widgets.
+ * </p>
+ *
+ * @param redraw the new redraw state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #redraw(int, int, int, int, boolean)
+ * @see #update()
+ */
+public void setRedraw (boolean redraw) {
+ checkWidget();
+ if (redraw) {
+ if (--drawCount == 0) {
+// OS.HIViewSetDrawingEnabled (handle, true);
+// invalidateVisibleRegion (handle);
+// redrawWidget (handle, true);
+ }
+ } else {
+ if (drawCount == 0) {
+// OS.HIViewSetDrawingEnabled (handle, false);
+// invalidateVisibleRegion (handle);
+ }
+ drawCount++;
+ }
+}
+
+public void setRegion (Region region) {
+ checkWidget ();
+ if (region != null && region.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+ this.region = region;
+// redrawWidget (handle, true);
+}
+
+boolean setRadioSelection (boolean value){
+ return false;
+}
+
+/**
+ * Sets the receiver's size to the point specified by the arguments.
+ * <p>
+ * Note: Attempting to set the width or height of the
+ * receiver to a negative number will cause that
+ * value to be set to zero instead.
+ * </p>
+ *
+ * @param width the new width for the receiver
+ * @param height the new height for the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSize (int width, int height) {
+ checkWidget();
+ setBounds (0, 0, Math.max (0, width), Math.max (0, height), false, true);
+}
+
+/**
+ * Sets the receiver's size to the point specified by the argument.
+ * <p>
+ * Note: Attempting to set the width or height of the
+ * receiver to a negative number will cause them to be
+ * set to zero instead.
+ * </p>
+ *
+ * @param size the new size for the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSize (Point size) {
+ checkWidget ();
+ if (size == null) error (SWT.ERROR_NULL_ARGUMENT);
+ setBounds (0, 0, Math.max (0, size.x), Math.max (0, size.y), false, true);
+}
+
+boolean setTabGroupFocus () {
+ return setTabItemFocus ();
+}
+
+boolean setTabItemFocus () {
+ if (!isShowing ()) return false;
+ return forceFocus ();
+}
+
+/**
+ * Sets the receiver's tool tip text to the argument, which
+ * may be null indicating that no tool tip text should be shown.
+ *
+ * @param string the new tool tip text (or null)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setToolTipText (String string) {
+ checkWidget();
+ toolTipText = string;
+ view.setToolTip(NSString.stringWith(string));
+}
+
+/**
+ * Marks the receiver as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param visible the new visibility state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setVisible (boolean visible) {
+ checkWidget();
+ if (visible) {
+ if ((state & HIDDEN) == 0) return;
+ state &= ~HIDDEN;
+ } else {
+ if ((state & HIDDEN) != 0) return;
+ state |= HIDDEN;
+ }
+ if (visible) {
+ /*
+ * It is possible (but unlikely), that application
+ * code could have disposed the widget in the show
+ * event. If this happens, just return.
+ */
+ sendEvent (SWT.Show);
+ if (isDisposed ()) return;
+ }
+
+ /*
+ * Feature in the Macintosh. If the receiver has focus, hiding
+ * the receiver causes no control to have focus. Also, the focus
+ * needs to be cleared from any TXNObject so that it stops blinking
+ * the caret. The fix is to assign focus to the first ancestor
+ * control that takes focus. If no control will take focus, clear
+ * the focus control.
+ */
+ Control control = null;
+ boolean fixFocus = false;
+ if (!visible) {
+// if (display.focusEvent != SWT.FocusOut) {
+ control = display.getFocusControl ();
+ fixFocus = isFocusAncestor (control);
+// }
+ }
+ topView().setHidden(!visible);
+ if (!visible) {
+ /*
+ * It is possible (but unlikely), that application
+ * code could have disposed the widget in the show
+ * event. If this happens, just return.
+ */
+ sendEvent (SWT.Hide);
+ if (isDisposed ()) return;
+ }
+ if (fixFocus) fixFocus (control);
+}
+
+void setZOrder () {
+// int topHandle = topHandle ();
+// int parentHandle = parent.handle;
+// OS.HIViewAddSubview (parentHandle, topHandle);
+// OS.HIViewSetZOrder (topHandle, OS.kHIViewZOrderBelow, 0);
+// Rect rect = getInset ();
+// rect.right = rect.left;
+// rect.bottom = rect.top;
+// OS.SetControlBounds (topHandle, rect);
+}
+
+void setZOrder (Control control, boolean above) {
+// int otherControl = control == null ? 0 : control.topHandle ();
+// setZOrder (topHandle (), otherControl, above);
+}
+
+void sort (int [] items) {
+ /* Shell Sort from K&R, pg 108 */
+ int length = items.length;
+ for (int gap=length/2; gap>0; gap/=2) {
+ for (int i=gap; i<length; i++) {
+ for (int j=i-gap; j>=0; j-=gap) {
+ if (items [j] <= items [j + gap]) {
+ int swap = items [j];
+ items [j] = items [j + gap];
+ items [j + gap] = swap;
+ }
+ }
+ }
+ }
+}
+
+/**
+ * Returns a point which is the result of converting the
+ * argument, which is specified in display relative coordinates,
+ * to coordinates relative to the receiver.
+ * <p>
+ * @param x the x coordinate to be translated
+ * @param y the y coordinate to be translated
+ * @return the translated coordinates
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public Point toControl (int x, int y) {
+ checkWidget();
+ return display.map (null, this, x, y);
+}
+
+/**
+ * Returns a point which is the result of converting the
+ * argument, which is specified in display relative coordinates,
+ * to coordinates relative to the receiver.
+ * <p>
+ * @param point the point to be translated (must not be null)
+ * @return the translated coordinates
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point toControl (Point point) {
+ checkWidget();
+ if (point == null) error (SWT.ERROR_NULL_ARGUMENT);
+ return toControl (point.x, point.y);
+}
+
+/**
+ * Returns a point which is the result of converting the
+ * argument, which is specified in coordinates relative to
+ * the receiver, to display relative coordinates.
+ * <p>
+ * @param x the x coordinate to be translated
+ * @param y the y coordinate to be translated
+ * @return the translated coordinates
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public Point toDisplay (int x, int y) {
+ checkWidget();
+ return display.map (this, null, x, y);
+}
+
+/**
+ * Returns a point which is the result of converting the
+ * argument, which is specified in coordinates relative to
+ * the receiver, to display relative coordinates.
+ * <p>
+ * @param point the point to be translated (must not be null)
+ * @return the translated coordinates
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point toDisplay (Point point) {
+ checkWidget();
+ if (point == null) error (SWT.ERROR_NULL_ARGUMENT);
+ return toDisplay (point.x, point.y);
+}
+
+NSView topView () {
+ return view;
+}
+
+boolean translateTraversal (int key, int theEvent, boolean [] consume) {
+ int detail = SWT.TRAVERSE_NONE;
+ int code = traversalCode (key, theEvent);
+ boolean all = false;
+ switch (key) {
+ case 53: /* Esc */ {
+ all = true;
+ detail = SWT.TRAVERSE_ESCAPE;
+ break;
+ }
+ case 76: /* KP Enter */
+ case 36: /* Return */ {
+ all = true;
+ detail = SWT.TRAVERSE_RETURN;
+ break;
+ }
+ case 48: /* Tab */ {
+// int [] modifiers = new int [1];
+// OS.GetEventParameter (theEvent, OS.kEventParamKeyModifiers, OS.typeUInt32, null, 4, null, modifiers);
+// boolean next = (modifiers [0] & OS.shiftKey) == 0;
+// detail = next ? SWT.TRAVERSE_TAB_NEXT : SWT.TRAVERSE_TAB_PREVIOUS;
+ break;
+ }
+ case 126: /* Up arrow */
+ case 123: /* Left arrow */
+ case 125: /* Down arrow */
+ case 124: /* Right arrow */ {
+ boolean next = key == 125 /* Down arrow */ || key == 124 /* Right arrow */;
+ detail = next ? SWT.TRAVERSE_ARROW_NEXT : SWT.TRAVERSE_ARROW_PREVIOUS;
+ break;
+ }
+ case 116: /* Page up */
+ case 121: /* Page down */ {
+ all = true;
+// int [] modifiers = new int [1];
+// OS.GetEventParameter (theEvent, OS.kEventParamKeyModifiers, OS.typeUInt32, null, 4, null, modifiers);
+// if ((modifiers [0] & OS.controlKey) == 0) return false;
+// detail = key == 121 /* Page down */ ? SWT.TRAVERSE_PAGE_NEXT : SWT.TRAVERSE_PAGE_PREVIOUS;
+ break;
+ }
+ default:
+ return false;
+ }
+ Event event = new Event ();
+ event.doit = consume [0] = (code & detail) != 0;
+ event.detail = detail;
+ if (!setKeyState (event, SWT.Traverse, theEvent)) return false;
+ Shell shell = getShell ();
+ Control control = this;
+ do {
+ if (control.traverse (event)) return true;
+ if (!event.doit && control.hooks (SWT.Traverse)) {
+ return false;
+ }
+ if (control == shell) return false;
+ control = control.parent;
+ } while (all && control != null);
+ return false;
+}
+
+int traversalCode (int key, int theEvent) {
+ int code = SWT.TRAVERSE_RETURN | SWT.TRAVERSE_TAB_NEXT | SWT.TRAVERSE_TAB_PREVIOUS;
+ Shell shell = getShell ();
+ if (shell.parent != null) code |= SWT.TRAVERSE_ESCAPE;
+ return code;
+}
+
+boolean traverseMnemonic (char key) {
+ return false;
+}
+
+/**
+ * Based on the argument, perform one of the expected platform
+ * traversal action. The argument should be one of the constants:
+ * <code>SWT.TRAVERSE_ESCAPE</code>, <code>SWT.TRAVERSE_RETURN</code>,
+ * <code>SWT.TRAVERSE_TAB_NEXT</code>, <code>SWT.TRAVERSE_TAB_PREVIOUS</code>,
+ * <code>SWT.TRAVERSE_ARROW_NEXT</code> and <code>SWT.TRAVERSE_ARROW_PREVIOUS</code>.
+ *
+ * @param traversal the type of traversal
+ * @return true if the traversal succeeded
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean traverse (int traversal) {
+ checkWidget();
+ Event event = new Event ();
+ event.doit = true;
+ event.detail = traversal;
+ return traverse (event);
+}
+
+boolean traverse (Event event) {
+ sendEvent (SWT.Traverse, event);
+ if (isDisposed ()) return true;
+ if (!event.doit) return false;
+ switch (event.detail) {
+ case SWT.TRAVERSE_NONE: return true;
+ case SWT.TRAVERSE_ESCAPE: return traverseEscape ();
+ case SWT.TRAVERSE_RETURN: return traverseReturn ();
+ case SWT.TRAVERSE_TAB_NEXT: return traverseGroup (true);
+ case SWT.TRAVERSE_TAB_PREVIOUS: return traverseGroup (false);
+ case SWT.TRAVERSE_ARROW_NEXT: return traverseItem (true);
+ case SWT.TRAVERSE_ARROW_PREVIOUS: return traverseItem (false);
+ case SWT.TRAVERSE_MNEMONIC: return traverseMnemonic (event);
+ case SWT.TRAVERSE_PAGE_NEXT: return traversePage (true);
+ case SWT.TRAVERSE_PAGE_PREVIOUS: return traversePage (false);
+ }
+ return false;
+}
+
+boolean traverseEscape () {
+ return false;
+}
+
+boolean traverseGroup (boolean next) {
+ Control root = computeTabRoot ();
+ Control group = computeTabGroup ();
+ Control [] list = root.computeTabList ();
+ int length = list.length;
+ int index = 0;
+ while (index < length) {
+ if (list [index] == group) break;
+ index++;
+ }
+ /*
+ * It is possible (but unlikely), that application
+ * code could have disposed the widget in focus in
+ * or out events. Ensure that a disposed widget is
+ * not accessed.
+ */
+ if (index == length) return false;
+ int start = index, offset = (next) ? 1 : -1;
+ while ((index = ((index + offset + length) % length)) != start) {
+ Control control = list [index];
+ if (!control.isDisposed () && control.setTabGroupFocus ()) {
+ return true;
+ }
+ }
+ if (group.isDisposed ()) return false;
+ return group.setTabGroupFocus ();
+}
+
+boolean traverseItem (boolean next) {
+ Control [] children = parent._getChildren ();
+ int length = children.length;
+ int index = 0;
+ while (index < length) {
+ if (children [index] == this) break;
+ index++;
+ }
+ /*
+ * It is possible (but unlikely), that application
+ * code could have disposed the widget in focus in
+ * or out events. Ensure that a disposed widget is
+ * not accessed.
+ */
+ if (index == length) return false;
+ int start = index, offset = (next) ? 1 : -1;
+ while ((index = (index + offset + length) % length) != start) {
+ Control child = children [index];
+ if (!child.isDisposed () && child.isTabItem ()) {
+ if (child.setTabItemFocus ()) return true;
+ }
+ }
+ return false;
+}
+
+boolean traverseReturn () {
+ return false;
+}
+
+boolean traversePage (boolean next) {
+ return false;
+}
+
+boolean traverseMnemonic (Event event) {
+ return false;
+}
+
+/**
+ * Forces all outstanding paint requests for the widget
+ * to be processed before this method returns. If there
+ * are no outstanding paint request, this method does
+ * nothing.
+ * <p>
+ * Note: This method does not cause a redraw.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #redraw()
+ * @see #redraw(int, int, int, int, boolean)
+ * @see PaintListener
+ * @see SWT#Paint
+ */
+public void update () {
+ checkWidget();
+ update (false);
+}
+
+void update (boolean all) {
+// checkWidget();
+ //TODO - not all
+// OS.HIViewRender (handle);
+}
+
+void updateBackgroundMode () {
+ int oldState = state & PARENT_BACKGROUND;
+ checkBackground ();
+ if (oldState != (state & PARENT_BACKGROUND)) {
+ setBackground ();
+ }
+}
+
+void updateLayout (boolean all) {
+ /* Do nothing */
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java
new file mode 100755
index 0000000000..4a3bfb44e2
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DateTime.java
@@ -0,0 +1,435 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * Instances of this class are selectable user interface
+ * objects that allow the user to enter and modify date
+ * or time values.
+ * <p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to add children to it, or set a layout on it.
+ * </p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>DATE, TIME, CALENDAR, SHORT, MEDIUM, LONG</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles DATE, TIME, or CALENDAR may be specified,
+ * and only one of the styles SHORT, MEDIUM, or LONG may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @since 3.3
+ */
+public class DateTime extends Composite {
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#DATE
+ * @see SWT#TIME
+ * @see SWT#CALENDAR
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public DateTime (Composite parent, int style) {
+ super (parent, checkStyle (style));
+}
+
+static int checkStyle (int style) {
+ /*
+ * Even though it is legal to create this widget
+ * with scroll bars, they serve no useful purpose
+ * because they do not automatically scroll the
+ * widget's client area. The fix is to clear
+ * the SWT style.
+ */
+ style &= ~(SWT.H_SCROLL | SWT.V_SCROLL);
+ style = checkBits (style, SWT.MEDIUM, SWT.SHORT, SWT.LONG, 0, 0, 0);
+ return checkBits (style, SWT.DATE, SWT.TIME, SWT.CALENDAR, 0, 0, 0);
+}
+
+protected void checkSubclass () {
+ if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the user changes the control's value.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener (SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Selection, typedListener);
+ addListener (SWT.DefaultSelection, typedListener);
+}
+
+public Point computeSize (int wHint, int hHint, boolean changed) {
+ checkWidget ();
+ int width = 0, height = 0;
+ NSControl widget = (NSControl)view;
+ NSRect oldRect = widget.frame();
+ widget.sizeToFit();
+ NSRect newRect = widget.frame();
+ widget.setFrame (oldRect);
+ width = (int)newRect.width;
+ height = (int)newRect.height;
+ if (width == 0) width = DEFAULT_WIDTH;
+ if (height == 0) height = DEFAULT_HEIGHT;
+ if (wHint != SWT.DEFAULT) width = wHint;
+ if (hHint != SWT.DEFAULT) height = hHint;
+ int border = getBorderWidth ();
+ width += border * 2; height += border * 2;
+ return new Point (width, height);
+}
+
+void createHandle () {
+ NSDatePicker widget = (NSDatePicker)new SWTDatePicker().alloc();
+ widget.initWithFrame(new NSRect());
+ int pickerStyle = OS.NSTextFieldAndStepperDatePickerStyle;
+ int elementFlags = 0;
+ if ((style & SWT.CALENDAR) != 0) {
+ pickerStyle = OS.NSClockAndCalendarDatePickerStyle;
+ elementFlags = OS.NSYearMonthDayDatePickerElementFlag;
+ } else {
+ if ((style & SWT.TIME) != 0) {
+ elementFlags = (style & SWT.SHORT) != 0 ? OS.NSHourMinuteDatePickerElementFlag : OS.NSHourMinuteSecondDatePickerElementFlag;
+ }
+ if ((style & SWT.DATE) != 0) {
+ elementFlags = (style & SWT.SHORT) != 0 ? OS.NSYearMonthDatePickerElementFlag : OS.NSYearMonthDayDatePickerElementFlag;
+ }
+ }
+ widget.setDatePickerStyle(pickerStyle);
+ widget.setDatePickerElements(elementFlags);
+ NSDate date = NSCalendarDate.calendarDate();
+ widget.setDateValue(date);
+ widget.setTarget(widget);
+ widget.setAction(OS.sel_sendSelection);
+ widget.setTag(jniRef);
+ view = widget;
+ parent.contentView().addSubview_(widget);
+}
+
+/**
+ * Returns the receiver's date, or day of the month.
+ * <p>
+ * The first day of the month is 1, and the last day depends on the month and year.
+ * </p>
+ *
+ * @return a positive integer beginning with 1
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getDay () {
+ checkWidget ();
+ return new NSCalendarDate(((NSDatePicker)view).dateValue().id).dayOfMonth();
+}
+
+/**
+ * Returns the receiver's hours.
+ * <p>
+ * Hours is an integer between 0 and 23.
+ * </p>
+ *
+ * @return an integer between 0 and 23
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getHours () {
+ checkWidget ();
+ return new NSCalendarDate(((NSDatePicker)view).dateValue().id).hourOfDay();
+}
+
+/**
+ * Returns the receiver's minutes.
+ * <p>
+ * Minutes is an integer between 0 and 59.
+ * </p>
+ *
+ * @return an integer between 0 and 59
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMinutes () {
+ checkWidget ();
+ return new NSCalendarDate(((NSDatePicker)view).dateValue().id).minuteOfHour();
+}
+
+/**
+ * Returns the receiver's month.
+ * <p>
+ * The first month of the year is 0, and the last month is 11.
+ * </p>
+ *
+ * @return an integer between 0 and 11
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMonth () {
+ checkWidget ();
+ return new NSCalendarDate(((NSDatePicker)view).dateValue().id).monthOfYear();
+}
+
+/**
+ * Returns the receiver's seconds.
+ * <p>
+ * Seconds is an integer between 0 and 59.
+ * </p>
+ *
+ * @return an integer between 0 and 59
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSeconds () {
+ checkWidget ();
+ return new NSCalendarDate(((NSDatePicker)view).dateValue().id).secondOfMinute();
+}
+
+/**
+ * Returns the receiver's year.
+ * <p>
+ * The first year is 1752 and the last year is 9999.
+ * </p>
+ *
+ * @return an integer between 1752 and 9999
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getYear () {
+ checkWidget ();
+ return new NSCalendarDate(((NSDatePicker)view).dateValue().id).yearOfCommonEra();
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Selection, listener);
+ eventTable.unhook (SWT.DefaultSelection, listener);
+}
+
+void sendSelection () {
+ //TODO post
+ sendEvent (SWT.Selection);
+}
+
+/**
+ * Sets the receiver's date, or day of the month, to the specified day.
+ * <p>
+ * The first day of the month is 1, and the last day depends on the month and year.
+ * </p>
+ *
+ * @param day a positive integer beginning with 1
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setDay (int day) {
+ checkWidget ();
+ NSCalendarDate date = new NSCalendarDate(((NSDatePicker)view).dateValue().id);
+ NSCalendarDate newDate = NSCalendarDate.dateWithYear(date.yearOfCommonEra(), date.monthOfYear(), day,
+ date.hourOfDay(), date.minuteOfHour(), date.secondOfMinute(), date.timeZone());
+ ((NSDatePicker)view).setDateValue(newDate);
+}
+
+/**
+ * Sets the receiver's hours.
+ * <p>
+ * Hours is an integer between 0 and 23.
+ * </p>
+ *
+ * @param hours an integer between 0 and 23
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setHours (int hours) {
+ checkWidget ();
+ NSCalendarDate date = new NSCalendarDate(((NSDatePicker)view).dateValue().id);
+ NSCalendarDate newDate = NSCalendarDate.dateWithYear(date.yearOfCommonEra(), date.monthOfYear(), date.dayOfMonth(),
+ hours, date.minuteOfHour(), date.secondOfMinute(), date.timeZone());
+ ((NSDatePicker)view).setDateValue(newDate);
+}
+
+/**
+ * Sets the receiver's minutes.
+ * <p>
+ * Minutes is an integer between 0 and 59.
+ * </p>
+ *
+ * @param minutes an integer between 0 and 59
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMinutes (int minutes) {
+ checkWidget ();
+ NSCalendarDate date = new NSCalendarDate(((NSDatePicker)view).dateValue().id);
+ NSCalendarDate newDate = NSCalendarDate.dateWithYear(date.yearOfCommonEra(), date.monthOfYear(), date.dayOfMonth(),
+ date.hourOfDay(), minutes, date.secondOfMinute(), date.timeZone());
+ ((NSDatePicker)view).setDateValue(newDate);
+}
+
+/**
+ * Sets the receiver's month.
+ * <p>
+ * The first month of the year is 0, and the last month is 11.
+ * </p>
+ *
+ * @param month an integer between 0 and 11
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMonth (int month) {
+ checkWidget ();
+ NSCalendarDate date = new NSCalendarDate(((NSDatePicker)view).dateValue().id);
+ NSCalendarDate newDate = NSCalendarDate.dateWithYear(date.yearOfCommonEra(), date.monthOfYear(), month,
+ date.hourOfDay(), date.minuteOfHour(), date.secondOfMinute(), date.timeZone());
+ ((NSDatePicker)view).setDateValue(newDate);
+}
+
+/**
+ * Sets the receiver's seconds.
+ * <p>
+ * Seconds is an integer between 0 and 59.
+ * </p>
+ *
+ * @param seconds an integer between 0 and 59
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSeconds (int seconds) {
+ checkWidget ();
+ NSCalendarDate date = new NSCalendarDate(((NSDatePicker)view).dateValue().id);
+ NSCalendarDate newDate = NSCalendarDate.dateWithYear(date.yearOfCommonEra(), date.monthOfYear(), date.dayOfMonth(),
+ date.hourOfDay(), date.minuteOfHour(), seconds, date.timeZone());
+ ((NSDatePicker)view).setDateValue(newDate);
+}
+
+/**
+ * Sets the receiver's year.
+ * <p>
+ * The first year is 1752 and the last year is 9999.
+ * </p>
+ *
+ * @param year an integer between 1752 and 9999
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setYear (int year) {
+ checkWidget ();
+ NSCalendarDate date = new NSCalendarDate(((NSDatePicker)view).dateValue().id);
+ NSCalendarDate newDate = NSCalendarDate.dateWithYear(year, date.monthOfYear(), date.dayOfMonth(),
+ date.hourOfDay(), date.minuteOfHour(), date.secondOfMinute(), date.timeZone());
+ ((NSDatePicker)view).setDateValue(newDate);
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Decorations.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Decorations.java
new file mode 100755
index 0000000000..d3f4995fd8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Decorations.java
@@ -0,0 +1,680 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+
+/**
+ * Instances of this class provide the appearance and
+ * behavior of <code>Shells</code>, but are not top
+ * level shells or dialogs. Class <code>Shell</code>
+ * shares a significant amount of code with this class,
+ * and is a subclass.
+ * <p>
+ * IMPORTANT: This class was intended to be abstract and
+ * should <em>never</em> be referenced or instantiated.
+ * Instead, the class <code>Shell</code> should be used.
+ * </p>
+ * <p>
+ * Instances are always displayed in one of the maximized,
+ * minimized or normal states:
+ * <ul>
+ * <li>
+ * When an instance is marked as <em>maximized</em>, the
+ * window manager will typically resize it to fill the
+ * entire visible area of the display, and the instance
+ * is usually put in a state where it can not be resized
+ * (even if it has style <code>RESIZE</code>) until it is
+ * no longer maximized.
+ * </li><li>
+ * When an instance is in the <em>normal</em> state (neither
+ * maximized or minimized), its appearance is controlled by
+ * the style constants which were specified when it was created
+ * and the restrictions of the window manager (see below).
+ * </li><li>
+ * When an instance has been marked as <em>minimized</em>,
+ * its contents (client area) will usually not be visible,
+ * and depending on the window manager, it may be
+ * "iconified" (that is, replaced on the desktop by a small
+ * simplified representation of itself), relocated to a
+ * distinguished area of the screen, or hidden. Combinations
+ * of these changes are also possible.
+ * </li>
+ * </ul>
+ * </p>
+ * Note: The styles supported by this class must be treated
+ * as <em>HINT</em>s, since the window manager for the
+ * desktop on which the instance is visible has ultimate
+ * control over the appearance and behavior of decorations.
+ * For example, some window managers only support resizable
+ * windows and will always assume the RESIZE style, even if
+ * it is not set.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>BORDER, CLOSE, MIN, MAX, NO_TRIM, RESIZE, TITLE, ON_TOP, TOOL</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * Class <code>SWT</code> provides two "convenience constants"
+ * for the most commonly required style combinations:
+ * <dl>
+ * <dt><code>SHELL_TRIM</code></dt>
+ * <dd>
+ * the result of combining the constants which are required
+ * to produce a typical application top level shell: (that
+ * is, <code>CLOSE | TITLE | MIN | MAX | RESIZE</code>)
+ * </dd>
+ * <dt><code>DIALOG_TRIM</code></dt>
+ * <dd>
+ * the result of combining the constants which are required
+ * to produce a typical application dialog shell: (that
+ * is, <code>TITLE | CLOSE | BORDER</code>)
+ * </dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ *
+ * @see #getMinimized
+ * @see #getMaximized
+ * @see Shell
+ * @see SWT
+ */
+public class Decorations extends Canvas {
+ Image image;
+ Image [] images = new Image [0];
+ Menu menuBar;
+ String text = "";
+ boolean minimized, maximized;
+ Control savedFocus;
+ Button defaultButton;
+
+Decorations () {
+ /* Do nothing */
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#BORDER
+ * @see SWT#CLOSE
+ * @see SWT#MIN
+ * @see SWT#MAX
+ * @see SWT#RESIZE
+ * @see SWT#TITLE
+ * @see SWT#NO_TRIM
+ * @see SWT#SHELL_TRIM
+ * @see SWT#DIALOG_TRIM
+ * @see SWT#ON_TOP
+ * @see SWT#TOOL
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Decorations (Composite parent, int style) {
+ super (parent, checkStyle (style));
+}
+
+static int checkStyle (int style) {
+ if ((style & SWT.NO_TRIM) != 0) {
+ style &= ~(SWT.CLOSE | SWT.TITLE | SWT.MIN | SWT.MAX | SWT.RESIZE | SWT.BORDER);
+ }
+ if ((style & (SWT.MENU | SWT.MIN | SWT.MAX | SWT.CLOSE)) != 0) {
+ style |= SWT.TITLE;
+ }
+ return style;
+}
+
+void bringToTop (boolean force) {
+ moveAbove (null);
+}
+
+protected void checkSubclass () {
+ if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+int compare (ImageData data1, ImageData data2) {
+ if (data1.width == data2.width && data1.height == data2.height) {
+ int transparent1 = data1.getTransparencyType ();
+ int transparent2 = data2.getTransparencyType ();
+ if (transparent1 == SWT.TRANSPARENCY_ALPHA) return -1;
+ if (transparent2 == SWT.TRANSPARENCY_ALPHA) return 1;
+ if (transparent1 == SWT.TRANSPARENCY_MASK) return -1;
+ if (transparent2 == SWT.TRANSPARENCY_MASK) return 1;
+ if (transparent1 == SWT.TRANSPARENCY_PIXEL) return -1;
+ if (transparent2 == SWT.TRANSPARENCY_PIXEL) return 1;
+ return 0;
+ }
+ return data1.width > data2.width || data1.height > data2.height ? -1 : 1;
+}
+
+Control computeTabGroup () {
+ return this;
+}
+
+Control computeTabRoot () {
+ return this;
+}
+
+void fixDecorations (Decorations newDecorations, Control control, Menu [] menus) {
+ if (this == newDecorations) return;
+ if (control == savedFocus) savedFocus = null;
+ if (control == defaultButton) defaultButton = null;
+ if (menus == null) return;
+ Menu menu = control.menu;
+ if (menu != null) {
+ int index = 0;
+ while (index < menus.length) {
+ if (menus [index] == menu) {
+ control.setMenu (null);
+ return;
+ }
+ index++;
+ }
+ menu.fixMenus (newDecorations);
+ }
+}
+
+/**
+ * Returns the receiver's default button if one had
+ * previously been set, otherwise returns null.
+ *
+ * @return the default button or null
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setDefaultButton(Button)
+ */
+public Button getDefaultButton () {
+ checkWidget();
+ return defaultButton;
+}
+
+/**
+ * Returns the receiver's image if it had previously been
+ * set using <code>setImage()</code>. The image is typically
+ * displayed by the window manager when the instance is
+ * marked as iconified, and may also be displayed somewhere
+ * in the trim when the instance is in normal or maximized
+ * states.
+ * <p>
+ * Note: This method will return null if called before
+ * <code>setImage()</code> is called. It does not provide
+ * access to a window manager provided, "default" image
+ * even if one exists.
+ * </p>
+ *
+ * @return the image
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Image getImage () {
+ checkWidget();
+ return image;
+}
+
+/**
+ * Returns the receiver's images if they had previously been
+ * set using <code>setImages()</code>. Images are typically
+ * displayed by the window manager when the instance is
+ * marked as iconified, and may also be displayed somewhere
+ * in the trim when the instance is in normal or maximized
+ * states. Depending where the icon is displayed, the platform
+ * chooses the icon with the "best" attributes. It is expected
+ * that the array will contain the same icon rendered at different
+ * sizes, with different depth and transparency attributes.
+ *
+ * <p>
+ * Note: This method will return an empty array if called before
+ * <code>setImages()</code> is called. It does not provide
+ * access to a window manager provided, "default" image
+ * even if one exists.
+ * </p>
+ *
+ * @return the images
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Image [] getImages () {
+ checkWidget ();
+ if (images == null) return new Image [0];
+ Image [] result = new Image [images.length];
+ System.arraycopy (images, 0, result, 0, images.length);
+ return result;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is currently
+ * maximized, and false otherwise.
+ * <p>
+ *
+ * @return the maximized state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setMaximized
+ */
+public boolean getMaximized () {
+ checkWidget();
+ return maximized;
+}
+
+/**
+ * Returns the receiver's menu bar if one had previously
+ * been set, otherwise returns null.
+ *
+ * @return the menu bar or null
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Menu getMenuBar () {
+ checkWidget();
+ return menuBar;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is currently
+ * minimized, and false otherwise.
+ * <p>
+ *
+ * @return the minimized state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setMinimized
+ */
+public boolean getMinimized () {
+ checkWidget();
+ return minimized;
+}
+
+String getNameText () {
+ return getText ();
+}
+
+/**
+ * Returns the receiver's text, which is the string that the
+ * window manager will typically display as the receiver's
+ * <em>title</em>. If the text has not previously been set,
+ * returns an empty string.
+ *
+ * @return the text
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+ checkWidget();
+ return text;
+}
+
+public boolean isReparentable () {
+ checkWidget();
+ return false;
+}
+
+boolean isTabGroup () {
+ return true;
+}
+
+boolean isTabItem () {
+ return false;
+}
+
+Decorations menuShell () {
+ return this;
+}
+
+void releaseChildren (boolean destroy) {
+ if (menuBar != null) {
+ menuBar.dispose ();
+ menuBar = null;
+ }
+ Display display = this.display;
+ super.releaseChildren (destroy);
+ //TODO
+// Menu [] menus = display.getMenus (this);
+// if (menus != null) {
+// for (int i=0; i<menus.length; i++) {
+// Menu menu = menus [i];
+// if (menu != null && !menu.isDisposed ()) {
+// menu.dispose ();
+// }
+// }
+// menus = null;
+// }
+}
+void releaseWidget () {
+ super.releaseWidget ();
+ image = null;
+ images = null;
+ savedFocus = null;
+ defaultButton = null;
+}
+
+boolean restoreFocus () {
+ if (savedFocus != null && savedFocus.isDisposed ()) savedFocus = null;
+ if (savedFocus == null) return false;
+ return savedFocus.forceFocus ();
+}
+
+void saveFocus () {
+// int window = OS.GetControlOwner (handle);
+// Control control = display.getFocusControl (window, false);
+// if (control != null && control != this && this == control.menuShell ()) {
+// setSavedFocus (control);
+// }
+}
+
+/**
+ * If the argument is not null, sets the receiver's default
+ * button to the argument, and if the argument is null, sets
+ * the receiver's default button to the first button which
+ * was set as the receiver's default button (called the
+ * <em>saved default button</em>). If no default button had
+ * previously been set, or the saved default button was
+ * disposed, the receiver's default button will be set to
+ * null.
+ * <p>
+ * The default button is the button that is selected when
+ * the receiver is active and the user presses ENTER.
+ * </p>
+ *
+ * @param button the new default button
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the button has been disposed</li>
+ * <li>ERROR_INVALID_PARENT - if the control is not in the same widget tree</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setDefaultButton (Button button) {
+ checkWidget();
+ if (button != null) {
+ if (button.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ if (button.menuShell () != this) error (SWT.ERROR_INVALID_PARENT);
+ if ((button.style & SWT.PUSH) == 0) return;
+ }
+ if (button == defaultButton) return;
+ if (defaultButton != null) {
+ if (!defaultButton.isDisposed ()) defaultButton.setDefault (false);
+ }
+ defaultButton = button;
+ if (defaultButton != null) {
+ if (!defaultButton.isDisposed ()) defaultButton.setDefault (true);
+ }
+}
+
+/**
+ * Sets the receiver's image to the argument, which may
+ * be null. The image is typically displayed by the window
+ * manager when the instance is marked as iconified, and
+ * may also be displayed somewhere in the trim when the
+ * instance is in normal or maximized states.
+ *
+ * @param image the new image (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setImage (Image image) {
+ checkWidget();
+ if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
+ this.image = image;
+ if (parent != null) return;
+// if (display.dockImage == 0) {
+// if (image != null) {
+// OS.SetApplicationDockTileImage (image.handle);
+// } else {
+// OS.RestoreApplicationDockTileImage ();
+// }
+// }
+}
+
+/**
+ * Sets the receiver's images to the argument, which may
+ * be an empty array. Images are typically displayed by the
+ * window manager when the instance is marked as iconified,
+ * and may also be displayed somewhere in the trim when the
+ * instance is in normal or maximized states. Depending where
+ * the icon is displayed, the platform chooses the icon with
+ * the "best" attributes. It is expected that the array will
+ * contain the same icon rendered at different sizes, with
+ * different depth and transparency attributes.
+ *
+ * @param images the new image array
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the array of images is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if one of the images is null or has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setImages (Image [] images) {
+ checkWidget();
+ if (images == null) error(SWT.ERROR_INVALID_ARGUMENT);
+ for (int i = 0; i < images.length; i++) {
+ if (images [i] == null || images [i].isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ this.images = images;
+ if (parent != null) return;
+// if (display.dockImage == 0) {
+// if (images != null && images.length > 1) {
+// Image [] bestImages = new Image [images.length];
+// System.arraycopy (images, 0, bestImages, 0, images.length);
+// sort (bestImages);
+// images = bestImages;
+// }
+// OS.SetApplicationDockTileImage (images [0].handle);
+// }
+}
+
+/**
+ * Sets the maximized state of the receiver.
+ * If the argument is <code>true</code> causes the receiver
+ * to switch to the maximized state, and if the argument is
+ * <code>false</code> and the receiver was previously maximized,
+ * causes the receiver to switch back to either the minimized
+ * or normal states.
+ * <p>
+ * Note: The result of intermixing calls to <code>setMaximized(true)</code>
+ * and <code>setMinimized(true)</code> will vary by platform. Typically,
+ * the behavior will match the platform user's expectations, but not
+ * always. This should be avoided if possible.
+ * </p>
+ *
+ * @param maximized the new maximized state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setMinimized
+ */
+public void setMaximized (boolean maximized) {
+ checkWidget();
+ this.maximized = maximized;
+}
+
+/**
+ * Sets the receiver's menu bar to the argument, which
+ * may be null.
+ *
+ * @param menu the new menu bar
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the menu has been disposed</li>
+ * <li>ERROR_INVALID_PARENT - if the menu is not in the same widget tree</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMenuBar (Menu menu) {
+ checkWidget();
+ if (menuBar == menu) return;
+ if (menu != null) {
+ if (menu.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
+ if ((menu.style & SWT.BAR) == 0) error (SWT.ERROR_MENU_NOT_BAR);
+ if (menu.parent != this) error (SWT.ERROR_INVALID_PARENT);
+ }
+ menuBar = menu;
+}
+
+/**
+ * Sets the minimized stated of the receiver.
+ * If the argument is <code>true</code> causes the receiver
+ * to switch to the minimized state, and if the argument is
+ * <code>false</code> and the receiver was previously minimized,
+ * causes the receiver to switch back to either the maximized
+ * or normal states.
+ * <p>
+ * Note: The result of intermixing calls to <code>setMaximized(true)</code>
+ * and <code>setMinimized(true)</code> will vary by platform. Typically,
+ * the behavior will match the platform user's expectations, but not
+ * always. This should be avoided if possible.
+ * </p>
+ *
+ * @param minimized the new maximized state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setMaximized
+ */
+public void setMinimized (boolean minimized) {
+ checkWidget();
+ this.minimized = minimized;
+}
+
+void setSavedFocus (Control control) {
+ savedFocus = control;
+}
+
+/**
+ * Sets the receiver's text, which is the string that the
+ * window manager will typically display as the receiver's
+ * <em>title</em>, to the argument, which must not be null.
+ *
+ * @param string the new text
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+ checkWidget();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ text = string;
+}
+
+void sort (Image [] images) {
+ /* Shell Sort from K&R, pg 108 */
+ int length = images.length;
+ if (length <= 1) return;
+ ImageData [] datas = new ImageData [length];
+ for (int i = 0; i < length; i++) {
+ datas [i] = images [i].getImageData ();
+ }
+ for (int gap=length/2; gap>0; gap/=2) {
+ for (int i=gap; i<length; i++) {
+ for (int j=i-gap; j>=0; j-=gap) {
+ if (compare (datas [j], datas [j + gap]) >= 0) {
+ Image swap = images [j];
+ images [j] = images [j + gap];
+ images [j + gap] = swap;
+ ImageData swapData = datas [j];
+ datas [j] = datas [j + gap];
+ datas [j + gap] = swapData;
+ }
+ }
+ }
+ }
+}
+
+boolean traverseItem (boolean next) {
+ return false;
+}
+
+boolean traverseReturn () {
+ if (defaultButton == null || defaultButton.isDisposed ()) return false;
+ if (!defaultButton.isVisible () || !defaultButton.isEnabled ()) return false;
+ defaultButton.click ();
+ return true;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DirectoryDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DirectoryDialog.java
new file mode 100755
index 0000000000..657a3c2f90
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/DirectoryDialog.java
@@ -0,0 +1,167 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+import org.eclipse.swt.*;
+
+
+/**
+ * Instances of this class allow the user to navigate
+ * the file system and select a directory.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ */
+public class DirectoryDialog extends Dialog {
+ String message = "", filterPath = "";
+
+/**
+ * Constructs a new instance of this class given only its parent.
+ *
+ * @param parent a shell which will be the parent of the new instance
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public DirectoryDialog (Shell parent) {
+ this (parent, SWT.APPLICATION_MODAL);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a shell which will be the parent of the new instance
+ * @param style the style of dialog to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public DirectoryDialog (Shell parent, int style) {
+ super (parent, style);
+ checkSubclass ();
+}
+
+/**
+ * Returns the path which the dialog will use to filter
+ * the directories it shows.
+ *
+ * @return the filter path
+ *
+ * @see #setFilterPath
+ */
+public String getFilterPath () {
+ return filterPath;
+}
+
+/**
+ * Returns the dialog's message, which is a description of
+ * the purpose for which it was opened. This message will be
+ * visible on the dialog while it is open.
+ *
+ * @return the message
+ */
+public String getMessage () {
+ return message;
+}
+
+/**
+ * Makes the dialog visible and brings it to the front
+ * of the display.
+ *
+ * @return a string describing the absolute path of the selected directory,
+ * or null if the dialog was cancelled or an error occurred
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the dialog has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the dialog</li>
+ * </ul>
+ */
+public String open () {
+ String directoryPath = null;
+ NSOpenPanel panel = NSOpenPanel.openPanel();
+ panel.setAllowsMultipleSelection((style & SWT.MULTI) != 0);
+ if (filterPath != null) panel.setDirectory(NSString.stringWith(filterPath));
+ panel.setTitle(NSString.stringWith(title != null ? title : ""));
+ panel.setCanChooseFiles(false);
+ panel.setCanChooseDirectories(true);
+ int response = panel.runModal();
+ if (response == OS.NSFileHandlingPanelOKButton) {
+ NSString filename = panel.filename();
+ char[] buffer = new char[filename.length()];
+ filename.getCharacters_(buffer);
+ directoryPath = filterPath = new String(buffer);
+ }
+// options.optionFlags = OS.kNavSupportPackages | OS.kNavAllowOpenPackages | OS.kNavAllowInvisibleFiles;
+ return directoryPath;
+}
+
+/**
+ * Sets the dialog's message, which is a description of
+ * the purpose for which it was opened. This message will be
+ * visible on the dialog while it is open.
+ *
+ * @param string the message
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ */
+public void setMessage (String string) {
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ message = string;
+}
+
+/**
+ * Sets the path that the dialog will use to filter
+ * the directories it shows to the argument, which may
+ * be null. If the string is null, then the operating
+ * system's default filter path will be used.
+ * <p>
+ * Note that the path string is platform dependent.
+ * For convenience, either '/' or '\' can be used
+ * as a path separator.
+ * </p>
+ *
+ * @param string the filter path
+ */
+public void setFilterPath (String string) {
+ filterPath = string;
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
new file mode 100755
index 0000000000..e6612ba7ee
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
@@ -0,0 +1,3054 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+import org.eclipse.swt.internal.Callback;
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+
+/**
+ * Instances of this class are responsible for managing the
+ * connection between SWT and the underlying operating
+ * system. Their most important function is to implement
+ * the SWT event loop in terms of the platform event model.
+ * They also provide various methods for accessing information
+ * about the operating system, and have overall control over
+ * the operating system resources which SWT allocates.
+ * <p>
+ * Applications which are built with SWT will <em>almost always</em>
+ * require only a single display. In particular, some platforms
+ * which SWT supports will not allow more than one <em>active</em>
+ * display. In other words, some platforms do not support
+ * creating a new display if one already exists that has not been
+ * sent the <code>dispose()</code> message.
+ * <p>
+ * In SWT, the thread which creates a <code>Display</code>
+ * instance is distinguished as the <em>user-interface thread</em>
+ * for that display.
+ * </p>
+ * The user-interface thread for a particular display has the
+ * following special attributes:
+ * <ul>
+ * <li>
+ * The event loop for that display must be run from the thread.
+ * </li>
+ * <li>
+ * Some SWT API methods (notably, most of the public methods in
+ * <code>Widget</code> and its subclasses), may only be called
+ * from the thread. (To support multi-threaded user-interface
+ * applications, class <code>Display</code> provides inter-thread
+ * communication methods which allow threads other than the
+ * user-interface thread to request that it perform operations
+ * on their behalf.)
+ * </li>
+ * <li>
+ * The thread is not allowed to construct other
+ * <code>Display</code>s until that display has been disposed.
+ * (Note that, this is in addition to the restriction mentioned
+ * above concerning platform support for multiple displays. Thus,
+ * the only way to have multiple simultaneously active displays,
+ * even on platforms which support it, is to have multiple threads.)
+ * </li>
+ * </ul>
+ * Enforcing these attributes allows SWT to be implemented directly
+ * on the underlying operating system's event model. This has
+ * numerous benefits including smaller footprint, better use of
+ * resources, safer memory management, clearer program logic,
+ * better performance, and fewer overall operating system threads
+ * required. The down side however, is that care must be taken
+ * (only) when constructing multi-threaded applications to use the
+ * inter-thread communication mechanisms which this class provides
+ * when required.
+ * </p><p>
+ * All SWT API methods which may only be called from the user-interface
+ * thread are distinguished in their documentation by indicating that
+ * they throw the "<code>ERROR_THREAD_INVALID_ACCESS</code>"
+ * SWT exception.
+ * </p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Close, Dispose, Settings</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ * @see #syncExec
+ * @see #asyncExec
+ * @see #wake
+ * @see #readAndDispatch
+ * @see #sleep
+ * @see Device#dispose
+ */
+public class Display extends Device {
+
+ /* Windows and Events */
+ Event [] eventQueue;
+ EventTable eventTable, filterTable;
+ boolean disposing;
+
+ /* Sync/Async Widget Communication */
+ Synchronizer synchronizer = new Synchronizer (this);
+ Thread thread;
+ boolean allowTimers, runAsyncMessages;
+
+ Caret currentCaret;
+
+ NSApplication application;
+ NSAutoreleasePool pool;
+
+ NSPoint cascade = new NSPoint();
+
+ Callback windowDelegateCallback2, windowDelegateCallback3, windowDelegateCallback4, windowDelegateCallback5;
+ Callback windowDelegateCallback6;
+ Callback dialogCallback3;
+
+ /* Menus */
+// Menu menuBar;
+// Menu [] menus, popups;
+// static final int ID_TEMPORARY = 1000;
+// static final int ID_START = 1001;
+
+ /* Display Shutdown */
+ Runnable [] disposeList;
+
+ /* System Tray */
+ Tray tray;
+
+ /* System Resources */
+ Image errorImage, infoImage, warningImage;
+ Cursor [] cursors = new Cursor [SWT.CURSOR_HAND + 1];
+
+ /* Key Mappings. */
+ static int [] [] KeyTable = {
+
+ /* Keyboard and Mouse Masks */
+// {58, SWT.ALT},
+// {56, SWT.SHIFT},
+// {59, SWT.CONTROL},
+// {55, SWT.COMMAND},
+
+ /* Non-Numeric Keypad Keys */
+ {OS.NSUpArrowFunctionKey, SWT.ARROW_UP},
+ {OS.NSDownArrowFunctionKey, SWT.ARROW_DOWN},
+ {OS.NSLeftArrowFunctionKey, SWT.ARROW_LEFT},
+ {OS.NSRightArrowFunctionKey, SWT.ARROW_RIGHT},
+ {OS.NSPageUpFunctionKey, SWT.PAGE_UP},
+ {OS.NSPageDownFunctionKey, SWT.PAGE_DOWN},
+ {OS.NSHomeFunctionKey, SWT.HOME},
+ {OS.NSEndFunctionKey, SWT.END},
+
+// {??, SWT.INSERT},
+
+ /* Virtual and Ascii Keys */
+// {51, SWT.BS},
+// {36, SWT.CR},
+// {117, SWT.DEL},
+// {53, SWT.ESC},
+// {76, SWT.LF},
+// {48, SWT.TAB},
+
+ /* Functions Keys */
+ {OS.NSF1FunctionKey, SWT.F1},
+ {OS.NSF2FunctionKey, SWT.F2},
+ {OS.NSF3FunctionKey, SWT.F3},
+ {OS.NSF4FunctionKey, SWT.F4},
+ {OS.NSF5FunctionKey, SWT.F5},
+ {OS.NSF6FunctionKey, SWT.F6},
+ {OS.NSF7FunctionKey, SWT.F7},
+ {OS.NSF8FunctionKey, SWT.F8},
+ {OS.NSF9FunctionKey, SWT.F9},
+ {OS.NSF10FunctionKey, SWT.F10},
+ {OS.NSF11FunctionKey, SWT.F11},
+ {OS.NSF12FunctionKey, SWT.F12},
+ {OS.NSF13FunctionKey, SWT.F13},
+ {OS.NSF14FunctionKey, SWT.F14},
+ {OS.NSF15FunctionKey, SWT.F15},
+
+ /* Numeric Keypad Keys */
+// {67, SWT.KEYPAD_MULTIPLY},
+// {69, SWT.KEYPAD_ADD},
+// {76, SWT.KEYPAD_CR},
+// {78, SWT.KEYPAD_SUBTRACT},
+// {65, SWT.KEYPAD_DECIMAL},
+// {75, SWT.KEYPAD_DIVIDE},
+// {82, SWT.KEYPAD_0},
+// {83, SWT.KEYPAD_1},
+// {84, SWT.KEYPAD_2},
+// {85, SWT.KEYPAD_3},
+// {86, SWT.KEYPAD_4},
+// {87, SWT.KEYPAD_5},
+// {88, SWT.KEYPAD_6},
+// {89, SWT.KEYPAD_7},
+// {91, SWT.KEYPAD_8},
+// {92, SWT.KEYPAD_9},
+// {81, SWT.KEYPAD_EQUAL},
+
+ /* Other keys */
+// {??, SWT.CAPS_LOCK},
+
+// {71, SWT.NUM_LOCK},
+
+// {??, SWT.SCROLL_LOCK},
+// {??, SWT.PAUSE},
+// {??, SWT.BREAK},
+// {??, SWT.PRINT_SCREEN},
+
+// {114, SWT.HELP},
+
+ };
+
+ static String APP_NAME = "SWT";
+ static final String ADD_WIDGET_KEY = "org.eclipse.swt.internal.addWidget";
+
+ /* Multiple Displays. */
+ static Display Default;
+ static Display [] Displays = new Display [4];
+
+ /* Package Name */
+ static final String PACKAGE_PREFIX = "org.eclipse.swt.widgets.";
+
+ /* Timer */
+ Runnable timerList [];
+ NSTimer nsTimers [];
+ SWTWindowDelegate timerDelegate = (SWTWindowDelegate)new SWTWindowDelegate().alloc().init();
+
+ /* Display Data */
+ Object data;
+ String [] keys;
+ Object [] values;
+
+ /*
+ * TEMPORARY CODE. Install the runnable that
+ * gets the current display. This code will
+ * be removed in the future.
+ */
+ static {
+ DeviceFinder = new Runnable () {
+ public void run () {
+ Device device = getCurrent ();
+ if (device == null) {
+ device = getDefault ();
+ }
+ setDevice (device);
+ }
+ };
+ }
+
+/*
+* TEMPORARY CODE.
+*/
+static void setDevice (Device device) {
+ CurrentDevice = device;
+}
+
+static byte [] ascii (String name) {
+ int length = name.length ();
+ char [] chars = new char [length];
+ name.getChars (0, length, chars, 0);
+ byte [] buffer = new byte [length + 1];
+ for (int i=0; i<length; i++) {
+ buffer [i] = (byte) chars [i];
+ }
+ return buffer;
+}
+
+static int translateKey (int key) {
+ for (int i=0; i<KeyTable.length; i++) {
+ if (KeyTable [i] [0] == key) return KeyTable [i] [1];
+ }
+ return 0;
+}
+
+static int untranslateKey (int key) {
+ for (int i=0; i<KeyTable.length; i++) {
+ if (KeyTable [i] [1] == key) return KeyTable [i] [0];
+ }
+ return 0;
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when an event of the given type occurs anywhere
+ * in a widget. The event type is one of the event constants
+ * defined in class <code>SWT</code>. When the event does occur,
+ * the listener is notified by sending it the <code>handleEvent()</code>
+ * message.
+ * <p>
+ * Setting the type of an event to <code>SWT.None</code> from
+ * within the <code>handleEvent()</code> method can be used to
+ * change the event type and stop subsequent Java listeners
+ * from running. Because event filters run before other listeners,
+ * event filters can both block other listeners and set arbitrary
+ * fields within an event. For this reason, event filters are both
+ * powerful and dangerous. They should generally be avoided for
+ * performance, debugging and code maintenance reasons.
+ * </p>
+ *
+ * @param eventType the type of event to listen for
+ * @param listener the listener which should be notified when the event occurs
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Listener
+ * @see SWT
+ * @see #removeFilter
+ * @see #removeListener
+ *
+ * @since 3.0
+ */
+public void addFilter (int eventType, Listener listener) {
+ checkDevice ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (filterTable == null) filterTable = new EventTable ();
+ filterTable.hook (eventType, listener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when an event of the given type occurs. The event
+ * type is one of the event constants defined in class <code>SWT</code>.
+ * When the event does occur in the display, the listener is notified by
+ * sending it the <code>handleEvent()</code> message.
+ *
+ * @param eventType the type of event to listen for
+ * @param listener the listener which should be notified when the event occurs
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Listener
+ * @see SWT
+ * @see #removeListener
+ *
+ * @since 2.0
+ */
+public void addListener (int eventType, Listener listener) {
+ checkDevice ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) eventTable = new EventTable ();
+ eventTable.hook (eventType, listener);
+}
+
+//void addMenu (Menu menu) {
+// if (menus == null) menus = new Menu [12];
+// for (int i=0; i<menus.length; i++) {
+// if (menus [i] == null) {
+// menu.id = (short)(ID_START + i);
+// menus [i] = menu;
+// return;
+// }
+// }
+// Menu [] newMenus = new Menu [menus.length + 12];
+// menu.id = (short)(ID_START + menus.length);
+// newMenus [menus.length] = menu;
+// System.arraycopy (menus, 0, newMenus, 0, menus.length);
+// menus = newMenus;
+//}
+//
+//void addPopup (Menu menu) {
+// if (popups == null) popups = new Menu [4];
+// int length = popups.length;
+// for (int i=0; i<length; i++) {
+// if (popups [i] == menu) return;
+// }
+// int index = 0;
+// while (index < length) {
+// if (popups [index] == null) break;
+// index++;
+// }
+// if (index == length) {
+// Menu [] newPopups = new Menu [length + 4];
+// System.arraycopy (popups, 0, newPopups, 0, length);
+// popups = newPopups;
+// }
+// popups [index] = menu;
+//}
+
+/**
+ * Causes the <code>run()</code> method of the runnable to
+ * be invoked by the user-interface thread at the next
+ * reasonable opportunity. The caller of this method continues
+ * to run in parallel, and is not notified when the
+ * runnable has completed. Specifying <code>null</code> as the
+ * runnable simply wakes the user-interface thread when run.
+ * <p>
+ * Note that at the time the runnable is invoked, widgets
+ * that have the receiver as their display may have been
+ * disposed. Therefore, it is necessary to check for this
+ * case inside the runnable before accessing the widget.
+ * </p>
+ *
+ * @param runnable code to run on the user-interface thread or <code>null</code>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #syncExec
+ */
+public void asyncExec (Runnable runnable) {
+ synchronized (Device.class) {
+ if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+ synchronizer.asyncExec (runnable);
+ }
+}
+
+/**
+ * Causes the system hardware to emit a short sound
+ * (if it supports this capability).
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void beep () {
+ checkDevice ();
+}
+
+protected void checkDevice () {
+ if (thread == null) error (SWT.ERROR_WIDGET_DISPOSED);
+ if (thread != Thread.currentThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
+ if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+}
+
+/**
+ * Checks that this class can be subclassed.
+ * <p>
+ * IMPORTANT: See the comment in <code>Widget.checkSubclass()</code>.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see Widget#checkSubclass
+ */
+protected void checkSubclass () {
+ if (!Display.isValidClass (getClass ())) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+/**
+ * Constructs a new instance of this class.
+ * <p>
+ * Note: The resulting display is marked as the <em>current</em>
+ * display. If this is the first display which has been
+ * constructed since the application started, it is also
+ * marked as the <em>default</em> display.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if called from a thread that already created an existing display</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see #getCurrent
+ * @see #getDefault
+ * @see Widget#checkSubclass
+ * @see Shell
+ */
+public Display () {
+ this (null);
+}
+
+/**
+ * Constructs a new instance of this class using the parameter.
+ *
+ * @param data the device data
+ */
+public Display (DeviceData data) {
+ super (data);
+}
+
+static void checkDisplay (Thread thread, boolean multiple) {
+ synchronized (Device.class) {
+ for (int i=0; i<Displays.length; i++) {
+ if (Displays [i] != null) {
+ if (!multiple) SWT.error (SWT.ERROR_NOT_IMPLEMENTED, null, " [multiple displays]");
+ if (Displays [i].thread == thread) SWT.error (SWT.ERROR_THREAD_INVALID_ACCESS);
+ }
+ }
+ }
+}
+
+static String convertToLf(String text) {
+ char Cr = '\r';
+ char Lf = '\n';
+ int length = text.length ();
+ if (length == 0) return text;
+
+ /* Check for an LF or CR/LF. Assume the rest of the string
+ * is formated that way. This will not work if the string
+ * contains mixed delimiters. */
+ int i = text.indexOf (Lf, 0);
+ if (i == -1 || i == 0) return text;
+ if (text.charAt (i - 1) != Cr) return text;
+
+ /* The string is formatted with CR/LF.
+ * Create a new string with the LF line delimiter. */
+ i = 0;
+ StringBuffer result = new StringBuffer ();
+ while (i < length) {
+ int j = text.indexOf (Cr, i);
+ if (j == -1) j = length;
+ String s = text.substring (i, j);
+ result.append (s);
+ i = j + 2;
+ result.append (Lf);
+ }
+ return result.toString ();
+}
+
+/**
+ * Requests that the connection between SWT and the underlying
+ * operating system be closed.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Device#dispose
+ *
+ * @since 2.0
+ */
+public void close () {
+ checkDevice ();
+ Event event = new Event ();
+ sendEvent (SWT.Close, event);
+ if (event.doit) dispose ();
+}
+
+/**
+ * Creates the device in the operating system. If the device
+ * does not have a handle, this method may do nothing depending
+ * on the device.
+ * <p>
+ * This method is called before <code>init</code>.
+ * </p>
+ *
+ * @param data the DeviceData which describes the receiver
+ *
+ * @see #init
+ */
+protected void create (DeviceData data) {
+ checkSubclass ();
+ checkDisplay (thread = Thread.currentThread (), false);
+ createDisplay (data);
+ register (this);
+ if (Default == null) Default = this;
+}
+
+void createDisplay (DeviceData data) {
+ if (OS.VERSION < 0x1040) {
+ System.out.println ("***WARNING: SWT requires MacOS X version " + 10 + "." + 4 + " or greater"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ System.out.println ("***WARNING: Detected: " + Integer.toHexString((OS.VERSION & 0xFF00) >> 8) + "." + Integer.toHexString((OS.VERSION & 0xF0) >> 4) + "." + Integer.toHexString(OS.VERSION & 0xF)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ /*
+ * Feature in the Macintosh. On OS 10.2, it is necessary
+ * to explicitly check in with the Process Manager and set
+ * the current process to be the front process in order for
+ * windows to come to the front by default. The fix is call
+ * both GetCurrentProcess() and SetFrontProcess().
+ *
+ * NOTE: It is not actually necessary to use the process
+ * serial number returned by GetCurrentProcess() in the
+ * call to SetFrontProcess() (ie. kCurrentProcess can be
+ * used) but both functions must be called in order for
+ * windows to come to the front.
+ */
+ int [] psn = new int [2];
+ if (OS.GetCurrentProcess (psn) == OS.noErr) {
+// int pid = OS.getpid ();
+// byte [] buffer = null;
+// int ptr = OS.getenv (ascii ("APP_NAME_" + pid));
+// if (ptr != 0) {
+// buffer = new byte [OS.strlen (ptr) + 1];
+// OS.memmove (buffer, ptr, buffer.length);
+// } else {
+// if (APP_NAME != null) {
+// char [] chars = new char [APP_NAME.length ()];
+// APP_NAME.getChars (0, chars.length, chars, 0);
+// int cfstring = OS.CFStringCreateWithCharacters (OS.kCFAllocatorDefault, chars, chars.length);
+// if (cfstring != 0) {
+// CFRange range = new CFRange ();
+// range.length = chars.length;
+// int encoding = OS.CFStringGetSystemEncoding ();
+// int [] size = new int [1];
+// int numChars = OS.CFStringGetBytes (cfstring, range, encoding, (byte) '?', true, null, 0, size);
+// if (numChars != 0) {
+// buffer = new byte [size [0] + 1];
+// numChars = OS.CFStringGetBytes (cfstring, range, encoding, (byte) '?', true, buffer, size [0], size);
+// }
+// OS.CFRelease (cfstring);
+// }
+// }
+// }
+// if (buffer != null) OS.CPSSetProcessName (psn, buffer);
+ OS.TransformProcessType (psn, OS.kProcessTransformToForegroundApplication);
+ OS.SetFrontProcess (psn);
+// ptr = OS.getenv (ascii ("APP_ICON_" + pid));
+// if (ptr != 0) {
+// int image = readImageRef (ptr);
+// if (image != 0) {
+// dockImage = image;
+// OS.SetApplicationDockTileImage (dockImage);
+// }
+// }
+ }
+
+ pool = (NSAutoreleasePool)new NSAutoreleasePool().alloc().init();
+ application = NSApplication.sharedApplication();
+}
+
+static void deregister (Display display) {
+ synchronized (Device.class) {
+ for (int i=0; i<Displays.length; i++) {
+ if (display == Displays [i]) Displays [i] = null;
+ }
+ }
+}
+
+/**
+ * Destroys the device in the operating system and releases
+ * the device's handle. If the device does not have a handle,
+ * this method may do nothing depending on the device.
+ * <p>
+ * This method is called after <code>release</code>.
+ * </p>
+ * @see Device#dispose
+ * @see #release
+ */
+protected void destroy () {
+ if (this == Default) Default = null;
+ deregister (this);
+ destroyDisplay ();
+}
+
+void destroyDisplay () {
+ if (pool != null) pool.release();
+ pool = null;
+ application = null;
+}
+
+/**
+ * Causes the <code>run()</code> method of the runnable to
+ * be invoked by the user-interface thread just before the
+ * receiver is disposed. Specifying a <code>null</code> runnable
+ * is ignored.
+ *
+ * @param runnable code to run at dispose time.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void disposeExec (Runnable runnable) {
+ checkDevice ();
+ if (disposeList == null) disposeList = new Runnable [4];
+ for (int i=0; i<disposeList.length; i++) {
+ if (disposeList [i] == null) {
+ disposeList [i] = runnable;
+ return;
+ }
+ }
+ Runnable [] newDisposeList = new Runnable [disposeList.length + 4];
+ System.arraycopy (disposeList, 0, newDisposeList, 0, disposeList.length);
+ newDisposeList [disposeList.length] = runnable;
+ disposeList = newDisposeList;
+}
+
+void error (int code) {
+ SWT.error(code);
+}
+
+boolean filterEvent (Event event) {
+ if (filterTable != null) filterTable.sendEvent (event);
+ return false;
+}
+
+boolean filters (int eventType) {
+ if (filterTable == null) return false;
+ return filterTable.hooks (eventType);
+}
+
+/**
+ * Given the operating system handle for a widget, returns
+ * the instance of the <code>Widget</code> subclass which
+ * represents it in the currently running application, if
+ * such exists, or null if no matching widget can be found.
+ * <p>
+ * <b>IMPORTANT:</b> This method should not be called from
+ * application code. The arguments are platform-specific.
+ * </p>
+ *
+ * @param handle the handle for the widget
+ * @return the SWT widget that the handle represents
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Widget findWidget (int handle) {
+ checkDevice ();
+// return getWidget (handle);
+ return null;
+}
+
+/**
+ * Given the operating system handle for a widget,
+ * and widget-specific id, returns the instance of
+ * the <code>Widget</code> subclass which represents
+ * the handle/id pair in the currently running application,
+ * if such exists, or null if no matching widget can be found.
+ * <p>
+ * <b>IMPORTANT:</b> This method should not be called from
+ * application code. The arguments are platform-specific.
+ * </p>
+ *
+ * @param handle the handle for the widget
+ * @param id the id for the subwidget (usually an item)
+ * @return the SWT widget that the handle/id pair represents
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public Widget findWidget (int handle, int id) {
+ checkDevice ();
+ return null;
+}
+
+/**
+ * Given a widget and a widget-specific id, returns the
+ * instance of the <code>Widget</code> subclass which represents
+ * the widget/id pair in the currently running application,
+ * if such exists, or null if no matching widget can be found.
+ *
+ * @param widget the widget
+ * @param id the id for the subwidget (usually an item)
+ * @return the SWT subwidget (usually an item) that the widget/id pair represents
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public Widget findWidget (Widget widget, int id) {
+ checkDevice ();
+ return null;
+}
+
+/**
+ * Returns the display which the given thread is the
+ * user-interface thread for, or null if the given thread
+ * is not a user-interface thread for any display. Specifying
+ * <code>null</code> as the thread will return <code>null</code>
+ * for the display.
+ *
+ * @param thread the user-interface thread
+ * @return the display for the given thread
+ */
+public static Display findDisplay (Thread thread) {
+ synchronized (Device.class) {
+ for (int i=0; i<Displays.length; i++) {
+ Display display = Displays [i];
+ if (display != null && display.thread == thread) {
+ return display;
+ }
+ }
+ return null;
+ }
+}
+
+/**
+ * Returns the currently active <code>Shell</code>, or null
+ * if no shell belonging to the currently running application
+ * is active.
+ *
+ * @return the active shell or null
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Shell getActiveShell () {
+ checkDevice ();
+ NSWindow window = application.keyWindow();
+ if (window != null) {
+ NSView view = window.contentView();
+ if (view != null && view.respondsToSelector(OS.sel_tag)) {
+ int tag = OS.objc_msgSend(view.id, OS.sel_tag);
+ if (tag != -1) {
+ Object object = OS.JNIGetObject(tag);
+ if (object instanceof Shell) {
+ return (Shell)object;
+ }
+ }
+ }
+ }
+ return null;
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location.
+ *
+ * @return the bounding rectangle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Rectangle getBounds () {
+ checkDevice ();
+ return super.getBounds ();
+}
+
+/**
+ * Returns the display which the currently running thread is
+ * the user-interface thread for, or null if the currently
+ * running thread is not a user-interface thread for any display.
+ *
+ * @return the current display
+ */
+public static Display getCurrent () {
+ return findDisplay (Thread.currentThread ());
+}
+
+int getCaretBlinkTime () {
+ checkDevice ();
+ return 560;
+}
+
+/**
+ * Returns a rectangle which describes the area of the
+ * receiver which is capable of displaying data.
+ *
+ * @return the client area
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getBounds
+ */
+public Rectangle getClientArea () {
+ checkDevice ();
+ return super.getClientArea ();
+}
+
+/**
+ * Returns the control which the on-screen pointer is currently
+ * over top of, or null if it is not currently over one of the
+ * controls built by the currently running application.
+ *
+ * @return the control under the cursor
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Control getCursorControl () {
+ checkDevice();
+ return null;
+}
+
+/**
+ * Returns the location of the on-screen pointer relative
+ * to the top left corner of the screen.
+ *
+ * @return the cursor location
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Point getCursorLocation () {
+ checkDevice ();
+ NSPoint location = NSEvent.mouseLocation();
+ //TODO bad for other screens
+ NSRect rect = NSScreen.mainScreen().frame();
+ return new Point ((int) location.x, (int) (rect.height - location.y));
+}
+
+/**
+ * Returns an array containing the recommended cursor sizes.
+ *
+ * @return the array of cursor sizes
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Point [] getCursorSizes () {
+ checkDevice ();
+ return new Point [] {new Point (16, 16)};
+}
+
+/**
+ * Returns the default display. One is created (making the
+ * thread that invokes this method its user-interface thread)
+ * if it did not already exist.
+ *
+ * @return the default display
+ */
+public static Display getDefault () {
+ synchronized (Device.class) {
+ if (Default == null) Default = new Display ();
+ return Default;
+ }
+}
+
+/**
+ * Returns the application defined property of the receiver
+ * with the specified name, or null if it has not been set.
+ * <p>
+ * Applications may have associated arbitrary objects with the
+ * receiver in this fashion. If the objects stored in the
+ * properties need to be notified when the display is disposed
+ * of, it is the application's responsibility to provide a
+ * <code>disposeExec()</code> handler which does so.
+ * </p>
+ *
+ * @param key the name of the property
+ * @return the value of the property or null if it has not been set
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the key is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #setData(String, Object)
+ * @see #disposeExec(Runnable)
+ */
+public Object getData (String key) {
+ checkDevice ();
+ if (key == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (keys == null) return null;
+ for (int i=0; i<keys.length; i++) {
+ if (keys [i].equals (key)) return values [i];
+ }
+ return null;
+}
+
+/**
+ * Returns the application defined, display specific data
+ * associated with the receiver, or null if it has not been
+ * set. The <em>display specific data</em> is a single,
+ * unnamed field that is stored with every display.
+ * <p>
+ * Applications may put arbitrary objects in this field. If
+ * the object stored in the display specific data needs to
+ * be notified when the display is disposed of, it is the
+ * application's responsibility to provide a
+ * <code>disposeExec()</code> handler which does so.
+ * </p>
+ *
+ * @return the display specific data
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #setData(Object)
+ * @see #disposeExec(Runnable)
+ */
+public Object getData () {
+ checkDevice ();
+ return data;
+}
+
+/**
+ * Returns the button dismissal alignment, one of <code>LEFT</code> or <code>RIGHT</code>.
+ * The button dismissal alignment is the ordering that should be used when positioning the
+ * default dismissal button for a dialog. For example, in a dialog that contains an OK and
+ * CANCEL button, on platforms where the button dismissal alignment is <code>LEFT</code>, the
+ * button ordering should be OK/CANCEL. When button dismissal alignment is <code>RIGHT</code>,
+ * the button ordering should be CANCEL/OK.
+ *
+ * @return the button dismissal order
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public int getDismissalAlignment () {
+ checkDevice ();
+ return SWT.RIGHT;
+}
+
+/**
+ * Returns the longest duration, in milliseconds, between
+ * two mouse button clicks that will be considered a
+ * <em>double click</em> by the underlying operating system.
+ *
+ * @return the double click time
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public int getDoubleClickTime () {
+ checkDevice ();
+ return 0;
+// return OS.GetDblTime () * 1000 / 60;
+}
+
+/**
+ * Returns the control which currently has keyboard focus,
+ * or null if keyboard events are not currently going to
+ * any of the controls built by the currently running
+ * application.
+ *
+ * @return the control under the cursor
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Control getFocusControl () {
+ checkDevice ();
+ NSWindow window = application.keyWindow();
+ if (window != null) {
+ NSResponder view = window.firstResponder();
+ if (view != null && view.respondsToSelector(OS.sel_tag)) {
+ int tag = OS.objc_msgSend(view.id, OS.sel_tag);
+ if (tag != -1) {
+ Object object = OS.JNIGetObject(tag);
+ if (object instanceof Control) {
+ //TODO go up hierarchy
+ return (Control)object;
+ }
+ }
+ }
+ }
+ return null;
+}
+
+
+/**
+ * Returns true when the high contrast mode is enabled.
+ * Otherwise, false is returned.
+ * <p>
+ * Note: This operation is a hint and is not supported on
+ * platforms that do not have this concept.
+ * </p>
+ *
+ * @return the high contrast mode
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public boolean getHighContrast () {
+ checkDevice ();
+ return false;
+}
+
+/**
+ * Returns the maximum allowed depth of icons on this display, in bits per pixel.
+ * On some platforms, this may be different than the actual depth of the display.
+ *
+ * @return the maximum icon depth
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Device#getDepth
+ */
+public int getIconDepth () {
+ return getDepth ();
+}
+
+/**
+ * Returns an array containing the recommended icon sizes.
+ *
+ * @return the array of icon sizes
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Decorations#setImages(Image[])
+ *
+ * @since 3.0
+ */
+public Point [] getIconSizes () {
+ checkDevice ();
+ return new Point [] {
+ new Point (16, 16), new Point (32, 32),
+ new Point (64, 64), new Point (128, 128)};
+}
+
+int getLastEventTime () {
+ /*
+ * This code is intentionally commented. Event time is
+ * in seconds and we need an accurate time in milliseconds.
+ */
+// return (int) (OS.GetLastUserEventTime () * 1000.0);
+ return (int) System.currentTimeMillis ();
+}
+
+//Menu [] getMenus (Decorations shell) {
+// if (menus == null) return new Menu [0];
+// int count = 0;
+// for (int i = 0; i < menus.length; i++) {
+// Menu menu = menus[i];
+// if (menu != null && menu.parent == shell) count++;
+// }
+// int index = 0;
+// Menu[] result = new Menu[count];
+// for (int i = 0; i < menus.length; i++) {
+// Menu menu = menus[i];
+// if (menu != null && menu.parent == shell) {
+// result[index++] = menu;
+// }
+// }
+// return result;
+//}
+//
+//Menu getMenu (int id) {
+// if (menus == null) return null;
+// int index = id - ID_START;
+// if (0 <= index && index < menus.length) return menus [index];
+// return null;
+//}
+//
+//Menu getMenuBar () {
+// return menuBar;
+//}
+
+int getMessageCount () {
+ return synchronizer.getMessageCount ();
+}
+
+/**
+ * Returns an array of monitors attached to the device.
+ *
+ * @return the array of monitors
+ *
+ * @since 3.0
+ */
+public Monitor [] getMonitors () {
+ checkDevice ();
+ NSArray screens = NSScreen.screens();
+ int count = screens.count();
+ Monitor [] monitors = new Monitor [count];
+ for (int i=0; i<count; i++) {
+ Monitor monitor = new Monitor ();
+ NSScreen screen = new NSScreen(screens.objectAtIndex(i));
+ NSRect frame = screen.frame();
+ monitor.x = (int)frame.x;
+ monitor.y = (int)frame.y;
+ monitor.width = (int)frame.width;
+ monitor.height = (int)frame.height;
+ NSRect visibleFrame = screen.visibleFrame();
+ monitor.clientX = (int)visibleFrame.x;
+ monitor.clientY = (int)visibleFrame.y;
+ monitor.clientWidth = (int)visibleFrame.width;
+ monitor.clientHeight = (int)visibleFrame.height;
+ monitors [i] = monitor;
+ }
+ return monitors;
+}
+
+/**
+ * Returns the primary monitor for that device.
+ *
+ * @return the primary monitor
+ *
+ * @since 3.0
+ */
+public Monitor getPrimaryMonitor () {
+ checkDevice ();
+ Monitor monitor = new Monitor ();
+ NSScreen screen = NSScreen.mainScreen();
+ NSRect frame = screen.frame();
+ monitor.x = (int)frame.x;
+ monitor.y = (int)frame.y;
+ monitor.width = (int)frame.width;
+ monitor.height = (int)frame.height;
+ NSRect visibleFrame = screen.visibleFrame();
+ monitor.clientX = (int)visibleFrame.x;
+ monitor.clientY = (int)visibleFrame.y;
+ monitor.clientWidth = (int)visibleFrame.width;
+ monitor.clientHeight = (int)visibleFrame.height;
+ return monitor;
+}
+
+/**
+ * Returns a (possibly empty) array containing all shells which have
+ * not been disposed and have the receiver as their display.
+ *
+ * @return the receiver's shells
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Shell [] getShells () {
+ checkDevice ();
+// int index = 0;
+// Shell [] result = new Shell [16];
+// for (int i = 0; i < widgetTable.length; i++) {
+// Widget widget = widgetTable [i];
+// if (widget != null && widget instanceof Shell) {
+// int j = 0;
+// while (j < index) {
+// if (result [j] == widget) break;
+// j++;
+// }
+// if (j == index) {
+// if (index == result.length) {
+// Shell [] newResult = new Shell [index + 16];
+// System.arraycopy (result, 0, newResult, 0, index);
+// result = newResult;
+// }
+// result [index++] = (Shell) widget;
+// }
+// }
+// }
+// if (index == result.length) return result;
+// Shell [] newResult = new Shell [index];
+// System.arraycopy (result, 0, newResult, 0, index);
+// return newResult;
+ return new Shell[0];
+}
+
+/**
+ * Gets the synchronizer used by the display.
+ *
+ * @return the receiver's synchronizer
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.4
+ */
+public Synchronizer getSynchronizer () {
+ checkDevice ();
+ return synchronizer;
+}
+
+/**
+ * Returns the thread that has invoked <code>syncExec</code>
+ * or null if no such runnable is currently being invoked by
+ * the user-interface thread.
+ * <p>
+ * Note: If a runnable invoked by asyncExec is currently
+ * running, this method will return null.
+ * </p>
+ *
+ * @return the receiver's sync-interface thread
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Thread getSyncThread () {
+ synchronized (Device.class) {
+ if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+ return synchronizer.syncThread;
+ }
+}
+
+/**
+ * Returns the matching standard color for the given
+ * constant, which should be one of the color constants
+ * specified in class <code>SWT</code>. Any value other
+ * than one of the SWT color constants which is passed
+ * in will result in the color black. This color should
+ * not be free'd because it was allocated by the system,
+ * not the application.
+ *
+ * @param id the color constant
+ * @return the matching color
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see SWT
+ */
+public Color getSystemColor (int id) {
+ checkDevice ();
+ NSColor color = null;
+ switch (id) {
+ case SWT.COLOR_INFO_FOREGROUND: return super.getSystemColor (SWT.COLOR_BLACK);
+ case SWT.COLOR_INFO_BACKGROUND: return Color.cocoa_new (this, new float [] {0xFF / 255f, 0xFF / 255f, 0xE1 / 255f, 1});
+ case SWT.COLOR_TITLE_FOREGROUND: color = NSColor.windowFrameTextColor(); break;
+ case SWT.COLOR_TITLE_BACKGROUND: color = NSColor.secondarySelectedControlColor(); break;
+ case SWT.COLOR_TITLE_BACKGROUND_GRADIENT: color = NSColor.windowFrameColor(); break;
+ case SWT.COLOR_TITLE_INACTIVE_FOREGROUND: color = NSColor.disabledControlTextColor(); break;
+ case SWT.COLOR_TITLE_INACTIVE_BACKGROUND: color = NSColor.secondarySelectedControlColor(); break;
+ case SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT: color = NSColor.secondarySelectedControlColor(); break;
+ case SWT.COLOR_WIDGET_DARK_SHADOW: color = NSColor.controlDarkShadowColor(); break;
+ case SWT.COLOR_WIDGET_NORMAL_SHADOW: color = NSColor.controlShadowColor(); break;
+ case SWT.COLOR_WIDGET_LIGHT_SHADOW: color = NSColor.controlHighlightColor(); break;
+ case SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW: color = NSColor.controlLightHighlightColor(); break;
+ case SWT.COLOR_WIDGET_BACKGROUND: color = NSColor.lightGrayColor(); break;
+ case SWT.COLOR_WIDGET_FOREGROUND: color = NSColor.controlTextColor(); break;
+ case SWT.COLOR_WIDGET_BORDER: return super.getSystemColor (SWT.COLOR_BLACK);
+ case SWT.COLOR_LIST_FOREGROUND: color = NSColor.textColor(); break;
+ case SWT.COLOR_LIST_BACKGROUND: color = NSColor.textBackgroundColor(); break;
+ case SWT.COLOR_LIST_SELECTION_TEXT: color = NSColor.selectedTextColor(); break;
+ case SWT.COLOR_LIST_SELECTION: color = NSColor.selectedTextBackgroundColor(); break;
+ default:
+ return super.getSystemColor (id);
+ }
+ if (color == null) return super.getSystemColor(id);
+ color = color.colorUsingColorSpace(NSColorSpace.deviceRGBColorSpace());
+ if (color == null) return super.getSystemColor(id);
+ float[] components = new float[color.numberOfComponents()];
+ color.getComponents(components);
+ return Color.cocoa_new (this, new float[]{components[0], components[1], components[2], components[3]});
+}
+
+/**
+ * Returns the matching standard platform cursor for the given
+ * constant, which should be one of the cursor constants
+ * specified in class <code>SWT</code>. This cursor should
+ * not be free'd because it was allocated by the system,
+ * not the application. A value of <code>null</code> will
+ * be returned if the supplied constant is not an SWT cursor
+ * constant.
+ *
+ * @param id the SWT cursor constant
+ * @return the corresponding cursor or <code>null</code>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see SWT#CURSOR_ARROW
+ * @see SWT#CURSOR_WAIT
+ * @see SWT#CURSOR_CROSS
+ * @see SWT#CURSOR_APPSTARTING
+ * @see SWT#CURSOR_HELP
+ * @see SWT#CURSOR_SIZEALL
+ * @see SWT#CURSOR_SIZENESW
+ * @see SWT#CURSOR_SIZENS
+ * @see SWT#CURSOR_SIZENWSE
+ * @see SWT#CURSOR_SIZEWE
+ * @see SWT#CURSOR_SIZEN
+ * @see SWT#CURSOR_SIZES
+ * @see SWT#CURSOR_SIZEE
+ * @see SWT#CURSOR_SIZEW
+ * @see SWT#CURSOR_SIZENE
+ * @see SWT#CURSOR_SIZESE
+ * @see SWT#CURSOR_SIZESW
+ * @see SWT#CURSOR_SIZENW
+ * @see SWT#CURSOR_UPARROW
+ * @see SWT#CURSOR_IBEAM
+ * @see SWT#CURSOR_NO
+ * @see SWT#CURSOR_HAND
+ *
+ * @since 3.0
+ */
+public Cursor getSystemCursor (int id) {
+ checkDevice ();
+ if (!(0 <= id && id < cursors.length)) return null;
+ if (cursors [id] == null) {
+ cursors [id] = new Cursor (this, id);
+ }
+ return cursors [id];
+}
+
+/**
+ * Returns the matching standard platform image for the given
+ * constant, which should be one of the icon constants
+ * specified in class <code>SWT</code>. This image should
+ * not be free'd because it was allocated by the system,
+ * not the application. A value of <code>null</code> will
+ * be returned either if the supplied constant is not an
+ * SWT icon constant or if the platform does not define an
+ * image that corresponds to the constant.
+ *
+ * @param id the SWT icon constant
+ * @return the corresponding image or <code>null</code>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see SWT#ICON_ERROR
+ * @see SWT#ICON_INFORMATION
+ * @see SWT#ICON_QUESTION
+ * @see SWT#ICON_WARNING
+ * @see SWT#ICON_WORKING
+ *
+ * @since 3.0
+ */
+public Image getSystemImage (int id) {
+ checkDevice ();
+// switch (id) {
+// case SWT.ICON_ERROR: {
+// if (errorImage != null) return errorImage;
+// int [] image = createImage (OS.kAlertStopIcon);
+// if (image == null) break;
+// return errorImage = Image.carbon_new (this, SWT.ICON, image [0], image [1]);
+// }
+// case SWT.ICON_INFORMATION:
+// case SWT.ICON_QUESTION:
+// case SWT.ICON_WORKING: {
+// if (infoImage != null) return infoImage;
+// int [] image = createImage (OS.kAlertNoteIcon);
+// if (image == null) break;
+// return infoImage = Image.carbon_new (this, SWT.ICON, image [0], image [1]);
+// }
+// case SWT.ICON_WARNING: {
+// if (warningImage != null) return warningImage;
+// int [] image = createImage (OS.kAlertCautionIcon);
+// if (image == null) break;
+// return warningImage = Image.carbon_new (this, SWT.ICON, image [0], image [1]);
+// }
+// }
+
+ //[[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(code)];
+ return null;
+// return Image.cocoa_new (this, SWT.ICON, NSImage.imageNamed (NSString.stringWith("NSImageNameGoRightTemplate")));
+}
+
+/**
+ * Returns the single instance of the system tray or null
+ * when there is no system tray available for the platform.
+ *
+ * @return the system tray or <code>null</code>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Tray getSystemTray () {
+ checkDevice ();
+ if (tray != null) return tray;
+ return tray = new Tray (this, SWT.NONE);
+}
+
+/**
+ * Returns the user-interface thread for the receiver.
+ *
+ * @return the receiver's user-interface thread
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Thread getThread () {
+ synchronized (Device.class) {
+ if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+ return thread;
+ }
+}
+
+/**
+ * Initializes any internal resources needed by the
+ * device.
+ * <p>
+ * This method is called after <code>create</code>.
+ * </p>
+ *
+ * @see #create
+ */
+protected void init () {
+ super.init ();
+ initClasses ();
+}
+
+void initClasses () {
+ dialogCallback3 = new Callback(this, "dialogProc", 3);
+ int dialogProc3 = dialogCallback3.getAddress();
+ if (dialogProc3 == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
+
+ windowDelegateCallback3 = new Callback(this, "windowDelegateProc", 3);
+ int proc3 = windowDelegateCallback3.getAddress();
+ if (proc3 == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
+ windowDelegateCallback2 = new Callback(this, "windowDelegateProc", 2);
+ int proc2 = windowDelegateCallback2.getAddress();
+ if (proc2 == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
+ windowDelegateCallback4 = new Callback(this, "windowDelegateProc", 4);
+ int proc4 = windowDelegateCallback4.getAddress();
+ if (proc4 == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
+ windowDelegateCallback5 = new Callback(this, "windowDelegateProc", 5);
+ int proc5 = windowDelegateCallback5.getAddress();
+ if (proc5 == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
+ windowDelegateCallback6 = new Callback(this, "windowDelegateProc", 6);
+ int proc6 = windowDelegateCallback6.getAddress();
+ if (proc6 == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
+
+ int drawRectProc = OS.drawRect_CALLBACK(proc3);
+
+ String className = "SWTWindowDelegate";
+ int cls = OS.objc_allocateClassPair(OS.class_NSObject, className, 0);
+ OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+ OS.class_addMethod(cls, OS.sel_windowDidResize_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_windowShouldClose_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_windowWillClose_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
+ OS.class_addMethod(cls, OS.sel_timerProc_1, proc3, "@:@");
+ OS.objc_registerClassPair(cls);
+
+ className = "SWTPanelDelegate";
+ cls = OS.objc_allocateClassPair(OS.class_NSObject, className, 0);
+ OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+ OS.class_addMethod(cls, OS.sel_windowWillClose_1, dialogProc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_changeColor_1, dialogProc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_changeFont_1, dialogProc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
+ OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.objc_registerClassPair(cls);
+
+ className = "SWTView";
+ cls = OS.objc_allocateClassPair(OS.class_NSView, className, 0);
+ OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+ OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
+ OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_drawRect_1, drawRectProc, "@:i");
+ OS.class_addMethod(cls, OS.sel_mouseDown_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_mouseDragged_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_mouseEntered_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_mouseUp_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_keyDown_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_keyUp_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_acceptsFirstResponder, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_resignFirstResponder, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_becomeFirstResponder, proc2, "@:");
+ OS.objc_registerClassPair(cls);
+
+ className = "SWTScrollView";
+ cls = OS.objc_allocateClassPair(OS.class_NSScrollView, className, 0);
+ OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+ OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
+ OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_sendVerticalSelection, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_sendHorizontalSelection, proc2, "@:");
+// OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.objc_registerClassPair(cls);
+
+ className = "SWTButton";
+ cls = OS.objc_allocateClassPair(OS.class_NSButton, className, 0);
+// OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
+// OS.class_addMethod(cls, OS.sel_mouseDown_1, proc3, "@:@");
+// OS.class_addMethod(cls, OS.sel_keyDown_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_drawRect_1, drawRectProc, "@:i");
+ OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.objc_registerClassPair(cls);
+
+ className = "SWTTableView";
+ cls = OS.objc_allocateClassPair(OS.class_NSTableView, className, 0);
+ OS.class_addMethod(cls, OS.sel_sendDoubleSelection, proc2, "@:");
+// OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_numberOfRowsInTableView_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_tableView_1objectValueForTableColumn_1row_1, proc5, "@:@:@:@");
+ OS.class_addMethod(cls, OS.sel_tableView_1shouldEditTableColumn_1row_1, proc5, "@:@:@:@");
+ OS.class_addMethod(cls, OS.sel_tableViewSelectionDidChange_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_tableView_1willDisplayCell_1forTableColumn_1row_1, proc6, "@:@@@i");
+ OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.objc_registerClassPair(cls);
+
+ className = "SWTOutlineView";
+ cls = OS.objc_allocateClassPair(OS.class_NSOutlineView, className, 0);
+ OS.class_addMethod(cls, OS.sel_sendDoubleSelection, proc2, "@:");
+// OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
+// OS.class_addMethod(cls, OS.sel_numberOfRowsInTableView_1, proc3, "@:@");
+// OS.class_addMethod(cls, OS.sel_tableView_1objectValueForTableColumn_1row_1, proc5, "@:@:@:@");
+// OS.class_addMethod(cls, OS.sel_tableView_1shouldEditTableColumn_1row_1, proc5, "@:@:@:@");
+// OS.class_addMethod(cls, OS.sel_tableViewSelectionDidChange_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_outlineView_1child_1ofItem_1, proc5, "@:@i@");
+ OS.class_addMethod(cls, OS.sel_outlineView_1isItemExpandable_1, proc4, "@:@@");
+ OS.class_addMethod(cls, OS.sel_outlineView_1numberOfChildrenOfItem_1, proc4, "@:@@");
+ OS.class_addMethod(cls, OS.sel_outlineView_1objectValueForTableColumn_1byItem_1, proc5, "@:@@@");
+ OS.class_addMethod(cls, OS.sel_outlineView_1willDisplayCell_1forTableColumn_1item_1, proc6, "@:@@@@");
+ OS.class_addMethod(cls, OS.sel_outlineView_1setObjectValue_1forTableColumn_1byItem_1, proc6, "@:@@@@");
+ OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.objc_registerClassPair(cls);
+
+ className = "SWTTreeItem";
+ cls = OS.objc_allocateClassPair(OS.class_NSObject, className, 0);
+// OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
+ OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+ OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
+ OS.objc_registerClassPair(cls);
+
+ className = "SWTTabView";
+ cls = OS.objc_allocateClassPair(OS.class_NSTabView, className, 0);
+// OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
+ OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+ OS.class_addMethod(cls, OS.sel_tabView_1willSelectTabViewItem_1, proc4, "@:@@");
+ OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
+ OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.objc_registerClassPair(cls);
+
+ className = "SWTBox";
+ cls = OS.objc_allocateClassPair(OS.class_NSBox, className, 0);
+// OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
+ OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+ OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
+ OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.objc_registerClassPair(cls);
+
+ className = "SWTProgressIndicator";
+ cls = OS.objc_allocateClassPair(OS.class_NSProgressIndicator, className, 0);
+// OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
+ OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+ OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
+ OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.objc_registerClassPair(cls);
+
+ className = "SWTSlider";
+ cls = OS.objc_allocateClassPair(OS.class_NSSlider, className, 0);
+// OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.objc_registerClassPair(cls);
+
+ className = "SWTPopUpButton";
+ cls = OS.objc_allocateClassPair(OS.class_NSPopUpButton, className, 0);
+// OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.objc_registerClassPair(cls);
+
+ className = "SWTComboBox";
+ cls = OS.objc_allocateClassPair(OS.class_NSComboBox, className, 0);
+// OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_comboBoxSelectionDidChange_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.objc_registerClassPair(cls);
+
+ className = "SWTDatePicker";
+ cls = OS.objc_allocateClassPair(OS.class_NSDatePicker, className, 0);
+// OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.objc_registerClassPair(cls);
+
+ className = "SWTImageView";
+ cls = OS.objc_allocateClassPair(OS.class_NSImageView, className, 0);
+// OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_drawRect_1, OS.drawRect_CALLBACK(proc3), "@:i");
+ OS.class_addMethod(cls, OS.sel_mouseDown_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_mouseUp_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_rightMouseDown_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.objc_registerClassPair(cls);
+
+ className = "SWTStepper";
+ cls = OS.objc_allocateClassPair(OS.class_NSStepper, className, 0);
+// OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.objc_registerClassPair(cls);
+
+ className = "SWTScroller";
+ cls = OS.objc_allocateClassPair(OS.class_NSScroller, className, 0);
+// OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
+ OS.objc_registerClassPair(cls);
+
+ className = "SWTTextView";
+ cls = OS.objc_allocateClassPair(OS.class_NSTextView, className, 0);
+// OS.class_addMethod(cls, OS.sel_isFlipped, proc2, "@:");
+// OS.class_addMethod(cls, OS.sel_sendSelection, proc2, "@:");
+ OS.class_addIvar(cls, "tag", OS.PTR_SIZEOF, (byte)(Math.log(OS.PTR_SIZEOF) / Math.log(2)), "i");
+ OS.class_addMethod(cls, OS.sel_tag, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_setTag_1, proc3, "@:i");
+ OS.class_addMethod(cls, OS.sel_menuForEvent_1, proc3, "@:@");
+ OS.class_addMethod(cls, OS.sel_textView_1clickedOnLink_1atIndex_1, proc5, "@:@@i");
+ OS.objc_registerClassPair(cls);
+}
+
+/**
+ * Invokes platform specific functionality to allocate a new GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Display</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param data the platform specific GC data
+ * @return the platform specific GC handle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ * @exception SWTError <ul>
+ * <li>ERROR_NO_HANDLES if a handle could not be obtained for gc creation</li>
+ * </ul>
+ */
+public int internal_new_GC (GCData data) {
+ if (isDisposed()) SWT.error(SWT.ERROR_DEVICE_DISPOSED);
+ //TODO - multiple monitors
+ return 0;
+}
+
+/**
+ * Invokes platform specific functionality to dispose a GC handle.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Display</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param hDC the platform specific GC handle
+ * @param data the platform specific GC data
+ */
+public void internal_dispose_GC (int context, GCData data) {
+ if (isDisposed()) SWT.error(SWT.ERROR_DEVICE_DISPOSED);
+
+}
+
+static boolean isValidClass (Class clazz) {
+ String name = clazz.getName ();
+ int index = name.lastIndexOf ('.');
+ return name.substring (0, index + 1).equals (PACKAGE_PREFIX);
+}
+
+boolean isValidThread () {
+ return thread == Thread.currentThread ();
+}
+
+/**
+ * Generate a low level system event.
+ *
+ * <code>post</code> is used to generate low level keyboard
+ * and mouse events. The intent is to enable automated UI
+ * testing by simulating the input from the user. Most
+ * SWT applications should never need to call this method.
+ * <p>
+ * Note that this operation can fail when the operating system
+ * fails to generate the event for any reason. For example,
+ * this can happen when there is no such key or mouse button
+ * or when the system event queue is full.
+ * </p>
+ * <p>
+ * <b>Event Types:</b>
+ * <p>KeyDown, KeyUp
+ * <p>The following fields in the <code>Event</code> apply:
+ * <ul>
+ * <li>(in) type KeyDown or KeyUp</li>
+ * <p> Either one of:
+ * <li>(in) character a character that corresponds to a keyboard key</li>
+ * <li>(in) keyCode the key code of the key that was typed,
+ * as defined by the key code constants in class <code>SWT</code></li>
+ * </ul>
+ * <p>MouseDown, MouseUp</p>
+ * <p>The following fields in the <code>Event</code> apply:
+ * <ul>
+ * <li>(in) type MouseDown or MouseUp
+ * <li>(in) button the button that is pressed or released
+ * </ul>
+ * <p>MouseMove</p>
+ * <p>The following fields in the <code>Event</code> apply:
+ * <ul>
+ * <li>(in) type MouseMove
+ * <li>(in) x the x coordinate to move the mouse pointer to in screen coordinates
+ * <li>(in) y the y coordinate to move the mouse pointer to in screen coordinates
+ * </ul>
+ * </dl>
+ *
+ * @param event the event to be generated
+ *
+ * @return true if the event was generated or false otherwise
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the event is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.0
+ *
+ */
+public boolean post(Event event) {
+ synchronized (Device.class) {
+ if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+ if (event == null) error (SWT.ERROR_NULL_ARGUMENT);
+// int type = event.type;
+// switch (type) {
+// case SWT.KeyDown:
+// case SWT.KeyUp: {
+// int vKey = Display.untranslateKey (event.keyCode);
+// if (vKey != 0) {
+// return OS.CGPostKeyboardEvent (0, vKey, type == SWT.KeyDown) == 0;
+// } else {
+// vKey = -1;
+// int kchrPtr = OS.GetScriptManagerVariable ((short) OS.smKCHRCache);
+// int key = -1;
+// int [] state = new int [1];
+// int [] encoding = new int [1];
+// short keyScript = (short) OS.GetScriptManagerVariable ((short) OS.smKeyScript);
+// short regionCode = (short) OS.GetScriptManagerVariable ((short) OS.smRegionCode);
+// if (OS.UpgradeScriptInfoToTextEncoding (keyScript, (short) OS.kTextLanguageDontCare, regionCode, null, encoding) == OS.paramErr) {
+// if (OS.UpgradeScriptInfoToTextEncoding (keyScript, (short) OS.kTextLanguageDontCare, (short) OS.kTextRegionDontCare, null, encoding) == OS.paramErr) {
+// encoding [0] = OS.kTextEncodingMacRoman;
+// }
+// }
+// int [] encodingInfo = new int [1];
+// OS.CreateUnicodeToTextInfoByEncoding (encoding [0], encodingInfo);
+// if (encodingInfo [0] != 0) {
+// char [] input = {event.character};
+// byte [] buffer = new byte [2];
+// OS.ConvertFromUnicodeToPString (encodingInfo [0], 2, input, buffer);
+// OS.DisposeUnicodeToTextInfo (encodingInfo);
+// key = buffer [1] & 0x7f;
+// }
+// if (key == -1) return false;
+// for (int i = 0 ; i <= 0x7F ; i++) {
+// int result1 = OS.KeyTranslate (kchrPtr, (short) (i | 512), state);
+// int result2 = OS.KeyTranslate (kchrPtr, (short) i, state);
+// if ((result1 & 0x7f) == key || (result2 & 0x7f) == key) {
+// vKey = i;
+// break;
+// }
+// }
+// if (vKey == -1) return false;
+// return OS.CGPostKeyboardEvent (key, vKey, type == SWT.KeyDown) == 0;
+// }
+// }
+// case SWT.MouseDown:
+// case SWT.MouseMove:
+// case SWT.MouseUp: {
+// CGPoint mouseCursorPosition = new CGPoint ();
+// int chord = OS.GetCurrentEventButtonState ();
+// if (type == SWT.MouseMove) {
+// mouseCursorPosition.x = event.x;
+// mouseCursorPosition.y = event.y;
+// return OS.CGPostMouseEvent (mouseCursorPosition, true, 5, (chord & 0x1) != 0, (chord & 0x2) != 0, (chord & 0x4) != 0, (chord & 0x8) != 0, (chord & 0x10) != 0) == 0;
+// } else {
+// int button = event.button;
+// if (button < 1 || button > 5) return false;
+// boolean button1 = false, button2 = false, button3 = false, button4 = false, button5 = false;
+// switch (button) {
+// case 1: {
+// button1 = type == SWT.MouseDown;
+// button2 = (chord & 0x4) != 0;
+// button3 = (chord & 0x2) != 0;
+// button4 = (chord & 0x8) != 0;
+// button5 = (chord & 0x10) != 0;
+// break;
+// }
+// case 2: {
+// button1 = (chord & 0x1) != 0;
+// button2 = type == SWT.MouseDown;
+// button3 = (chord & 0x2) != 0;
+// button4 = (chord & 0x8) != 0;
+// button5 = (chord & 0x10) != 0;
+// break;
+// }
+// case 3: {
+// button1 = (chord & 0x1) != 0;
+// button2 = (chord & 0x4) != 0;
+// button3 = type == SWT.MouseDown;
+// button4 = (chord & 0x8) != 0;
+// button5 = (chord & 0x10) != 0;
+// break;
+// }
+// case 4: {
+// button1 = (chord & 0x1) != 0;
+// button2 = (chord & 0x4) != 0;
+// button3 = (chord & 0x2) != 0;
+// button4 = type == SWT.MouseDown;
+// button5 = (chord & 0x10) != 0;
+// break;
+// }
+// case 5: {
+// button1 = (chord & 0x1) != 0;
+// button2 = (chord & 0x4) != 0;
+// button3 = (chord & 0x2) != 0;
+// button4 = (chord & 0x8) != 0;
+// button5 = type == SWT.MouseDown;
+// break;
+// }
+// }
+// org.eclipse.swt.internal.carbon.Point pt = new org.eclipse.swt.internal.carbon.Point ();
+// OS.GetGlobalMouse (pt);
+// mouseCursorPosition.x = pt.h;
+// mouseCursorPosition.y = pt.v;
+// return OS.CGPostMouseEvent (mouseCursorPosition, true, 5, button1, button3, button2, button4, button5) == 0;
+// }
+// }
+// case SWT.MouseWheel: {
+// return OS.CGPostScrollWheelEvent (1, event.count) == 0;
+// }
+// }
+ return false;
+ }
+}
+
+void postEvent (Event event) {
+ /*
+ * Place the event at the end of the event queue.
+ * This code is always called in the Display's
+ * thread so it must be re-enterant but does not
+ * need to be synchronized.
+ */
+ if (eventQueue == null) eventQueue = new Event [4];
+ int index = 0;
+ int length = eventQueue.length;
+ while (index < length) {
+ if (eventQueue [index] == null) break;
+ index++;
+ }
+ if (index == length) {
+ Event [] newQueue = new Event [length + 4];
+ System.arraycopy (eventQueue, 0, newQueue, 0, length);
+ eventQueue = newQueue;
+ }
+ eventQueue [index] = event;
+}
+
+/**
+ * Maps a point from one coordinate system to another.
+ * When the control is null, coordinates are mapped to
+ * the display.
+ * <p>
+ * NOTE: On right-to-left platforms where the coordinate
+ * systems are mirrored, special care needs to be taken
+ * when mapping coordinates from one control to another
+ * to ensure the result is correctly mirrored.
+ *
+ * Mapping a point that is the origin of a rectangle and
+ * then adding the width and height is not equivalent to
+ * mapping the rectangle. When one control is mirrored
+ * and the other is not, adding the width and height to a
+ * point that was mapped causes the rectangle to extend
+ * in the wrong direction. Mapping the entire rectangle
+ * instead of just one point causes both the origin and
+ * the corner of the rectangle to be mapped.
+ * </p>
+ *
+ * @param from the source <code>Control</code> or <code>null</code>
+ * @param to the destination <code>Control</code> or <code>null</code>
+ * @param point to be mapped
+ * @return point with mapped coordinates
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public Point map (Control from, Control to, Point point) {
+ checkDevice ();
+ if (point == null) error (SWT.ERROR_NULL_ARGUMENT);
+ return map (from, to, point.x, point.y);
+}
+
+/**
+ * Maps a point from one coordinate system to another.
+ * When the control is null, coordinates are mapped to
+ * the display.
+ * <p>
+ * NOTE: On right-to-left platforms where the coordinate
+ * systems are mirrored, special care needs to be taken
+ * when mapping coordinates from one control to another
+ * to ensure the result is correctly mirrored.
+ *
+ * Mapping a point that is the origin of a rectangle and
+ * then adding the width and height is not equivalent to
+ * mapping the rectangle. When one control is mirrored
+ * and the other is not, adding the width and height to a
+ * point that was mapped causes the rectangle to extend
+ * in the wrong direction. Mapping the entire rectangle
+ * instead of just one point causes both the origin and
+ * the corner of the rectangle to be mapped.
+ * </p>
+ *
+ * @param from the source <code>Control</code> or <code>null</code>
+ * @param to the destination <code>Control</code> or <code>null</code>
+ * @param x coordinates to be mapped
+ * @param y coordinates to be mapped
+ * @return point with mapped coordinates
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public Point map (Control from, Control to, int x, int y) {
+ checkDevice ();
+ if (from != null && from.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+ if (to != null && to.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+ Point point = new Point (x, y);
+ if (from == to) return point;
+ NSPoint pt = new NSPoint();
+ pt.x = x;
+ pt.y = y;
+ NSWindow fromWindow = from != null ? from.view.window() : null;
+ NSWindow toWindow = to != null ? to.view.window() : null;
+ if (toWindow != null && fromWindow != null && toWindow.id == fromWindow.id) {
+ pt = from.view.convertPoint_toView_(pt, to.view);
+ } else {
+ if (from != null) {
+ pt = from.view.convertPoint_toView_(pt, null);
+ pt = fromWindow.convertBaseToScreen(pt);
+ pt.y = fromWindow.screen().frame().height - pt.y;
+ }
+ if (to != null) {
+ pt.y = toWindow.screen().frame().height - pt.y;
+ pt = toWindow.convertScreenToBase(pt);
+ pt = to.view.convertPoint_fromView_(pt, null);
+ }
+ }
+ point.x = (int)pt.x;
+ point.y = (int)pt.y;
+ return point;
+}
+
+/**
+ * Maps a point from one coordinate system to another.
+ * When the control is null, coordinates are mapped to
+ * the display.
+ * <p>
+ * NOTE: On right-to-left platforms where the coordinate
+ * systems are mirrored, special care needs to be taken
+ * when mapping coordinates from one control to another
+ * to ensure the result is correctly mirrored.
+ *
+ * Mapping a point that is the origin of a rectangle and
+ * then adding the width and height is not equivalent to
+ * mapping the rectangle. When one control is mirrored
+ * and the other is not, adding the width and height to a
+ * point that was mapped causes the rectangle to extend
+ * in the wrong direction. Mapping the entire rectangle
+ * instead of just one point causes both the origin and
+ * the corner of the rectangle to be mapped.
+ * </p>
+ *
+ * @param from the source <code>Control</code> or <code>null</code>
+ * @param to the destination <code>Control</code> or <code>null</code>
+ * @param rectangle to be mapped
+ * @return rectangle with mapped coordinates
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the rectangle is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public Rectangle map (Control from, Control to, Rectangle rectangle) {
+ checkDevice ();
+ if (rectangle == null) error (SWT.ERROR_NULL_ARGUMENT);
+ return map (from, to, rectangle.x, rectangle.y, rectangle.width, rectangle.height);
+}
+
+/**
+ * Maps a point from one coordinate system to another.
+ * When the control is null, coordinates are mapped to
+ * the display.
+ * <p>
+ * NOTE: On right-to-left platforms where the coordinate
+ * systems are mirrored, special care needs to be taken
+ * when mapping coordinates from one control to another
+ * to ensure the result is correctly mirrored.
+ *
+ * Mapping a point that is the origin of a rectangle and
+ * then adding the width and height is not equivalent to
+ * mapping the rectangle. When one control is mirrored
+ * and the other is not, adding the width and height to a
+ * point that was mapped causes the rectangle to extend
+ * in the wrong direction. Mapping the entire rectangle
+ * instead of just one point causes both the origin and
+ * the corner of the rectangle to be mapped.
+ * </p>
+ *
+ * @param from the source <code>Control</code> or <code>null</code>
+ * @param to the destination <code>Control</code> or <code>null</code>
+ * @param x coordinates to be mapped
+ * @param y coordinates to be mapped
+ * @param width coordinates to be mapped
+ * @param height coordinates to be mapped
+ * @return rectangle with mapped coordinates
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public Rectangle map (Control from, Control to, int x, int y, int width, int height) {
+ checkDevice ();
+ if (from != null && from.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+ if (to != null && to.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+ Rectangle rectangle = new Rectangle (x, y, width, height);
+ if (from == to) return rectangle;
+ NSPoint pt = new NSPoint();
+ pt.x = x;
+ pt.y = y;
+ NSWindow fromWindow = from != null ? from.view.window() : null;
+ NSWindow toWindow = to != null ? to.view.window() : null;
+ if (toWindow != null && fromWindow != null && toWindow.id == fromWindow.id) {
+ pt = from.view.convertPoint_toView_(pt, to.view);
+ } else {
+ if (from != null) {
+ pt = from.view.convertPoint_toView_(pt, null);
+ pt = fromWindow.convertBaseToScreen(pt);
+ pt.y = fromWindow.screen().frame().height - pt.y;
+ }
+ if (to != null) {
+ pt.y = toWindow.screen().frame().height - pt.y;
+ pt = toWindow.convertScreenToBase(pt);
+ pt = to.view.convertPoint_fromView_(pt, null);
+ }
+ }
+ rectangle.x = (int)pt.x;
+ rectangle.y = (int)pt.y;
+ return rectangle;
+}
+
+/**
+ * Reads an event from the operating system's event queue,
+ * dispatches it appropriately, and returns <code>true</code>
+ * if there is potentially more work to do, or <code>false</code>
+ * if the caller can sleep until another event is placed on
+ * the event queue.
+ * <p>
+ * In addition to checking the system event queue, this method also
+ * checks if any inter-thread messages (created by <code>syncExec()</code>
+ * or <code>asyncExec()</code>) are waiting to be processed, and if
+ * so handles them before returning.
+ * </p>
+ *
+ * @return <code>false</code> if the caller can sleep upon return from this method
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_FAILED_EXEC - if an exception occurred while running an inter-thread message</li>
+ * </ul>
+ *
+ * @see #sleep
+ * @see #wake
+ */
+public boolean readAndDispatch () {
+ checkDevice ();
+ NSAutoreleasePool pool = (NSAutoreleasePool)new NSAutoreleasePool().alloc().init();
+ try {
+ boolean events = false;
+ events |= runTimers ();
+ NSEvent event = application.nextEventMatchingMask(0, null, OS.NSDefaultRunLoopMode, true);
+ if (event != null) {
+ events = true;
+ application.sendEvent(event);
+ }
+ if (events) {
+ runDeferredEvents ();
+ return true;
+ }
+ return runAsyncMessages (false);
+ } finally {
+ pool.release();
+ }
+}
+
+static void register (Display display) {
+ synchronized (Device.class) {
+ for (int i=0; i<Displays.length; i++) {
+ if (Displays [i] == null) {
+ Displays [i] = display;
+ return;
+ }
+ }
+ Display [] newDisplays = new Display [Displays.length + 4];
+ System.arraycopy (Displays, 0, newDisplays, 0, Displays.length);
+ newDisplays [Displays.length] = display;
+ Displays = newDisplays;
+ }
+}
+
+/**
+ * Releases any internal resources back to the operating
+ * system and clears all fields except the device handle.
+ * <p>
+ * Disposes all shells which are currently open on the display.
+ * After this method has been invoked, all related related shells
+ * will answer <code>true</code> when sent the message
+ * <code>isDisposed()</code>.
+ * </p><p>
+ * When a device is destroyed, resources that were acquired
+ * on behalf of the programmer need to be returned to the
+ * operating system. For example, if the device allocated a
+ * font to be used as the system font, this font would be
+ * freed in <code>release</code>. Also,to assist the garbage
+ * collector and minimize the amount of memory that is not
+ * reclaimed when the programmer keeps a reference to a
+ * disposed device, all fields except the handle are zero'd.
+ * The handle is needed by <code>destroy</code>.
+ * </p>
+ * This method is called before <code>destroy</code>.
+ *
+ * @see Device#dispose
+ * @see #destroy
+ */
+protected void release () {
+ disposing = true;
+ sendEvent (SWT.Dispose, new Event ());
+ Shell [] shells = getShells ();
+ for (int i=0; i<shells.length; i++) {
+ Shell shell = shells [i];
+ if (!shell.isDisposed ()) shell.dispose ();
+ }
+ if (tray != null) tray.dispose ();
+ tray = null;
+// while (readAndDispatch ()) {}
+ if (disposeList != null) {
+ for (int i=0; i<disposeList.length; i++) {
+ if (disposeList [i] != null) disposeList [i].run ();
+ }
+ }
+ disposeList = null;
+ synchronizer.releaseSynchronizer ();
+ synchronizer = null;
+ releaseDisplay ();
+ super.release ();
+}
+
+void releaseDisplay () {
+ /* Release the System Images */
+ if (errorImage != null) errorImage.dispose ();
+ if (infoImage != null) infoImage.dispose ();
+ if (warningImage != null) warningImage.dispose ();
+ errorImage = infoImage = warningImage = null;
+
+ //TODO - stop caret
+ currentCaret = null;
+
+ /* Release Timers */
+ if (nsTimers != null) {
+ for (int i=0; i<nsTimers.length; i++) {
+ //TODO - check -1 as sentinal
+ if (nsTimers [i] != null /*&& timerIds [i] != -1*/) {
+ nsTimers [i].invalidate();
+ nsTimers [i].release();
+ }
+ }
+ }
+ nsTimers = null;
+
+ /* Release the System Cursors */
+ for (int i = 0; i < cursors.length; i++) {
+ if (cursors [i] != null) cursors [i].dispose ();
+ }
+ cursors = null;
+
+ if (windowDelegateCallback2 != null) windowDelegateCallback2.dispose ();
+ if (windowDelegateCallback3 != null) windowDelegateCallback3.dispose ();
+ if (windowDelegateCallback4 != null) windowDelegateCallback4.dispose ();
+ if (windowDelegateCallback5 != null) windowDelegateCallback5.dispose ();
+ if (windowDelegateCallback6 != null) windowDelegateCallback6.dispose ();
+ if (dialogCallback3 != null) dialogCallback3.dispose ();
+ windowDelegateCallback2 = windowDelegateCallback3 = windowDelegateCallback4 = null;
+ windowDelegateCallback6 = windowDelegateCallback5 = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when an event of the given type occurs anywhere in
+ * a widget. The event type is one of the event constants defined
+ * in class <code>SWT</code>.
+ *
+ * @param eventType the type of event to listen for
+ * @param listener the listener which should no longer be notified when the event occurs
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Listener
+ * @see SWT
+ * @see #addFilter
+ * @see #addListener
+ *
+ * @since 3.0
+ */
+public void removeFilter (int eventType, Listener listener) {
+ checkDevice ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (filterTable == null) return;
+ filterTable.unhook (eventType, listener);
+ if (filterTable.size () == 0) filterTable = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when an event of the given type occurs. The event type
+ * is one of the event constants defined in class <code>SWT</code>.
+ *
+ * @param eventType the type of event to listen for
+ * @param listener the listener which should no longer be notified when the event occurs
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Listener
+ * @see SWT
+ * @see #addListener
+ *
+ * @since 2.0
+ */
+public void removeListener (int eventType, Listener listener) {
+ checkDevice ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (eventType, listener);
+}
+
+//void removeMenu (Menu menu) {
+// if (menus == null) return;
+// menus [menu.id - ID_START] = null;
+//}
+//
+//void removePopup (Menu menu) {
+// if (popups == null) return;
+// for (int i=0; i<popups.length; i++) {
+// if (popups [i] == menu) {
+// popups [i] = null;
+// return;
+// }
+// }
+//}
+
+boolean runAsyncMessages (boolean all) {
+ return synchronizer.runAsyncMessages (all);
+}
+
+boolean runDeferredEvents () {
+ /*
+ * Run deferred events. This code is always
+ * called in the Display's thread so it must
+ * be re-enterant need not be synchronized.
+ */
+ while (eventQueue != null) {
+
+ /* Take an event off the queue */
+ Event event = eventQueue [0];
+ if (event == null) break;
+ int length = eventQueue.length;
+ System.arraycopy (eventQueue, 1, eventQueue, 0, --length);
+ eventQueue [length] = null;
+
+ /* Run the event */
+ Widget widget = event.widget;
+ if (widget != null && !widget.isDisposed ()) {
+ Widget item = event.item;
+ if (item == null || !item.isDisposed ()) {
+ widget.notifyListeners (event.type, event);
+ }
+ }
+
+ /*
+ * At this point, the event queue could
+ * be null due to a recursive invokation
+ * when running the event.
+ */
+ }
+
+ /* Clear the queue */
+ eventQueue = null;
+ return true;
+}
+
+boolean runTimers () {
+ if (timerList == null) return false;
+ boolean result = false;
+ for (int i=0; i<timerList.length; i++) {
+ if (nsTimers [i] == null && timerList [i] != null) {
+ Runnable runnable = timerList [i];
+ timerList [i] = null;
+ if (runnable != null) {
+ result = true;
+ runnable.run ();
+ }
+ }
+ }
+ return result;
+}
+
+void sendEvent (int eventType, Event event) {
+ if (eventTable == null && filterTable == null) {
+ return;
+ }
+ if (event == null) event = new Event ();
+ event.display = this;
+ event.type = eventType;
+ if (event.time == 0) event.time = getLastEventTime ();
+ if (!filterEvent (event)) {
+ if (eventTable != null) eventTable.sendEvent (event);
+ }
+}
+
+/**
+ * On platforms which support it, sets the application name
+ * to be the argument. On Motif, for example, this can be used
+ * to set the name used for resource lookup. Specifying
+ * <code>null</code> for the name clears it.
+ *
+ * @param name the new app name or <code>null</code>
+ */
+public static void setAppName (String name) {
+ APP_NAME = name;
+}
+
+//TODO - use custom timer instead of timerExec
+Runnable caretTimer = new Runnable () {
+ public void run () {
+ if (currentCaret != null) {
+ if (currentCaret == null || currentCaret.isDisposed()) return;
+ if (currentCaret.blinkCaret ()) {
+ int blinkRate = currentCaret.blinkRate;
+ if (blinkRate != 0) timerExec (blinkRate, this);
+ } else {
+ currentCaret = null;
+ }
+ }
+
+ }
+};
+void setCurrentCaret (Caret caret) {
+// if (caretID != 0) OS.RemoveEventLoopTimer (caretID);
+// caretID = 0;
+ currentCaret = caret;
+ if (currentCaret != null) {
+ int blinkRate = currentCaret.blinkRate;
+ timerExec (blinkRate, caretTimer);
+ }
+}
+
+/**
+ * Sets the location of the on-screen pointer relative to the top left corner
+ * of the screen. <b>Note: It is typically considered bad practice for a
+ * program to move the on-screen pointer location.</b>
+ *
+ * @param x the new x coordinate for the cursor
+ * @param y the new y coordinate for the cursor
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public void setCursorLocation (int x, int y) {
+ checkDevice ();
+ CGPoint pt = new CGPoint ();
+ pt.x = x; pt.y = y;
+ OS.CGWarpMouseCursorPosition (pt);
+}
+
+/**
+ * Sets the location of the on-screen pointer relative to the top left corner
+ * of the screen. <b>Note: It is typically considered bad practice for a
+ * program to move the on-screen pointer location.</b>
+ *
+ * @param point new position
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_NULL_ARGUMENT - if the point is null
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public void setCursorLocation (Point point) {
+ checkDevice ();
+ if (point == null) error (SWT.ERROR_NULL_ARGUMENT);
+ setCursorLocation (point.x, point.y);
+}
+
+/**
+ * Sets the application defined property of the receiver
+ * with the specified name to the given argument.
+ * <p>
+ * Applications may have associated arbitrary objects with the
+ * receiver in this fashion. If the objects stored in the
+ * properties need to be notified when the display is disposed
+ * of, it is the application's responsibility provide a
+ * <code>disposeExec()</code> handler which does so.
+ * </p>
+ *
+ * @param key the name of the property
+ * @param value the new value for the property
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the key is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getData(String)
+ * @see #disposeExec(Runnable)
+ */
+public void setData (String key, Object value) {
+ checkDevice ();
+ if (key == null) error (SWT.ERROR_NULL_ARGUMENT);
+
+ /* Remove the key/value pair */
+ if (value == null) {
+ if (keys == null) return;
+ int index = 0;
+ while (index < keys.length && !keys [index].equals (key)) index++;
+ if (index == keys.length) return;
+ if (keys.length == 1) {
+ keys = null;
+ values = null;
+ } else {
+ String [] newKeys = new String [keys.length - 1];
+ Object [] newValues = new Object [values.length - 1];
+ System.arraycopy (keys, 0, newKeys, 0, index);
+ System.arraycopy (keys, index + 1, newKeys, index, newKeys.length - index);
+ System.arraycopy (values, 0, newValues, 0, index);
+ System.arraycopy (values, index + 1, newValues, index, newValues.length - index);
+ keys = newKeys;
+ values = newValues;
+ }
+ return;
+ }
+
+ /* Add the key/value pair */
+ if (keys == null) {
+ keys = new String [] {key};
+ values = new Object [] {value};
+ return;
+ }
+ for (int i=0; i<keys.length; i++) {
+ if (keys [i].equals (key)) {
+ values [i] = value;
+ return;
+ }
+ }
+ String [] newKeys = new String [keys.length + 1];
+ Object [] newValues = new Object [values.length + 1];
+ System.arraycopy (keys, 0, newKeys, 0, keys.length);
+ System.arraycopy (values, 0, newValues, 0, values.length);
+ newKeys [keys.length] = key;
+ newValues [values.length] = value;
+ keys = newKeys;
+ values = newValues;
+}
+
+/**
+ * Sets the application defined, display specific data
+ * associated with the receiver, to the argument.
+ * The <em>display specific data</em> is a single,
+ * unnamed field that is stored with every display.
+ * <p>
+ * Applications may put arbitrary objects in this field. If
+ * the object stored in the display specific data needs to
+ * be notified when the display is disposed of, it is the
+ * application's responsibility provide a
+ * <code>disposeExec()</code> handler which does so.
+ * </p>
+ *
+ * @param data the new display specific data
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #getData()
+ * @see #disposeExec(Runnable)
+ */
+public void setData (Object data) {
+ checkDevice ();
+ this.data = data;
+}
+
+/**
+ * Sets the synchronizer used by the display to be
+ * the argument, which can not be null.
+ *
+ * @param synchronizer the new synchronizer for the display (must not be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the synchronizer is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_FAILED_EXEC - if an exception occurred while running an inter-thread message</li>
+ * </ul>
+ */
+public void setSynchronizer (Synchronizer synchronizer) {
+ checkDevice ();
+ if (synchronizer == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (synchronizer == this.synchronizer) return;
+ Synchronizer oldSynchronizer;
+ synchronized (Device.class) {
+ oldSynchronizer = this.synchronizer;
+ this.synchronizer = synchronizer;
+ }
+ if (oldSynchronizer != null) {
+ oldSynchronizer.runAsyncMessages(true);
+ }
+}
+
+/**
+ * Causes the user-interface thread to <em>sleep</em> (that is,
+ * to be put in a state where it does not consume CPU cycles)
+ * until an event is received or it is otherwise awakened.
+ *
+ * @return <code>true</code> if an event requiring dispatching was placed on the queue.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #wake
+ */
+public boolean sleep () {
+ checkDevice ();
+ if (getMessageCount () != 0) return true;
+ NSAutoreleasePool pool = (NSAutoreleasePool)new NSAutoreleasePool().alloc().init();
+ try {
+ allowTimers = runAsyncMessages = false;
+ NSRunLoop.currentRunLoop().runMode(OS.NSDefaultRunLoopMode, NSDate.distantFuture());
+ allowTimers = runAsyncMessages = true;
+ return true;
+ } finally {
+ pool.release();
+ }
+}
+
+int sourceProc (int info) {
+ return 0;
+}
+
+/**
+ * Causes the <code>run()</code> method of the runnable to
+ * be invoked by the user-interface thread at the next
+ * reasonable opportunity. The thread which calls this method
+ * is suspended until the runnable completes. Specifying <code>null</code>
+ * as the runnable simply wakes the user-interface thread.
+ * <p>
+ * Note that at the time the runnable is invoked, widgets
+ * that have the receiver as their display may have been
+ * disposed. Therefore, it is necessary to check for this
+ * case inside the runnable before accessing the widget.
+ * </p>
+ *
+ * @param runnable code to run on the user-interface thread or <code>null</code>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_FAILED_EXEC - if an exception occurred when executing the runnable</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #asyncExec
+ */
+public void syncExec (Runnable runnable) {
+ Synchronizer synchronizer;
+ synchronized (Device.class) {
+ if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+ synchronizer = this.synchronizer;
+ }
+ synchronizer.syncExec (runnable);
+}
+
+/**
+ * Causes the <code>run()</code> method of the runnable to
+ * be invoked by the user-interface thread after the specified
+ * number of milliseconds have elapsed. If milliseconds is less
+ * than zero, the runnable is not executed.
+ * <p>
+ * Note that at the time the runnable is invoked, widgets
+ * that have the receiver as their display may have been
+ * disposed. Therefore, it is necessary to check for this
+ * case inside the runnable before accessing the widget.
+ * </p>
+ *
+ * @param milliseconds the delay before running the runnable
+ * @param runnable code to run on the user-interface thread
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the runnable is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #asyncExec
+ */
+public void timerExec (int milliseconds, Runnable runnable) {
+ checkDevice ();
+ //TODO - remove a timer, reschedule a timer not tested
+ if (runnable == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (timerList == null) timerList = new Runnable [4];
+ if (nsTimers == null) nsTimers = new NSTimer [4];
+ int index = 0;
+ while (index < timerList.length) {
+ if (timerList [index] == runnable) break;
+ index++;
+ }
+ if (index != timerList.length) {
+ NSTimer timer = nsTimers [index];
+ if (milliseconds < 0) {
+ timer.invalidate();
+ timerList [index] = null;
+ nsTimers [index] = null;
+ } else {
+ timer.setFireDate(NSDate.dateWithTimeIntervalSinceNow (milliseconds / 1000.0));
+ }
+ return;
+ }
+ if (milliseconds < 0) return;
+ index = 0;
+ while (index < timerList.length) {
+ if (timerList [index] == null) break;
+ index++;
+ }
+ if (index == timerList.length) {
+ Runnable [] newTimerList = new Runnable [timerList.length + 4];
+ System.arraycopy (timerList, 0, newTimerList, 0, timerList.length);
+ timerList = newTimerList;
+ NSTimer [] newTimerIds = new NSTimer [nsTimers.length + 4];
+ System.arraycopy (nsTimers, 0, newTimerIds, 0, nsTimers.length);
+ nsTimers = newTimerIds;
+ }
+ NSTimer timer = NSTimer.static_scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_(milliseconds / 1000.0, timerDelegate, OS.sel_timerProc_1, 0, false);
+ timer.retain();
+ if (timer != null) {
+ nsTimers [index] = timer;
+ timerList [index] = runnable;
+ }
+}
+
+int timerProc (int id) {
+ NSTimer timer = new NSTimer (id);
+ int index = timer.userInfo();
+ if (timerList == null) return 0;
+ if (0 <= index && index < timerList.length) {
+ if (allowTimers) {
+ Runnable runnable = timerList [index];
+ timerList [index] = null;
+ nsTimers [index] = null;
+ if (runnable != null) runnable.run ();
+ } else {
+ nsTimers [index] = null;
+ wakeThread ();
+ }
+ }
+ timer.release();
+ return 0;
+}
+
+/**
+ * Forces all outstanding paint requests for the display
+ * to be processed before this method returns.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see Control#update()
+ */
+public void update () {
+ checkDevice ();
+// Shell [] shells = getShells ();
+// for (int i=0; i<shells.length; i++) {
+// Shell shell = shells [i];
+// if (!shell.isDisposed ()) shell.update (true);
+// }
+
+}
+
+/**
+ * If the receiver's user-interface thread was <code>sleep</code>ing,
+ * causes it to be awakened and start running again. Note that this
+ * method may be called from any thread.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @see #sleep
+ */
+public void wake () {
+ synchronized (Device.class) {
+ if (isDisposed ()) error (SWT.ERROR_DEVICE_DISPOSED);
+ if (thread == Thread.currentThread ()) return;
+ wakeThread ();
+ }
+}
+
+void wakeThread () {
+ NSObject object = new NSObject().alloc().init();
+ object.performSelectorOnMainThread_withObject_waitUntilDone_(OS.sel_release, null, false);
+}
+
+int dialogProc(int id, int sel, int arg0) {
+ int jniRef = OS.objc_msgSend(id, OS.sel_tag);
+ if (jniRef == 0 || jniRef == -1) return 0;
+ if (sel == OS.sel_changeColor_1) {
+ ColorDialog dialog = (ColorDialog)OS.JNIGetObject(jniRef);
+ if (dialog == null) return 0;
+ dialog.changeColor(arg0);
+ } else if (sel == OS.sel_changeFont_1) {
+ FontDialog dialog = (FontDialog)OS.JNIGetObject(jniRef);
+ if (dialog == null) return 0;
+ dialog.changeFont(arg0);
+ } else if (sel == OS.sel_windowWillClose_1) {
+ Object object = OS.JNIGetObject(jniRef);
+ if (object instanceof FontDialog) {
+ ((FontDialog)object).windowWillClose(arg0);
+ } else if (object instanceof ColorDialog) {
+ ((ColorDialog)object).windowWillClose(arg0);
+ }
+ }
+ return 0;
+}
+
+int windowDelegateProc(int delegate, int sel) {
+ if (sel == OS.sel_tag) {
+ int[] tag = new int[1];
+ OS.object_getInstanceVariable(delegate, "tag", tag);
+ return tag[0];
+ }
+ int jniRef = OS.objc_msgSend(delegate, OS.sel_tag);
+ if (jniRef == 0 || jniRef == -1) return 0;
+ Widget widget = (Widget)OS.JNIGetObject(jniRef);
+ if (widget == null) return 0;
+ if (sel == OS.sel_isFlipped) {
+ return widget.isFlipped() ? 1 : 0;
+ }
+ if (sel == OS.sel_sendSelection) {
+ widget.sendSelection();
+ return 0;
+ }
+ if (sel == OS.sel_sendDoubleSelection) {
+ widget.sendDoubleSelection();
+ return 0;
+ }
+ if (sel == OS.sel_sendVerticalSelection) {
+ widget.sendVerticalSelection();
+ return 0;
+ }
+ if (sel == OS.sel_sendHorizontalSelection) {
+ widget.sendHorizontalSelection();
+ return 0;
+ }
+ if (sel == OS.sel_acceptsFirstResponder) {
+ return widget.acceptsFirstResponder() ? 1 : 0;
+ }
+ if (sel == OS.sel_becomeFirstResponder) {
+ return widget.becomeFirstResponder() ? 1 : 0;
+ }
+ if (sel == OS.sel_resignFirstResponder) {
+ return widget.resignFirstResponder() ? 1 : 0;
+ }
+ return 0;
+}
+
+int windowDelegateProc(int id, int sel, int arg0) {
+ if (sel == OS.sel_timerProc_1) {
+ return timerProc (arg0);
+ }
+ if (sel == OS.sel_setTag_1) {
+ OS.object_setInstanceVariable(id, "tag", arg0);
+ return 0;
+ }
+ int jniRef = OS.objc_msgSend(id, OS.sel_tag);
+ if (jniRef == 0 || jniRef == -1) return 0;
+ Widget widget = (Widget)OS.JNIGetObject(jniRef);
+ if (widget == null) return 0;
+ if (sel == OS.sel_windowWillClose_1) {
+ widget.windowWillClose(arg0);
+ } else if (sel == OS.sel_drawRect_1) {
+ NSRect rect = new NSRect();
+ OS.memmove(rect, arg0, NSRect.sizeof);
+ widget.drawRect(id, rect);
+ } else if (sel == OS.sel_windowShouldClose_1) {
+ return widget.windowShouldClose(arg0) ? 1 : 0;
+ } else if (sel == OS.sel_mouseDown_1) {
+ widget.mouseDown(arg0);
+ } else if (sel == OS.sel_rightMouseDown_1) {
+ widget.rightMouseDown(arg0);
+ } else if (sel == OS.sel_mouseDragged_1) {
+ widget.mouseDragged(arg0);
+ } else if (sel == OS.sel_mouseUp_1) {
+ widget.mouseUp(arg0);
+ } else if (sel == OS.sel_mouseEntered_1) {
+ widget.mouseEntered(arg0);
+ } else if (sel == OS.sel_keyDown_1) {
+ widget.keyDown(arg0);
+ } else if (sel == OS.sel_keyUp_1) {
+ widget.keyUp(arg0);
+ } else if (sel == OS.sel_numberOfRowsInTableView_1) {
+ return widget.numberOfRowsInTableView(arg0);
+ } else if (sel == OS.sel_comboBoxSelectionDidChange_1) {
+ widget.comboBoxSelectionDidChange(arg0);
+ } else if (sel == OS.sel_tableViewSelectionDidChange_1) {
+ widget.tableViewSelectionDidChange(arg0);
+ } else if (sel == OS.sel_windowDidResize_1) {
+ widget.windowDidResize(arg0);
+ } else if (sel == OS.sel_windowDidMove_1) {
+ widget.windowDidMove(arg0);
+ } else if (sel == OS.sel_menuForEvent_1) {
+ return widget.menuForEvent(arg0);
+ }
+ return 0;
+}
+
+
+int windowDelegateProc(int delegate, int sel, int arg0, int arg1) {
+ int jniRef = OS.objc_msgSend(delegate, OS.sel_tag);
+ if (jniRef == 0 || jniRef == -1) return 0;
+ Widget widget = (Widget)OS.JNIGetObject(jniRef);
+ if (widget == null) return 0;
+ if (sel == OS.sel_tabView_1willSelectTabViewItem_1) {
+ widget.willSelectTabViewItem(arg0, arg1);
+ } else if (sel == OS.sel_outlineView_1isItemExpandable_1) {
+ return widget.outlineView_isItemExpandable(arg0, arg1) ? 1 : 0;
+ } else if (sel == OS.sel_outlineView_1numberOfChildrenOfItem_1) {
+ return widget.outlineView_numberOfChildrenOfItem(arg0, arg1);
+ }
+ return 0;
+}
+
+int windowDelegateProc(int delegate, int sel, int arg0, int arg1, int arg2) {
+ int jniRef = OS.objc_msgSend(delegate, OS.sel_tag);
+ if (jniRef == 0 || jniRef == -1) return 0;
+ Widget widget = (Widget)OS.JNIGetObject(jniRef);
+ if (widget == null) return 0;
+ if (sel == OS.sel_tableView_1objectValueForTableColumn_1row_1) {
+ return widget.tableViewobjectValueForTableColumnrow(arg0, arg1, arg2);
+ }
+ if (sel == OS.sel_tableView_1shouldEditTableColumn_1row_1) {
+ return widget.tableViewshouldEditTableColumnrow(arg0, arg1, arg2) ? 1 : 0;
+ } else if (sel == OS.sel_textView_1clickedOnLink_1atIndex_1) {
+ return widget.clickOnLink(arg0, arg1, arg2) ? 1 : 0;
+ } else if (sel == OS.sel_outlineView_1child_1ofItem_1) {
+ return widget.outlineView_child_ofItem(arg0, arg1, arg2);
+ } else if (sel == OS.sel_outlineView_1objectValueForTableColumn_1byItem_1) {
+ return widget.outlineView_objectValueForTableColumn_byItem(arg0, arg1, arg2);
+ }
+ return 0;
+}
+
+int windowDelegateProc(int delegate, int sel, int arg0, int arg1, int arg2, int arg3) {
+ int jniRef = OS.objc_msgSend(delegate, OS.sel_tag);
+ if (jniRef == 0 || jniRef == -1) return 0;
+ Widget widget = (Widget)OS.JNIGetObject(jniRef);
+ if (widget == null) return 0;
+ if (sel == OS.sel_tableView_1willDisplayCell_1forTableColumn_1row_1) {
+ widget.tableViewwillDisplayCellforTableColumnrow(arg0, arg1, arg2, arg3);
+ } else if (sel == OS.sel_outlineView_1willDisplayCell_1forTableColumn_1item_1) {
+ widget.outlineView_willDisplayCell_forTableColumn_item(arg0, arg1, arg2, arg3);
+ } else if (sel == OS.sel_outlineView_1setObjectValue_1forTableColumn_1byItem_1) {
+ widget.outlineView_setObjectValue_forTableColumn_byItem(arg0, arg1, arg2, arg3);
+ }
+ return 0;
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FileDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FileDialog.java
new file mode 100755
index 0000000000..5659d6bb4a
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FileDialog.java
@@ -0,0 +1,256 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * Instances of this class allow the user to navigate
+ * the file system and select or enter a file name.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>SAVE, OPEN, MULTI</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles SAVE and OPEN may be specified.
+ * </p><p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ */
+public class FileDialog extends Dialog {
+ String [] filterNames = new String [0];
+ String [] filterExtensions = new String [0];
+ String [] fileNames = new String[0];
+ String filterPath = "", fileName = "";
+ static final char EXTENSION_SEPARATOR = ';';
+
+/**
+ * Constructs a new instance of this class given only its parent.
+ *
+ * @param parent a shell which will be the parent of the new instance
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public FileDialog (Shell parent) {
+ this (parent, SWT.APPLICATION_MODAL);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a shell which will be the parent of the new instance
+ * @param style the style of dialog to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public FileDialog (Shell parent, int style) {
+ super (parent, style);
+ checkSubclass ();
+}
+
+/**
+ * Returns the path of the first file that was
+ * selected in the dialog relative to the filter path, or an
+ * empty string if no such file has been selected.
+ *
+ * @return the relative path of the file
+ */
+public String getFileName () {
+ return fileName;
+}
+
+/**
+ * Returns a (possibly empty) array with the paths of all files
+ * that were selected in the dialog relative to the filter path.
+ *
+ * @return the relative paths of the files
+ */
+public String [] getFileNames () {
+ return fileNames;
+}
+
+/**
+ * Returns the file extensions which the dialog will
+ * use to filter the files it shows.
+ *
+ * @return the file extensions filter
+ */
+public String [] getFilterExtensions () {
+ return filterExtensions;
+}
+
+/**
+ * Returns the names that describe the filter extensions
+ * which the dialog will use to filter the files it shows.
+ *
+ * @return the list of filter names
+ */
+public String [] getFilterNames () {
+ return filterNames;
+}
+
+/**
+ * Returns the directory path that the dialog will use, or an empty
+ * string if this is not set. File names in this path will appear
+ * in the dialog, filtered according to the filter extensions.
+ *
+ * @return the directory path string
+ *
+ * @see #setFilterExtensions
+ */
+public String getFilterPath () {
+ return filterPath;
+}
+
+/**
+ * Makes the dialog visible and brings it to the front
+ * of the display.
+ *
+ * @return a string describing the absolute path of the first selected file,
+ * or null if the dialog was cancelled or an error occurred
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the dialog has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the dialog</li>
+ * </ul>
+ */
+public String open () {
+ String fullPath = null;
+ fileNames = new String [0];
+ NSSavePanel panel;
+ if ((style & SWT.SAVE) != 0) {
+ NSSavePanel savePanel = NSSavePanel.savePanel();
+ panel = savePanel;
+ } else {
+ NSOpenPanel openPanel = NSOpenPanel.openPanel();
+ openPanel.setAllowsMultipleSelection((style & SWT.MULTI) != 0);
+ panel = openPanel;
+ }
+ if (filterPath != null) panel.setDirectory(NSString.stringWith(filterPath));
+ panel.setTitle(NSString.stringWith(title != null ? title : ""));
+ int response = panel.runModal();
+ if (response == OS.NSFileHandlingPanelOKButton) {
+ NSString filename = panel.filename();
+ char[] buffer = new char[filename.length()];
+ filename.getCharacters_(buffer);
+ fullPath = new String(buffer);
+ if ((style & SWT.SAVE) == 0) {
+ NSArray filenames = ((NSOpenPanel)panel).filenames();
+ int count = filenames.count();
+ fileNames = new String[count];
+ for (int i = 0; i < count; i++) {
+ filename = new NSString(filenames.objectAtIndex(i));
+ buffer = new char[filename.length()];
+ filename.getCharacters_(buffer);
+ fileNames[i] = new String(buffer);
+ }
+ }
+ }
+ return fullPath;
+}
+
+/**
+ * Set the initial filename which the dialog will
+ * select by default when opened to the argument,
+ * which may be null. The name will be prefixed with
+ * the filter path when one is supplied.
+ *
+ * @param string the file name
+ */
+public void setFileName (String string) {
+ fileName = string;
+}
+
+/**
+ * Set the file extensions which the dialog will
+ * use to filter the files it shows to the argument,
+ * which may be null.
+ * <p>
+ * The strings are platform specific. For example, on
+ * Windows, an extension filter string is typically of
+ * the form "*.extension", where "*.*" matches all files.
+ * </p>
+ *
+ * @param extensions the file extension filter
+ *
+ * @see #setFilterNames to specify the user-friendly
+ * names corresponding to the extensions
+ */
+public void setFilterExtensions (String [] extensions) {
+ filterExtensions = extensions;
+}
+
+/**
+ * Sets the the names that describe the filter extensions
+ * which the dialog will use to filter the files it shows
+ * to the argument, which may be null.
+ * <p>
+ * Each name is a user-friendly short description shown for
+ * its corresponding filter. The <code>names</code> array must
+ * be the same length as the <code>extensions</code> array.
+ * </p>
+ *
+ * @param names the list of filter names, or null for no filter names
+ *
+ * @see #setFilterExtensions
+ */
+public void setFilterNames (String [] names) {
+ filterNames = names;
+}
+
+/**
+ * Sets the directory path that the dialog will use
+ * to the argument, which may be null. File names in this
+ * path will appear in the dialog, filtered according
+ * to the filter extensions. If the string is null,
+ * then the operating system's default filter path
+ * will be used.
+ * <p>
+ * Note that the path string is platform dependent.
+ * For convenience, either '/' or '\' can be used
+ * as a path separator.
+ * </p>
+ *
+ * @param string the directory path
+ *
+ * @see #setFilterExtensions
+ */
+public void setFilterPath (String string) {
+ filterPath = string;
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FontDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FontDialog.java
new file mode 100755
index 0000000000..1a5b770b9b
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/FontDialog.java
@@ -0,0 +1,281 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * Instances of this class allow the user to select a font
+ * from all available fonts in the system.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ */
+public class FontDialog extends Dialog {
+ FontData fontData;
+ RGB rgb;
+ boolean open;
+ int fontID, fontSize;
+
+/**
+ * Constructs a new instance of this class given only its parent.
+ *
+ * @param parent a shell which will be the parent of the new instance
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public FontDialog (Shell parent) {
+ this (parent, SWT.APPLICATION_MODAL);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a shell which will be the parent of the new instance
+ * @param style the style of dialog to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public FontDialog (Shell parent, int style) {
+ super (parent, style);
+ checkSubclass ();
+}
+
+void changeFont(int arg0) {
+}
+
+/**
+ * Returns a FontData object describing the font that was
+ * selected in the dialog, or null if none is available.
+ *
+ * @return the FontData for the selected font, or null
+ * @deprecated use #getFontList ()
+ */
+public FontData getFontData () {
+ return fontData;
+}
+
+/**
+ * Returns a FontData set describing the font that was
+ * selected in the dialog, or null if none is available.
+ *
+ * @return the FontData for the selected font, or null
+ * @since 2.1.1
+ */
+public FontData [] getFontList () {
+ if (fontData == null) return null;
+ FontData [] result = new FontData [1];
+ result [0] = fontData;
+ return result;
+}
+
+/**
+ * Returns an RGB describing the color that was selected
+ * in the dialog, or null if none is available.
+ *
+ * @return the RGB value for the selected color, or null
+ *
+ * @see PaletteData#getRGBs
+ *
+ * @since 2.1
+ */
+public RGB getRGB () {
+ return rgb;
+}
+
+//int fontProc (int nextHandler, int theEvent, int userData) {
+// int kind = OS.GetEventKind (theEvent);
+// switch (kind) {
+// case OS.kEventFontPanelClosed:
+// open = false;
+// break;
+// case OS.kEventFontSelection:
+// int [] fontID = new int [1];
+// if (OS.GetEventParameter (theEvent, OS.kEventParamATSUFontID, OS.typeUInt32, null, 4, null, fontID) == OS.noErr) {
+// this.fontID = fontID [0];
+// }
+// int [] fontSize = new int [1];
+// if (OS.GetEventParameter (theEvent, OS.kEventParamATSUFontSize, OS.typeFixed, null, 4, null, fontSize) == OS.noErr) {
+// this.fontSize = fontSize [0];
+// }
+// RGBColor color = new RGBColor ();
+// int [] actualSize = new int [1];
+// if (OS.GetEventParameter (theEvent, OS.kEventParamFontColor, OS.typeRGBColor, null, RGBColor.sizeof, actualSize, color) == OS.noErr) {
+// int red = (color.red >> 8) & 0xFF;
+// int green = (color.green >> 8) & 0xFF;
+// int blue = (color.blue >> 8) & 0xFF;
+// rgb = new RGB (red, green, blue);
+// } else {
+// int [] dict = new int [1];
+// if (OS.GetEventParameter (theEvent, OS.kEventParamDictionary, OS.typeCFDictionaryRef, null, 4, actualSize, dict) == OS.noErr) {
+// int [] attrib = new int [1];
+// if (OS.CFDictionaryGetValueIfPresent (dict [0], OS.kFontPanelAttributesKey (), attrib)) {
+// int [] tags = new int [1];
+// int [] sizes = new int [1];
+// int [] values = new int [1];
+// if (OS.CFDictionaryGetValueIfPresent (attrib [0], OS.kFontPanelAttributeTagsKey (), tags) &&
+// OS.CFDictionaryGetValueIfPresent (attrib [0], OS.kFontPanelAttributeSizesKey (), sizes) &&
+// OS.CFDictionaryGetValueIfPresent (attrib [0], OS.kFontPanelAttributeValuesKey (), values)
+// ) {
+// int count = OS.CFDataGetLength (tags [0]) / 4;
+// int tagPtr = OS.CFDataGetBytePtr (tags[0]);
+// int sizePtr = OS.CFDataGetBytePtr (sizes [0]);
+// int [] tag = new int [1];
+// int [] size = new int [1];
+// int valueOffset = 0;
+// for (int i = 0 ; i < count ; i++) {
+// OS.memmove (tag, tagPtr + (i * 4), 4);
+// OS.memmove (size, sizePtr + (i * 4), 4);
+// if (tag [0] == OS.kATSUColorTag && size[0] == RGBColor.sizeof) {
+// int valuePtr = OS.CFDataGetBytePtr (values [0]);
+// OS.memmove (color, valuePtr + valueOffset, RGBColor.sizeof);
+// int red = (color.red >> 8) & 0xFF;
+// int green = (color.green >> 8) & 0xFF;
+// int blue = (color.blue >> 8) & 0xFF;
+// rgb = new RGB (red, green, blue);
+// break ;
+// }
+// valueOffset = size[0];
+// }
+// }
+// }
+// }
+// }
+// break;
+// }
+// return OS.noErr;
+//}
+
+/**
+ * Makes the dialog visible and brings it to the front
+ * of the display.
+ *
+ * @return a FontData object describing the font that was selected,
+ * or null if the dialog was cancelled or an error occurred
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the dialog has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the dialog</li>
+ * </ul>
+ */
+public FontData open () {
+ Display display = parent != null ? parent.display : Display.getCurrent ();
+
+ NSFontPanel panel = NSFontPanel.sharedFontPanel();
+ panel.setTitle(NSString.stringWith(title != null ? title : ""));
+ if (fontData != null) {
+ Font font = new Font(display, fontData);
+ NSFontManager.sharedFontManager().setSelectedFont(font.handle, false);
+ font.dispose();
+ }
+ SWTPanelDelegate delegate = (SWTPanelDelegate)new SWTPanelDelegate().alloc().init();
+ int jniRef = OS.NewGlobalRef(this);
+ if (jniRef == 0) SWT.error(SWT.ERROR_NO_HANDLES);
+ delegate.setTag(jniRef);
+ panel.setDelegate(delegate);
+ fontData = null;
+ panel.orderFront(null);
+ NSApplication.sharedApplication().runModalForWindow_(panel);
+ panel.setDelegate(null);
+ delegate.release();
+ OS.DeleteGlobalRef(jniRef);
+ NSFont font = NSFontManager.sharedFontManager().selectedFont();
+ if (font != null) {
+ //TODO - this does work
+ fontData = Font.cocoa_new(display, font).getFontData()[0];
+ }
+ return fontData;
+}
+
+/**
+ * Sets a FontData object describing the font to be
+ * selected by default in the dialog, or null to let
+ * the platform choose one.
+ *
+ * @param fontData the FontData to use initially, or null
+ * @deprecated use #setFontList (FontData [])
+ */
+public void setFontData (FontData fontData) {
+ this.fontData = fontData;
+}
+
+/**
+ * Sets the set of FontData objects describing the font to
+ * be selected by default in the dialog, or null to let
+ * the platform choose one.
+ *
+ * @param fontData the set of FontData objects to use initially, or null
+ * to let the platform select a default when open() is called
+ *
+ * @see Font#getFontData
+ *
+ * @since 2.1.1
+ */
+public void setFontList (FontData [] fontData) {
+ if (fontData != null && fontData.length > 0) {
+ this.fontData = fontData [0];
+ } else {
+ this.fontData = null;
+ }
+}
+
+/**
+ * Sets the RGB describing the color to be selected by default
+ * in the dialog, or null to let the platform choose one.
+ *
+ * @param rgb the RGB value to use initially, or null to let
+ * the platform select a default when open() is called
+ *
+ * @see PaletteData#getRGBs
+ *
+ * @since 2.1
+ */
+public void setRGB (RGB rgb) {
+ this.rgb = rgb;
+}
+
+void windowWillClose(int sender) {
+ NSApplication.sharedApplication().stop(null);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Group.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Group.java
new file mode 100755
index 0000000000..2bda94490f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Group.java
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * Instances of this class provide an etched border
+ * with an optional title.
+ * <p>
+ * Shadow styles are hints and may not be honoured
+ * by the platform. To create a group with the
+ * default shadow style for the platform, do not
+ * specify a shadow style.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>SHADOW_ETCHED_IN, SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_OUT, SHADOW_NONE</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the above styles may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ */
+public class Group extends Composite {
+ SWTView contentView;
+ String text = "";
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#SHADOW_ETCHED_IN
+ * @see SWT#SHADOW_ETCHED_OUT
+ * @see SWT#SHADOW_IN
+ * @see SWT#SHADOW_OUT
+ * @see SWT#SHADOW_NONE
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Group (Composite parent, int style) {
+ super (parent, checkStyle (style));
+}
+
+static int checkStyle (int style) {
+ style |= SWT.NO_FOCUS;
+ /*
+ * Even though it is legal to create this widget
+ * with scroll bars, they serve no useful purpose
+ * because they do not automatically scroll the
+ * widget's client area. The fix is to clear
+ * the SWT style.
+ */
+ return style & ~(SWT.H_SCROLL | SWT.V_SCROLL);
+}
+
+protected void checkSubclass () {
+ if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+public Rectangle computeTrim (int x, int y, int width, int height) {
+ checkWidget ();
+ NSBox widget = (NSBox)view;
+ NSRect titleRect = widget.titleRect();
+ NSRect frame = contentView.frame();
+ x -= frame.x;
+ y -= frame.y + titleRect.height;
+ width += frame.x * 2;
+ height += frame.y * 2 + titleRect.height;
+ return super.computeTrim(x, y, width, height);
+}
+
+NSView contentView () {
+ return contentView;
+}
+
+void createHandle () {
+ SWTBox widget = (SWTBox)new SWTBox().alloc();
+ widget.initWithFrame(new NSRect());
+ widget.setTitle(NSString.stringWith(""));
+ widget.setTag(jniRef);
+ SWTView contentWidget = (SWTView)new SWTView().alloc();
+ contentWidget.initWithFrame(new NSRect());
+ contentWidget.setTag(jniRef);
+// contentWidget.setDrawsBackground(false);
+ widget.setContentView(contentWidget);
+ contentView = contentWidget;
+ view = widget;
+ parent.contentView().addSubview_(widget);
+}
+
+public Rectangle getClientArea () {
+ checkWidget();
+ NSRect rect = contentView.bounds();
+ return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+}
+
+String getNameText () {
+ return getText ();
+}
+
+/**
+ * Returns the receiver's text, which is the string that the
+ * is used as the <em>title</em>. If the text has not previously
+ * been set, returns an empty string.
+ *
+ * @return the text
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+ checkWidget ();
+ return text;
+}
+
+void releaseHandle () {
+ super.releaseHandle ();
+ if (contentView != null) {
+ contentView.setTag(-1);
+ contentView.release();
+ }
+ contentView = null;
+}
+
+/**
+ * Sets the receiver's text, which is the string that will
+ * be displayed as the receiver's <em>title</em>, to the argument,
+ * which may not be null. The string may include the mnemonic character.
+ * </p>
+ * Mnemonics are indicated by an '&amp;' that causes the next
+ * character to be the mnemonic. When the user presses a
+ * key sequence that matches the mnemonic, focus is assigned
+ * to the first child of the group. On most platforms, the
+ * mnemonic appears underlined but may be emphasised in a
+ * platform specific manner. The mnemonic indicator character
+ * '&amp;' can be escaped by doubling it in the string, causing
+ * a single '&amp;' to be displayed.
+ * </p>
+ * @param string the new text
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+ checkWidget();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ text = string;
+ char [] buffer = new char [text.length ()];
+ text.getChars (0, buffer.length, buffer, 0);
+ int length = fixMnemonic (buffer);
+ ((NSBox)view).setTitle(NSString.stringWithCharacters(buffer, length));
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java
new file mode 100755
index 0000000000..35fa5462aa
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Label.java
@@ -0,0 +1,321 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+
+/**
+ * Instances of this class represent a non-selectable
+ * user interface object that displays a string or image.
+ * When SEPARATOR is specified, displays a single
+ * vertical or horizontal line.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>SEPARATOR, HORIZONTAL, VERTICAL</dd>
+ * <dd>SHADOW_IN, SHADOW_OUT, SHADOW_NONE</dd>
+ * <dd>CENTER, LEFT, RIGHT, WRAP</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of SHADOW_IN, SHADOW_OUT and SHADOW_NONE may be specified.
+ * SHADOW_NONE is a HINT. Only one of HORIZONTAL and VERTICAL may be specified.
+ * Only one of CENTER, LEFT and RIGHT may be specified.
+ * </p><p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ */
+public class Label extends Control {
+ String text = "";
+ Image image;
+ boolean isImage;
+ NSTextField textView;
+ NSImageView imageView;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#SEPARATOR
+ * @see SWT#HORIZONTAL
+ * @see SWT#VERTICAL
+ * @see SWT#SHADOW_IN
+ * @see SWT#SHADOW_OUT
+ * @see SWT#SHADOW_NONE
+ * @see SWT#CENTER
+ * @see SWT#LEFT
+ * @see SWT#RIGHT
+ * @see SWT#WRAP
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Label (Composite parent, int style) {
+ super (parent, checkStyle (style));
+}
+
+static int checkStyle (int style) {
+ style |= SWT.NO_FOCUS;
+ if ((style & SWT.SEPARATOR) != 0) {
+ style = checkBits (style, SWT.VERTICAL, SWT.HORIZONTAL, 0, 0, 0, 0);
+ return checkBits (style, SWT.SHADOW_OUT, SWT.SHADOW_IN, SWT.SHADOW_NONE, 0, 0, 0);
+ }
+ return checkBits (style, SWT.LEFT, SWT.CENTER, SWT.RIGHT, 0, 0, 0);
+}
+
+public Point computeSize (int wHint, int hHint, boolean changed) {
+ checkWidget();
+ int width = 0, height = 0;
+ if ((style & SWT.SEPARATOR) != 0) {
+ if ((style & SWT.HORIZONTAL) != 0) {
+ width = DEFAULT_WIDTH;
+ height = 3;
+ } else {
+ width = 3;
+ height = DEFAULT_HEIGHT;
+ }
+ } else {
+ if (image != null && isImage) {
+ Rectangle bounds = image.getBounds();
+ width = bounds.width;
+ height = bounds.height;
+ } else {
+ NSRect oldRect = textView.frame();
+ textView.sizeToFit();
+ NSRect newRect = textView.frame();
+ textView.setFrame (oldRect);
+ width = (int)newRect.width;
+ height = (int)newRect.height;
+ }
+ }
+ if (wHint != SWT.DEFAULT) width = wHint;
+ if (hHint != SWT.DEFAULT) height = hHint;
+ return new Point (width, height);
+}
+
+void createHandle () {
+ SWTBox widget = (SWTBox)new SWTBox().alloc();
+ widget.initWithFrame(new NSRect());
+ widget.setTag(jniRef);
+ widget.setTitle(NSString.stringWith(""));
+ if ((style & SWT.SEPARATOR) != 0) {
+ widget.setBoxType(OS.NSBoxSeparator);
+ } else {
+ widget.setBorderType(OS.NSNoBorder);
+
+ NSImageView imageWidget = (NSImageView)new SWTImageView().alloc();
+ imageWidget.initWithFrame(new NSRect());
+ imageWidget.setTag(jniRef);
+
+ NSTextField textWidget = (NSTextField)new NSTextField().alloc();
+ textWidget.initWithFrame(new NSRect());
+ textWidget.setBordered(false);
+ textWidget.setEditable(false);
+ textWidget.setDrawsBackground(false);
+ textWidget.setTag(jniRef);
+
+
+ widget.addSubview_(imageWidget);
+ widget.addSubview_(textWidget);
+ widget.setContentView(textWidget);
+
+ imageView = imageWidget;
+ textView = textWidget;
+ }
+ view = widget;
+ parent.contentView().addSubview_(widget);
+}
+
+/**
+ * Returns a value which describes the position of the
+ * text or image in the receiver. The value will be one of
+ * <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code>
+ * unless the receiver is a <code>SEPARATOR</code> label, in
+ * which case, <code>NONE</code> is returned.
+ *
+ * @return the alignment
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getAlignment () {
+ checkWidget();
+ if ((style & SWT.SEPARATOR) != 0) return SWT.LEFT;
+ if ((style & SWT.CENTER) != 0) return SWT.CENTER;
+ if ((style & SWT.RIGHT) != 0) return SWT.RIGHT;
+ return SWT.LEFT;
+}
+
+/**
+ * Returns the receiver's image if it has one, or null
+ * if it does not.
+ *
+ * @return the receiver's image
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Image getImage () {
+ checkWidget();
+ return image;
+}
+
+String getNameText () {
+ return getText ();
+}
+
+/**
+ * Returns the receiver's text, which will be an empty
+ * string if it has never been set or if the receiver is
+ * a <code>SEPARATOR</code> label.
+ *
+ * @return the receiver's text
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+ checkWidget();
+ if ((style & SWT.SEPARATOR) != 0) return "";
+ return text;
+}
+
+/**
+ * Controls how text and images will be displayed in the receiver.
+ * The argument should be one of <code>LEFT</code>, <code>RIGHT</code>
+ * or <code>CENTER</code>. If the receiver is a <code>SEPARATOR</code>
+ * label, the argument is ignored and the alignment is not changed.
+ *
+ * @param alignment the new alignment
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setAlignment (int alignment) {
+ checkWidget();
+ if ((style & SWT.SEPARATOR) != 0) return;
+ if ((alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER)) == 0) return;
+ style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+ style |= alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+ //TODO - not implemented
+}
+
+int setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
+ int result = super.setBounds(x, y, width, height, move, resize);
+ if ((result & RESIZED) != 0) {
+ if (imageView != null || textView != null) {
+ NSRect rect = view.bounds();
+ imageView.setFrame(rect);
+ textView.setFrame(rect);
+ }
+ }
+ return result;
+}
+
+/**
+ * Sets the receiver's image to the argument, which may be
+ * null indicating that no image should be displayed.
+ *
+ * @param image the image to display on the receiver (may be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setImage (Image image) {
+ checkWidget();
+ if ((style & SWT.SEPARATOR) != 0) return;
+ if (image != null && image.isDisposed ()) {
+ error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ this.image = image;
+ isImage = true;
+ imageView.setImage(image != null ? image.handle : null);
+ ((NSBox)view).setContentView(imageView);
+}
+
+/**
+ * Sets the receiver's text.
+ * <p>
+ * This method sets the widget label. The label may include
+ * the mnemonic character and line delimiters.
+ * </p>
+ * <p>
+ * Mnemonics are indicated by an '&amp;' that causes the next
+ * character to be the mnemonic. When the user presses a
+ * key sequence that matches the mnemonic, focus is assigned
+ * to the control that follows the label. On most platforms,
+ * the mnemonic appears underlined but may be emphasised in a
+ * platform specific manner. The mnemonic indicator character
+ * '&amp;' can be escaped by doubling it in the string, causing
+ * a single '&amp;' to be displayed.
+ * </p>
+ *
+ * @param string the new text
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+ checkWidget();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if ((style & SWT.SEPARATOR) != 0) return;
+ isImage = false;
+ text = string;
+ char [] buffer = new char [text.length ()];
+ text.getChars (0, buffer.length, buffer, 0);
+ int length = fixMnemonic (buffer);
+ new NSCell(textView.cell()).setTitle(NSString.stringWithCharacters(buffer, length));
+ ((NSBox)view).setContentView(textView);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Link.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Link.java
new file mode 100755
index 0000000000..765597e7c5
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Link.java
@@ -0,0 +1,428 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+
+/**
+ * Instances of this class represent a selectable
+ * user interface object that displays a text with
+ * links.
+ * <p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @since 3.1
+ */
+public class Link extends Control {
+ NSScrollView scrollView;
+ String text;
+ Point [] offsets;
+ Point selection;
+ String [] ids;
+ int [] mnemonics;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Link (Composite parent, int style) {
+ super (parent, style);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the control is selected by the user.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener (SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Selection, typedListener);
+ addListener (SWT.DefaultSelection, typedListener);
+}
+
+boolean clickOnLink(int textView, int link, int charIndex) {
+ NSString str = new NSString (link);
+ char [] buffer = new char [str.length ()];
+ str.getCharacters_ (buffer);
+ Event event = new Event ();
+ event.text = new String (buffer);
+ sendEvent (SWT.Selection, event);
+ return true;
+}
+
+public Point computeSize (int wHint, int hHint, boolean changed) {
+ checkWidget ();
+ if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0;
+ if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0;
+ int width, height;
+ //TODO wrapping, wHint
+ int borderStyle = hasBorder() ? OS.NSBezelBorder : OS.NSNoBorder;
+ NSSize borderSize = NSScrollView.frameSizeForContentSize(new NSSize(), false, false, borderStyle);
+ NSTextView widget = (NSTextView)view;
+ NSSize size = widget.textStorage().size();
+ width = (int)(size.width + borderSize.width);
+ height = (int)(size.height + borderSize.height);
+ if (wHint != SWT.DEFAULT) width = wHint;
+ if (hHint != SWT.DEFAULT) height = hHint;
+ int border = getBorderWidth ();
+ width += border * 2;
+ height += border * 2;
+ return new Point (width, height);
+}
+
+void createHandle () {
+ SWTScrollView scrollWidget = (SWTScrollView)new SWTScrollView().alloc();
+ scrollWidget.initWithFrame(new NSRect ());
+ scrollWidget.setDrawsBackground(false);
+ scrollWidget.setBorderType(hasBorder() ? OS.NSBezelBorder : OS.NSNoBorder);
+ scrollWidget.setTag(jniRef);
+
+ SWTTextView widget = (SWTTextView)new SWTTextView().alloc();
+ widget.initWithFrame(new NSRect());
+ widget.setEditable(false);
+ widget.setDrawsBackground(false);
+ widget.setDelegate(widget);
+ widget.setAutoresizingMask (OS.NSViewWidthSizable | OS.NSViewHeightSizable);
+ widget.setTag(jniRef);
+ widget.textContainer().setLineFragmentPadding(0);
+
+ scrollView = scrollWidget;
+ view = widget;
+ scrollView.addSubview_(view);
+ scrollView.setDocumentView(view);
+ parent.contentView().addSubview_(scrollView);
+}
+
+void createWidget () {
+ super.createWidget ();
+ text = "";
+}
+
+String getNameText () {
+ return getText ();
+}
+
+
+/**
+ * Returns the receiver's text, which will be an empty
+ * string if it has never been set.
+ *
+ * @return the receiver's text
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+ checkWidget ();
+ return text;
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ offsets = null;
+ ids = null;
+ mnemonics = null;
+ text = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Selection, listener);
+ eventTable.unhook (SWT.DefaultSelection, listener);
+}
+
+String parse (String string) {
+ int length = string.length ();
+ offsets = new Point [length / 4];
+ ids = new String [length / 4];
+ mnemonics = new int [length / 4 + 1];
+ StringBuffer result = new StringBuffer ();
+ char [] buffer = new char [length];
+ string.getChars (0, string.length (), buffer, 0);
+ int index = 0, state = 0, linkIndex = 0;
+ int start = 0, tagStart = 0, linkStart = 0, endtagStart = 0, refStart = 0;
+ while (index < length) {
+ char c = Character.toLowerCase (buffer [index]);
+ switch (state) {
+ case 0:
+ if (c == '<') {
+ tagStart = index;
+ state++;
+ }
+ break;
+ case 1:
+ if (c == 'a') state++;
+ break;
+ case 2:
+ switch (c) {
+ case 'h':
+ state = 7;
+ break;
+ case '>':
+ linkStart = index + 1;
+ state++;
+ break;
+ default:
+ if (Character.isWhitespace(c)) break;
+ else state = 13;
+ }
+ break;
+ case 3:
+ if (c == '<') {
+ endtagStart = index;
+ state++;
+ }
+ break;
+ case 4:
+ state = c == '/' ? state + 1 : 3;
+ break;
+ case 5:
+ state = c == 'a' ? state + 1 : 3;
+ break;
+ case 6:
+ if (c == '>') {
+ mnemonics [linkIndex] = parseMnemonics (buffer, start, tagStart, result);
+ int offset = result.length ();
+ parseMnemonics (buffer, linkStart, endtagStart, result);
+ offsets [linkIndex] = new Point (offset, result.length () - 1);
+ if (ids [linkIndex] == null) {
+ ids [linkIndex] = new String (buffer, linkStart, endtagStart - linkStart);
+ }
+ linkIndex++;
+ start = tagStart = linkStart = endtagStart = refStart = index + 1;
+ state = 0;
+ } else {
+ state = 3;
+ }
+ break;
+ case 7:
+ state = c == 'r' ? state + 1 : 0;
+ break;
+ case 8:
+ state = c == 'e' ? state + 1 : 0;
+ break;
+ case 9:
+ state = c == 'f' ? state + 1 : 0;
+ break;
+ case 10:
+ state = c == '=' ? state + 1 : 0;
+ break;
+ case 11:
+ if (c == '"') {
+ state++;
+ refStart = index + 1;
+ } else {
+ state = 0;
+ }
+ break;
+ case 12:
+ if (c == '"') {
+ ids[linkIndex] = new String (buffer, refStart, index - refStart);
+ state = 2;
+ }
+ break;
+ case 13:
+ if (Character.isWhitespace (c)) {
+ state = 0;
+ } else if (c == '='){
+ state++;
+ }
+ break;
+ case 14:
+ state = c == '"' ? state + 1 : 0;
+ break;
+ case 15:
+ if (c == '"') state = 2;
+ break;
+ default:
+ state = 0;
+ break;
+ }
+ index++;
+ }
+ if (start < length) {
+ int tmp = parseMnemonics (buffer, start, tagStart, result);
+ int mnemonic = parseMnemonics (buffer, linkStart, index, result);
+ if (mnemonic == -1) mnemonic = tmp;
+ mnemonics [linkIndex] = mnemonic;
+ } else {
+ mnemonics [linkIndex] = -1;
+ }
+ if (offsets.length != linkIndex) {
+ Point [] newOffsets = new Point [linkIndex];
+ System.arraycopy (offsets, 0, newOffsets, 0, linkIndex);
+ offsets = newOffsets;
+ String [] newIDs = new String [linkIndex];
+ System.arraycopy (ids, 0, newIDs, 0, linkIndex);
+ ids = newIDs;
+ int [] newMnemonics = new int [linkIndex + 1];
+ System.arraycopy (mnemonics, 0, newMnemonics, 0, linkIndex + 1);
+ mnemonics = newMnemonics;
+ }
+ return result.toString ();
+}
+
+int parseMnemonics (char[] buffer, int start, int end, StringBuffer result) {
+ int mnemonic = -1, index = start;
+ while (index < end) {
+ if (buffer [index] == '&') {
+ if (index + 1 < end && buffer [index + 1] == '&') {
+ result.append (buffer [index]);
+ index++;
+ } else {
+ mnemonic = result.length();
+ }
+ } else {
+ result.append (buffer [index]);
+ }
+ index++;
+ }
+ return mnemonic;
+}
+
+/**
+ * Sets the receiver's text.
+ * <p>
+ * The string can contain both regular text and hyperlinks. A hyperlink
+ * is delimited by an anchor tag, &lt;A&gt; and &lt;/A&gt;. Within an
+ * anchor, a single HREF attribute is supported. When a hyperlink is
+ * selected, the text field of the selection event contains either the
+ * text of the hyperlink or the value of its HREF, if one was specified.
+ * In the rare case of identical hyperlinks within the same string, the
+ * HREF tag can be used to distinguish between them. The string may
+ * include the mnemonic character and line delimiters.
+ * </p>
+ *
+ * @param string the new text
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+ checkWidget ();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (string.equals (text)) return;
+ text = string;
+ NSTextView widget = (NSTextView)view;
+ widget.setString(NSString.stringWith(parse(string)));
+ NSTextStorage textStorage = widget.textStorage();
+ NSRange range = new NSRange();
+ for (int i = 0; i < offsets.length; i++) {
+ range.location = offsets[i].x;
+ range.length = offsets[i].y - offsets[i].x + 1;
+ textStorage.addAttribute(OS.NSLinkAttributeName(), NSString.stringWith(ids[i]), range);
+ }
+}
+
+NSView topView () {
+ return scrollView;
+}
+
+//int traversalCode (int key, int theEvent) {
+// if (offsets.length == 0) return 0;
+// int bits = super.traversalCode (key, theEvent);
+// if (key == 48 /* Tab */ && theEvent != 0) {
+// int [] modifiers = new int [1];
+// OS.GetEventParameter (theEvent, OS.kEventParamKeyModifiers, OS.typeUInt32, null, 4, null, modifiers);
+// boolean next = (modifiers [0] & OS.shiftKey) == 0;
+// if (next && focusIndex < offsets.length - 1) {
+// return bits & ~ SWT.TRAVERSE_TAB_NEXT;
+// }
+// if (!next && focusIndex > 0) {
+// return bits & ~ SWT.TRAVERSE_TAB_PREVIOUS;
+// }
+// }
+// return bits;
+//}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java
new file mode 100755
index 0000000000..6f1ca3fa27
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java
@@ -0,0 +1,1225 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+
+/**
+ * Instances of this class represent a selectable user interface
+ * object that displays a list of strings and issues notification
+ * when a string is selected. A list may be single or multi select.
+ * <p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>SINGLE, MULTI</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection, DefaultSelection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of SINGLE and MULTI may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ */
+public class List extends Scrollable {
+ NSTableColumn column;
+ String [] items;
+ int itemCount;
+ boolean ignoreSelect;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#SINGLE
+ * @see SWT#MULTI
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public List (Composite parent, int style) {
+ super (parent, checkStyle (style));
+}
+
+/**
+ * Adds the argument to the end of the receiver's list.
+ *
+ * @param string the new item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #add(String,int)
+ */
+public void add (String string) {
+ checkWidget();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (itemCount == items.length) {
+ String [] newItems = new String [itemCount + 4];
+ System.arraycopy (items, 0, newItems, 0, items.length);
+ items = newItems;
+ }
+ items [itemCount++] = string;
+ ((NSTableView)view).reloadData();
+ //TODO adjust horizontal scrollbar
+}
+
+/**
+ * Adds the argument to the receiver's list at the given
+ * zero-relative index.
+ * <p>
+ * Note: To add an item at the end of the list, use the
+ * result of calling <code>getItemCount()</code> as the
+ * index or use <code>add(String)</code>.
+ * </p>
+ *
+ * @param string the new item
+ * @param index the index for the item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #add(String)
+ */
+public void add (String string, int index) {
+ checkWidget();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (!(0 <= index && index <= itemCount)) error (SWT.ERROR_INVALID_RANGE);
+ if (index != itemCount) fixSelection (index, true);
+ if (itemCount == items.length) {
+ String [] newItems = new String [itemCount + 4];
+ System.arraycopy (items, 0, newItems, 0, items.length);
+ items = newItems;
+ }
+ System.arraycopy (items, index, items, index + 1, itemCount++ - index);
+ items [index] = string;
+ ((NSTableView)view).reloadData();
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's selection, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the selection changes.
+ * <code>widgetDefaultSelected</code> is typically called when an item is double-clicked.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the user changes the receiver's selection
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener(listener);
+ addListener(SWT.Selection,typedListener);
+ addListener(SWT.DefaultSelection,typedListener);
+}
+
+static int checkStyle (int style) {
+ return checkBits (style, SWT.SINGLE, SWT.MULTI, 0, 0, 0, 0);
+}
+
+public Point computeSize (int wHint, int hHint, boolean changed) {
+ checkWidget();
+ int width = 0;
+ if (wHint == SWT.DEFAULT) {
+ GC gc = new GC (this);
+ for (int i=0; i<itemCount; i++) {
+ Point extent = gc.stringExtent (items [i]);
+ width = Math.max (width, extent.x);
+ }
+ gc.dispose ();
+// width += EXTRA_WIDTH;
+ } else {
+ width = wHint;
+ }
+ if (width <= 0) width = DEFAULT_WIDTH;
+ int height = 0;
+ if (hHint == SWT.DEFAULT) {
+ height = itemCount * getItemHeight ();
+ } else {
+ height = hHint;
+ }
+ if (height <= 0) height = DEFAULT_HEIGHT;
+ Rectangle rect = computeTrim (0, 0, width, height);
+ return new Point (rect.width, rect.height);
+}
+
+void createHandle () {
+ SWTScrollView scrollWidget = (SWTScrollView)new SWTScrollView().alloc();
+ scrollWidget.initWithFrame(new NSRect ());
+ if ((style & SWT.H_SCROLL) != 0) scrollWidget.setHasHorizontalScroller(true);
+ if ((style & SWT.V_SCROLL) != 0) scrollWidget.setHasVerticalScroller(true);
+ scrollWidget.setBorderType((style & SWT.BORDER) != 0 ? OS.NSBezelBorder : OS.NSNoBorder);
+ scrollWidget.setTag(jniRef);
+
+ NSTableView widget = (NSTableView)new SWTTableView().alloc();
+ widget.initWithFrame(new NSRect());
+ widget.setAllowsMultipleSelection((style & SWT.MULTI) != 0);
+ widget.setDataSource(widget);
+ widget.setHeaderView(null);
+ widget.setDelegate(widget);
+ widget.setTag(jniRef);
+ widget.setDoubleAction(OS.sel_sendDoubleSelection);
+
+ column = (NSTableColumn)new NSTableColumn().alloc();
+ column.initWithIdentifier(NSString.stringWith(""));
+ widget.addTableColumn (column);
+
+ scrollView = scrollWidget;
+ view = widget;
+ scrollView.setDocumentView(widget);
+ parent.contentView().addSubview_(scrollView);
+}
+
+void createWidget () {
+ super.createWidget ();
+ items = new String [4];
+}
+
+Color defaultBackground () {
+ return display.getSystemColor (SWT.COLOR_LIST_BACKGROUND);
+}
+
+Color defaultForeground () {
+ return display.getSystemColor (SWT.COLOR_LIST_FOREGROUND);
+}
+
+/**
+ * Deselects the item at the given zero-relative index in the receiver.
+ * If the item at the index was already deselected, it remains
+ * deselected. Indices that are out of range are ignored.
+ *
+ * @param index the index of the item to deselect
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselect (int index) {
+ checkWidget();
+ if (0 <= index && index < itemCount) {
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ widget.deselectRow (index);
+ widget.setDelegate(widget);
+ }
+}
+
+/**
+ * Deselects the items at the given zero-relative indices in the receiver.
+ * If the item at the given zero-relative index in the receiver
+ * is selected, it is deselected. If the item at the index
+ * was not selected, it remains deselected. The range of the
+ * indices is inclusive. Indices that are out of range are ignored.
+ *
+ * @param start the start index of the items to deselect
+ * @param end the end index of the items to deselect
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselect (int start, int end) {
+ checkWidget();
+ if (start > end) return;
+ if (end < 0 || start >= itemCount) return;
+ start = Math.max (0, start);
+ end = Math.min (itemCount - 1, end);
+ int length = end - start + 1;
+ if (length <= 0) return;
+ if (start == 0 && end == itemCount - 1) {
+ deselectAll ();
+ } else {
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ for (int i=0; i<length; i++) {
+ widget.deselectRow (i);
+ }
+ widget.setDelegate(widget);
+ }
+}
+
+/**
+ * Deselects the items at the given zero-relative indices in the receiver.
+ * If the item at the given zero-relative index in the receiver
+ * is selected, it is deselected. If the item at the index
+ * was not selected, it remains deselected. Indices that are out
+ * of range and duplicate indices are ignored.
+ *
+ * @param indices the array of indices for the items to deselect
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the set of indices is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselect (int [] indices) {
+ checkWidget();
+ if (indices == null) error (SWT.ERROR_NULL_ARGUMENT);
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ for (int i=0; i<indices.length; i++) {
+ widget.deselectRow (indices [i]);
+ }
+ widget.setDelegate(widget);
+}
+
+/**
+ * Deselects all selected items in the receiver.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselectAll () {
+ checkWidget ();
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ widget.deselectAll(null);
+ widget.setDelegate(widget);
+}
+
+void fixSelection (int index, boolean add) {
+ int [] selection = getSelectionIndices ();
+ if (selection.length == 0) return;
+ int newCount = 0;
+ boolean fix = false;
+ for (int i = 0; i < selection.length; i++) {
+ if (!add && selection [i] == index) {
+ fix = true;
+ } else {
+ int newIndex = newCount++;
+ selection [newIndex] = selection [i] + 1;
+ if (selection [newIndex] - 1 >= index) {
+ selection [newIndex] += add ? 1 : -1;
+ fix = true;
+ }
+ }
+ }
+ if (fix) select (selection, newCount, true);
+}
+
+/**
+ * Returns the zero-relative index of the item which currently
+ * has the focus in the receiver, or -1 if no item has focus.
+ *
+ * @return the index of the selected item
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getFocusIndex () {
+ checkWidget();
+// int [] first = new int [1], last = new int [1];
+// if (OS.GetDataBrowserSelectionAnchor (handle, first, last) != OS.noErr) return -1;
+// return first [0] - 1;
+ return -1;
+}
+
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getItem (int index) {
+ checkWidget();
+ if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE);
+ return items [index];
+}
+
+/**
+ * Returns the number of items contained in the receiver.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+ checkWidget();
+ return itemCount;
+}
+
+/**
+ * Returns the height of the area which would be used to
+ * display <em>one</em> of the items in the list.
+ *
+ * @return the height of one item
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemHeight () {
+ checkWidget ();
+ return (int)((NSTableView)view).rowHeight();
+}
+
+/**
+ * Returns a (possibly empty) array of <code>String</code>s which
+ * are the items in the receiver.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items in the receiver's list
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String [] getItems () {
+ checkWidget();
+ String [] result = new String [itemCount];
+ System.arraycopy (items, 0, result, 0, itemCount);
+ return result;
+}
+
+/**
+ * Returns an array of <code>String</code>s that are currently
+ * selected in the receiver. The order of the items is unspecified.
+ * An empty array indicates that no items are selected.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its selection, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ * @return an array representing the selection
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String [] getSelection () {
+ checkWidget ();
+ //BUG ?
+ if (((NSTableView)view).numberOfSelectedRows() == 0) {
+ return new String [0];
+ }
+ NSIndexSet selection = ((NSTableView)view).selectedRowIndexes();
+ int bufferSize = selection.lastIndex() - selection.firstIndex() + 1;
+ int [] indexBuffer = new int [bufferSize];
+ selection.getIndexes(indexBuffer, bufferSize, 0);
+ String [] result = new String [bufferSize];
+ for (int i=0; i<bufferSize; i++) {
+ result [i] = items [indexBuffer [i]];
+ }
+ return result;
+}
+
+/**
+ * Returns the number of selected items contained in the receiver.
+ *
+ * @return the number of selected items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelectionCount () {
+ checkWidget ();
+ return ((NSTableView)view).numberOfSelectedRows();
+}
+
+/**
+ * Returns the zero-relative index of the item which is currently
+ * selected in the receiver, or -1 if no item is selected.
+ *
+ * @return the index of the selected item or -1
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelectionIndex () {
+ checkWidget();
+ //TODO - check empty selection case
+ return ((NSTableView)view).selectedRow();
+}
+
+/**
+ * Returns the zero-relative indices of the items which are currently
+ * selected in the receiver. The order of the indices is unspecified.
+ * The array is empty if no items are selected.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its selection, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ * @return the array of indices of the selected items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int [] getSelectionIndices () {
+ checkWidget ();
+ //BUG
+ if (((NSTableView)view).numberOfSelectedRows() == 0) {
+ return new int [0];
+ }
+ NSIndexSet selection = ((NSTableView)view).selectedRowIndexes();
+ int bufferSize = selection.lastIndex() - selection.firstIndex() + 1;
+ int [] indexBuffer = new int [bufferSize];
+ selection.getIndexes(indexBuffer, bufferSize, 0);
+ return indexBuffer;
+}
+
+/**
+ * Returns the zero-relative index of the item which is currently
+ * at the top of the receiver. This index can change when items are
+ * scrolled or new items are added or removed.
+ *
+ * @return the index of the top item
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getTopIndex () {
+ checkWidget();
+ //TODO - partial item at the top
+ NSRect rect = scrollView.documentVisibleRect();
+ NSPoint point = new NSPoint();
+ point.x = rect.x;
+ point.y = rect.y;
+ return ((NSTableView)view).rowAtPoint(point);
+}
+
+/**
+ * Gets the index of an item.
+ * <p>
+ * The list is searched starting at 0 until an
+ * item is found that is equal to the search item.
+ * If no item is found, -1 is returned. Indexing
+ * is zero based.
+ *
+ * @param string the search item
+ * @return the index of the item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (String item) {
+ checkWidget();
+ if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
+ for (int i=0; i<itemCount; i++) {
+ if (items [i].equals (item)) return i;
+ }
+ return -1;
+}
+
+/**
+ * Searches the receiver's list starting at the given,
+ * zero-relative index until an item is found that is equal
+ * to the argument, and returns the index of that item. If
+ * no item is found or the starting index is out of range,
+ * returns -1.
+ *
+ * @param string the search item
+ * @param start the zero-relative index at which to start the search
+ * @return the index of the item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (String string, int start) {
+ checkWidget();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ for (int i=start; i<itemCount; i++) {
+ if (items [i].equals (string)) return i;
+ }
+ return -1;
+}
+
+/**
+ * Returns <code>true</code> if the item is selected,
+ * and <code>false</code> otherwise. Indices out of
+ * range are ignored.
+ *
+ * @param index the index of the item
+ * @return the selection state of the item at the index
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean isSelected (int index) {
+ checkWidget();
+ //TODO - range check
+ return ((NSTableView)view).isRowSelected(index);
+}
+
+int numberOfRowsInTableView(int aTableView) {
+ return itemCount;
+}
+
+void releaseHandle () {
+ super.releaseHandle ();
+ if (column != null) column.release();
+ column = null;
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ items = null;
+}
+
+/**
+ * Removes the item from the receiver at the given
+ * zero-relative index.
+ *
+ * @param index the index for the item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (int index) {
+ checkWidget();
+ if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE);
+ if (index != itemCount - 1) fixSelection (index, false);
+ System.arraycopy (items, index + 1, items, index, --itemCount - index);
+ items [itemCount] = null;
+ ((NSTableView)view).noteNumberOfRowsChanged();
+}
+
+/**
+ * Removes the items from the receiver which are
+ * between the given zero-relative start and end
+ * indices (inclusive).
+ *
+ * @param start the start of the range
+ * @param end the end of the range
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if either the start or end are not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (int start, int end) {
+ checkWidget();
+ if (start > end) return;
+ if (!(0 <= start && start <= end && end < itemCount)) {
+ error (SWT.ERROR_INVALID_RANGE);
+ }
+ int length = end - start + 1;
+ for (int i=0; i<length; i++) remove (start);
+}
+
+/**
+ * Searches the receiver's list starting at the first item
+ * until an item is found that is equal to the argument,
+ * and removes that item from the list.
+ *
+ * @param string the item to remove
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the string is not found in the list</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (String string) {
+ checkWidget();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ int index = indexOf (string, 0);
+ if (index == -1) error (SWT.ERROR_INVALID_ARGUMENT);
+ remove (index);
+}
+
+/**
+ * Removes the items from the receiver at the given
+ * zero-relative indices.
+ *
+ * @param indices the array of indices of the items
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * <li>ERROR_NULL_ARGUMENT - if the indices array is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (int [] indices) {
+ checkWidget ();
+ if (indices == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (indices.length == 0) return;
+ int [] newIndices = new int [indices.length];
+ System.arraycopy (indices, 0, newIndices, 0, indices.length);
+ sort (newIndices);
+ int start = newIndices [newIndices.length - 1], end = newIndices [0];
+ int count = getItemCount ();
+ if (!(0 <= start && start <= end && end < count)) {
+ error (SWT.ERROR_INVALID_RANGE);
+ }
+ int last = -1;
+ for (int i=0; i<newIndices.length; i++) {
+ int index = newIndices [i];
+ if (index != last) {
+ remove (index);
+ last = index;
+ }
+ }
+}
+
+/**
+ * Removes all of the items from the receiver.
+ * <p>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void removeAll () {
+ checkWidget();
+ items = new String [4];
+ itemCount = 0;
+ ((NSTableView)view).noteNumberOfRowsChanged();
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's selection.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook(SWT.Selection, listener);
+ eventTable.unhook(SWT.DefaultSelection,listener);
+}
+
+/**
+ * Selects the item at the given zero-relative index in the receiver's
+ * list. If the item at the index was already selected, it remains
+ * selected. Indices that are out of range are ignored.
+ *
+ * @param index the index of the item to select
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void select (int index) {
+ checkWidget();
+ if (0 <= index && index < itemCount) {
+ NSIndexSet indexes = (NSIndexSet)new NSIndexSet().alloc();
+ indexes.initWithIndex(index);
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ ((NSTableView)view).selectRowIndexes(indexes, true);
+ widget.setDelegate(view);
+ }
+}
+
+/**
+ * Selects the items in the range specified by the given zero-relative
+ * indices in the receiver. The range of indices is inclusive.
+ * The current selection is not cleared before the new items are selected.
+ * <p>
+ * If an item in the given range is not selected, it is selected.
+ * If an item in the given range was already selected, it remains selected.
+ * Indices that are out of range are ignored and no items will be selected
+ * if start is greater than end.
+ * If the receiver is single-select and there is more than one item in the
+ * given range, then all indices are ignored.
+ *
+ * @param start the start of the range
+ * @param end the end of the range
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see List#setSelection(int,int)
+ */
+public void select (int start, int end) {
+ checkWidget ();
+ if (end < 0 || start > end || ((style & SWT.SINGLE) != 0 && start != end)) return;
+ if (itemCount == 0 || start >= itemCount) return;
+ if (start == 0 && end == itemCount - 1) {
+ selectAll ();
+ } else {
+ start = Math.max (0, start);
+ end = Math.min (end, itemCount - 1);
+ int length = end - start + 1;
+ NSIndexSet indexes = (NSIndexSet)new NSIndexSet().alloc();
+ NSRange range = new NSRange();
+ range.location = start;
+ range.length = length;
+ indexes.initWithIndexesInRange(range);
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ widget.selectRowIndexes(indexes, true);
+ widget.setDelegate(widget);
+ }
+}
+
+/**
+ * Selects the items at the given zero-relative indices in the receiver.
+ * The current selection is not cleared before the new items are selected.
+ * <p>
+ * If the item at a given index is not selected, it is selected.
+ * If the item at a given index was already selected, it remains selected.
+ * Indices that are out of range and duplicate indices are ignored.
+ * If the receiver is single-select and multiple indices are specified,
+ * then all indices are ignored.
+ *
+ * @param indices the array of indices for the items to select
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the array of indices is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see List#setSelection(int[])
+ */
+public void select (int [] indices) {
+ checkWidget ();
+ if (indices == null) error (SWT.ERROR_NULL_ARGUMENT);
+ int length = indices.length;
+ if (length == 0 || ((style & SWT.SINGLE) != 0 && length > 1)) return;
+ int count = 0;
+ NSMutableIndexSet indexes = (NSMutableIndexSet)new NSMutableIndexSet().alloc().init();
+ for (int i=0; i<length; i++) {
+ int index = indices [length - i - 1];
+ if (index >= 0 && index < itemCount) {
+ indexes.addIndex (indices [i]);
+ }
+ }
+ if (count > 0) {
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ widget.selectRowIndexes(indexes, true);
+ widget.setDelegate(widget);
+ }
+}
+
+void select (int [] ids, int count, boolean clear) {
+ NSMutableIndexSet indexes = (NSMutableIndexSet)new NSMutableIndexSet().alloc().init();
+ for (int i=0; i<count; i++) indexes.addIndex (ids [i] - 1); //WRONG -1
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ widget.selectRowIndexes(indexes, !clear);
+ widget.setDelegate(widget);
+
+}
+
+/**
+ * Selects all of the items in the receiver.
+ * <p>
+ * If the receiver is single-select, do nothing.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void selectAll () {
+ checkWidget ();
+ if ((style & SWT.SINGLE) != 0) return;
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ widget.selectAll(null);
+ widget.setDelegate(widget);
+}
+
+void sendDoubleSelection() {
+ postEvent (SWT.DefaultSelection);
+}
+
+/**
+ * Sets the text of the item in the receiver's list at the given
+ * zero-relative index to the string argument.
+ *
+ * @param index the index for the item
+ * @param string the new text for the item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setItem (int index, String string) {
+ checkWidget();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE);
+ items [index] = string;
+ ((NSTableView)view).reloadData();
+}
+
+/**
+ * Sets the receiver's items to be the given array of items.
+ *
+ * @param items the array of items
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the items array is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if an item in the items array is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setItems (String [] items) {
+ checkWidget();
+ if (items == null) error (SWT.ERROR_NULL_ARGUMENT);
+ for (int i=0; i<items.length; i++) {
+ if (items [i] == null) error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ this.items = new String [items.length];
+ System.arraycopy (items, 0, this.items, 0, items.length);
+ itemCount = items.length;
+ ((NSTableView)view).reloadData();
+}
+
+/**
+ * Selects the item at the given zero-relative index in the receiver.
+ * If the item at the index was already selected, it remains selected.
+ * The current selection is first cleared, then the new item is selected.
+ * Indices that are out of range are ignored.
+ *
+ * @param index the index of the item to select
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @see List#deselectAll()
+ * @see List#select(int)
+ */
+public void setSelection (int index) {
+ checkWidget();
+ deselectAll ();
+ setSelection (index, false);
+}
+
+void setSelection (int index, boolean notify) {
+// checkWidget();
+ if (0 <= index && index < itemCount) {
+ int [] ids = new int [] {index + 1};
+ select (ids, ids.length, true);
+ showIndex (index);
+ if (notify) postEvent (SWT.Selection);
+ }
+}
+
+/**
+ * Selects the items in the range specified by the given zero-relative
+ * indices in the receiver. The range of indices is inclusive.
+ * The current selection is cleared before the new items are selected.
+ * <p>
+ * Indices that are out of range are ignored and no items will be selected
+ * if start is greater than end.
+ * If the receiver is single-select and there is more than one item in the
+ * given range, then all indices are ignored.
+ *
+ * @param start the start index of the items to select
+ * @param end the end index of the items to select
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see List#deselectAll()
+ * @see List#select(int,int)
+ */
+public void setSelection (int start, int end) {
+ checkWidget ();
+ deselectAll ();
+ if (end < 0 || start > end || ((style & SWT.SINGLE) != 0 && start != end)) return;
+ if (itemCount == 0 || start >= itemCount) return;
+ start = Math.max (0, start);
+ end = Math.min (end, itemCount - 1);
+ int length = end - start + 1;
+ int [] ids = new int [length];
+ for (int i=0; i<length; i++) ids [i] = end - i + 1;
+ select (ids, length, true);
+ if (ids.length > 0) showIndex (ids [0] - 1);
+}
+
+/**
+ * Selects the items at the given zero-relative indices in the receiver.
+ * The current selection is cleared before the new items are selected.
+ * <p>
+ * Indices that are out of range and duplicate indices are ignored.
+ * If the receiver is single-select and multiple indices are specified,
+ * then all indices are ignored.
+ *
+ * @param indices the indices of the items to select
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the array of indices is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see List#deselectAll()
+ * @see List#select(int[])
+ */
+public void setSelection (int [] indices) {
+ checkWidget ();
+ if (indices == null) error (SWT.ERROR_NULL_ARGUMENT);
+ deselectAll ();
+ int length = indices.length;
+ if (length == 0 || ((style & SWT.SINGLE) != 0 && length > 1)) return;
+ int [] ids = new int [length];
+ int count = 0;
+ for (int i=0; i<length; i++) {
+ int index = indices [length - i - 1];
+ if (index >= 0 && index < itemCount) {
+ ids [count++] = index + 1;
+ }
+ }
+ if (count > 0) {
+ select (ids, count, true);
+ showIndex (ids [0] - 1);
+ }
+}
+
+/**
+ * Sets the receiver's selection to be the given array of items.
+ * The current selection is cleared before the new items are selected.
+ * <p>
+ * Items that are not in the receiver are ignored.
+ * If the receiver is single-select and multiple items are specified,
+ * then all items are ignored.
+ *
+ * @param items the array of items
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the array of items is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see List#deselectAll()
+ * @see List#select(int[])
+ * @see List#setSelection(int[])
+ */
+public void setSelection (String [] items) {
+ checkWidget ();
+ if (items == null) error (SWT.ERROR_NULL_ARGUMENT);
+ deselectAll ();
+ int length = items.length;
+ if (length == 0 || ((style & SWT.SINGLE) != 0 && length > 1)) return;
+ int count = 0;
+ int [] ids = new int [length];
+ for (int i=0; i<length; i++) {
+ String string = items [length - i - 1];
+ if ((style & SWT.SINGLE) != 0) {
+ int index = indexOf (string, 0);
+ if (index != -1) {
+ count = 1;
+ ids = new int [] {index + 1};
+ }
+ } else {
+ int index = 0;
+ while ((index = indexOf (string, index)) != -1) {
+ if (count == ids.length) {
+ int [] newIds = new int [ids.length + 4];
+ System.arraycopy (ids, 0, newIds, 0, ids.length);
+ ids = newIds;
+ }
+ ids [count++] = index + 1;
+ index++;
+ }
+ }
+ }
+ if (count > 0) {
+ select (ids, count, true);
+ showIndex (ids [0] - 1);
+ }
+}
+
+/**
+ * Sets the zero-relative index of the item which is currently
+ * at the top of the receiver. This index can change when items
+ * are scrolled or new items are added and removed.
+ *
+ * @param index the index of the top item
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setTopIndex (int index) {
+ checkWidget();
+ NSRect rect = ((NSTableView)view).rectOfRow(index);
+ ((NSTableView)view).scrollRectToVisible(rect);
+}
+
+void showIndex (int index) {
+ if (0 <= index && index < itemCount) {
+ ((NSTableView)view).scrollRowToVisible(index);
+ }
+}
+
+/**
+ * Shows the selection. If the selection is already showing in the receiver,
+ * this method simply returns. Otherwise, the items are scrolled until
+ * the selection is visible.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void showSelection () {
+ checkWidget();
+ int index = getSelectionIndex ();
+ if (index >= 0) showIndex (index);
+}
+
+void tableViewSelectionDidChange (int aNotification) {
+ postEvent (SWT.Selection);
+}
+
+boolean tableViewshouldEditTableColumnrow(int aTableView, int aTableColumn, int rowIndex) {
+ return false;
+}
+
+int tableViewobjectValueForTableColumnrow(int aTableView, int aTableColumn, int rowIndex) {
+ return NSString.stringWith(items[rowIndex]).id;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java
new file mode 100755
index 0000000000..8e5478492c
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Menu.java
@@ -0,0 +1,845 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+
+/**
+ * Instances of this class are user interface objects that contain
+ * menu items.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>BAR, DROP_DOWN, POP_UP, NO_RADIO_GROUP</dd>
+ * <dd>LEFT_TO_RIGHT, RIGHT_TO_LEFT</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Help, Hide, Show </dd>
+ * </dl>
+ * <p>
+ * Note: Only one of BAR, DROP_DOWN and POP_UP may be specified.
+ * Only one of LEFT_TO_RIGHT or RIGHT_TO_LEFT may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ */
+public class Menu extends Widget {
+ /**
+ * the handle to the OS resource
+ * (Warning: This field is platform dependent)
+ * <p>
+ * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It is not available on all
+ * platforms and should never be accessed from application code.
+ * </p>
+ */
+ NSMenu nsMenu;
+ short id;
+ int x, y, itemCount;
+// int width, height;
+ boolean hasLocation, modified, closed;
+ MenuItem [] items;
+ MenuItem cascade, defaultItem, lastTarget;
+ Decorations parent;
+
+/**
+ * Constructs a new instance of this class given its parent,
+ * and sets the style for the instance so that the instance
+ * will be a popup menu on the given parent's shell.
+ *
+ * @param parent a control which will be the parent of the new instance (cannot be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#POP_UP
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Menu (Control parent) {
+ this (checkNull (parent).menuShell (), SWT.POP_UP);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Decorations</code>) and a style value
+ * describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a decorations control which will be the parent of the new instance (cannot be null)
+ * @param style the style of menu to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#BAR
+ * @see SWT#DROP_DOWN
+ * @see SWT#POP_UP
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Menu (Decorations parent, int style) {
+ super (parent, checkStyle (style));
+ this.parent = parent;
+ createWidget ();
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Menu</code>) and sets the style
+ * for the instance so that the instance will be a drop-down
+ * menu on the given parent's parent.
+ *
+ * @param parentMenu a menu which will be the parent of the new instance (cannot be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#DROP_DOWN
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Menu (Menu parentMenu) {
+ this (checkNull (parentMenu).parent, SWT.DROP_DOWN);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>MenuItem</code>) and sets the style
+ * for the instance so that the instance will be a drop-down
+ * menu on the given parent's parent menu.
+ *
+ * @param parentItem a menu item which will be the parent of the new instance (cannot be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#DROP_DOWN
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Menu (MenuItem parentItem) {
+ this (checkNull (parentItem).parent);
+}
+
+static Control checkNull (Control control) {
+ if (control == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ return control;
+}
+
+static Menu checkNull (Menu menu) {
+ if (menu == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ return menu;
+}
+
+static MenuItem checkNull (MenuItem item) {
+ if (item == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ return item;
+}
+
+static int checkStyle (int style) {
+ return checkBits (style, SWT.POP_UP, SWT.BAR, SWT.DROP_DOWN, 0, 0, 0);
+}
+
+void _setVisible (boolean visible) {
+ if ((style & (SWT.BAR | SWT.DROP_DOWN)) != 0) return;
+ if (visible) {
+ //TODO - not tested
+ Shell shell = getShell ();
+ NSWindow window = shell.window;
+ NSPoint location = null;
+ if (hasLocation) {
+ location = new NSPoint ();
+ location.x = x;
+ location.y = y;
+ } else {
+ location = window.mouseLocationOutsideOfEventStream();
+ }
+ NSEvent nsEvent = NSEvent.otherEventWithType(OS.NSApplicationDefined, location, 0, 0.0, window.windowNumber(), window.graphicsContext(), (short)0, 0, 0);
+ NSMenu.static_popUpContextMenu_withEvent_forView_ (nsMenu, nsEvent, shell.view);
+ } else {
+ nsMenu.cancelTracking ();
+ }
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when help events are generated for the control,
+ * by sending it one of the messages defined in the
+ * <code>HelpListener</code> interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see HelpListener
+ * @see #removeHelpListener
+ */
+public void addHelpListener (HelpListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Help, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when menus are hidden or shown, by sending it
+ * one of the messages defined in the <code>MenuListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MenuListener
+ * @see #removeMenuListener
+ */
+public void addMenuListener (MenuListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Hide,typedListener);
+ addListener (SWT.Show,typedListener);
+}
+
+void createHandle () {
+// display.addMenu (this);
+ nsMenu = (NSMenu)new NSMenu().alloc();
+ nsMenu.initWithTitle(NSString.stringWith(""));
+ nsMenu.setAutoenablesItems(false);
+}
+
+void createItem (MenuItem item, int index) {
+ checkWidget ();
+ if (!(0 <= index && index <= itemCount)) error (SWT.ERROR_INVALID_RANGE);
+ NSMenuItem nsItem = null;
+ if ((item.style & SWT.SEPARATOR) != 0) {
+ nsItem = NSMenuItem.separatorItem();
+ } else {
+ nsItem= (NSMenuItem)new NSMenuItem().alloc();
+ nsItem.initWithTitle(NSString.stringWith(""), 0, NSString.stringWith(""));
+ }
+ item.nsItem = nsItem;
+ nsMenu.insertItem(nsItem, index);
+ if (itemCount == items.length) {
+ MenuItem [] newItems = new MenuItem [items.length + 4];
+ System.arraycopy (items, 0, newItems, 0, items.length);
+ items = newItems;
+ }
+ System.arraycopy (items, index, items, index + 1, itemCount++ - index);
+ items [index] = item;
+}
+
+void createWidget () {
+ checkOrientation (parent);
+ super.createWidget ();
+ items = new MenuItem [4];
+}
+
+void destroyItem (MenuItem item) {
+ int index = 0;
+ while (index < itemCount) {
+ if (items [index] == item) break;
+ index++;
+ }
+ if (index == itemCount) return;
+ System.arraycopy (items, index + 1, items, index, --itemCount - index);
+ items [itemCount] = null;
+ if (itemCount == 0) items = new MenuItem [4];
+ nsMenu.removeItem (item.nsItem);
+}
+
+void destroyWidget () {
+ NSMenu nsMenu = this.nsMenu;
+ releaseHandle ();
+ if (nsMenu != null) {
+ nsMenu.release();
+ }
+}
+
+void fixMenus (Decorations newParent) {
+ this.parent = newParent;
+}
+
+/**
+ * Returns the default menu item or null if none has
+ * been previously set.
+ *
+ * @return the default menu item.
+ *
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public MenuItem getDefaultItem () {
+ checkWidget();
+ return defaultItem;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled, and
+ * <code>false</code> otherwise. A disabled menu is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #isEnabled
+ */
+public boolean getEnabled () {
+ checkWidget();
+ return (state & DISABLED) == 0;
+}
+
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public MenuItem getItem (int index) {
+ checkWidget ();
+ if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE);
+ return items [index];
+}
+
+/**
+ * Returns the number of items contained in the receiver.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+ checkWidget ();
+ return itemCount;
+}
+
+/**
+ * Returns a (possibly empty) array of <code>MenuItem</code>s which
+ * are the items in the receiver.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items in the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public MenuItem [] getItems () {
+ checkWidget ();
+ MenuItem [] result = new MenuItem [itemCount];
+ int index = 0;
+ if (items != null) {
+ for (int i = 0; i < itemCount; i++) {
+ MenuItem item = items [i];
+ if (item != null && !item.isDisposed ()) {
+ result [index++] = item;
+ }
+ }
+ }
+ if (index != result.length) {
+ MenuItem [] newItems = new MenuItem[index];
+ System.arraycopy(result, 0, newItems, 0, index);
+ result = newItems;
+ }
+ return result;
+}
+
+String getNameText () {
+ String result = "";
+ MenuItem [] items = getItems ();
+ int length = items.length;
+ if (length > 0) {
+ for (int i=0; i<length-1; i++) {
+ result = result + items [i].getNameText() + ", ";
+ }
+ result = result + items [length-1].getNameText ();
+ }
+ return result;
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Decorations</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Decorations getParent () {
+ checkWidget ();
+ return parent;
+}
+
+/**
+ * Returns the receiver's parent item, which must be a
+ * <code>MenuItem</code> or null when the receiver is a
+ * root.
+ *
+ * @return the receiver's parent item
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public MenuItem getParentItem () {
+ checkWidget ();
+ return cascade;
+}
+
+/**
+ * Returns the receiver's parent item, which must be a
+ * <code>Menu</code> or null when the receiver is a
+ * root.
+ *
+ * @return the receiver's parent item
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Menu getParentMenu () {
+ checkWidget ();
+ if (cascade != null) return cascade.parent;
+ return null;
+}
+
+/**
+ * Returns the receiver's shell. For all controls other than
+ * shells, this simply returns the control's nearest ancestor
+ * shell. Shells return themselves, even if they are children
+ * of other shells.
+ *
+ * @return the receiver's shell
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getParent
+ */
+public Shell getShell () {
+ checkWidget ();
+ return parent.getShell ();
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible, and
+ * <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getVisible () {
+ checkWidget ();
+ if ((style & SWT.BAR) != 0) {
+ return this == parent.menuShell ().menuBar;
+ }
+ if ((style & SWT.POP_UP) != 0) {
+// Menu [] popups = display.popups;
+// if (popups == null) return false;
+// for (int i=0; i<popups.length; i++) {
+// if (popups [i] == this) return true;
+// }
+ }
+// MenuTrackingData outData = new MenuTrackingData ();
+// return OS.GetMenuTrackingData (handle, outData) == OS.noErr;
+ return false;
+}
+
+
+/**
+ * Searches the receiver's list starting at the first item
+ * (index 0) until an item is found that is equal to the
+ * argument, and returns the index of that item. If no item
+ * is found, returns -1.
+ *
+ * @param item the search item
+ * @return the index of the item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (MenuItem item) {
+ checkWidget ();
+ if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
+ for (int i=0; i<itemCount; i++) {
+ if (items [i] == item) return i;
+ }
+ return -1;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled and all
+ * of the receiver's ancestors are enabled, and <code>false</code>
+ * otherwise. A disabled menu is typically not selectable from the
+ * user interface and draws with an inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getEnabled
+ */
+public boolean isEnabled () {
+ checkWidget ();
+ Menu parentMenu = getParentMenu ();
+ if (parentMenu == null) {
+ return getEnabled () && parent.isEnabled ();
+ }
+ return getEnabled () && parentMenu.isEnabled ();
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible and all
+ * of the receiver's ancestors are visible and <code>false</code>
+ * otherwise.
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getVisible
+ */
+public boolean isVisible () {
+ checkWidget ();
+ return getVisible ();
+}
+
+int modifierIndex (String accelText) {
+ int start = accelText.length () - 1;
+ int index = start;
+ while (index >= 0) {
+ char c = accelText.charAt (index);
+ switch (c) {
+ case ' ':
+ if (index != start) return index;
+ break;
+ case '\u2303':
+ case '\u2325':
+ case '\u21E7':
+ case '\u2318':
+ return index;
+ }
+ index--;
+ }
+ return -1;
+}
+
+void releaseChildren (boolean destroy) {
+ if (items != null) {
+ for (int i=0; i<items.length; i++) {
+ MenuItem item = items [i];
+ if (item != null && !item.isDisposed ()) {
+ item.release (false);
+ }
+ }
+ items = null;
+ }
+ super.releaseChildren (destroy);
+}
+
+void releaseHandle () {
+ super.releaseHandle ();
+ nsMenu = null;
+}
+
+void releaseParent () {
+ super.releaseParent ();
+ if (cascade != null) cascade.setMenu (null);
+ if ((style & SWT.BAR) != 0 && this == parent.menuBar) {
+ parent.setMenuBar (null);
+ }
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+// display.removeMenu (this);
+ parent = null;
+ cascade = defaultItem = lastTarget = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the help events are generated for the control.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see HelpListener
+ * @see #addHelpListener
+ */
+public void removeHelpListener (HelpListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Help, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the menu events are generated for the control.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MenuListener
+ * @see #addMenuListener
+ */
+public void removeMenuListener (MenuListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Hide, listener);
+ eventTable.unhook (SWT.Show, listener);
+}
+
+/**
+ * Sets the default menu item to the argument or removes
+ * the default emphasis when the argument is <code>null</code>.
+ *
+ * @param item the default menu item or null
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the menu item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setDefaultItem (MenuItem item) {
+ checkWidget();
+ if (item != null && item.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
+ defaultItem = item;
+}
+
+/**
+ * Enables the receiver if the argument is <code>true</code>,
+ * and disables it otherwise. A disabled menu is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ *
+ * @param enabled the new enabled state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setEnabled (boolean enabled) {
+ checkWidget();
+ if (enabled) {
+ state &= ~DISABLED;
+ //OS.EnableMenuItem (handle, (short)0);
+ } else {
+ state |= DISABLED;
+ //OS.DisableMenuItem (handle, (short)0);
+ }
+}
+
+/**
+ * Sets the location of the receiver, which must be a popup,
+ * to the point specified by the arguments which are relative
+ * to the display.
+ * <p>
+ * Note that this is different from most widgets where the
+ * location of the widget is relative to the parent.
+ * </p><p>
+ * Note that the platform window manager ultimately has control
+ * over the location of popup menus.
+ * </p>
+ *
+ * @param x the new x coordinate for the receiver
+ * @param y the new y coordinate for the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLocation (int x, int y) {
+ checkWidget ();
+ this.x = x;
+ this.y = y;
+ hasLocation = true;
+}
+
+/**
+ * Sets the location of the receiver, which must be a popup,
+ * to the point specified by the argument which is relative
+ * to the display.
+ * <p>
+ * Note that this is different from most widgets where the
+ * location of the widget is relative to the parent.
+ * </p><p>
+ * Note that the platform window manager ultimately has control
+ * over the location of popup menus.
+ * </p>
+ *
+ * @param location the new location for the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public void setLocation (Point location) {
+ checkWidget ();
+ if (location == null) error (SWT.ERROR_NULL_ARGUMENT);
+ setLocation (location.x, location.y);
+}
+
+/**
+ * Marks the receiver as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param visible the new visibility state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setVisible (boolean visible) {
+ checkWidget ();
+ if ((style & (SWT.BAR | SWT.DROP_DOWN)) != 0) return;
+ if (visible) {
+// display.addPopup (this);
+ //TODO -WRONG
+ _setVisible (true);
+ } else {
+// display.removePopup (this);
+ _setVisible (false);
+ }
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MenuItem.java
new file mode 100755
index 0000000000..4117882186
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MenuItem.java
@@ -0,0 +1,739 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.events.*;
+
+/**
+ * Instances of this class represent a selectable user interface object
+ * that issues notification when pressed and released.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>CHECK, CASCADE, PUSH, RADIO, SEPARATOR</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Arm, Help, Selection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles CHECK, CASCADE, PUSH, RADIO and SEPARATOR
+ * may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ */
+public class MenuItem extends Item {
+ NSMenuItem nsItem;
+ Menu parent, menu;
+ int accelerator;
+// int x, y, width, height;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Menu</code>) and a style value
+ * describing its behavior and appearance. The item is added
+ * to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a menu control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#CHECK
+ * @see SWT#CASCADE
+ * @see SWT#PUSH
+ * @see SWT#RADIO
+ * @see SWT#SEPARATOR
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public MenuItem (Menu parent, int style) {
+ super (parent, checkStyle (style));
+ this.parent = parent;
+ parent.createItem (this, parent.getItemCount ());
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Menu</code>), a style value
+ * describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a menu control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the zero-relative index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#CHECK
+ * @see SWT#CASCADE
+ * @see SWT#PUSH
+ * @see SWT#RADIO
+ * @see SWT#SEPARATOR
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public MenuItem (Menu parent, int style, int index) {
+ super (parent, checkStyle (style));
+ this.parent = parent;
+ parent.createItem (this, index);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the arm events are generated for the control, by sending
+ * it one of the messages defined in the <code>ArmListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ArmListener
+ * @see #removeArmListener
+ */
+public void addArmListener (ArmListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Arm, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the help events are generated for the control, by sending
+ * it one of the messages defined in the <code>HelpListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see HelpListener
+ * @see #removeHelpListener
+ */
+public void addHelpListener (HelpListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Help, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the menu item is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * When <code>widgetSelected</code> is called, the stateMask field of the event object is valid.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the menu item is selected by the user
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener (SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener(listener);
+ addListener (SWT.Selection,typedListener);
+ addListener (SWT.DefaultSelection,typedListener);
+}
+
+protected void checkSubclass () {
+ if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+static int checkStyle (int style) {
+ return checkBits (style, SWT.PUSH, SWT.CHECK, SWT.RADIO, SWT.SEPARATOR, SWT.CASCADE, 0);
+}
+
+void destroyWidget () {
+ parent.destroyItem (this);
+ releaseHandle ();
+}
+
+/**
+ * Returns the widget accelerator. An accelerator is the bit-wise
+ * OR of zero or more modifier masks and a key. Examples:
+ * <code>SWT.CONTROL | SWT.SHIFT | 'T', SWT.ALT | SWT.F2</code>.
+ * The default value is zero, indicating that the menu item does
+ * not have an accelerator.
+ *
+ * @return the accelerator or 0
+ *
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getAccelerator () {
+ checkWidget ();
+ return accelerator;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled, and
+ * <code>false</code> otherwise. A disabled menu item is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #isEnabled
+ */
+public boolean getEnabled () {
+ checkWidget();
+ return (state & DISABLED) == 0;
+}
+
+/**
+ * Returns the receiver's cascade menu if it has one or null
+ * if it does not. Only <code>CASCADE</code> menu items can have
+ * a pull down menu. The sequence of key strokes, button presses
+ * and/or button releases that are used to request a pull down
+ * menu is platform specific.
+ *
+ * @return the receiver's menu
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Menu getMenu () {
+ checkWidget ();
+ return menu;
+}
+
+String getNameText () {
+ if ((style & SWT.SEPARATOR) != 0) return "|";
+ return super.getNameText ();
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Menu</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Menu getParent () {
+ checkWidget ();
+ return parent;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is selected,
+ * and false otherwise.
+ * <p>
+ * When the receiver is of type <code>CHECK</code> or <code>RADIO</code>,
+ * it is selected when it is checked.
+ *
+ * @return the selection state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getSelection () {
+ checkWidget ();
+ if ((style & (SWT.CHECK | SWT.RADIO)) == 0) return false;
+ return ((NSMenuItem)nsItem).state() == OS.NSOnState;
+}
+
+//int kEventProcessCommand (int nextHandler, int theEvent, int userData) {
+// //TEMPORARY CODE
+// if (!isEnabled ()) return OS.noErr;
+//
+// if ((style & SWT.CHECK) != 0) {
+// setSelection (!getSelection ());
+// } else {
+// if ((style & SWT.RADIO) != 0) {
+// if ((parent.getStyle () & SWT.NO_RADIO_GROUP) != 0) {
+// setSelection (!getSelection ());
+// } else {
+// selectRadio ();
+// }
+// }
+// }
+// int [] modifiers = new int [1];
+// OS.GetEventParameter (theEvent, OS.kEventParamKeyModifiers, OS.typeUInt32, null, 4, null, modifiers);
+// Event event = new Event ();
+// setInputState (event, (short) 0, OS.GetCurrentEventButtonState (), modifiers [0]);
+// postEvent (SWT.Selection, event);
+// return OS.noErr;
+//}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled and all
+ * of the receiver's ancestors are enabled, and <code>false</code>
+ * otherwise. A disabled menu item is typically not selectable from the
+ * user interface and draws with an inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getEnabled
+ */
+public boolean isEnabled () {
+ return getEnabled () && parent.isEnabled ();
+}
+
+//int keyGlyph (int key) {
+// switch (key) {
+// case SWT.BS: return OS.kMenuDeleteLeftGlyph;
+// case SWT.CR: return OS.kMenuReturnGlyph;
+// case SWT.DEL: return OS.kMenuDeleteRightGlyph;
+// case SWT.ESC: return OS.kMenuEscapeGlyph;
+// case SWT.LF: return OS.kMenuReturnGlyph;
+// case SWT.TAB: return OS.kMenuTabRightGlyph;
+// case ' ': return OS.kMenuBlankGlyph;
+//// case ' ': return OS.kMenuSpaceGlyph;
+// case SWT.ALT: return OS.kMenuOptionGlyph;
+// case SWT.SHIFT: return OS.kMenuShiftGlyph;
+// case SWT.CONTROL: return OS.kMenuControlISOGlyph;
+// case SWT.COMMAND: return OS.kMenuCommandGlyph;
+// case SWT.ARROW_UP: return OS.kMenuUpArrowGlyph;
+// case SWT.ARROW_DOWN: return OS.kMenuDownArrowGlyph;
+// case SWT.ARROW_LEFT: return OS.kMenuLeftArrowGlyph;
+// case SWT.ARROW_RIGHT: return OS.kMenuRightArrowGlyph;
+// case SWT.PAGE_UP: return OS.kMenuPageUpGlyph;
+// case SWT.PAGE_DOWN: return OS.kMenuPageDownGlyph;
+// case SWT.F1: return OS.kMenuF1Glyph;
+// case SWT.F2: return OS.kMenuF2Glyph;
+// case SWT.F3: return OS.kMenuF3Glyph;
+// case SWT.F4: return OS.kMenuF4Glyph;
+// case SWT.F5: return OS.kMenuF5Glyph;
+// case SWT.F6: return OS.kMenuF6Glyph;
+// case SWT.F7: return OS.kMenuF7Glyph;
+// case SWT.F8: return OS.kMenuF8Glyph;
+// case SWT.F9: return OS.kMenuF9Glyph;
+// case SWT.F10: return OS.kMenuF10Glyph;
+// case SWT.F11: return OS.kMenuF11Glyph;
+// case SWT.F12: return OS.kMenuF12Glyph;
+// }
+// return OS.kMenuNullGlyph;
+//}
+
+void releaseHandle () {
+ super.releaseHandle ();
+ parent = null;
+}
+
+void releaseChildren (boolean destroy) {
+ if (menu != null) {
+ menu.release (false);
+ menu = null;
+ }
+ super.releaseChildren (destroy);
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ accelerator = 0;
+ if (this == parent.defaultItem) parent.defaultItem = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the arm events are generated for the control.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ArmListener
+ * @see #addArmListener
+ */
+public void removeArmListener (ArmListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Arm, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the help events are generated for the control.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see HelpListener
+ * @see #addHelpListener
+ */
+public void removeHelpListener (HelpListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Help, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Selection, listener);
+ eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+void selectRadio () {
+ int index = 0;
+ MenuItem [] items = parent.getItems ();
+ while (index < items.length && items [index] != this) index++;
+ int i = index - 1;
+ while (i >= 0 && items [i].setRadioSelection (false)) --i;
+ int j = index + 1;
+ while (j < items.length && items [j].setRadioSelection (false)) j++;
+ setSelection (true);
+}
+
+/**
+ * Sets the widget accelerator. An accelerator is the bit-wise
+ * OR of zero or more modifier masks and a key. Examples:
+ * <code>SWT.MOD1 | SWT.MOD2 | 'T', SWT.MOD3 | SWT.F2</code>.
+ * <code>SWT.CONTROL | SWT.SHIFT | 'T', SWT.ALT | SWT.F2</code>.
+ * The default value is zero, indicating that the menu item does
+ * not have an accelerator.
+ *
+ * @param accelerator an integer that is the bit-wise OR of masks and a key
+ *
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setAccelerator (int accelerator) {
+ checkWidget ();
+ this.accelerator = accelerator;
+ int key = accelerator & SWT.KEY_MASK;
+ int virtualKey = Display.untranslateKey (key);
+ NSString string = null;
+ if (virtualKey != 0) {
+ string = NSString.stringWith ((char)virtualKey + "");
+ } else {
+ string = NSString.stringWith ((char)key + "").lowercaseString();
+ }
+ nsItem.setKeyEquivalent (string);
+ int mask = 0;
+ if ((accelerator & SWT.SHIFT) != 0) mask |= OS.NSShiftKeyMask;
+ if ((accelerator & SWT.CONTROL) != 0) mask |= OS.NSControlKeyMask;
+// if ((accelerator & SWT.COMMAND) != 0) mask &= ~OS.kMenuNoCommandModifier;
+ if ((accelerator & SWT.COMMAND) != 0) mask |= OS.NSCommandKeyMask;
+ if ((accelerator & SWT.ALT) != 0) mask |= OS.NSAlternateKeyMask;
+ nsItem.setKeyEquivalentModifierMask (mask);
+
+// int index = parent.indexOf (this);
+// if (index == -1) return;
+// boolean update = (this.accelerator == 0 && accelerator != 0) || (this.accelerator != 0 && accelerator == 0);
+// this.accelerator = accelerator;
+// boolean inSetVirtualKey = false;
+// int inModifiers = OS.kMenuNoModifiers, inGlyph = OS.kMenuNullGlyph, inKey = 0;
+// if (accelerator != 0) {
+// inKey = accelerator & SWT.KEY_MASK;
+// inGlyph = keyGlyph (inKey);
+// int virtualKey = Display.untranslateKey (inKey);
+// if (inKey == ' ') virtualKey = 49;
+// if (virtualKey != 0) {
+// inSetVirtualKey = true;
+// inKey = virtualKey;
+// } else {
+// inKey = Character.toUpperCase ((char)inKey);
+// }
+// inModifiers = (byte) OS.kMenuNoCommandModifier;
+// if ((accelerator & SWT.SHIFT) != 0) inModifiers |= OS.kMenuShiftModifier;
+// if ((accelerator & SWT.CONTROL) != 0) inModifiers |= OS.kMenuControlModifier;
+// if ((accelerator & SWT.COMMAND) != 0) inModifiers &= ~OS.kMenuNoCommandModifier;
+// if ((accelerator & SWT.ALT) != 0) inModifiers |= OS.kMenuOptionModifier;
+// }
+// short menuIndex = (short) (index + 1);
+// OS.SetMenuItemModifiers (parent.handle, menuIndex, (byte)inModifiers);
+// OS.SetMenuItemCommandKey (parent.handle, menuIndex, inSetVirtualKey, (char)inKey);
+// OS.SetMenuItemKeyGlyph (parent.handle, menuIndex, (short)inGlyph);
+// if (update) updateText (menuIndex);
+}
+
+/**
+ * Enables the receiver if the argument is <code>true</code>,
+ * and disables it otherwise. A disabled menu item is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ *
+ * @param enabled the new enabled state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setEnabled (boolean enabled) {
+ checkWidget ();
+ ((NSMenuItem)nsItem).setEnabled(enabled);
+}
+
+/**
+ * Sets the image the receiver will display to the argument.
+ * <p>
+ * Note: This operation is a hint and is not supported on
+ * platforms that do not have this concept (for example, Windows NT).
+ * </p>
+ *
+ * @param image the image to display
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setImage (Image image) {
+ checkWidget ();
+ if ((style & SWT.SEPARATOR) != 0) return;
+ super.setImage (image);
+ ((NSMenuItem)nsItem).setImage(image != null? image.handle : null);
+}
+
+/**
+ * Sets the receiver's pull down menu to the argument.
+ * Only <code>CASCADE</code> menu items can have a
+ * pull down menu. The sequence of key strokes, button presses
+ * and/or button releases that are used to request a pull down
+ * menu is platform specific.
+ * <p>
+ * Note: Disposing of a menu item that has a pull down menu
+ * will dispose of the menu. To avoid this behavior, set the
+ * menu to null before the menu item is disposed.
+ * </p>
+ *
+ * @param menu the new pull down menu
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_MENU_NOT_DROP_DOWN - if the menu is not a drop down menu</li>
+ * <li>ERROR_MENUITEM_NOT_CASCADE - if the menu item is not a <code>CASCADE</code></li>
+ * <li>ERROR_INVALID_ARGUMENT - if the menu has been disposed</li>
+ * <li>ERROR_INVALID_PARENT - if the menu is not in the same widget tree</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMenu (Menu menu) {
+ checkWidget ();
+
+ /* Check to make sure the new menu is valid */
+ if ((style & SWT.CASCADE) == 0) {
+ error (SWT.ERROR_MENUITEM_NOT_CASCADE);
+ }
+ if (menu != null) {
+ if (menu.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
+ if ((menu.style & SWT.DROP_DOWN) == 0) {
+ error (SWT.ERROR_MENU_NOT_DROP_DOWN);
+ }
+ if (menu.parent != parent.parent) {
+ error (SWT.ERROR_INVALID_PARENT);
+ }
+ }
+
+ /* Assign the new menu */
+ Menu oldMenu = this.menu;
+ if (oldMenu == menu) return;
+ if (oldMenu != null) oldMenu.cascade = null;
+ this.menu = menu;
+
+ /* Update the menu in the OS */
+ ((NSMenuItem)nsItem).setSubmenu(menu.nsMenu);
+
+}
+
+boolean setRadioSelection (boolean value) {
+ if ((style & SWT.RADIO) == 0) return false;
+ if (getSelection () != value) {
+ setSelection (value);
+ postEvent (SWT.Selection);
+ }
+ return true;
+}
+
+/**
+ * Sets the selection state of the receiver.
+ * <p>
+ * When the receiver is of type <code>CHECK</code> or <code>RADIO</code>,
+ * it is selected when it is checked.
+ *
+ * @param selected the new selection state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (boolean selected) {
+ checkWidget ();
+ if ((style & (SWT.CHECK | SWT.RADIO)) == 0) return;
+ ((NSMenuItem)nsItem).setState(selected ? OS.NSOnState : OS.NSOffState);
+}
+
+/**
+ * Sets the receiver's text. The string may include
+ * the mnemonic character and accelerator text.
+ * <p>
+ * Mnemonics are indicated by an '&amp;' that causes the next
+ * character to be the mnemonic. When the user presses a
+ * key sequence that matches the mnemonic, a selection
+ * event occurs. On most platforms, the mnemonic appears
+ * underlined but may be emphasised in a platform specific
+ * manner. The mnemonic indicator character '&amp;' can be
+ * escaped by doubling it in the string, causing a single
+ * '&amp;' to be displayed.
+ * </p>
+ * <p>
+ * Accelerator text is indicated by the '\t' character.
+ * On platforms that support accelerator text, the text
+ * that follows the '\t' character is displayed to the user,
+ * typically indicating the key stroke that will cause
+ * the item to become selected. On most platforms, the
+ * accelerator text appears right aligned in the menu.
+ * Setting the accelerator text does not install the
+ * accelerator key sequence. The accelerator key sequence
+ * is installed using #setAccelerator.
+ * </p>
+ *
+ * @param string the new text
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setAccelerator
+ */
+public void setText (String string) {
+ checkWidget ();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if ((style & SWT.SEPARATOR) != 0) return;
+ if (text.equals (string)) return;
+ int index = parent.indexOf (this);
+ if (index == -1) return;
+ super.setText (string);
+ char [] buffer = new char [text.length ()];
+ text.getChars (0, buffer.length, buffer, 0);
+ int length = fixMnemonic (buffer);
+ ((NSMenuItem)nsItem).setTitle(NSString.stringWithCharacters(buffer, length));
+}
+
+}
+
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MessageBox.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MessageBox.java
new file mode 100755
index 0000000000..0430ee1c4f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/MessageBox.java
@@ -0,0 +1,258 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * Instances of this class are used to inform or warn the user.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>ICON_ERROR, ICON_INFORMATION, ICON_QUESTION, ICON_WARNING, ICON_WORKING</dd>
+ * <dd>OK, OK | CANCEL</dd>
+ * <dd>YES | NO, YES | NO | CANCEL</dd>
+ * <dd>RETRY | CANCEL</dd>
+ * <dd>ABORT | RETRY | IGNORE</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles ICON_ERROR, ICON_INFORMATION, ICON_QUESTION,
+ * ICON_WARNING and ICON_WORKING may be specified.
+ * </p><p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ */
+public class MessageBox extends Dialog {
+ String message = "";
+
+
+/**
+ * Constructs a new instance of this class given only its parent.
+ *
+ * @param parent a shell which will be the parent of the new instance
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public MessageBox (Shell parent) {
+ this (parent, SWT.OK | SWT.ICON_INFORMATION | SWT.APPLICATION_MODAL);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ *
+ * @param parent a shell which will be the parent of the new instance
+ * @param style the style of dialog to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public MessageBox (Shell parent, int style) {
+ super (parent, checkStyle (style));
+ checkSubclass ();
+}
+
+static int checkStyle (int style) {
+ if ((style & (SWT.PRIMARY_MODAL | SWT.APPLICATION_MODAL | SWT.SYSTEM_MODAL)) == 0) style |= SWT.APPLICATION_MODAL;
+ int mask = (SWT.YES | SWT.NO | SWT.OK | SWT.CANCEL | SWT.ABORT | SWT.RETRY | SWT.IGNORE);
+ int bits = style & mask;
+ if (bits == SWT.OK || bits == SWT.CANCEL || bits == (SWT.OK | SWT.CANCEL)) return style;
+ if (bits == SWT.YES || bits == SWT.NO || bits == (SWT.YES | SWT.NO) || bits == (SWT.YES | SWT.NO | SWT.CANCEL)) return style;
+ if (bits == (SWT.RETRY | SWT.CANCEL) || bits == (SWT.ABORT | SWT.RETRY | SWT.IGNORE)) return style;
+ style = (style & ~mask) | SWT.OK;
+ return style;
+}
+
+/**
+ * Returns the dialog's message, or an empty string if it does not have one.
+ * The message is a description of the purpose for which the dialog was opened.
+ * This message will be visible in the dialog while it is open.
+ *
+ * @return the message
+ */
+public String getMessage () {
+ return message;
+}
+
+/**
+ * Makes the dialog visible and brings it to the front
+ * of the display.
+ *
+ * @return the ID of the button that was selected to dismiss the
+ * message box (e.g. SWT.OK, SWT.CANCEL, etc.)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the dialog has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the dialog</li>
+ * </ul>
+ */
+public int open () {
+ int alertType = OS.NSInformationalAlertStyle;
+ if ((style & SWT.ICON_ERROR) != 0) alertType = OS.NSCriticalAlertStyle;
+ if ((style & SWT.ICON_INFORMATION) != 0) alertType = OS.NSInformationalAlertStyle;
+ if ((style & SWT.ICON_QUESTION) != 0) alertType = OS.NSInformationalAlertStyle;
+ if ((style & SWT.ICON_WARNING) != 0) alertType = OS.NSWarningAlertStyle;
+ if ((style & SWT.ICON_WORKING) != 0) alertType = OS.NSInformationalAlertStyle;
+ NSString defaultButton = null, alternateButton = null, otherButton = null;
+ int mask = (SWT.YES | SWT.NO | SWT.OK | SWT.CANCEL | SWT.ABORT | SWT.RETRY | SWT.IGNORE);
+ int bits = style & mask;
+ switch (bits) {
+ case SWT.OK:
+ break;
+ case SWT.CANCEL:
+ defaultButton = NSString.stringWith(SWT.getMessage("SWT_Cancel"));
+ break;
+ case SWT.OK | SWT.CANCEL:
+ alternateButton = NSString.stringWith(SWT.getMessage("SWT_Cancel"));
+ break;
+ case SWT.YES:
+ defaultButton = NSString.stringWith(SWT.getMessage("SWT_Yes"));
+ break;
+ case SWT.NO:
+ defaultButton = NSString.stringWith(SWT.getMessage("SWT_No"));
+ break;
+ case SWT.YES | SWT.NO:
+ defaultButton = NSString.stringWith(SWT.getMessage("SWT_Yes"));
+ alternateButton = NSString.stringWith(SWT.getMessage("SWT_No"));
+ break;
+ case SWT.YES | SWT.NO | SWT.CANCEL:
+ defaultButton = NSString.stringWith(SWT.getMessage("SWT_Yes"));
+ alternateButton = NSString.stringWith(SWT.getMessage("SWT_No"));
+ otherButton = NSString.stringWith(SWT.getMessage("SWT_Cancel"));
+ break;
+ case SWT.RETRY | SWT.CANCEL:
+ defaultButton = NSString.stringWith(SWT.getMessage("SWT_Retry"));
+ alternateButton = NSString.stringWith(SWT.getMessage("SWT_Cancel"));
+ break;
+ case SWT.ABORT | SWT.RETRY | SWT.IGNORE:
+ defaultButton = NSString.stringWith(SWT.getMessage("SWT_Abort"));
+ alternateButton = NSString.stringWith(SWT.getMessage("SWT_Retry"));
+ otherButton = NSString.stringWith(SWT.getMessage("SWT_Ignore"));
+ break;
+ }
+ NSString title = NSString.stringWith(this.title != null ? this.title : "");
+ NSString message = NSString.stringWith(this.message != null ? this.message : "");
+ NSAlert alert = NSAlert.alertWithMessageText(title, defaultButton, alternateButton, otherButton, message);
+ alert.setAlertStyle(alertType);
+ int response = alert.runModal();
+ switch (bits) {
+ case SWT.OK:
+ switch (response) {
+ case OS.NSAlertDefaultReturn:
+ return SWT.OK;
+ }
+ break;
+ case SWT.CANCEL:
+ switch (response) {
+ case OS.NSAlertDefaultReturn:
+ return SWT.CANCEL;
+ }
+ break;
+ case SWT.OK | SWT.CANCEL:
+ switch (response) {
+ case OS.NSAlertDefaultReturn:
+ return SWT.OK;
+ case OS.NSAlertAlternateReturn:
+ return SWT.CANCEL;
+ }
+ break;
+ case SWT.YES:
+ switch (response) {
+ case OS.NSAlertDefaultReturn:
+ return SWT.YES;
+ }
+ break;
+ case SWT.NO:
+ switch (response) {
+ case OS.NSAlertDefaultReturn:
+ return SWT.NO;
+ }
+ break;
+ case SWT.YES | SWT.NO:
+ switch (response) {
+ case OS.NSAlertDefaultReturn:
+ return SWT.YES;
+ case OS.NSAlertAlternateReturn:
+ return SWT.NO;
+ }
+ break;
+ case SWT.YES | SWT.NO | SWT.CANCEL:
+ switch (response) {
+ case OS.NSAlertDefaultReturn:
+ return SWT.YES;
+ case OS.NSAlertAlternateReturn:
+ return SWT.NO;
+ case OS.NSAlertOtherReturn:
+ return SWT.CANCEL;
+ }
+ break;
+ case SWT.RETRY | SWT.CANCEL:
+ switch (response) {
+ case OS.NSAlertDefaultReturn:
+ return SWT.RETRY;
+ case OS.NSAlertAlternateReturn:
+ return SWT.CANCEL;
+ }
+ break;
+ case SWT.ABORT | SWT.RETRY | SWT.IGNORE:
+ switch (response) {
+ case OS.NSAlertDefaultReturn:
+ return SWT.ABORT;
+ case OS.NSAlertAlternateReturn:
+ return SWT.RETRY;
+ case OS.NSAlertOtherReturn:
+ return SWT.IGNORE;
+ }
+ break;
+ }
+ return SWT.CANCEL;
+}
+
+/**
+ * Sets the dialog's message, which is a description of
+ * the purpose for which it was opened. This message will be
+ * visible on the dialog while it is open.
+ *
+ * @param string the message
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ */
+public void setMessage (String string) {
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ message = string;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ProgressBar.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ProgressBar.java
new file mode 100755
index 0000000000..1816931cdf
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ProgressBar.java
@@ -0,0 +1,209 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+
+/**
+ * Instances of the receiver represent an unselectable
+ * user interface object that is used to display progress,
+ * typically in the form of a bar.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>SMOOTH, HORIZONTAL, VERTICAL, INDETERMINATE</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles HORIZONTAL and VERTICAL may be specified.
+ * </p><p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ */
+public class ProgressBar extends Control {
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#SMOOTH
+ * @see SWT#HORIZONTAL
+ * @see SWT#VERTICAL
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public ProgressBar (Composite parent, int style) {
+ super (parent, checkStyle (style));
+}
+
+static int checkStyle (int style) {
+ style |= SWT.NO_FOCUS;
+ return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
+}
+
+public Point computeSize (int wHint, int hHint, boolean changed) {
+ checkWidget();
+ NSProgressIndicator widget = (NSProgressIndicator)view;
+ NSRect oldRect = widget.frame();
+ widget.sizeToFit();
+ NSRect newRect = widget.frame();
+ widget.setFrame (oldRect);
+ int size = (int)newRect.height;
+ int width = 0, height = 0;
+ if ((style & SWT.HORIZONTAL) != 0) {
+ height = size;
+ width = height * 10;
+ } else {
+ width = size;
+ height = width * 10;
+ }
+ if (wHint != SWT.DEFAULT) width = wHint;
+ if (hHint != SWT.DEFAULT) height = hHint;
+ return new Point (width, height);
+}
+
+void createHandle () {
+ SWTProgressIndicator widget = (SWTProgressIndicator)new SWTProgressIndicator().alloc();
+ widget.initWithFrame(new NSRect());
+ widget.setUsesThreadedAnimation(false);
+ widget.setIndeterminate((style & SWT.INDETERMINATE) != 0);
+ if ((style & SWT.INDETERMINATE) != 0) widget.startAnimation(null);
+ widget.setTag(jniRef);
+ view = widget;
+ parent.contentView().addSubview_(widget);
+}
+
+/**
+ * Returns the maximum value which the receiver will allow.
+ *
+ * @return the maximum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMaximum () {
+ checkWidget();
+ return (int)((NSProgressIndicator)view).maxValue();
+}
+
+/**
+ * Returns the minimum value which the receiver will allow.
+ *
+ * @return the minimum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMinimum () {
+ checkWidget();
+ return (int)((NSProgressIndicator)view).minValue();
+}
+
+/**
+ * Returns the single 'selection' that is the receiver's position.
+ *
+ * @return the selection
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelection () {
+ checkWidget();
+ return (int)((NSProgressIndicator)view).doubleValue();
+}
+
+/**
+ * Sets the maximum value that the receiver will allow. This new
+ * value will be ignored if it is not greater than the receiver's current
+ * minimum value. If the new maximum is applied then the receiver's
+ * selection value will be adjusted if necessary to fall within its new range.
+ *
+ * @param value the new maximum, which must be greater than the current minimum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMaximum (int value) {
+ checkWidget();
+ if (value < 0) return;
+ ((NSProgressIndicator)view).setMaxValue(value);
+}
+
+/**
+ * Sets the minimum value that the receiver will allow. This new
+ * value will be ignored if it is negative or is not less than the receiver's
+ * current maximum value. If the new minimum is applied then the receiver's
+ * selection value will be adjusted if necessary to fall within its new range.
+ *
+ * @param value the new minimum, which must be nonnegative and less than the current maximum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMinimum (int value) {
+ checkWidget();
+ if (value < 0) return;
+ ((NSProgressIndicator)view).setMinValue(value);
+}
+
+/**
+ * Sets the single 'selection' that is the receiver's
+ * position to the argument which must be greater than or equal
+ * to zero.
+ *
+ * @param value the new selection (must be zero or greater)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (int value) {
+ checkWidget();
+ ((NSProgressIndicator)view).setDoubleValue(value);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Sash.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Sash.java
new file mode 100755
index 0000000000..95baff80d7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Sash.java
@@ -0,0 +1,319 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.events.*;
+
+/**
+ * Instances of the receiver represent a selectable user interface object
+ * that allows the user to drag a rubber banded outline of the sash within
+ * the parent control.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>HORIZONTAL, VERTICAL, SMOOTH</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles HORIZONTAL and VERTICAL may be specified.
+ * </p><p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ */
+public class Sash extends Control {
+ Cursor sizeCursor;
+ boolean dragging;
+ int lastX, lastY, startX, startY;
+ private final static int INCREMENT = 1;
+ private final static int PAGE_INCREMENT = 9;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#HORIZONTAL
+ * @see SWT#VERTICAL
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Sash (Composite parent, int style) {
+ super (parent, checkStyle (style));
+ int cursorStyle = (style & SWT.VERTICAL) != 0 ? SWT.CURSOR_SIZEWE : SWT.CURSOR_SIZENS;
+ sizeCursor = new Cursor (display, cursorStyle);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * When <code>widgetSelected</code> is called, the x, y, width, and height fields of the event object are valid.
+ * If the receiver is being dragged, the event object detail field contains the value <code>SWT.DRAG</code>.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the control is selected by the user
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener(listener);
+ addListener(SWT.Selection,typedListener);
+ addListener(SWT.DefaultSelection,typedListener);
+}
+
+static int checkStyle (int style) {
+ /*
+ * Macintosh only supports smooth dragging.
+ */
+ style |= SWT.SMOOTH;
+ return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
+}
+
+boolean becomeFirstResponder () {
+ boolean result = super.becomeFirstResponder();
+ NSRect frame = view.frame();
+ lastX = (int)frame.x;
+ lastY = (int)frame.y;
+ return result;
+}
+
+public Point computeSize (int wHint, int hHint, boolean changed) {
+ checkWidget();
+ int width = 0, height = 0;
+ if ((style & SWT.HORIZONTAL) != 0) {
+ width += DEFAULT_WIDTH; height += 5;
+ } else {
+ width += 5; height += DEFAULT_HEIGHT;
+ }
+ if (wHint != SWT.DEFAULT) width = wHint;
+ if (hHint != SWT.DEFAULT) height = hHint;
+ return new Point (width, height);
+}
+
+void createHandle () {
+ SWTView widget = (SWTView)new SWTView().alloc();
+ widget.initWithFrame (new NSRect());
+ widget.setTag(jniRef);
+ view = widget;
+ parent.contentView().addSubview_(view);
+}
+
+void keyDown(int theEvent) {
+ super.keyDown(theEvent);
+ //TODO consumed
+ NSEvent nsEvent = new NSEvent(theEvent);
+ int keyCode = nsEvent.keyCode();
+ switch (keyCode) {
+ case 126: /* Up arrow */
+ case 123: /* Left arrow */
+ case 125: /* Down arrow */
+ case 124: /* Right arrow */ {
+ int xChange = 0, yChange = 0;
+ int stepSize = PAGE_INCREMENT;
+ int modifiers = nsEvent.modifierFlags();
+ if ((modifiers & OS.NSControlKeyMask) != 0) stepSize = INCREMENT;
+ if ((style & SWT.VERTICAL) != 0) {
+ if (keyCode == 126 || keyCode == 125) break;
+ xChange = keyCode == 123 ? -stepSize : stepSize;
+ } else {
+ if (keyCode == 123 || keyCode == 124) break;
+ yChange = keyCode == 126 ? -stepSize : stepSize;
+ }
+
+ Rectangle bounds = getBounds ();
+ int width = bounds.width, height = bounds.height;
+ Rectangle parentBounds = parent.getBounds ();
+ int parentWidth = parentBounds.width;
+ int parentHeight = parentBounds.height;
+ int newX = lastX, newY = lastY;
+ if ((style & SWT.VERTICAL) != 0) {
+ newX = Math.min (Math.max (0, lastX + xChange), parentWidth - width);
+ } else {
+ newY = Math.min (Math.max (0, lastY + yChange), parentHeight - height);
+ }
+ if (newX == lastX && newY == lastY) return;
+ Event event = new Event ();
+ event.x = newX;
+ event.y = newY;
+ event.width = width;
+ event.height = height;
+ sendEvent (SWT.Selection, event);
+ if (isDisposed ()) break;
+ if (event.doit) {
+ setBounds (event.x, event.y, width, height);
+ if (isDisposed ()) break;
+ lastX = event.x;
+ lastY = event.y;
+ if (isDisposed ()) return;
+ int cursorX = event.x, cursorY = event.y;
+ if ((style & SWT.VERTICAL) != 0) {
+ cursorY += height / 2;
+ } else {
+ cursorX += width / 2;
+ }
+ display.setCursorLocation (parent.toDisplay (cursorX, cursorY));
+ }
+ break;
+ }
+ }
+}
+
+void mouseDown(int theEvent) {
+ super.mouseDown(theEvent);
+ NSEvent nsEvent = new NSEvent(theEvent);
+ if (nsEvent.clickCount() != 1) return;
+ NSPoint location = nsEvent.locationInWindow();
+ NSPoint point = view.convertPoint_fromView_(location, null);
+ startX = (int)point.x;
+ startY = (int)point.y;
+ NSRect frame = view.frame();
+ Event event = new Event ();
+ event.x = (int)frame.x;
+ event.y = (int)frame.y;
+ event.width = (int)frame.width;
+ event.height = (int)frame.height;
+ sendEvent (SWT.Selection, event);
+ if (isDisposed ()) return;
+ if (event.doit) {
+ lastX = event.x;
+ lastY = event.y;
+ dragging = true;
+ setLocation(event.x, event.y);
+ }
+}
+
+void mouseDragged(int theEvent) {
+ super.mouseDragged(theEvent);
+ if (!dragging) return;
+ NSEvent nsEvent = new NSEvent(theEvent);
+ NSPoint location = nsEvent.locationInWindow();
+ NSPoint point = view.convertPoint_fromView_(location, null);
+ NSRect frame = view.frame();
+ NSRect parentFrame = parent.topView().frame();
+ int newX = lastX, newY = lastY;
+ if ((style & SWT.VERTICAL) != 0) {
+ newX = Math.min (Math.max (0, (int)(point.x + frame.x - startX)), (int)(parentFrame.width - frame.width));
+ } else {
+ newY = Math.min (Math.max (0, (int)(point.y + frame.y - startY)), (int)(parentFrame.height - frame.height));
+ }
+ if (newX == lastX && newY == lastY) return;
+ Event event = new Event ();
+ event.x = newX;
+ event.y = newY;
+ event.width = (int)frame.width;
+ event.height = (int)frame.height;
+ sendEvent (SWT.Selection, event);
+ if (isDisposed ()) return;
+ if (event.doit) {
+ lastX = event.x;
+ lastY = event.y;
+ setBounds (event.x, event.y, (int)frame.width, (int)frame.height);
+ }
+}
+
+void mouseEntered(int theEvent) {
+ //TODO need to add tracking area
+ super.mouseEntered(theEvent);
+ sizeCursor.handle.set();
+}
+
+void mouseUp(int theEvent) {
+ super.mouseUp(theEvent);
+ if (!dragging) return;
+ dragging = false;
+ NSRect frame = view.frame();
+ Event event = new Event ();
+ event.x = lastX;
+ event.y = lastY;
+ event.width = (int)frame.width;
+ event.height = (int)frame.height;
+ sendEvent (SWT.Selection, event);
+ if (isDisposed ()) return;
+ if (event.doit) {
+ setBounds (event.x, event.y, (int)frame.width, (int)frame.height);
+ }
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ if (sizeCursor != null) sizeCursor.dispose ();
+ sizeCursor = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook(SWT.Selection, listener);
+ eventTable.unhook(SWT.DefaultSelection,listener);
+}
+
+int traversalCode (int key, int theEvent) {
+ return 0;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scale.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scale.java
new file mode 100755
index 0000000000..2d530b7907
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scale.java
@@ -0,0 +1,347 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+
+/**
+ * Instances of the receiver represent a selectable user
+ * interface object that present a range of continuous
+ * numeric values.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>HORIZONTAL, VERTICAL</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles HORIZONTAL and VERTICAL may be specified.
+ * </p><p>
+ * <p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ */
+public class Scale extends Control {
+ int increment = 1;
+ int pageIncrement = 10;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#HORIZONTAL
+ * @see SWT#VERTICAL
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Scale (Composite parent, int style) {
+ super (parent, checkStyle (style));
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's value, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the user changes the receiver's value.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ */
+public void addSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener(listener);
+ addListener(SWT.Selection,typedListener);
+ addListener(SWT.DefaultSelection,typedListener);
+}
+
+static int checkStyle (int style) {
+ return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
+}
+
+public Point computeSize (int wHint, int hHint, boolean changed) {
+ checkWidget();
+ NSSlider widget = (NSSlider)view;
+ NSRect oldRect = widget.frame();
+ widget.sizeToFit();
+ NSRect newRect = widget.frame();
+ widget.setFrame (oldRect);
+ int width = 0, height = 0;
+ if ((style & SWT.HORIZONTAL) != 0) {
+ height = (int)newRect.width;
+ width = height * 10;
+ } else {
+ width = (int)newRect.width;
+ height = width * 10;
+ }
+ if (wHint != SWT.DEFAULT) width = wHint;
+ if (hHint != SWT.DEFAULT) height = hHint;
+ return new Point (width, height);
+}
+
+void createHandle () {
+ NSSlider widget = (NSSlider)new SWTSlider().alloc();
+ NSRect rect = new NSRect();
+ if ((style & SWT.HORIZONTAL) != 0) {
+ rect.width = 1;
+ } else {
+ rect.height = 1;
+ }
+ widget.initWithFrame(rect);
+ widget.setMaxValue(100);
+ widget.setTag(jniRef);
+ view = widget;
+ parent.contentView().addSubview_(widget);
+}
+
+/**
+ * Returns the amount that the receiver's value will be
+ * modified by when the up/down (or right/left) arrows
+ * are pressed.
+ *
+ * @return the increment
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getIncrement () {
+ checkWidget();
+ return increment;
+}
+
+/**
+ * Returns the maximum value which the receiver will allow.
+ *
+ * @return the maximum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMaximum () {
+ checkWidget();
+ return (int)((NSSlider)view).maxValue();
+}
+
+/**
+ * Returns the minimum value which the receiver will allow.
+ *
+ * @return the minimum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMinimum () {
+ checkWidget();
+ return (int)((NSSlider)view).minValue();
+}
+
+/**
+ * Returns the amount that the receiver's value will be
+ * modified by when the page increment/decrement areas
+ * are selected.
+ *
+ * @return the page increment
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getPageIncrement () {
+ checkWidget();
+ return pageIncrement;
+}
+
+/**
+ * Returns the 'selection', which is the receiver's position.
+ *
+ * @return the selection
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelection () {
+ checkWidget();
+// int value = OS.GetControl32BitValue (handle);
+// if ((style & SWT.VERTICAL) != 0) {
+// int minimum = OS.GetControl32BitMinimum (handle);
+// int maximum = OS.GetControl32BitMaximum (handle);
+// value = maximum - value + minimum;
+// }
+ return (int)((NSSlider)view).doubleValue();
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's value.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook(SWT.Selection, listener);
+ eventTable.unhook(SWT.DefaultSelection,listener);
+}
+
+/**
+ * Sets the amount that the receiver's value will be
+ * modified by when the up/down (or right/left) arrows
+ * are pressed to the argument, which must be at least
+ * one.
+ *
+ * @param increment the new increment (must be greater than zero)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setIncrement (int value) {
+ checkWidget();
+ if (value < 1) return;
+ increment = value;
+}
+
+/**
+ * Sets the maximum value that the receiver will allow. This new
+ * value will be ignored if it is not greater than the receiver's current
+ * minimum value. If the new maximum is applied then the receiver's
+ * selection value will be adjusted if necessary to fall within its new range.
+ *
+ * @param value the new maximum, which must be greater than the current minimum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMaximum (int value) {
+ checkWidget();
+ if (value < 0) return;
+ ((NSSlider)view).setMaxValue(value);
+}
+
+/**
+ * Sets the minimum value that the receiver will allow. This new
+ * value will be ignored if it is negative or is not less than the receiver's
+ * current maximum value. If the new minimum is applied then the receiver's
+ * selection value will be adjusted if necessary to fall within its new range.
+ *
+ * @param value the new minimum, which must be nonnegative and less than the current maximum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMinimum (int value) {
+ checkWidget();
+ if (value < 0) return;
+ ((NSSlider)view).setMinValue(value);
+}
+
+/**
+ * Sets the amount that the receiver's value will be
+ * modified by when the page increment/decrement areas
+ * are selected to the argument, which must be at least
+ * one.
+ *
+ * @param pageIncrement the page increment (must be greater than zero)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setPageIncrement (int value) {
+ checkWidget();
+ if (value < 1) return;
+ pageIncrement = value;
+}
+
+/**
+ * Sets the 'selection', which is the receiver's value,
+ * to the argument which must be greater than or equal to zero.
+ *
+ * @param value the new selection (must be zero or greater)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (int value) {
+ checkWidget();
+ ((NSSlider)view).setDoubleValue(value);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ScrollBar.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ScrollBar.java
new file mode 100755
index 0000000000..f7f25f6664
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ScrollBar.java
@@ -0,0 +1,659 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+
+/**
+ * Instances of this class are selectable user interface
+ * objects that represent a range of positive, numeric values.
+ * <p>
+ * At any given moment, a given scroll bar will have a
+ * single 'selection' that is considered to be its
+ * value, which is constrained to be within the range of
+ * values the scroll bar represents (that is, between its
+ * <em>minimum</em> and <em>maximum</em> values).
+ * </p><p>
+ * Typically, scroll bars will be made up of five areas:
+ * <ol>
+ * <li>an arrow button for decrementing the value</li>
+ * <li>a page decrement area for decrementing the value by a larger amount</li>
+ * <li>a <em>thumb</em> for modifying the value by mouse dragging</li>
+ * <li>a page increment area for incrementing the value by a larger amount</li>
+ * <li>an arrow button for incrementing the value</li>
+ * </ol>
+ * Based on their style, scroll bars are either <code>HORIZONTAL</code>
+ * (which have a left facing button for decrementing the value and a
+ * right facing button for incrementing it) or <code>VERTICAL</code>
+ * (which have an upward facing button for decrementing the value
+ * and a downward facing buttons for incrementing it).
+ * </p><p>
+ * On some platforms, the size of the scroll bar's thumb can be
+ * varied relative to the magnitude of the range of values it
+ * represents (that is, relative to the difference between its
+ * maximum and minimum values). Typically, this is used to
+ * indicate some proportional value such as the ratio of the
+ * visible area of a document to the total amount of space that
+ * it would take to display it. SWT supports setting the thumb
+ * size even if the underlying platform does not, but in this
+ * case the appearance of the scroll bar will not change.
+ * </p><p>
+ * Scroll bars are created by specifying either <code>H_SCROLL</code>,
+ * <code>V_SCROLL</code> or both when creating a <code>Scrollable</code>.
+ * They are accessed from the <code>Scrollable</code> using
+ * <code>getHorizontalBar</code> and <code>getVerticalBar</code>.
+ * </p><p>
+ * Note: Scroll bars are not Controls. On some platforms, scroll bars
+ * that appear as part of some standard controls such as a text or list
+ * have no operating system resources and are not children of the control.
+ * For this reason, scroll bars are treated specially. To create a control
+ * that looks like a scroll bar but has operating system resources, use
+ * <code>Slider</code>.
+ * </p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>HORIZONTAL, VERTICAL</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles HORIZONTAL and VERTICAL may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see Slider
+ * @see Scrollable
+ * @see Scrollable#getHorizontalBar
+ * @see Scrollable#getVerticalBar
+ */
+public class ScrollBar extends Widget {
+ NSScroller view;
+ Scrollable parent;
+ int minimum, maximum, thumb;
+ int increment = 1;
+ int pageIncrement = 10;
+ id target;
+ int actionSelector;;
+
+ScrollBar () {
+ /* Do nothing */
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's value, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * When <code>widgetSelected</code> is called, the event object detail field contains one of the following values:
+ * <code>SWT.NONE</code> - for the end of a drag.
+ * <code>SWT.DRAG</code>.
+ * <code>SWT.HOME</code>.
+ * <code>SWT.END</code>.
+ * <code>SWT.ARROW_DOWN</code>.
+ * <code>SWT.ARROW_UP</code>.
+ * <code>SWT.PAGE_DOWN</code>.
+ * <code>SWT.PAGE_UP</code>.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the user changes the receiver's value
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener(listener);
+ addListener(SWT.Selection,typedListener);
+ addListener(SWT.DefaultSelection,typedListener);
+}
+
+static int checkStyle (int style) {
+ return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
+}
+
+void createWidget () {
+ maximum = 100;
+ thumb = 10;
+ super.createWidget();
+}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled, and
+ * <code>false</code> otherwise. A disabled control is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #isEnabled
+ */
+public boolean getEnabled () {
+ checkWidget();
+ return (state & DISABLED) == 0;
+}
+
+/**
+ * Returns the amount that the receiver's value will be
+ * modified by when the up/down (or right/left) arrows
+ * are pressed.
+ *
+ * @return the increment
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getIncrement () {
+ checkWidget();
+ return increment;
+}
+
+/**
+ * Returns the maximum value which the receiver will allow.
+ *
+ * @return the maximum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMaximum () {
+ checkWidget();
+ return maximum;
+}
+
+/**
+ * Returns the minimum value which the receiver will allow.
+ *
+ * @return the minimum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMinimum () {
+ checkWidget();
+ return minimum;
+}
+
+/**
+ * Returns the amount that the receiver's value will be
+ * modified by when the page increment/decrement areas
+ * are selected.
+ *
+ * @return the page increment
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getPageIncrement () {
+ checkWidget();
+ return pageIncrement;
+}
+
+/**
+ * Returns the receiver's parent, which must be a Scrollable.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Scrollable getParent () {
+ checkWidget ();
+ return parent;
+}
+
+/**
+ * Returns the single 'selection' that is the receiver's value.
+ *
+ * @return the selection
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelection () {
+ checkWidget();
+ NSScroller widget = (NSScroller)view;
+ float value = widget.floatValue();
+ return (int)((maximum - thumb - minimum) * value + minimum);
+}
+
+/**
+ * Returns a point describing the receiver's size. The
+ * x coordinate of the result is the width of the receiver.
+ * The y coordinate of the result is the height of the
+ * receiver.
+ *
+ * @return the receiver's size
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getSize () {
+ checkWidget();
+// return getControlSize (handle);
+ return new Point(0, 0);
+}
+
+/**
+ * Returns the size of the receiver's thumb relative to the
+ * difference between its maximum and minimum values.
+ *
+ * @return the thumb value
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ScrollBar
+ */
+public int getThumb () {
+ checkWidget();
+ return thumb;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible, and
+ * <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getVisible () {
+ checkWidget();
+ return (state & HIDDEN) == 0;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled and all
+ * of the receiver's ancestors are enabled, and <code>false</code>
+ * otherwise. A disabled control is typically not selectable from the
+ * user interface and draws with an inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getEnabled
+ */
+public boolean isEnabled () {
+ checkWidget();
+ return getEnabled () && parent.isEnabled ();
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible and all
+ * of the receiver's ancestors are visible and <code>false</code>
+ * otherwise.
+ *
+ * @return the receiver's visibility state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getVisible
+ */
+public boolean isVisible () {
+ checkWidget();
+ return getVisible () && parent.isVisible ();
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's value.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook(SWT.Selection, listener);
+ eventTable.unhook(SWT.DefaultSelection,listener);
+}
+
+void releaseHandle () {
+ super.releaseHandle ();
+ view = null;
+}
+
+void releaseParent () {
+ super.releaseParent ();
+ if (parent.horizontalBar == this) parent.horizontalBar = null;
+ if (parent.verticalBar == this) parent.verticalBar = null;
+ parent.resizeClientArea ();
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ parent = null;
+}
+
+void sendSelection () {
+ int value = 0;
+ if (target != null) {
+ view.sendAction(actionSelector, target);
+ } else {
+ value = getSelection ();
+ }
+ Event event = new Event();
+ int hitPart = ((NSScroller)view).hitPart();
+ switch (hitPart) {
+ case OS.NSScrollerDecrementLine:
+ value -= increment;
+ event.detail = SWT.ARROW_UP;
+ break;
+ case OS.NSScrollerDecrementPage:
+ value -= pageIncrement;
+ event.detail = SWT.PAGE_UP;
+ break;
+ case OS.NSScrollerIncrementLine:
+ value += increment;
+ event.detail = SWT.PAGE_DOWN;
+ break;
+ case OS.NSScrollerIncrementPage:
+ value += pageIncrement;
+ event.detail = SWT.ARROW_DOWN;
+ break;
+ case OS.NSScrollerKnob:
+ event.detail = SWT.DRAG;
+ break;
+ }
+ if (target == null) {
+ if (event.detail != SWT.DRAG) {
+ setSelection(value);
+ }
+ }
+ sendEvent(SWT.Selection, event);
+}
+
+/**
+ * Sets the amount that the receiver's value will be
+ * modified by when the up/down (or right/left) arrows
+ * are pressed to the argument, which must be at least
+ * one.
+ *
+ * @param value the new increment (must be greater than zero)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setIncrement (int value) {
+ checkWidget();
+ if (value < 1) return;
+ increment = value;
+}
+
+/**
+ * Enables the receiver if the argument is <code>true</code>,
+ * and disables it otherwise. A disabled control is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ *
+ * @param enabled the new enabled state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setEnabled (boolean enabled) {
+ checkWidget();
+// if (enabled) {
+// if ((state & DISABLED) == 0) return;
+// state &= ~DISABLED;
+// OS.EnableControl (handle);
+// } else {
+// if ((state & DISABLED) != 0) return;
+// state |= DISABLED;
+// OS.DisableControl (handle);
+// }
+}
+
+/**
+ * Sets the maximum. If this value is negative or less than or
+ * equal to the minimum, the value is ignored. If necessary, first
+ * the thumb and then the selection are adjusted to fit within the
+ * new range.
+ *
+ * @param value the new maximum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMaximum (int value) {
+ checkWidget();
+ if (value < 0) return;
+ if (value <= minimum) return;
+ if (value - minimum < thumb) {
+ thumb = value - minimum;
+ }
+ int selection = Math.max(minimum, Math.min (getSelection (), value - thumb));
+ this.maximum = value;
+ updateBar(selection, minimum, value, thumb);
+}
+
+/**
+ * Sets the minimum value. If this value is negative or greater
+ * than or equal to the maximum, the value is ignored. If necessary,
+ * first the thumb and then the selection are adjusted to fit within
+ * the new range.
+ *
+ * @param value the new minimum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMinimum (int value) {
+ checkWidget();
+ if (value < 0) return;
+ if (value >= maximum) return;
+ if (maximum - value < thumb) {
+ thumb = maximum - value;
+ }
+ int selection = Math.min(maximum - thumb, Math.max (getSelection (), value));
+ this.minimum = value;
+ updateBar(selection, value, maximum, thumb);
+}
+
+/**
+ * Sets the amount that the receiver's value will be
+ * modified by when the page increment/decrement areas
+ * are selected to the argument, which must be at least
+ * one.
+ *
+ * @param value the page increment (must be greater than zero)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setPageIncrement (int value) {
+ checkWidget();
+ if (value < 1) return;
+ pageIncrement = value;
+}
+
+/**
+ * Sets the single <em>selection</em> that is the receiver's
+ * value to the argument which must be greater than or equal
+ * to zero.
+ *
+ * @param selection the new selection (must be zero or greater)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (int value) {
+ checkWidget();
+ updateBar(value, minimum, maximum, thumb);
+}
+
+/**
+ * Sets the size of the receiver's thumb relative to the
+ * difference between its maximum and minimum values. This new
+ * value will be ignored if it is less than one, and will be
+ * clamped if it exceeds the receiver's current range.
+ *
+ * @param value the new thumb value, which must be at least one and not
+ * larger than the size of the current range
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setThumb (int value) {
+ checkWidget();
+ if (value < 1) return;
+ value = Math.min (value, maximum - minimum);
+ this.thumb = value;
+ updateBar(getSelection(), minimum, maximum, value);
+}
+
+/**
+ * Sets the receiver's selection, minimum value, maximum
+ * value, thumb, increment and page increment all at once.
+ * <p>
+ * Note: This is similar to setting the values individually
+ * using the appropriate methods, but may be implemented in a
+ * more efficient fashion on some platforms.
+ * </p>
+ *
+ * @param selection the new selection value
+ * @param minimum the new minimum value
+ * @param maximum the new maximum value
+ * @param thumb the new thumb value
+ * @param increment the new increment value
+ * @param pageIncrement the new pageIncrement value
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setValues (int selection, int minimum, int maximum, int thumb, int increment, int pageIncrement) {
+ checkWidget();
+ if (minimum < 0) return;
+ if (maximum < 0) return;
+ if (thumb < 1) return;
+ if (increment < 1) return;
+ if (pageIncrement < 1) return;
+ thumb = Math.min (thumb, maximum - minimum);
+ this.increment = increment;
+ this.pageIncrement = pageIncrement;
+ updateBar(selection, minimum, maximum, thumb);
+}
+
+/**
+ * Marks the receiver as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param visible the new visibility state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setVisible (boolean visible) {
+ checkWidget();
+ //TODO visibility
+ parent.setScrollBarVisible (this, visible);
+}
+
+void updateBar(int selection, int minimum, int maximum, int thumb) {
+ NSScroller widget = (NSScroller)view;
+ selection = Math.max(minimum, Math.min(maximum - thumb, selection));
+ int range = maximum - thumb - minimum;
+ float fraction = range < 0 ? 1 : (float)(selection - minimum) / range;
+ float knob = minimum == maximum ? 1 : (float)(thumb - minimum) / maximum - minimum;
+ widget.setFloatValue(fraction, knob);
+ widget.setEnabled(range > 0);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java
new file mode 100755
index 0000000000..1066d47277
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java
@@ -0,0 +1,309 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+
+/**
+ * This class is the abstract superclass of all classes which
+ * represent controls that have standard scroll bars.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>H_SCROLL, V_SCROLL</dd>
+ * <dt><b>Events:</b>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation.
+ * </p>
+ */
+public abstract class Scrollable extends Control {
+ SWTScrollView scrollView;
+ ScrollBar horizontalBar, verticalBar;
+
+Scrollable () {
+ /* Do nothing */
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#H_SCROLL
+ * @see SWT#V_SCROLL
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Scrollable (Composite parent, int style) {
+ super (parent, style);
+}
+
+/**
+ * Given a desired <em>client area</em> for the receiver
+ * (as described by the arguments), returns the bounding
+ * rectangle which would be required to produce that client
+ * area.
+ * <p>
+ * In other words, it returns a rectangle such that, if the
+ * receiver's bounds were set to that rectangle, the area
+ * of the receiver which is capable of displaying data
+ * (that is, not covered by the "trimmings") would be the
+ * rectangle described by the arguments (relative to the
+ * receiver's parent).
+ * </p>
+ *
+ * @param x the desired x coordinate of the client area
+ * @param y the desired y coordinate of the client area
+ * @param width the desired width of the client area
+ * @param height the desired height of the client area
+ * @return the required bounds to produce the given client area
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getClientArea
+ */
+public Rectangle computeTrim (int x, int y, int width, int height) {
+ checkWidget();
+ if (scrollView != null) {
+ NSSize size = new NSSize();
+ size.width = width;
+ size.height = height;
+ int border = hasBorder() ? OS.NSBezelBorder : OS.NSNoBorder;
+ size = NSScrollView.frameSizeForContentSize(size, (style & SWT.H_SCROLL) != 0, (style & SWT.V_SCROLL) != 0, border);
+ width = (int)size.width;
+ height = (int)size.height;
+ NSRect frame = scrollView.contentView().frame();
+ x -= frame.x;
+ y -= frame.y;
+ }
+ return new Rectangle (x, y, width, height);
+}
+
+ScrollBar createScrollBar (int style) {
+ if (scrollView == null) return null;
+ ScrollBar bar = new ScrollBar ();
+ bar.parent = this;
+ bar.style = style;
+ bar.display = display;
+ NSScroller scroller;
+ int actionSelector;
+ if ((style & SWT.H_SCROLL) != 0) {
+ scroller = scrollView.horizontalScroller();
+ actionSelector = OS.sel_sendHorizontalSelection;
+ } else {
+ scroller = scrollView.verticalScroller();
+ actionSelector = OS.sel_sendVerticalSelection;
+ }
+ bar.view = scroller;
+ bar.createJNIRef();
+ scroller.setTag(bar.jniRef);
+ if ((state & CANVAS) == 0) {
+ bar.target = scroller.target();
+ bar.actionSelector = scroller.action();
+ }
+ scroller.setTarget(scrollView);
+ scroller.setAction(actionSelector);
+ return bar;
+}
+
+void createWidget () {
+ super.createWidget ();
+ if ((style & SWT.H_SCROLL) != 0) horizontalBar = createScrollBar (SWT.H_SCROLL);
+ if ((style & SWT.V_SCROLL) != 0) verticalBar = createScrollBar (SWT.V_SCROLL);
+}
+
+/**
+ * Returns a rectangle which describes the area of the
+ * receiver which is capable of displaying data (that is,
+ * not covered by the "trimmings").
+ *
+ * @return the client area
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #computeTrim
+ */
+public Rectangle getClientArea () {
+ checkWidget();
+ if (scrollView != null) {
+ NSSize size = scrollView.contentSize();
+ return new Rectangle(0, 0, (int)size.width, (int)size.height);
+ } else {
+ NSRect rect = view.bounds();
+ return new Rectangle(0, 0, (int)rect.width, (int)rect.height);
+ }
+}
+
+/**
+ * Returns the receiver's horizontal scroll bar if it has
+ * one, and null if it does not.
+ *
+ * @return the horizontal scroll bar (or null)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public ScrollBar getHorizontalBar () {
+ checkWidget();
+ return horizontalBar;
+}
+
+/**
+ * Returns the receiver's vertical scroll bar if it has
+ * one, and null if it does not.
+ *
+ * @return the vertical scroll bar (or null)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public ScrollBar getVerticalBar () {
+ checkWidget();
+ return verticalBar;
+}
+
+boolean hooksKeys () {
+ return hooks (SWT.KeyDown) || hooks (SWT.KeyUp) || hooks (SWT.Traverse);
+}
+
+
+void releaseHandle () {
+ super.releaseHandle ();
+ if (scrollView != null) {
+ scrollView.setTag(-1);
+ scrollView.release();
+ }
+ scrollView = null;
+}
+
+void releaseChildren (boolean destroy) {
+ if (horizontalBar != null) {
+ horizontalBar.release (false);
+ horizontalBar = null;
+ }
+ if (verticalBar != null) {
+ verticalBar.release (false);
+ verticalBar = null;
+ }
+ super.releaseChildren (destroy);
+}
+
+void resizeClientArea () {
+// if (scrolledHandle == 0) return;
+// if ((state & CANVAS) == 0) return;
+// int vWidth = 0, hHeight = 0;
+// int [] outMetric = new int [1];
+// OS.GetThemeMetric (OS.kThemeMetricScrollBarWidth, outMetric);
+// boolean isVisibleHBar = horizontalBar != null && horizontalBar.getVisible ();
+// boolean isVisibleVBar = verticalBar != null && verticalBar.getVisible ();
+// if (isVisibleHBar) hHeight = outMetric [0];
+// if (isVisibleVBar) vWidth = outMetric [0];
+// int width, height;
+// CGRect rect = new CGRect ();
+// OS.HIViewGetBounds (scrolledHandle, rect);
+// width = (int) rect.width;
+// height = (int) rect.height;
+// Rect inset = inset ();
+// width = Math.max (0, width - vWidth - inset.left - inset.right);
+// height = Math.max (0, height - hHeight - inset.top - inset.bottom);
+// setBounds (handle, inset.left, inset.top, width, height, true, true, false);
+// if (isVisibleHBar) {
+// setBounds (horizontalBar.handle, inset.left, inset.top + height, width, hHeight, true, true, false);
+// }
+// if (isVisibleVBar) {
+// setBounds (verticalBar.handle, inset.left + width, inset.top, vWidth, height, true, true, false);
+// }
+}
+
+void sendHorizontalSelection () {
+ horizontalBar.sendSelection ();
+}
+
+boolean sendMouseWheel (short wheelAxis, int wheelDelta) {
+// if ((state & CANVAS) != 0) {
+// ScrollBar bar = wheelAxis == OS.kEventMouseWheelAxisX ? horizontalBar : verticalBar;
+// if (bar != null && bar.getEnabled ()) {
+// bar.setSelection (Math.max (0, bar.getSelection () - bar.getIncrement () * wheelDelta));
+// Event event = new Event ();
+// event.detail = wheelDelta > 0 ? SWT.PAGE_UP : SWT.PAGE_DOWN;
+// bar.sendEvent (SWT.Selection, event);
+// return true;
+// }
+// }
+ return false;
+}
+
+void sendVerticalSelection () {
+ verticalBar.sendSelection ();
+}
+
+boolean setScrollBarVisible (ScrollBar bar, boolean visible) {
+ if (scrollView == null) return false;
+ if ((state & CANVAS) == 0) return false;
+ if (visible) {
+ if ((bar.state & HIDDEN) == 0) return false;
+ bar.state &= ~HIDDEN;
+ } else {
+ if ((bar.state & HIDDEN) != 0) return false;
+ bar.state |= HIDDEN;
+ }
+ resizeClientArea ();
+// setVisible (bar.handle, visible);
+ bar.sendEvent (visible ? SWT.Show : SWT.Hide);
+ sendEvent (SWT.Resize);
+ return true;
+}
+
+void setZOrder () {
+ super.setZOrder ();
+// if (scrolledHandle != 0) OS.HIViewAddSubview (scrolledHandle, handle);
+}
+
+NSView topView () {
+ if (scrollView != null) return scrollView;
+ return super.topView ();
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
new file mode 100755
index 0000000000..10afc57ab8
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Shell.java
@@ -0,0 +1,1237 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * Instances of this class represent the "windows"
+ * which the desktop or "window manager" is managing.
+ * Instances that do not have a parent (that is, they
+ * are built using the constructor, which takes a
+ * <code>Display</code> as the argument) are described
+ * as <em>top level</em> shells. Instances that do have
+ * a parent are described as <em>secondary</em> or
+ * <em>dialog</em> shells.
+ * <p>
+ * Instances are always displayed in one of the maximized,
+ * minimized or normal states:
+ * <ul>
+ * <li>
+ * When an instance is marked as <em>maximized</em>, the
+ * window manager will typically resize it to fill the
+ * entire visible area of the display, and the instance
+ * is usually put in a state where it can not be resized
+ * (even if it has style <code>RESIZE</code>) until it is
+ * no longer maximized.
+ * </li><li>
+ * When an instance is in the <em>normal</em> state (neither
+ * maximized or minimized), its appearance is controlled by
+ * the style constants which were specified when it was created
+ * and the restrictions of the window manager (see below).
+ * </li><li>
+ * When an instance has been marked as <em>minimized</em>,
+ * its contents (client area) will usually not be visible,
+ * and depending on the window manager, it may be
+ * "iconified" (that is, replaced on the desktop by a small
+ * simplified representation of itself), relocated to a
+ * distinguished area of the screen, or hidden. Combinations
+ * of these changes are also possible.
+ * </li>
+ * </ul>
+ * </p><p>
+ * The <em>modality</em> of an instance may be specified using
+ * style bits. The modality style bits are used to determine
+ * whether input is blocked for other shells on the display.
+ * The <code>PRIMARY_MODAL</code> style allows an instance to block
+ * input to its parent. The <code>APPLICATION_MODAL</code> style
+ * allows an instance to block input to every other shell in the
+ * display. The <code>SYSTEM_MODAL</code> style allows an instance
+ * to block input to all shells, including shells belonging to
+ * different applications.
+ * </p><p>
+ * Note: The styles supported by this class are treated
+ * as <em>HINT</em>s, since the window manager for the
+ * desktop on which the instance is visible has ultimate
+ * control over the appearance and behavior of decorations
+ * and modality. For example, some window managers only
+ * support resizable windows and will always assume the
+ * RESIZE style, even if it is not set. In addition, if a
+ * modality style is not supported, it is "upgraded" to a
+ * more restrictive modality style that is supported. For
+ * example, if <code>PRIMARY_MODAL</code> is not supported,
+ * it would be upgraded to <code>APPLICATION_MODAL</code>.
+ * A modality style may also be "downgraded" to a less
+ * restrictive style. For example, most operating systems
+ * no longer support <code>SYSTEM_MODAL</code> because
+ * it can freeze up the desktop, so this is typically
+ * downgraded to <code>APPLICATION_MODAL</code>.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>BORDER, CLOSE, MIN, MAX, NO_TRIM, RESIZE, TITLE, ON_TOP, TOOL</dd>
+ * <dd>APPLICATION_MODAL, MODELESS, PRIMARY_MODAL, SYSTEM_MODAL</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Activate, Close, Deactivate, Deiconify, Iconify</dd>
+ * </dl>
+ * Class <code>SWT</code> provides two "convenience constants"
+ * for the most commonly required style combinations:
+ * <dl>
+ * <dt><code>SHELL_TRIM</code></dt>
+ * <dd>
+ * the result of combining the constants which are required
+ * to produce a typical application top level shell: (that
+ * is, <code>CLOSE | TITLE | MIN | MAX | RESIZE</code>)
+ * </dd>
+ * <dt><code>DIALOG_TRIM</code></dt>
+ * <dd>
+ * the result of combining the constants which are required
+ * to produce a typical application dialog shell: (that
+ * is, <code>TITLE | CLOSE | BORDER</code>)
+ * </dd>
+ * </dl>
+ * </p>
+ * <p>
+ * Note: Only one of the styles APPLICATION_MODAL, MODELESS,
+ * PRIMARY_MODAL and SYSTEM_MODAL may be specified.
+ * </p><p>
+ * IMPORTANT: This class is not intended to be subclassed.
+ * </p>
+ *
+ * @see Decorations
+ * @see SWT
+ */
+public class Shell extends Decorations {
+ NSWindow window;
+ SWTWindowDelegate windowDelegate;
+ boolean opened, moved, resized, fullScreen;
+// boolean resized, moved, drawing, reshape, update, deferDispose, active, disposed, opened, fullScreen;
+ Control lastActive;
+ Region region;
+ Rectangle normalBounds;
+
+ static int DEFAULT_CLIENT_WIDTH = -1;
+ static int DEFAULT_CLIENT_HEIGHT = -1;
+
+/**
+ * Constructs a new instance of this class. This is equivalent
+ * to calling <code>Shell((Display) null)</code>.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public Shell () {
+ this ((Display) null);
+}
+
+/**
+ * Constructs a new instance of this class given only the style
+ * value describing its behavior and appearance. This is equivalent
+ * to calling <code>Shell((Display) null, style)</code>.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param style the style of control to construct
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#BORDER
+ * @see SWT#CLOSE
+ * @see SWT#MIN
+ * @see SWT#MAX
+ * @see SWT#RESIZE
+ * @see SWT#TITLE
+ * @see SWT#NO_TRIM
+ * @see SWT#SHELL_TRIM
+ * @see SWT#DIALOG_TRIM
+ * @see SWT#MODELESS
+ * @see SWT#PRIMARY_MODAL
+ * @see SWT#APPLICATION_MODAL
+ * @see SWT#SYSTEM_MODAL
+ */
+public Shell (int style) {
+ this ((Display) null, style);
+}
+
+/**
+ * Constructs a new instance of this class given only the display
+ * to create it on. It is created with style <code>SWT.SHELL_TRIM</code>.
+ * <p>
+ * Note: Currently, null can be passed in for the display argument.
+ * This has the effect of creating the shell on the currently active
+ * display if there is one. If there is no current display, the
+ * shell is created on a "default" display. <b>Passing in null as
+ * the display argument is not considered to be good coding style,
+ * and may not be supported in a future release of SWT.</b>
+ * </p>
+ *
+ * @param display the display to create the shell on
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public Shell (Display display) {
+ this (display, SWT.SHELL_TRIM);
+}
+
+/**
+ * Constructs a new instance of this class given the display
+ * to create it on and a style value describing its behavior
+ * and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p><p>
+ * Note: Currently, null can be passed in for the display argument.
+ * This has the effect of creating the shell on the currently active
+ * display if there is one. If there is no current display, the
+ * shell is created on a "default" display. <b>Passing in null as
+ * the display argument is not considered to be good coding style,
+ * and may not be supported in a future release of SWT.</b>
+ * </p>
+ *
+ * @param display the display to create the shell on
+ * @param style the style of control to construct
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#BORDER
+ * @see SWT#CLOSE
+ * @see SWT#MIN
+ * @see SWT#MAX
+ * @see SWT#RESIZE
+ * @see SWT#TITLE
+ * @see SWT#NO_TRIM
+ * @see SWT#SHELL_TRIM
+ * @see SWT#DIALOG_TRIM
+ * @see SWT#MODELESS
+ * @see SWT#PRIMARY_MODAL
+ * @see SWT#APPLICATION_MODAL
+ * @see SWT#SYSTEM_MODAL
+ */
+public Shell (Display display, int style) {
+ this (display, null, style, 0, false);
+}
+
+Shell (Display display, Shell parent, int style, int handle, boolean embedded) {
+ super ();
+ checkSubclass ();
+ if (display == null) display = Display.getCurrent ();
+ if (display == null) display = Display.getDefault ();
+ if (!display.isValidThread ()) {
+ error (SWT.ERROR_THREAD_INVALID_ACCESS);
+ }
+ if (parent != null && parent.isDisposed ()) {
+ error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ this.style = checkStyle (style);
+ this.parent = parent;
+ this.display = display;
+ if (handle != 0) {
+ if (embedded) {
+ view = new NSView(handle);
+ } else {
+ window = new NSWindow(handle);
+ state |= FOREIGN_HANDLE;
+ }
+ }
+ createWidget ();
+}
+
+/**
+ * Constructs a new instance of this class given only its
+ * parent. It is created with style <code>SWT.DIALOG_TRIM</code>.
+ * <p>
+ * Note: Currently, null can be passed in for the parent.
+ * This has the effect of creating the shell on the currently active
+ * display if there is one. If there is no current display, the
+ * shell is created on a "default" display. <b>Passing in null as
+ * the parent is not considered to be good coding style,
+ * and may not be supported in a future release of SWT.</b>
+ * </p>
+ *
+ * @param parent a shell which will be the parent of the new instance
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the parent is disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+public Shell (Shell parent) {
+ this (parent, SWT.DIALOG_TRIM);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p><p>
+ * Note: Currently, null can be passed in for the parent.
+ * This has the effect of creating the shell on the currently active
+ * display if there is one. If there is no current display, the
+ * shell is created on a "default" display. <b>Passing in null as
+ * the parent is not considered to be good coding style,
+ * and may not be supported in a future release of SWT.</b>
+ * </p>
+ *
+ * @param parent a shell which will be the parent of the new instance
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the parent is disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#BORDER
+ * @see SWT#CLOSE
+ * @see SWT#MIN
+ * @see SWT#MAX
+ * @see SWT#RESIZE
+ * @see SWT#TITLE
+ * @see SWT#NO_TRIM
+ * @see SWT#SHELL_TRIM
+ * @see SWT#DIALOG_TRIM
+ * @see SWT#ON_TOP
+ * @see SWT#TOOL
+ * @see SWT#MODELESS
+ * @see SWT#PRIMARY_MODAL
+ * @see SWT#APPLICATION_MODAL
+ * @see SWT#SYSTEM_MODAL
+ */
+public Shell (Shell parent, int style) {
+ this (parent != null ? parent.display : null, parent, style, 0, false);
+}
+
+public static Shell internal_new (Display display, int handle) {
+ return new Shell (display, null, SWT.NO_TRIM, handle, false);
+}
+
+static int checkStyle (int style) {
+ style = Decorations.checkStyle (style);
+ style &= ~SWT.TRANSPARENT;
+ int mask = SWT.SYSTEM_MODAL | SWT.APPLICATION_MODAL | SWT.PRIMARY_MODAL;
+ int bits = style & ~mask;
+ if ((style & SWT.SYSTEM_MODAL) != 0) return bits | SWT.SYSTEM_MODAL;
+ if ((style & SWT.APPLICATION_MODAL) != 0) return bits | SWT.APPLICATION_MODAL;
+ if ((style & SWT.PRIMARY_MODAL) != 0) return bits | SWT.PRIMARY_MODAL;
+ return bits;
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when operations are performed on the receiver,
+ * by sending the listener one of the messages defined in the
+ * <code>ShellListener</code> interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ShellListener
+ * @see #removeShellListener
+ */
+public void addShellListener(ShellListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener(SWT.Activate,typedListener);
+ addListener(SWT.Close,typedListener);
+ addListener(SWT.Deactivate,typedListener);
+ addListener(SWT.Iconify,typedListener);
+ addListener(SWT.Deiconify,typedListener);
+}
+
+void bringToTop (boolean force) {
+ if (getMinimized ()) return;
+ if (force) {
+ forceActive ();
+ } else {
+ setActive ();
+ }
+}
+
+void checkOpen () {
+ if (!opened) resized = false;
+}
+
+/**
+ * Requests that the window manager close the receiver in
+ * the same way it would be closed when the user clicks on
+ * the "close box" or performs some other platform specific
+ * key or mouse combination that indicates the window
+ * should be removed.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT#Close
+ * @see #dispose
+ */
+public void close () {
+ checkWidget();
+ closeWidget ();
+}
+
+void closeWidget () {
+ Event event = new Event ();
+ sendEvent (SWT.Close, event);
+ if (event.doit && !isDisposed ()) dispose ();
+}
+
+public Rectangle computeTrim (int x, int y, int width, int height) {
+ checkWidget();
+ Rectangle trim = super.computeTrim(x, y, width, height);
+ NSRect rect = new NSRect ();
+ rect.x = trim.x;
+ rect.y = trim.y;
+ rect.width = trim.width;
+ rect.height = trim.height;
+ rect = NSWindow.static_frameRectForContentRect_styleMask_(rect, window.styleMask());
+ return new Rectangle ((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+}
+
+void createHandle () {
+ state |= CANVAS;// | GRAB | HIDDEN;
+ if (window != null) {
+
+ } else {
+ window = (NSWindow) new NSWindow ().alloc ();
+ NSRect rect = new NSRect();
+ Monitor monitor = getMonitor ();
+ Rectangle clientArea = monitor.getClientArea ();
+ rect.width = clientArea.width * 5 / 8;
+ rect.height = clientArea.height * 5 / 8;
+ int styleMask = OS.NSBorderlessWindowMask;
+ if ((style & SWT.NO_TRIM) == 0) {
+ styleMask = OS.NSTitledWindowMask;
+ if ((style & SWT.CLOSE) != 0) styleMask |= OS.NSClosableWindowMask;
+ if ((style & SWT.MIN) != 0) styleMask |= OS.NSMiniaturizableWindowMask;
+// if ((style & SWT.MAX) != 0) styleMask |= ;
+ if ((style & SWT.RESIZE) != 0) styleMask |= OS.NSResizableWindowMask;
+ }
+ window = window.initWithContentRect_styleMask_backing_defer_(rect, styleMask, OS.NSBackingStoreBuffered, false);
+ display.cascade = window.cascadeTopLeftFromPoint(display.cascade);
+ }
+
+ createHandle (null);
+
+ window.setContentView (view);
+ windowDelegate = (SWTWindowDelegate)new SWTWindowDelegate().alloc().init();
+ windowDelegate.setTag(jniRef);
+ window.setDelegate(windowDelegate);
+}
+
+void createWidget () {
+ super.createWidget ();
+ resizeBounds ();
+}
+
+void destroyWidget () {
+ Display display = this.display;
+ NSWindow window = this.window;
+ if (window != null) window.close();
+ releaseHandle ();
+}
+
+Control findBackgroundControl () {
+ return background != null || backgroundImage != null ? this : null;
+}
+
+Composite findDeferredControl () {
+ return layoutCount > 0 ? this : null;
+}
+
+Cursor findCursor () {
+ return cursor;
+}
+
+void fixShell (Shell newShell, Control control) {
+ if (this == newShell) return;
+// if (control == lastActive) setActiveControl (null);
+}
+
+/**
+ * If the receiver is visible, moves it to the top of the
+ * drawing order for the display on which it was created
+ * (so that all other shells on that display, which are not
+ * the receiver's children will be drawn behind it) and forces
+ * the window manager to make the shell active.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ * @see Control#moveAbove
+ * @see Control#setFocus
+ * @see Control#setVisible
+ * @see Display#getActiveShell
+ * @see Decorations#setDefaultButton(Button)
+ * @see Shell#open
+ * @see Shell#setActive
+ */
+public void forceActive () {
+ checkWidget ();
+ if (!isVisible ()) return;
+// OS.SelectWindow (shellHandle);
+// OS.SetFrontProcessWithOptions (new int [] {0, OS.kCurrentProcess}, OS.kSetFrontProcessFrontWindowOnly);
+}
+
+public int getAlpha () {
+ checkWidget ();
+ return (int)(window.alphaValue() * 255);
+}
+
+public Rectangle getBounds () {
+ checkWidget();
+ NSRect frame = window.frame ();
+ return new Rectangle ((int)frame.x, (int) frame.y, (int) frame.width, (int) frame.height);
+}
+
+int getDrawCount (int control) {
+ if (!isTrimHandle (control)) return drawCount;
+ return 0;
+}
+
+public boolean getFullScreen () {
+ checkWidget();
+ return fullScreen;
+}
+
+/**
+ * Returns the receiver's input method editor mode. This
+ * will be the result of bitwise OR'ing together one or
+ * more of the following constants defined in class
+ * <code>SWT</code>:
+ * <code>NONE</code>, <code>ROMAN</code>, <code>DBCS</code>,
+ * <code>PHONETIC</code>, <code>NATIVE</code>, <code>ALPHA</code>.
+ *
+ * @return the IME mode
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT
+ */
+public int getImeInputMode () {
+ checkWidget();
+ return SWT.NONE;
+}
+
+public Point getLocation () {
+ checkWidget();
+ NSRect frame = window.frame ();
+ return new Point ((int) frame.x, (int) frame.y);
+}
+
+public boolean getMaximized () {
+ checkWidget();
+ //NOT DONE
+ return !fullScreen && super.getMaximized ();
+}
+
+public boolean getMinimized () {
+ checkWidget();
+ if (!getVisible ()) return super.getMinimized ();
+// return OS.IsWindowCollapsed (shellHandle);
+ return false;
+}
+
+/**
+ * Returns a point describing the minimum receiver's size. The
+ * x coordinate of the result is the minimum width of the receiver.
+ * The y coordinate of the result is the minimum height of the
+ * receiver.
+ *
+ * @return the receiver's size
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public Point getMinimumSize () {
+ checkWidget();
+// Rect rect = new Rect ();
+// OS.GetWindowStructureWidths (shellHandle, rect);
+// CGPoint inMinLimits = new CGPoint (), inMaxLimits = new CGPoint ();
+// OS.GetWindowResizeLimits (shellHandle, inMinLimits, inMaxLimits);
+// int width = Math.max (1, (int) inMinLimits.x + (rect.left + rect.right));
+// int height = Math.max (1, (int) inMinLimits.y + (rect.top + rect.bottom));
+// return new Point (width, height);
+ return null;
+}
+
+float [] getParentBackground () {
+ return null;
+}
+
+/**
+ * Returns the region that defines the shape of the shell,
+ * or null if the shell has the default shape.
+ *
+ * @return the region that defines the shape of the shell (or null)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ *
+ */
+public Region getRegion () {
+ /* This method is needed for the @since 3.0 Javadoc */
+ checkWidget ();
+ return region;
+}
+
+public Shell getShell () {
+ checkWidget();
+ return this;
+}
+
+/**
+ * Returns an array containing all shells which are
+ * descendants of the receiver.
+ * <p>
+ * @return the dialog shells
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Shell [] getShells () {
+ checkWidget();
+ int count = 0;
+ Shell [] shells = display.getShells ();
+ for (int i=0; i<shells.length; i++) {
+ Control shell = shells [i];
+ do {
+ shell = shell.parent;
+ } while (shell != null && shell != this);
+ if (shell == this) count++;
+ }
+ int index = 0;
+ Shell [] result = new Shell [count];
+ for (int i=0; i<shells.length; i++) {
+ Control shell = shells [i];
+ do {
+ shell = shell.parent;
+ } while (shell != null && shell != this);
+ if (shell == this) {
+ result [index++] = shells [i];
+ }
+ }
+ return result;
+}
+
+public Point getSize () {
+ checkWidget();
+ NSRect frame = window.frame ();
+ return new Point ((int) frame.width, (int) frame.height);
+}
+
+boolean hasBorder () {
+ return false;
+}
+
+public boolean isEnabled () {
+ checkWidget();
+ return getEnabled ();
+}
+
+boolean isEnabledCursor () {
+ return true;
+}
+
+public boolean isVisible () {
+ checkWidget();
+ return getVisible ();
+}
+
+void resizeBounds () {
+// Rect rect = new Rect ();
+// OS.GetWindowBounds (shellHandle, (short) OS.kWindowContentRgn, rect);
+// int control = scrolledHandle != 0 ? scrolledHandle : handle;
+// setBounds (control, 0, 0, rect.right - rect.left, rect.bottom - rect.top, false, true, false);
+// resizeClientArea ();
+}
+
+/**
+ * Moves the receiver to the top of the drawing order for
+ * the display on which it was created (so that all other
+ * shells on that display, which are not the receiver's
+ * children will be drawn behind it), marks it visible,
+ * sets the focus and asks the window manager to make the
+ * shell active.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Control#moveAbove
+ * @see Control#setFocus
+ * @see Control#setVisible
+ * @see Display#getActiveShell
+ * @see Decorations#setDefaultButton(Button)
+ * @see Shell#setActive
+ * @see Shell#forceActive
+ */
+public void open () {
+ checkWidget();
+ setWindowVisible (true, true);
+ if (isDisposed ()) return;
+// if (active) {
+ if (!restoreFocus () && !traverseGroup (true)) setFocus ();
+// }
+}
+
+void releaseChildren (boolean destroy) {
+ Shell [] shells = getShells ();
+ for (int i=0; i<shells.length; i++) {
+ Shell shell = shells [i];
+ if (shell != null && !shell.isDisposed ()) {
+ shell.dispose ();
+ }
+ }
+ super.releaseChildren (destroy);
+}
+
+void releaseHandle () {
+ window.setDelegate(null);
+ if (windowDelegate != null) windowDelegate.release();
+ windowDelegate = null;
+ super.releaseHandle ();
+ window = null;
+}
+
+void releaseParent () {
+ /* Do nothing */
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+// disposed = true;
+ lastActive = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when operations are performed on the receiver.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ShellListener
+ * @see #addShellListener
+ */
+public void removeShellListener(ShellListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook(SWT.Activate, listener);
+ eventTable.unhook(SWT.Close, listener);
+ eventTable.unhook(SWT.Deactivate, listener);
+ eventTable.unhook(SWT.Iconify,listener);
+ eventTable.unhook(SWT.Deiconify,listener);
+}
+
+/**
+ * If the receiver is visible, moves it to the top of the
+ * drawing order for the display on which it was created
+ * (so that all other shells on that display, which are not
+ * the receiver's children will be drawn behind it) and asks
+ * the window manager to make the shell active
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ * @see Control#moveAbove
+ * @see Control#setFocus
+ * @see Control#setVisible
+ * @see Display#getActiveShell
+ * @see Decorations#setDefaultButton(Button)
+ * @see Shell#open
+ * @see Shell#setActive
+ */
+public void setActive () {
+ checkWidget ();
+ if (!isVisible ()) return;
+// OS.SelectWindow (shellHandle);
+}
+
+void setActiveControl (Control control) {
+ if (control != null && control.isDisposed ()) control = null;
+ if (lastActive != null && lastActive.isDisposed ()) lastActive = null;
+ if (lastActive == control) return;
+
+ /*
+ * Compute the list of controls to be activated and
+ * deactivated by finding the first common parent
+ * control.
+ */
+ Control [] activate = (control == null) ? new Control[0] : control.getPath ();
+ Control [] deactivate = (lastActive == null) ? new Control[0] : lastActive.getPath ();
+ lastActive = control;
+ int index = 0, length = Math.min (activate.length, deactivate.length);
+ while (index < length) {
+ if (activate [index] != deactivate [index]) break;
+ index++;
+ }
+
+ /*
+ * It is possible (but unlikely), that application
+ * code could have destroyed some of the widgets. If
+ * this happens, keep processing those widgets that
+ * are not disposed.
+ */
+ for (int i=deactivate.length-1; i>=index; --i) {
+ if (!deactivate [i].isDisposed ()) {
+ deactivate [i].sendEvent (SWT.Deactivate);
+ }
+ }
+ for (int i=activate.length-1; i>=index; --i) {
+ if (!activate [i].isDisposed ()) {
+ activate [i].sendEvent (SWT.Activate);
+ }
+ }
+}
+
+public void setAlpha (int alpha) {
+ checkWidget ();
+ alpha &= 0xFF;
+ window.setAlphaValue (alpha / 255f);
+}
+
+int setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
+// if (fullScreen) setFullScreen (false);
+ if (move && resize) {
+ NSRect rect = new NSRect ();
+ rect.x = x;
+ //TODO - get the screen for the point
+ int screenHeight = (int) window.screen().frame().height;
+ rect.y = screenHeight - y;
+ rect.width = width;
+ rect.height = height;
+ window.setFrame_display_(rect, false);
+ } else {
+ if (move) {
+ NSPoint point = new NSPoint();
+ point.x = x;
+ //TODO - get the screen for the point
+ int screenHeight = (int) window.screen().frame().height;
+ point.y = screenHeight - y;
+ window.setFrameTopLeftPoint (point);
+ } else {
+ if (resize) {
+ NSRect rect = window.frame();
+ rect.width = width;
+ rect.height = height;
+ window.setFrame_display_(rect, false);
+ }
+ }
+ }
+ return 0;
+}
+
+public void setEnabled (boolean enabled) {
+ checkWidget();
+ if (((state & DISABLED) == 0) == enabled) return;
+ super.setEnabled (enabled);
+// if (enabled && OS.IsWindowActive (shellHandle)) {
+// if (!restoreFocus ()) traverseGroup (false);
+// }
+}
+
+public void setFullScreen (boolean fullScreen) {
+ checkWidget ();
+ this.fullScreen = fullScreen;
+// if (fullScreen) {
+// normalBounds = getBounds ();
+// OS.ChangeWindowAttributes (shellHandle, OS.kWindowNoTitleBarAttribute, OS.kWindowResizableAttribute | OS.kWindowLiveResizeAttribute);
+// updateSystemUIMode ();
+// Rectangle screen = getMonitor ().getBounds ();
+// if (menuBar != null && getMonitor ().equals(display.getPrimaryMonitor ())) {
+// Rect rect = new Rect ();
+// int gdevice = OS.GetMainDevice ();
+// OS.GetAvailableWindowPositioningBounds (gdevice, rect);
+// screen.height -= rect.top;
+// screen.y += rect.top;
+// }
+// Rect rect = new Rect ();
+// OS.SetRect (rect, (short) screen.x, (short) screen.y, (short) (screen.x + screen.width), (short) (screen.y + screen.height));
+// OS.SetWindowBounds (shellHandle, (short) OS.kWindowStructureRgn, rect);
+// } else {
+// int attributes = 0;
+// if ((style & SWT.RESIZE) != 0) {
+// attributes |= OS.kWindowResizableAttribute;
+// /*
+// * Bug in the Macintosh. For some reason, a window has no title bar
+// * and the kWindowResizableAttribute, no rubber banding feedback is
+// * given while the window is resizing. The fix is to create the window
+// * with kWindowLiveResizeAttribute in this case. This is inconsistent
+// * with other windows, but the user will get feedback when resizing.
+// */
+// if ((style & SWT.TITLE) == 0) attributes |= OS.kWindowLiveResizeAttribute;
+// if (!OS.__BIG_ENDIAN__()) attributes |= OS.kWindowLiveResizeAttribute;
+// }
+// OS.ChangeWindowAttributes (shellHandle, attributes, OS.kWindowNoTitleBarAttribute);
+// OS.SetSystemUIMode (OS.kUIModeNormal, 0);
+// if (maximized) {
+// setMaximized (true);
+// } else {
+// Rect rect = new Rect ();
+// if (normalBounds != null) OS.SetRect (rect, (short) normalBounds.x, (short) normalBounds.y, (short) (normalBounds.x + normalBounds.width), (short) (normalBounds.y + normalBounds.height));
+// OS.SetWindowBounds (shellHandle, (short) OS.kWindowStructureRgn, rect);
+// }
+// normalBounds = null;
+// }
+}
+
+public void setMenuBar (Menu menu) {
+ checkWidget();
+ super.setMenuBar (menu);
+// if (display.getActiveShell () == this) {
+// display.setMenuBar (menuBar);
+// }
+}
+
+/**
+ * Sets the input method editor mode to the argument which
+ * should be the result of bitwise OR'ing together one or more
+ * of the following constants defined in class <code>SWT</code>:
+ * <code>NONE</code>, <code>ROMAN</code>, <code>DBCS</code>,
+ * <code>PHONETIC</code>, <code>NATIVE</code>, <code>ALPHA</code>.
+ *
+ * @param mode the new IME mode
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT
+ */
+public void setImeInputMode (int mode) {
+ checkWidget();
+}
+
+public void setMaximized (boolean maximized) {
+ checkWidget();
+ super.setMaximized (maximized);
+// org.eclipse.swt.internal.carbon.Point pt = new org.eclipse.swt.internal.carbon.Point ();
+// if (maximized) {
+// Rect rect = new Rect ();
+// int gdevice = OS.GetMainDevice ();
+// OS.GetAvailableWindowPositioningBounds (gdevice, rect);
+// pt.h = (short) (rect.right - rect.left);
+// pt.v = (short) (rect.bottom - rect.top);
+// }
+// short inPartCode = (short) (maximized ? OS.inZoomOut : OS.inZoomIn);
+// OS.ZoomWindowIdeal (shellHandle, inPartCode, pt);
+}
+
+public void setMinimized (boolean minimized) {
+ checkWidget();
+ if (this.minimized == minimized) return;
+ super.setMinimized (minimized);
+// if (!minimized && OS.IsWindowCollapsed (shellHandle)) {
+// OS.SelectWindow (shellHandle);
+// }
+// OS.CollapseWindow (shellHandle, minimized);
+}
+
+/**
+ * Sets the receiver's minimum size to the size specified by the arguments.
+ * If the new minimum size is larger than the current size of the receiver,
+ * the receiver is resized to the new minimum size.
+ *
+ * @param width the new minimum width for the receiver
+ * @param height the new minimum height for the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setMinimumSize (int width, int height) {
+ checkWidget();
+// int clientWidth = 0, clientHeight = 0;
+// int trim = SWT.TITLE | SWT.CLOSE | SWT.MIN | SWT.MAX;
+// if ((style & SWT.NO_TRIM) == 0 && (style & trim) != 0) {
+// clientWidth = DEFAULT_CLIENT_WIDTH;
+// clientHeight = DEFAULT_CLIENT_HEIGHT;
+// }
+// Rect rect = new Rect ();
+// OS.GetWindowStructureWidths (shellHandle, rect);
+// CGPoint inMinLimits = new CGPoint (), inMaxLimits = new CGPoint ();
+// OS.GetWindowResizeLimits (shellHandle, inMinLimits, inMaxLimits);
+// width = Math.max (width, clientWidth + rect.left + rect.right);
+// height = Math.max (height, clientHeight + rect.top + rect.bottom);
+// inMinLimits.x = width - (rect.left + rect.right);
+// inMinLimits.y = height - (rect.top + rect.bottom);
+// OS.SetWindowResizeLimits (shellHandle, inMinLimits, inMaxLimits);
+// Point size = getSize ();
+// int newWidth = Math.max (size.x, width), newHeight = Math.max (size.y, height);
+// if (newWidth != size.x || newHeight != size.y) setSize (newWidth, newHeight);
+}
+
+/**
+ * Sets the receiver's minimum size to the size specified by the argument.
+ * If the new minimum size is larger than the current size of the receiver,
+ * the receiver is resized to the new minimum size.
+ *
+ * @param size the new minimum size for the receiver
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setMinimumSize (Point size) {
+ checkWidget();
+ if (size == null) error (SWT.ERROR_NULL_ARGUMENT);
+ setMinimumSize (size.x, size.y);
+}
+
+/**
+ * Sets the shape of the shell to the region specified
+ * by the argument. When the argument is null, the
+ * default shape of the shell is restored. The shell
+ * must be created with the style SWT.NO_TRIM in order
+ * to specify a region.
+ *
+ * @param region the region that defines the shape of the shell (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the region has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ *
+ */
+public void setRegion (Region region) {
+ checkWidget ();
+ if ((style & SWT.NO_TRIM) == 0) return;
+ if (region != null && region.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+// if (region == null) {
+// rgnRect = null;
+// } else {
+// if (rgnRect == null) {
+// rgnRect = new Rect ();
+// OS.GetWindowBounds (shellHandle, (short) OS.kWindowStructureRgn, rgnRect);
+// OS.SetRect (rgnRect, (short) 0, (short) 0, (short) (rgnRect.right - rgnRect.left), (short) (rgnRect.bottom - rgnRect.top));
+// }
+// }
+// this.region = region;
+// /*
+// * Bug in the Macintosh. Calling ReshapeCustomWindow() from a
+// * kEventWindowDrawContent handler originating from ShowWindow()
+// * will deadlock. The fix is to detected this case and only call
+// * ReshapeCustomWindow() after the default handler is done.
+// */
+// if (drawing) {
+// reshape = true;
+// } else {
+// OS.ReshapeCustomWindow (shellHandle);
+// redrawWidget (handle, true);
+// }
+}
+
+public void setText (String string) {
+ checkWidget();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ super.setText (string);
+ NSString str = NSString.stringWith(string);
+ window.setTitle(str);
+// str.release();
+}
+
+public void setVisible (boolean visible) {
+ checkWidget();
+ setWindowVisible (visible, false);
+}
+
+void setWindowVisible (boolean visible, boolean key) {
+ if (window.isVisible() == visible) return;
+ if (visible) {
+ sendEvent (SWT.Show);
+ if (isDisposed ()) return;
+ if (key) {
+ window.makeKeyAndOrderFront (null);
+ } else {
+ window.orderFront (null);
+ }
+ opened = true;
+ if (!moved) {
+ moved = true;
+ sendEvent (SWT.Move);
+ if (isDisposed ()) return;
+ }
+ if (!resized) {
+ resized = true;
+ sendEvent (SWT.Resize);
+ if (isDisposed ()) return;
+ if (layout != null) {
+ markLayout (false, false);
+ updateLayout (false);
+ }
+ }
+ } else {
+ window.orderOut (null);
+ sendEvent (SWT.Hide);
+ }
+}
+
+void setZOrder () {
+// if (scrolledHandle != 0) OS.HIViewAddSubview (scrolledHandle, handle);
+}
+
+void setZOrder (Control control, boolean above) {
+// if (above) {
+// //NOT DONE - move one window above another
+// OS.BringToFront (shellHandle);
+// } else {
+// int window = control == null ? 0 : OS.GetControlOwner (control.handle);
+// OS.SendBehind (shellHandle, window);
+// }
+}
+
+boolean traverseEscape () {
+ if (parent == null) return false;
+ if (!isVisible () || !isEnabled ()) return false;
+ close ();
+ return true;
+}
+
+void updateSystemUIMode () {
+ if (!getMonitor ().equals (display.getPrimaryMonitor ())) return;
+ boolean isActive = false;
+ Shell activeShell = display.getActiveShell ();
+ Shell current = this;
+ while (current != null) {
+ if (current.equals (activeShell)) {
+ isActive = true;
+ break;
+ }
+ current = (Shell) current.parent;
+ }
+ if (!isActive) return;
+// if (fullScreen) {
+// int mode = OS.kUIModeAllHidden;
+// if (menuBar != null) {
+// mode = OS.kUIModeContentHidden;
+// }
+// OS.SetSystemUIMode (mode, 0);
+// } else {
+// OS.SetSystemUIMode (OS.kUIModeNormal, 0);
+// }
+}
+
+void windowDidMove(int notification) {
+ moved = true;
+ sendEvent(SWT.Move);
+}
+
+void windowDidResize(int notification) {
+ resized = true;
+ sendEvent (SWT.Resize);
+ if (isDisposed ()) return;
+ if (layout != null) {
+ markLayout (false, false);
+ updateLayout (false);
+ }
+}
+
+boolean windowShouldClose(int window) {
+ closeWidget ();
+ return false;
+}
+
+void windowWillClose(int notification) {
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Slider.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Slider.java
new file mode 100755
index 0000000000..8fd3011eb6
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Slider.java
@@ -0,0 +1,512 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+
+/**
+ * Instances of this class are selectable user interface
+ * objects that represent a range of positive, numeric values.
+ * <p>
+ * At any given moment, a given slider will have a
+ * single 'selection' that is considered to be its
+ * value, which is constrained to be within the range of
+ * values the slider represents (that is, between its
+ * <em>minimum</em> and <em>maximum</em> values).
+ * </p><p>
+ * Typically, sliders will be made up of five areas:
+ * <ol>
+ * <li>an arrow button for decrementing the value</li>
+ * <li>a page decrement area for decrementing the value by a larger amount</li>
+ * <li>a <em>thumb</em> for modifying the value by mouse dragging</li>
+ * <li>a page increment area for incrementing the value by a larger amount</li>
+ * <li>an arrow button for incrementing the value</li>
+ * </ol>
+ * Based on their style, sliders are either <code>HORIZONTAL</code>
+ * (which have a left facing button for decrementing the value and a
+ * right facing button for incrementing it) or <code>VERTICAL</code>
+ * (which have an upward facing button for decrementing the value
+ * and a downward facing buttons for incrementing it).
+ * </p><p>
+ * On some platforms, the size of the slider's thumb can be
+ * varied relative to the magnitude of the range of values it
+ * represents (that is, relative to the difference between its
+ * maximum and minimum values). Typically, this is used to
+ * indicate some proportional value such as the ratio of the
+ * visible area of a document to the total amount of space that
+ * it would take to display it. SWT supports setting the thumb
+ * size even if the underlying platform does not, but in this
+ * case the appearance of the slider will not change.
+ * </p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>HORIZONTAL, VERTICAL</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles HORIZONTAL and VERTICAL may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @see ScrollBar
+ */
+public class Slider extends Control {
+ boolean dragging;
+ int minimum, maximum, thumb;
+ int increment = 1;
+ int pageIncrement = 10;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#HORIZONTAL
+ * @see SWT#VERTICAL
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Slider (Composite parent, int style) {
+ super (parent, checkStyle (style));
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's value, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * When <code>widgetSelected</code> is called, the event object detail field contains one of the following values:
+ * <code>SWT.NONE</code> - for the end of a drag.
+ * <code>SWT.DRAG</code>.
+ * <code>SWT.HOME</code>.
+ * <code>SWT.END</code>.
+ * <code>SWT.ARROW_DOWN</code>.
+ * <code>SWT.ARROW_UP</code>.
+ * <code>SWT.PAGE_DOWN</code>.
+ * <code>SWT.PAGE_UP</code>.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the user changes the receiver's value
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener(listener);
+ addListener(SWT.Selection,typedListener);
+ addListener(SWT.DefaultSelection,typedListener);
+}
+
+static int checkStyle (int style) {
+ return checkBits (style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0);
+}
+
+public Point computeSize (int wHint, int hHint, boolean changed) {
+ checkWidget();
+ int width = 0, height = 0;
+ if ((style & SWT.HORIZONTAL) != 0) {
+ height = (int)NSScroller.scrollerWidth();
+ width = height * 10;
+ } else {
+ width = (int)NSScroller.scrollerWidth();
+ height = width * 10;
+ }
+ if (wHint != SWT.DEFAULT) width = wHint;
+ if (hHint != SWT.DEFAULT) height = hHint;
+ return new Point (width, height);
+}
+
+void createHandle () {
+ NSScroller widget = (NSScroller)new SWTScroller().alloc();
+ NSRect rect = new NSRect();
+ if ((style & SWT.HORIZONTAL) != 0) {
+ rect.width = 1;
+ } else {
+ rect.height = 1;
+ }
+ widget.initWithFrame(rect);
+ widget.setEnabled(true);
+ widget.setTarget(widget);
+ widget.setAction(OS.sel_sendSelection);
+ widget.setTag(jniRef);
+ view = widget;
+ parent.contentView().addSubview_(widget);
+ updateBar(0, minimum, maximum, thumb);
+}
+
+void createWidget () {
+ maximum = 100;
+ thumb = 10;
+ super.createWidget();
+}
+
+/**
+ * Returns the amount that the receiver's value will be
+ * modified by when the up/down (or right/left) arrows
+ * are pressed.
+ *
+ * @return the increment
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getIncrement () {
+ checkWidget();
+ return increment;
+}
+
+/**
+ * Returns the maximum value which the receiver will allow.
+ *
+ * @return the maximum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMaximum () {
+ checkWidget();
+ return maximum;
+}
+
+/**
+ * Returns the minimum value which the receiver will allow.
+ *
+ * @return the minimum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMinimum () {
+ checkWidget();
+ return minimum;
+}
+
+/**
+ * Returns the amount that the receiver's value will be
+ * modified by when the page increment/decrement areas
+ * are selected.
+ *
+ * @return the page increment
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getPageIncrement () {
+ checkWidget();
+ return pageIncrement;
+}
+
+/**
+ * Returns the 'selection', which is the receiver's value.
+ *
+ * @return the selection
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelection () {
+ checkWidget();
+ NSScroller widget = (NSScroller)view;
+ float value = widget.floatValue();
+ return (int)((maximum - thumb - minimum) * value + minimum);
+}
+
+/**
+ * Returns the size of the receiver's thumb relative to the
+ * difference between its maximum and minimum values.
+ *
+ * @return the thumb value
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getThumb () {
+ checkWidget();
+ return thumb;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's value.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook(SWT.Selection, listener);
+ eventTable.unhook(SWT.DefaultSelection,listener);
+}
+
+void sendSelection () {
+ Event event = new Event();
+ int hitPart = ((NSScroller)view).hitPart();
+ int value = getSelection ();
+ switch (hitPart) {
+ case OS.NSScrollerDecrementLine:
+ event.detail = SWT.ARROW_UP;
+ value -= increment;
+ break;
+ case OS.NSScrollerDecrementPage:
+ value -= pageIncrement;
+ event.detail = SWT.PAGE_UP;
+ break;
+ case OS.NSScrollerIncrementLine:
+ value += increment;
+ event.detail = SWT.PAGE_DOWN;
+ break;
+ case OS.NSScrollerIncrementPage:
+ value += pageIncrement;
+ event.detail = SWT.ARROW_DOWN;
+ break;
+ case OS.NSScrollerKnob:
+ event.detail = SWT.DRAG;
+ break;
+ }
+ if (event.detail != SWT.DRAG) {
+ setSelection(value);
+ }
+ sendEvent(SWT.Selection, event);
+}
+
+/**
+ * Sets the amount that the receiver's value will be
+ * modified by when the up/down (or right/left) arrows
+ * are pressed to the argument, which must be at least
+ * one.
+ *
+ * @param value the new increment (must be greater than zero)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setIncrement (int value) {
+ checkWidget();
+ if (value < 1) return;
+ increment = value;
+}
+
+/**
+ * Sets the maximum. If this value is negative or less than or
+ * equal to the minimum, the value is ignored. If necessary, first
+ * the thumb and then the selection are adjusted to fit within the
+ * new range.
+ *
+ * @param value the new maximum, which must be greater than the current minimum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMaximum (int value) {
+ checkWidget();
+ if (value < 0) return;
+ if (value <= minimum) return;
+ if (value - minimum < thumb) {
+ thumb = value - minimum;
+ }
+ int selection = Math.max(minimum, Math.min (getSelection (), value - thumb));
+ this.maximum = value;
+ updateBar(selection, minimum, value, thumb);
+}
+
+/**
+ * Sets the minimum value. If this value is negative or greater
+ * than or equal to the maximum, the value is ignored. If necessary,
+ * first the thumb and then the selection are adjusted to fit within
+ * the new range.
+ *
+ * @param value the new minimum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMinimum (int value) {
+ checkWidget();
+ if (value < 0) return;
+ if (value >= maximum) return;
+ if (maximum - value < thumb) {
+ thumb = maximum - value;
+ }
+ int selection = Math.min(maximum - thumb, Math.max (getSelection (), value));
+ this.minimum = value;
+ updateBar(selection, value, maximum, thumb);
+}
+
+/**
+ * Sets the amount that the receiver's value will be
+ * modified by when the page increment/decrement areas
+ * are selected to the argument, which must be at least
+ * one.
+ *
+ * @param value the page increment (must be greater than zero)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setPageIncrement (int value) {
+ checkWidget();
+ if (value < 1) return;
+ pageIncrement = value;
+}
+
+/**
+ * Sets the 'selection', which is the receiver's
+ * value, to the argument which must be greater than or equal
+ * to zero.
+ *
+ * @param value the new selection (must be zero or greater)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (int value) {
+ checkWidget();
+ updateBar(value, minimum, maximum, thumb);
+}
+
+void updateBar(int selection, int minimum, int maximum, int thumb) {
+ NSScroller widget = (NSScroller)view;
+ selection = Math.max(minimum, Math.min(maximum - thumb, selection));
+ float fraction = minimum == maximum ? 1 : (float)(selection - minimum) / (maximum - thumb - minimum);
+ float knob = minimum == maximum ? 1 : (float)(thumb - minimum) / (maximum - minimum);
+ widget.setFloatValue(fraction, knob);
+}
+
+/**
+ * Sets the size of the receiver's thumb relative to the
+ * difference between its maximum and minimum values. This new
+ * value will be ignored if it is less than one, and will be
+ * clamped if it exceeds the receiver's current range.
+ *
+ * @param value the new thumb value, which must be at least one and not
+ * larger than the size of the current range
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setThumb (int value) {
+ checkWidget();
+ if (value < 1) return;
+ value = Math.min (value, maximum - minimum);
+ this.thumb = value;
+ updateBar(getSelection(), minimum, maximum, value);
+}
+
+/**
+ * Sets the receiver's selection, minimum value, maximum
+ * value, thumb, increment and page increment all at once.
+ * <p>
+ * Note: This is similar to setting the values individually
+ * using the appropriate methods, but may be implemented in a
+ * more efficient fashion on some platforms.
+ * </p>
+ *
+ * @param selection the new selection value
+ * @param minimum the new minimum value
+ * @param maximum the new maximum value
+ * @param thumb the new thumb value
+ * @param increment the new increment value
+ * @param pageIncrement the new pageIncrement value
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setValues (int selection, int minimum, int maximum, int thumb, int increment, int pageIncrement) {
+ checkWidget();
+ if (minimum < 0) return;
+ if (maximum < 0) return;
+ if (thumb < 1) return;
+ if (increment < 1) return;
+ if (pageIncrement < 1) return;
+ thumb = Math.min (thumb, maximum - minimum);
+ this.increment = increment;
+ this.pageIncrement = pageIncrement;
+ updateBar(selection, minimum, maximum, thumb);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java
new file mode 100755
index 0000000000..1010c6841e
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Spinner.java
@@ -0,0 +1,767 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * Instances of this class are selectable user interface
+ * objects that allow the user to enter and modify numeric
+ * values.
+ * <p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to add children to it, or set a layout on it.
+ * </p><p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>READ_ONLY, WRAP</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection, Modify, Verify</dd>
+ * </dl>
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @since 3.1
+ */
+public class Spinner extends Composite {
+ NSTextField textView;
+ NSStepper buttonView;
+ int pageIncrement = 10;
+ int digits = 0;
+
+ static int GAP = 0;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#READ_ONLY
+ * @see SWT#WRAP
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Spinner (Composite parent, int style) {
+ super (parent, checkStyle (style));
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver's text is modified, by sending
+ * it one of the messages defined in the <code>ModifyListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ModifyListener
+ * @see #removeModifyListener
+ */
+public void addModifyListener (ModifyListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Modify, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is not called for texts.
+ * <code>widgetDefaultSelected</code> is typically called when ENTER is pressed in a single-line text.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the control is selected by the user
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener(listener);
+ addListener (SWT.Selection,typedListener);
+ addListener (SWT.DefaultSelection,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver's text is verified, by sending
+ * it one of the messages defined in the <code>VerifyListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see VerifyListener
+ * @see #removeVerifyListener
+ */
+void addVerifyListener (VerifyListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Verify, typedListener);
+}
+
+static int checkStyle (int style) {
+ /*
+ * Even though it is legal to create this widget
+ * with scroll bars, they serve no useful purpose
+ * because they do not automatically scroll the
+ * widget's client area. The fix is to clear
+ * the SWT style.
+ */
+ return style & ~(SWT.H_SCROLL | SWT.V_SCROLL);
+}
+
+protected void checkSubclass () {
+ if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+public Point computeSize (int wHint, int hHint, boolean changed) {
+ checkWidget ();
+// int width = 0, height = 0;
+// int max = OS.GetControl32BitMaximum (buttonHandle);
+// String string = String.valueOf (max);
+// if (digits > 0) {
+// StringBuffer buffer = new StringBuffer ();
+// buffer.append (string);
+// buffer.append (getDecimalSeparator ());
+// int count = digits - string.length ();
+// while (count >= 0) {
+// buffer.append ("0");
+// count--;
+// }
+// string = buffer.toString ();
+// }
+// char [] buffer = new char [string.length ()];
+// string.getChars (0, buffer.length, buffer, 0);
+// int ptr = OS.CFStringCreateWithCharacters (OS.kCFAllocatorDefault, buffer, buffer.length);
+// Point size = textExtent (ptr, 0);
+// if (ptr != 0) OS.CFRelease (ptr);
+// width = Math.max (width, size.x);
+// height = Math.max (height, size.y);
+// int [] metric = new int [1];
+// OS.GetThemeMetric (OS.kThemeMetricEditTextWhitespace, metric);
+// width += metric [0] * 2;
+// if (wHint != SWT.DEFAULT) width = wHint;
+// if (hHint != SWT.DEFAULT) height = hHint;
+// Rectangle trim = computeTrim (0, 0, width, height);
+// OS.GetThemeMetric (OS.kThemeMetricLittleArrowsHeight, metric);
+// trim.height = Math.max (trim.height, metric [0]);
+// return new Point (trim.width, trim.height);
+ return new Point(60, 26);
+}
+
+public Rectangle computeTrim (int x, int y, int width, int height) {
+ checkWidget ();
+ //TODO - trim around text
+ buttonView.sizeToFit();
+ NSRect rect = buttonView.bounds();
+ width += rect.width;
+ return super.computeTrim(x, y, width, height);
+}
+
+/**
+ * Copies the selected text.
+ * <p>
+ * The current selection is copied to the clipboard.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void copy () {
+ checkWidget ();
+// short [] selection = new short [2];
+// if (OS.GetControlData (textHandle, (short)OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection, null) != OS.noErr) return;
+// if (selection [0] == selection [1]) return;
+// int [] actualSize = new int [1];
+// int [] ptr = new int [1];
+// if (OS.GetControlData (textHandle, (short)OS.kControlEntireControl, OS.kControlEditTextCFStringTag, 4, ptr, actualSize) != OS.noErr) return;
+// CFRange range = new CFRange ();
+// range.location = selection [0];
+// range.length = selection [1] - selection [0];
+// char [] buffer= new char [range.length];
+// OS.CFStringGetCharacters (ptr [0], range, buffer);
+// OS.CFRelease (ptr [0]);
+// copyToClipboard (buffer);
+}
+
+void createHandle () {
+ SWTView widget = (SWTView)new SWTView().alloc();
+ widget.initWithFrame(new NSRect());
+// widget.setDrawsBackground(false);
+ widget.setTag(jniRef);
+ NSStepper buttonWidget = (NSStepper)new SWTStepper().alloc();
+ buttonWidget.initWithFrame(new NSRect());
+ buttonWidget.setValueWraps((style & SWT.WRAP) != 0);
+ buttonWidget.setTarget(buttonWidget);
+ buttonWidget.setAction(OS.sel_sendSelection);
+ buttonWidget.setTag(jniRef);
+ NSTextField textWidget = (NSTextField)new NSTextField().alloc();
+ textWidget.initWithFrame(new NSRect());
+// textWidget.setTarget(widget);
+ textWidget.setTag(jniRef);
+ widget.addSubview_(textWidget);
+ widget.addSubview_(buttonWidget);
+ buttonView = buttonWidget;
+ textView = textWidget;
+ view = widget;
+ parent.contentView().addSubview_(widget);
+ setSelection (0, false, true, false);
+}
+
+/**
+ * Cuts the selected text.
+ * <p>
+ * The current selection is first copied to the
+ * clipboard and then deleted from the widget.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void cut () {
+ checkWidget ();
+ if ((style & SWT.READ_ONLY) != 0) return;
+// short [] selection = new short [2];
+// if (OS.GetControlData (textHandle, (short)OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection, null) != OS.noErr) return;
+// if (selection [0] == selection [1]) return;
+// char [] buffer = setText ("", selection [0], selection [1], true);
+// if (buffer != null) {
+// copyToClipboard (buffer);
+// }
+}
+
+/**
+ * Returns the number of decimal places used by the receiver.
+ *
+ * @return the digits
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getDigits () {
+ checkWidget ();
+ return digits;
+}
+
+/**
+ * Returns the amount that the receiver's value will be
+ * modified by when the up/down arrows are pressed.
+ *
+ * @return the increment
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getIncrement () {
+ checkWidget ();
+ return (int)buttonView.increment();
+}
+
+/**
+ * Returns the maximum value which the receiver will allow.
+ *
+ * @return the maximum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMaximum () {
+ checkWidget ();
+ return (int)buttonView.maxValue();
+}
+
+/**
+ * Returns the minimum value which the receiver will allow.
+ *
+ * @return the minimum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getMinimum () {
+ checkWidget ();
+ return (int)buttonView.minValue();
+}
+
+/**
+ * Returns the amount that the receiver's position will be
+ * modified by when the page up/down keys are pressed.
+ *
+ * @return the page increment
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getPageIncrement () {
+ checkWidget ();
+ return pageIncrement;
+}
+
+/**
+ * Returns the <em>selection</em>, which is the receiver's position.
+ *
+ * @return the selection
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelection () {
+ checkWidget ();
+ return (int)((NSStepper)buttonView).doubleValue();
+}
+
+int getSelectionText () {
+ return -1;
+}
+
+/**
+ * Pastes text from clipboard.
+ * <p>
+ * The selected text is deleted from the widget
+ * and new text inserted from the clipboard.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void paste () {
+ checkWidget ();
+// if ((style & SWT.READ_ONLY) != 0) return;
+// String text = getClipboardText ();
+// short [] selection = new short [2];
+// if (OS.GetControlData (textHandle, (short)OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection, null) != OS.noErr) return;
+// setText (text, selection [0], selection [1], true);
+}
+
+void releaseHandle () {
+ super.releaseHandle();
+ if (buttonView != null) {
+ buttonView.setTag(-1);
+ buttonView.release();
+ }
+ if (textView != null) {
+ textView.setTag(-1);
+ textView.release();
+ }
+ buttonView = null;
+ textView = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the receiver's text is modified.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ModifyListener
+ * @see #addModifyListener
+ */
+public void removeModifyListener (ModifyListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Modify, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Selection, listener);
+ eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is verified.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see VerifyListener
+ * @see #addVerifyListener
+ */
+void removeVerifyListener (VerifyListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Verify, listener);
+}
+
+void sendSelection () {
+ setSelection (getSelection(), false, true, true);
+}
+
+int setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
+ int result = super.setBounds(x, y, width, height, move, resize);
+ if ((result & RESIZED) != 0) {
+ buttonView.sizeToFit();
+ NSRect buttonFrame = buttonView.bounds();
+ NSRect frame = view.frame();
+ buttonFrame.x = frame.width - buttonFrame.width;
+ buttonFrame.y = 0;
+ frame.x = 0;
+ frame.y = 0;
+ frame.width -= buttonFrame.width + GAP;
+ textView.setFrame(frame);
+ buttonView.setFrame(buttonFrame);
+ }
+ return result;
+}
+
+/**
+ * Sets the number of decimal places used by the receiver.
+ * <p>
+ * The digit setting is used to allow for floating point values in the receiver.
+ * For example, to set the selection to a floating point value of 1.37 call setDigits() with
+ * a value of 2 and setSelection() with a value of 137. Similarly, if getDigits() has a value
+ * of 2 and getSelection() returns 137 this should be interpreted as 1.37. This applies to all
+ * numeric APIs.
+ * </p>
+ *
+ * @param value the new digits (must be greater than or equal to zero)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the value is less than zero</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setDigits (int value) {
+ checkWidget ();
+ if (value < 0) error (SWT.ERROR_INVALID_ARGUMENT);
+// if (value == digits) return;
+// digits = value;
+// int pos = OS.GetControl32BitValue (buttonHandle);
+// setSelection (pos, false, true, false);
+}
+
+/**
+ * Sets the amount that the receiver's value will be
+ * modified by when the up/down arrows are pressed to
+ * the argument, which must be at least one.
+ *
+ * @param value the new increment (must be greater than zero)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setIncrement (int value) {
+ checkWidget ();
+ if (value < 1) return;
+ buttonView.setIncrement(value);
+}
+
+/**
+ * Sets the maximum value that the receiver will allow. This new
+ * value will be ignored if it is not greater than the receiver's current
+ * minimum value. If the new maximum is applied then the receiver's
+ * selection value will be adjusted if necessary to fall within its new range.
+ *
+ * @param value the new maximum, which must be greater than the current minimum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMaximum (int value) {
+ checkWidget ();
+ if (value < 0) return;
+ int min = getMinimum ();
+ if (value <= min) return;
+ int pos = getSelection();
+ buttonView.setMaxValue(value);
+ if (pos > value) setSelection (value, true, true, false);
+}
+
+/**
+ * Sets the minimum value that the receiver will allow. This new
+ * value will be ignored if it is negative or is not less than the receiver's
+ * current maximum value. If the new minimum is applied then the receiver's
+ * selection value will be adjusted if necessary to fall within its new range.
+ *
+ * @param value the new minimum, which must be nonnegative and less than the current maximum
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setMinimum (int value) {
+ checkWidget ();
+ if (value < 0) return;
+ int max = getMaximum();
+ if (value >= max) return;
+ int pos = getSelection();
+ buttonView.setMinValue(value);
+ if (pos < value) setSelection (value, true, true, false);
+}
+
+/**
+ * Sets the amount that the receiver's position will be
+ * modified by when the page up/down keys are pressed
+ * to the argument, which must be at least one.
+ *
+ * @param value the page increment (must be greater than zero)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setPageIncrement (int value) {
+ checkWidget ();
+ if (value < 1) return;
+ pageIncrement = value;
+}
+
+/**
+ * Sets the <em>selection</em>, which is the receiver's
+ * position, to the argument. If the argument is not within
+ * the range specified by minimum and maximum, it will be
+ * adjusted to fall within this range.
+ *
+ * @param value the new selection (must be zero or greater)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (int value) {
+ checkWidget ();
+ int min = getMinimum();
+ int max = getMaximum();
+ value = Math.min (Math.max (min, value), max);
+ setSelection (value, true, true, false);
+}
+
+void setSelection (int value, boolean setPos, boolean setText, boolean notify) {
+ if (setPos) {
+ ((NSStepper)buttonView).setDoubleValue(value);
+ }
+ if (setText) {
+ String string = String.valueOf (value);
+ if (digits > 0) {
+ String decimalSeparator = ".";//getDecimalSeparator ();
+ int index = string.length () - digits;
+ StringBuffer buffer = new StringBuffer ();
+ if (index > 0) {
+ buffer.append (string.substring (0, index));
+ buffer.append (decimalSeparator);
+ buffer.append (string.substring (index));
+ } else {
+ buffer.append ("0");
+ buffer.append (decimalSeparator);
+ while (index++ < 0) buffer.append ("0");
+ buffer.append (string);
+ }
+ string = buffer.toString ();
+ }
+ NSCell cell = new NSCell(textView.cell());
+ if (hooks (SWT.Verify) || filters (SWT.Verify)) {
+ int length = cell.title().length();
+ string = verifyText (string, 0, length, null);
+ if (string == null) return;
+ }
+ cell.setTitle(NSString.stringWith(string));
+// short [] selection = new short [] {0, (short)string.length ()};
+// OS.SetControlData (textHandle, (short)OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection);
+ sendEvent (SWT.Modify);
+ }
+ //TODO post
+ if (notify) sendEvent (SWT.Selection);
+}
+
+/**
+ * Sets the receiver's selection, minimum value, maximum
+ * value, digits, increment and page increment all at once.
+ * <p>
+ * Note: This is similar to setting the values individually
+ * using the appropriate methods, but may be implemented in a
+ * more efficient fashion on some platforms.
+ * </p>
+ *
+ * @param selection the new selection value
+ * @param minimum the new minimum value
+ * @param maximum the new maximum value
+ * @param digits the new digits value
+ * @param increment the new increment value
+ * @param pageIncrement the new pageIncrement value
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setValues (int selection, int minimum, int maximum, int digits, int increment, int pageIncrement) {
+ checkWidget ();
+ if (minimum < 0) return;
+ if (maximum <= minimum) return;
+ if (digits < 0) return;
+ if (increment < 1) return;
+ if (pageIncrement < 1) return;
+ selection = Math.min (Math.max (minimum, selection), maximum);
+ this.pageIncrement = pageIncrement;
+ this.digits = digits;
+ buttonView.setIncrement(increment);
+ buttonView.setMaxValue(maximum);
+ buttonView.setMinValue(minimum);
+ setSelection (selection, true, true, false);
+}
+
+
+String verifyText (String string, int start, int end, Event keyEvent) {
+ Event event = new Event ();
+ event.text = string;
+ event.start = start;
+ event.end = end;
+ if (keyEvent != null) {
+ event.character = keyEvent.character;
+ event.keyCode = keyEvent.keyCode;
+ event.stateMask = keyEvent.stateMask;
+ }
+ int index = 0;
+ if (digits > 0) {
+ String decimalSeparator = ".";//getDecimalSeparator ();
+ index = string.indexOf (decimalSeparator);
+ if (index != -1) {
+ string = string.substring (0, index) + string.substring (index + 1);
+ }
+ index = 0;
+ }
+ while (index < string.length ()) {
+ if (!Character.isDigit (string.charAt (index))) break;
+ index++;
+ }
+ event.doit = index == string.length ();
+ /*
+ * It is possible (but unlikely), that application
+ * code could have disposed the widget in the verify
+ * event. If this happens, answer null to cancel
+ * the operation.
+ */
+ sendEvent (SWT.Verify, event);
+ if (!event.doit || isDisposed ()) return null;
+ return event.text;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TabFolder.java
new file mode 100755
index 0000000000..182d2577dc
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TabFolder.java
@@ -0,0 +1,596 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+
+/**
+ * Instances of this class implement the notebook user interface
+ * metaphor. It allows the user to select a notebook page from
+ * set of pages.
+ * <p>
+ * The item children that may be added to instances of this class
+ * must be of type <code>TabItem</code>.
+ * <code>Control</code> children are created and then set into a
+ * tab item using <code>TabItem#setControl</code>.
+ * </p><p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to set a layout on it.
+ * </p><p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>TOP, BOTTOM</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles TOP and BOTTOM may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ */
+public class TabFolder extends Composite {
+ TabItem [] items;
+ int itemCount;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public TabFolder (Composite parent, int style) {
+ super (parent, checkStyle (style));
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's selection, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * When <code>widgetSelected</code> is called, the item field of the event object is valid.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the user changes the receiver's selection
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Selection,typedListener);
+ addListener (SWT.DefaultSelection,typedListener);
+}
+
+static int checkStyle (int style) {
+ style = checkBits (style, SWT.TOP, SWT.BOTTOM, 0, 0, 0, 0);
+ /*
+ * Even though it is legal to create this widget
+ * with scroll bars, they serve no useful purpose
+ * because they do not automatically scroll the
+ * widget's client area. The fix is to clear
+ * the SWT style.
+ */
+ return style & ~(SWT.H_SCROLL | SWT.V_SCROLL);
+}
+
+protected void checkSubclass () {
+ if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+public Point computeSize (int wHint, int hHint, boolean changed) {
+ Point size = super.computeSize (wHint, hHint, changed);
+ if (wHint == SWT.DEFAULT && items.length > 0) {
+ NSSize mimSize = ((NSTabView)view).minimumSize();
+ Rectangle trim = computeTrim (0, 0, (int)mimSize.width, 0);
+ size.x = Math.max (trim.width, size.x);
+ }
+ return size;
+}
+
+public Rectangle computeTrim (int x, int y, int width, int height) {
+ checkWidget ();
+// CGRect oldBounds = new CGRect (), bounds = oldBounds;
+// OS.HIViewGetFrame (handle, oldBounds);
+// int MIN_SIZE = 100;
+// if (oldBounds.width < MIN_SIZE || oldBounds.height < MIN_SIZE) {
+// OS.HIViewSetDrawingEnabled (handle, false);
+// bounds = new CGRect ();
+// bounds.width = bounds.height = 100;
+// OS.HIViewSetFrame (handle, bounds);
+// }
+// Rect client = new Rect ();
+// OS.GetTabContentRect (handle, client);
+// if (oldBounds.width < MIN_SIZE || oldBounds.height < MIN_SIZE) {
+// OS.HIViewSetFrame (handle, oldBounds);
+// OS.HIViewSetDrawingEnabled (handle, drawCount == 0);
+// }
+// x -= client.left;
+// y -= client.top;
+// width += (int) bounds.width - (client.right - client.left);
+// height += (int) bounds.height - (client.bottom - client.top);
+// Rect inset = getInset ();
+// x -= inset.left;
+// y -= inset.top;
+// width += inset.left + inset.right;
+// height += inset.top + inset.bottom;
+// return new Rectangle (-client.left, -client.top, width, height);
+ return super.computeTrim(x, y, width, height);
+}
+
+void createHandle () {
+ SWTTabView widget = (SWTTabView)new SWTTabView().alloc();
+ widget.initWithFrame (new NSRect());
+ widget.setTag(jniRef);
+ widget.setDelegate(widget);
+ if ((style & SWT.BOTTOM) != 0) {
+ widget.setTabViewType(OS.NSBottomTabsBezelBorder);
+ }
+ view = widget;
+ parent.contentView().addSubview_(view);
+}
+
+void createItem (TabItem item, int index) {
+ int count = itemCount;
+ if (!(0 <= index && index <= count)) error (SWT.ERROR_INVALID_RANGE);
+ if (count == items.length) {
+ TabItem [] newItems = new TabItem [items.length + 4];
+ System.arraycopy (items, 0, newItems, 0, items.length);
+ items = newItems;
+ }
+ System.arraycopy (items, index, items, index + 1, count - index);
+ items [index] = item;
+ itemCount++;
+ NSTabViewItem nsItem = (NSTabViewItem)new NSTabViewItem().alloc().init();
+ item.nsItem = nsItem;
+ ((NSTabView)view).insertTabViewItem(nsItem, index);
+}
+
+void createWidget () {
+ super.createWidget ();
+ items = new TabItem [4];
+}
+
+void destroyItem (TabItem item) {
+ int count = itemCount;
+ int index = 0;
+ while (index < count) {
+ if (items [index] == item) break;
+ index++;
+ }
+ if (index == count) return;
+ --count;
+ System.arraycopy (items, index + 1, items, index, count - index);
+ items [count] = null;
+ if (count == 0) {
+ items = new TabItem [4];
+ }
+ itemCount = count;
+ ((NSTabView)view).removeTabViewItem(item.nsItem);
+}
+
+public Rectangle getClientArea () {
+ checkWidget ();
+ NSRect rect = ((NSTabView)view).contentRect();
+ int x = Math.max (0, (int)rect.x);
+ int y = Math.max (0, (int)rect.y);
+ int width = Math.max (0, (int)rect.width);
+ int height = Math.max (0, (int)rect.height);
+ return new Rectangle (x, y, width, height);
+}
+
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TabItem getItem (int index) {
+ checkWidget ();
+ int count = itemCount;
+ if (!(0 <= index && index < count)) error (SWT.ERROR_INVALID_RANGE);
+ return items [index];
+}
+
+/**
+ * Returns the number of items contained in the receiver.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+ checkWidget ();
+ return itemCount;
+}
+
+/**
+ * Returns an array of <code>TabItem</code>s which are the items
+ * in the receiver.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items in the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TabItem [] getItems () {
+ checkWidget ();
+ int count = itemCount;
+ TabItem [] result = new TabItem [count];
+ System.arraycopy (items, 0, result, 0, count);
+ return result;
+}
+
+/**
+ * Returns an array of <code>TabItem</code>s that are currently
+ * selected in the receiver. An empty array indicates that no
+ * items are selected.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its selection, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ * @return an array representing the selection
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TabItem [] getSelection () {
+ checkWidget ();
+ int index = getSelectionIndex ();
+ if (index == -1) return new TabItem [0];
+ return new TabItem [] {items [index]};
+}
+
+/**
+ * Returns the zero-relative index of the item which is currently
+ * selected in the receiver, or -1 if no item is selected.
+ *
+ * @return the index of the selected item
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelectionIndex () {
+ checkWidget ();
+ NSTabViewItem selected = ((NSTabView)view).selectedTabViewItem();
+ if (selected == null) return -1;
+ for (int i = 0; i < itemCount; i++) {
+ if (items[i].nsItem.id == selected.id) return i;
+ }
+ return -1;
+}
+
+/**
+ * Searches the receiver's list starting at the first item
+ * (index 0) until an item is found that is equal to the
+ * argument, and returns the index of that item. If no item
+ * is found, returns -1.
+ *
+ * @param item the search item
+ * @return the index of the item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (TabItem item) {
+ checkWidget ();
+ if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
+ int count = itemCount;
+ for (int i=0; i<count; i++) {
+ if (items [i] == item) return i;
+ }
+ return -1;
+}
+
+Point minimumSize (int wHint, int hHint, boolean flushCache) {
+ Control [] children = _getChildren ();
+ int width = 0, height = 0;
+ for (int i=0; i<children.length; i++) {
+ Control child = children [i];
+ int index = 0;
+ int count = itemCount;
+ while (index < count) {
+ if (items [index].control == child) break;
+ index++;
+ }
+ if (index == count) {
+ Rectangle rect = child.getBounds ();
+ width = Math.max (width, rect.x + rect.width);
+ height = Math.max (height, rect.y + rect.height);
+ } else {
+ Point size = child.computeSize (wHint, hHint, flushCache);
+ width = Math.max (width, size.x);
+ height = Math.max (height, size.y);
+ }
+ }
+ return new Point (width, height);
+}
+
+void releaseChildren (boolean destroy) {
+ if (items != null) {
+ for (int i=0; i<items.length; i++) {
+ TabItem item = items [i];
+ if (item != null && !item.isDisposed ()) {
+ item.release (false);
+ }
+ }
+ items = null;
+ }
+ super.releaseChildren (destroy);
+}
+
+void removeControl (Control control) {
+ super.removeControl (control);
+ int count = itemCount;
+ for (int i=0; i<count; i++) {
+ TabItem item = items [i];
+ if (item.control == control) item.setControl (null);
+ }
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's selection.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Selection, listener);
+ eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+int setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
+ int result = super.setBounds(x, y, width, height, move, resize);
+ if ((result & RESIZED) != 0) {
+ int index = getSelectionIndex ();
+ if (index != -1) {
+ TabItem item = items [index];
+ Control control = item.control;
+ if (control != null && !control.isDisposed ()) {
+ control.setBounds (getClientArea ());
+ }
+ }
+ }
+ return result;
+}
+
+void setFont (NSFont font) {
+ ((NSTabView)view).setFont(font);
+}
+
+/**
+ * Sets the receiver's selection to the given item.
+ * The current selected is first cleared, then the new item is
+ * selected.
+ *
+ * @param item the item to select
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setSelection (TabItem item) {
+ checkWidget ();
+ if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
+ setSelection (new TabItem [] {item});
+}
+
+/**
+ * Sets the receiver's selection to be the given array of items.
+ * The current selected is first cleared, then the new items are
+ * selected.
+ *
+ * @param items the array of items
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the items array is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (TabItem [] items) {
+ checkWidget ();
+ if (items == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (items.length == 0) {
+ setSelection (-1, false, false);
+ } else {
+ for (int i=items.length - 1; i>=0; --i) {
+ int index = indexOf (items [i]);
+ if (index != -1) setSelection (index, false, false);
+ }
+ }
+}
+
+/**
+ * Selects the item at the given zero-relative index in the receiver.
+ * If the item at the index was already selected, it remains selected.
+ * The current selection is first cleared, then the new items are
+ * selected. Indices that are out of range are ignored.
+ *
+ * @param index the index of the item to select
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (int index) {
+ checkWidget ();
+ int count = itemCount;
+ if (!(0 <= index && index < count)) return;
+ setSelection (index, false, false);
+}
+
+void setSelection (int index, boolean notify, boolean force) {
+ if (index >= itemCount) return;
+ int currentIndex = getSelectionIndex ();
+ if (!force && currentIndex == index) return;
+ if (currentIndex != -1) {
+ TabItem item = items [currentIndex];
+ if (item != null) {
+ Control control = item.control;
+ if (control != null && !control.isDisposed ()) {
+ control.setVisible (false);
+ }
+ }
+ }
+ ((NSTabView)view).selectTabViewItemAtIndex(index);
+ index = getSelectionIndex();
+ if (index != -1) {
+ TabItem item = items [index];
+ if (item != null) {
+ Control control = item.control;
+ if (control != null && !control.isDisposed ()) {
+ control.setBounds (getClientArea ());
+ control.setVisible (true);
+ }
+ if (notify) {
+ Event event = new Event ();
+ event.item = item;
+ sendEvent (SWT.Selection, event);
+ }
+ }
+ }
+}
+
+boolean traversePage (boolean next) {
+ int count = getItemCount ();
+ if (count == 0) return false;
+ int index = getSelectionIndex ();
+ if (index == -1) {
+ index = 0;
+ } else {
+ int offset = (next) ? 1 : -1;
+ index = (index + offset + count) % count;
+ }
+ setSelection (index, true, false);
+ return index == getSelectionIndex ();
+}
+
+void willSelectTabViewItem(int tabView, int tabViewItem) {
+ if (tabViewItem == 0) return;
+ for (int i = 0; i < itemCount; i++) {
+ TabItem item = items [i];
+ if (item.nsItem.id == tabViewItem) {
+ int currentIndex = getSelectionIndex ();
+ if (currentIndex != -1) {
+ TabItem selected = items [currentIndex];
+ if (selected != null) {
+ Control control = selected.control;
+ if (control != null && !control.isDisposed ()) {
+ control.setVisible (false);
+ }
+ }
+ }
+ Control control = item.control;
+ if (control != null && !control.isDisposed ()) {
+ control.setBounds (getClientArea ());
+ control.setVisible (true);
+ }
+ Event event = new Event ();
+ event.item = item;
+ sendEvent (SWT.Selection, event);
+ }
+ }
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TabItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TabItem.java
new file mode 100755
index 0000000000..51de86ff5d
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TabItem.java
@@ -0,0 +1,291 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * Instances of this class represent a selectable user interface object
+ * corresponding to a tab for a page in a tab folder.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ */
+public class TabItem extends Item {
+ TabFolder parent;
+ Control control;
+ String toolTipText;
+ NSTabViewItem nsItem;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>TabFolder</code>) and a style value
+ * describing its behavior and appearance. The item is added
+ * to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public TabItem (TabFolder parent, int style) {
+ super (parent, style);
+ this.parent = parent;
+ parent.createItem (this, parent.getItemCount ());
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>TabFolder</code>), a style value
+ * describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the zero-relative index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public TabItem (TabFolder parent, int style, int index) {
+ super (parent, style);
+ this.parent = parent;
+ parent.createItem (this, index);
+}
+
+protected void checkSubclass () {
+ if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+void destroyWidget () {
+ parent.destroyItem (this);
+ releaseHandle ();
+}
+
+/**
+ * Returns the control that is used to fill the client area of
+ * the tab folder when the user selects the tab item. If no
+ * control has been set, return <code>null</code>.
+ * <p>
+ * @return the control
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Control getControl () {
+ checkWidget ();
+ return control;
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>TabFolder</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TabFolder getParent () {
+ checkWidget ();
+ return parent;
+}
+
+/**
+ * Returns the receiver's tool tip text, or null if it has
+ * not been set.
+ *
+ * @return the receiver's tool tip text
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getToolTipText () {
+ checkWidget ();
+ return toolTipText;
+}
+
+void releaseHandle () {
+ super.releaseHandle ();
+ if (nsItem != null) nsItem.release();
+ nsItem = null;
+ parent = null;
+}
+
+void releaseParent () {
+ super.releaseParent ();
+ int index = parent.indexOf (this);
+ if (index == parent.getSelectionIndex ()) {
+ if (control != null) control.setVisible (false);
+ }
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ control = null;
+}
+
+/**
+ * Sets the control that is used to fill the client area of
+ * the tab folder when the user selects the tab item.
+ * <p>
+ * @param control the new control (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li>
+ * <li>ERROR_INVALID_PARENT - if the control is not in the same widget tree</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setControl (Control control) {
+ checkWidget ();
+ if (control != null) {
+ if (control.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+ if (control.parent != parent) error (SWT.ERROR_INVALID_PARENT);
+ }
+ if (this.control != null && this.control.isDisposed ()) {
+ this.control = null;
+ }
+ Control oldControl = this.control, newControl = control;
+ this.control = control;
+ int index = parent.indexOf (this);
+ if (index != parent.getSelectionIndex ()) {
+ if (newControl != null) newControl.setVisible (false);
+ return;
+ }
+ if (newControl != null) {
+// nsItem.setView(control.topView ());
+ newControl.setBounds (parent.getClientArea ());
+ newControl.setVisible (true);
+ }
+ if (oldControl != null) oldControl.setVisible (false);
+}
+
+public void setImage (Image image) {
+ checkWidget ();
+ int index = parent.indexOf (this);
+ if (index == -1) return;
+ super.setImage (image);
+}
+
+/**
+ * Sets the receiver's text. The string may include
+ * the mnemonic character.
+ * </p>
+ * <p>
+ * Mnemonics are indicated by an '&amp;' that causes the next
+ * character to be the mnemonic. When the user presses a
+ * key sequence that matches the mnemonic, a selection
+ * event occurs. On most platforms, the mnemonic appears
+ * underlined but may be emphasised in a platform specific
+ * manner. The mnemonic indicator character '&amp;' can be
+ * escaped by doubling it in the string, causing a single
+ * '&amp;' to be displayed.
+ * </p>
+ *
+ * @param string the new text
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ */
+public void setText (String string) {
+ checkWidget ();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ int index = parent.indexOf (this);
+ if (index == -1) return;
+ super.setText (string);
+ nsItem.setLabel(NSString.stringWith(string));
+}
+
+/**
+ * Sets the receiver's tool tip text to the argument, which
+ * may be null indicating that no tool tip text should be shown.
+ *
+ * @param string the new tool tip text (or null)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setToolTipText (String string) {
+ checkWidget();
+ toolTipText = string;
+}
+
+void update () {
+ setText (text);
+ setImage (image);
+ setToolTipText (toolTipText);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java
new file mode 100755
index 0000000000..95a8468ef5
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java
@@ -0,0 +1,2317 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+
+/**
+ * Instances of this class implement a selectable user interface
+ * object that displays a list of images and strings and issues
+ * notification when selected.
+ * <p>
+ * The item children that may be added to instances of this class
+ * must be of type <code>TableItem</code>.
+ * </p><p>
+ * Style <code>VIRTUAL</code> is used to create a <code>Table</code> whose
+ * <code>TableItem</code>s are to be populated by the client on an on-demand basis
+ * instead of up-front. This can provide significant performance improvements for
+ * tables that are very large or for which <code>TableItem</code> population is
+ * expensive (for example, retrieving values from an external source).
+ * </p><p>
+ * Here is an example of using a <code>Table</code> with style <code>VIRTUAL</code>:
+ * <code><pre>
+ * final Table table = new Table (parent, SWT.VIRTUAL | SWT.BORDER);
+ * table.setItemCount (1000000);
+ * table.addListener (SWT.SetData, new Listener () {
+ * public void handleEvent (Event event) {
+ * TableItem item = (TableItem) event.item;
+ * int index = table.indexOf (item);
+ * item.setText ("Item " + index);
+ * System.out.println (item.getText ());
+ * }
+ * });
+ * </pre></code>
+ * </p><p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to add <code>Control</code> children to it,
+ * or set a layout on it.
+ * </p><p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>SINGLE, MULTI, CHECK, FULL_SELECTION, HIDE_SELECTION, VIRTUAL</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection, DefaultSelection, SetData, MeasureItem, EraseItem, PaintItem</dd>
+ * </dl>
+ * </p><p>
+ * Note: Only one of the styles SINGLE, and MULTI may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ */
+public class Table extends Composite {
+ TableItem [] items;
+ TableColumn [] columns;
+ TableColumn sortColumn;
+ TableItem currentItem;
+ NSTableHeaderView headerView;
+ NSTableColumn firstColumn;
+ int columnCount, itemCount, lastIndexOf, sortDirection;
+// GC paintGC;
+// int itemCount, columnCount, column_id, idCount, anchorFirst, anchorLast, headerHeight, itemHeight, lastIndexOf;
+// boolean ignoreSelect, wasSelected, fixScrollWidth, drawBackground;
+// Rectangle imageBounds;
+// int showIndex, lastHittest, lastHittestColumn;
+// static final int CHECK_COLUMN_ID = 1024;
+// static final int COLUMN_ID = 1025;
+// static final int GRID_WIDTH = 1;
+// static final int ICON_AND_TEXT_GAP = 4;
+// static final int CELL_CONTENT_INSET = 12;
+// static final int BORDER_INSET = 1;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#SINGLE
+ * @see SWT#MULTI
+ * @see SWT#CHECK
+ * @see SWT#FULL_SELECTION
+ * @see SWT#HIDE_SELECTION
+ * @see SWT#VIRTUAL
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Table (Composite parent, int style) {
+ super (parent, checkStyle (style));
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's selection, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * When <code>widgetSelected</code> is called, the item field of the event object is valid.
+ * If the receiver has the <code>SWT.CHECK</code> style and the check selection changes,
+ * the event object detail field contains the value <code>SWT.CHECK</code>.
+ * <code>widgetDefaultSelected</code> is typically called when an item is double-clicked.
+ * The item field of the event object is valid for default selection, but the detail field is not used.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the user changes the receiver's selection
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener (SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Selection, typedListener);
+ addListener (SWT.DefaultSelection, typedListener);
+}
+
+TableItem _getItem (int index) {
+ if ((style & SWT.VIRTUAL) == 0) return items [index];
+ if (items [index] != null) return items [index];
+ return items [index] = new TableItem (this, SWT.NULL, -1, false);
+}
+
+boolean checkData (TableItem item, boolean redraw) {
+ if (item.cached) return true;
+ if ((style & SWT.VIRTUAL) != 0) {
+ item.cached = true;
+ Event event = new Event ();
+ event.item = item;
+ event.index = indexOf (item);
+ currentItem = item;
+ sendEvent (SWT.SetData, event);
+ //widget could be disposed at this point
+ currentItem = null;
+ if (isDisposed () || item.isDisposed ()) return false;
+ if (redraw) {
+// if (!setScrollWidth (item)) item.redraw (OS.kDataBrowserNoItem);
+ }
+ }
+ return true;
+}
+
+static int checkStyle (int style) {
+ /*
+ * Feature in Windows. It is not possible to create
+ * a table that does not have scroll bars. Therefore,
+ * no matter what style bits are specified, set the
+ * H_SCROLL and V_SCROLL bits so that the SWT style
+ * will match the widget that Windows creates.
+ */
+ style |= SWT.H_SCROLL | SWT.V_SCROLL;
+ return checkBits (style, SWT.SINGLE, SWT.MULTI, 0, 0, 0, 0);
+}
+
+protected void checkSubclass () {
+ if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+/**
+ * Clears the item at the given zero-relative index in the receiver.
+ * The text, icon and other attributes of the item are set to the default
+ * value. If the table was created with the <code>SWT.VIRTUAL</code> style,
+ * these attributes are requested again as needed.
+ *
+ * @param index the index of the item to clear
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT#VIRTUAL
+ * @see SWT#SetData
+ *
+ * @since 3.0
+ */
+public void clear (int index) {
+ checkWidget();
+ if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE);
+ TableItem item = items [index];
+ if (item != null) {
+ if (currentItem != item) item.clear ();
+ if (currentItem == null && drawCount == 0) {
+ int [] id = new int [] {index + 1};
+// OS.UpdateDataBrowserItems (handle, 0, id.length, id, OS.kDataBrowserItemNoProperty, OS.kDataBrowserNoItem);
+ }
+// setScrollWidth (item);
+ }
+}
+
+/**
+ * Removes the items from the receiver which are between the given
+ * zero-relative start and end indices (inclusive). The text, icon
+ * and other attributes of the items are set to their default values.
+ * If the table was created with the <code>SWT.VIRTUAL</code> style,
+ * these attributes are requested again as needed.
+ *
+ * @param start the start index of the item to clear
+ * @param end the end index of the item to clear
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if either the start or end are not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT#VIRTUAL
+ * @see SWT#SetData
+ *
+ * @since 3.0
+ */
+public void clear (int start, int end) {
+ checkWidget();
+ if (start > end) return;
+ if (!(0 <= start && start <= end && end < itemCount)) {
+ error (SWT.ERROR_INVALID_RANGE);
+ }
+ if (start == 0 && end == itemCount - 1) {
+ clearAll ();
+ } else {
+ for (int i=start; i<=end; i++) {
+ clear (i);
+ }
+ }
+}
+
+/**
+ * Clears the items at the given zero-relative indices in the receiver.
+ * The text, icon and other attributes of the items are set to their default
+ * values. If the table was created with the <code>SWT.VIRTUAL</code> style,
+ * these attributes are requested again as needed.
+ *
+ * @param indices the array of indices of the items
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * <li>ERROR_NULL_ARGUMENT - if the indices array is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT#VIRTUAL
+ * @see SWT#SetData
+ *
+ * @since 3.0
+ */
+public void clear (int [] indices) {
+ checkWidget();
+ if (indices == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (indices.length == 0) return;
+ for (int i=0; i<indices.length; i++) {
+ if (!(0 <= indices [i] && indices [i] < itemCount)) {
+ error (SWT.ERROR_INVALID_RANGE);
+ }
+ }
+ for (int i=0; i<indices.length; i++) {
+ clear (indices [i]);
+ }
+}
+
+/**
+ * Clears all the items in the receiver. The text, icon and other
+ * attributes of the items are set to their default values. If the
+ * table was created with the <code>SWT.VIRTUAL</code> style, these
+ * attributes are requested again as needed.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT#VIRTUAL
+ * @see SWT#SetData
+ *
+ * @since 3.0
+ */
+public void clearAll () {
+ checkWidget();
+ for (int i=0; i<itemCount; i++) {
+ TableItem item = items [i];
+ if (item != null) item.clear ();
+ }
+ if (currentItem == null && drawCount == 0) {
+// OS.UpdateDataBrowserItems (handle, 0, 0, null, OS.kDataBrowserItemNoProperty, OS.kDataBrowserNoItem);
+ }
+// setScrollWidth (items, true);
+}
+
+public Point computeSize (int wHint, int hHint, boolean changed) {
+ checkWidget();
+ int width = 0;
+ if (wHint == SWT.DEFAULT) {
+ if (columnCount != 0) {
+ for (int i=0; i<columnCount; i++) {
+ width += columns [i].getWidth ();
+ }
+ } else {
+ int columnWidth = 0;
+ GC gc = new GC (this);
+ for (int i=0; i<itemCount; i++) {
+ TableItem item = items [i];
+ if (item != null) {
+ columnWidth = Math.max (columnWidth, item.calculateWidth (0, gc));
+ }
+ }
+ gc.dispose ();
+ width += columnWidth + getInsetWidth ();
+ }
+// if ((style & SWT.CHECK) != 0) width += getCheckColumnWidth ();
+ } else {
+ width = wHint;
+ }
+ if (width <= 0) width = DEFAULT_WIDTH;
+ int height = 0;
+ if (hHint == SWT.DEFAULT) {
+ height = itemCount * getItemHeight () + getHeaderHeight();
+ } else {
+ height = hHint;
+ }
+ if (height <= 0) height = DEFAULT_HEIGHT;
+ Rectangle rect = computeTrim (0, 0, width, height);
+ return new Point (rect.width, rect.height);
+}
+
+void createHandle () {
+ //TODO - SWT.CHECK
+ SWTScrollView scrollWidget = (SWTScrollView)new SWTScrollView().alloc();
+ scrollWidget.initWithFrame(new NSRect ());
+ scrollWidget.setHasHorizontalScroller(true);
+ scrollWidget.setHasVerticalScroller(true);
+ scrollWidget.setBorderType(hasBorder() ? OS.NSBezelBorder : OS.NSNoBorder);
+ scrollWidget.setTag(jniRef);
+
+ NSTableView widget = (NSTableView)new SWTTableView().alloc();
+ widget.initWithFrame(new NSRect());
+ widget.setAllowsMultipleSelection((style & SWT.MULTI) != 0);
+ widget.setDataSource(widget);
+ widget.setDelegate(widget);
+ widget.setDoubleAction(OS.sel_sendDoubleSelection);
+ widget.setTag(jniRef);
+
+ headerView = widget.headerView();
+ headerView.retain();
+ widget.setHeaderView(null);
+
+ firstColumn = (NSTableColumn)new NSTableColumn().alloc();
+ firstColumn.initWithIdentifier(NSString.stringWith(""));
+ //column.setResizingMask(OS.NSTableColumnAutoresizingMask);
+ NSCell cell = (NSBrowserCell)new NSBrowserCell().alloc().init();
+ firstColumn.setDataCell(cell);
+ cell.release();
+ widget.addTableColumn (firstColumn);
+
+ scrollView = scrollWidget;
+ view = widget;
+ scrollView.setDocumentView(widget);
+ parent.contentView().addSubview_(scrollView);
+}
+
+void createItem (TableColumn column, int index) {
+ if (!(0 <= index && index <= columnCount)) error (SWT.ERROR_INVALID_RANGE);
+ if (columnCount == columns.length) {
+ TableColumn [] newColumns = new TableColumn [columnCount + 4];
+ System.arraycopy (columns, 0, newColumns, 0, columns.length);
+ columns = newColumns;
+ }
+ NSTableColumn nsColumn;
+ if (columnCount == 0) {
+ //TODO - clear attributes, alignment etc.
+ nsColumn = firstColumn;
+ firstColumn = null;
+ } else {
+ //TODO - set attributes, alignment etc.
+ nsColumn = (NSTableColumn)new NSTableColumn().alloc();
+ nsColumn.initWithIdentifier(NSString.stringWith(""));
+ ((NSTableView)view).addTableColumn (nsColumn);
+ ((NSTableView)view).moveColumn (columnCount, index);
+ NSCell cell = (NSBrowserCell)new NSBrowserCell().alloc().init();
+ nsColumn.setDataCell(cell);
+ cell.release();
+ }
+ column.nsColumn = nsColumn;
+ nsColumn.headerCell().setTitle(NSString.stringWith(""));
+ nsColumn.setWidth(0);
+ System.arraycopy (columns, index, columns, index + 1, columnCount++ - index);
+ columns [index] = column;
+ if (columnCount > 1) {
+ for (int i=0; i<itemCount; i++) {
+ TableItem item = items [i];
+ if (item != null) {
+ String [] strings = item.strings;
+ if (strings != null) {
+ String [] temp = new String [columnCount];
+ System.arraycopy (strings, 0, temp, 0, index);
+ System.arraycopy (strings, index, temp, index+1, columnCount-index-1);
+ temp [index] = "";
+ item.strings = temp;
+ }
+ if (index == 0) item.text = "";
+ Image [] images = item.images;
+ if (images != null) {
+ Image [] temp = new Image [columnCount];
+ System.arraycopy (images, 0, temp, 0, index);
+ System.arraycopy (images, index, temp, index+1, columnCount-index-1);
+ item.images = temp;
+ }
+ if (index == 0) item.image = null;
+ Color [] cellBackground = item.cellBackground;
+ if (cellBackground != null) {
+ Color [] temp = new Color [columnCount];
+ System.arraycopy (cellBackground, 0, temp, 0, index);
+ System.arraycopy (cellBackground, index, temp, index+1, columnCount-index-1);
+ item.cellBackground = temp;
+ }
+ Color [] cellForeground = item.cellForeground;
+ if (cellForeground != null) {
+ Color [] temp = new Color [columnCount];
+ System.arraycopy (cellForeground, 0, temp, 0, index);
+ System.arraycopy (cellForeground, index, temp, index+1, columnCount-index-1);
+ item.cellForeground = temp;
+ }
+ Font [] cellFont = item.cellFont;
+ if (cellFont != null) {
+ Font [] temp = new Font [columnCount];
+ System.arraycopy (cellFont, 0, temp, 0, index);
+ System.arraycopy (cellFont, index, temp, index+1, columnCount-index-1);
+ item.cellFont = temp;
+ }
+ }
+ }
+ }
+}
+
+void createItem (TableItem item, int index) {
+ if (!(0 <= index && index <= itemCount)) error (SWT.ERROR_INVALID_RANGE);
+ if (itemCount == items.length) {
+ /* Grow the array faster when redraw is off */
+ int length = drawCount == 0 ? items.length + 4 : Math.max (4, items.length * 3 / 2);
+ TableItem [] newItems = new TableItem [length];
+ System.arraycopy (items, 0, newItems, 0, items.length);
+ items = newItems;
+ }
+ System.arraycopy (items, index, items, index + 1, itemCount++ - index);
+ items [index] = item;
+ //TODO - use noteNumberOfRowsChanged?
+ ((NSTableView)view).reloadData();
+}
+
+void createWidget () {
+ super.createWidget ();
+ items = new TableItem [4];
+ columns = new TableColumn [4];
+}
+
+Color defaultBackground () {
+ return display.getSystemColor (SWT.COLOR_LIST_BACKGROUND);
+}
+
+Color defaultForeground () {
+ return display.getSystemColor (SWT.COLOR_LIST_FOREGROUND);
+}
+
+/**
+ * Deselects the item at the given zero-relative index in the receiver.
+ * If the item at the index was already deselected, it remains
+ * deselected. Indices that are out of range are ignored.
+ *
+ * @param index the index of the item to deselect
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselect (int index) {
+ checkWidget();
+ if (0 <= index && index < itemCount) {
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ widget.deselectRow (index);
+ widget.setDelegate(widget);
+ }
+}
+
+/**
+ * Deselects the items at the given zero-relative indices in the receiver.
+ * If the item at the given zero-relative index in the receiver
+ * is selected, it is deselected. If the item at the index
+ * was not selected, it remains deselected. The range of the
+ * indices is inclusive. Indices that are out of range are ignored.
+ *
+ * @param start the start index of the items to deselect
+ * @param end the end index of the items to deselect
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselect (int start, int end) {
+ checkWidget();
+ //TODO - check range
+ if (start == 0 && end == itemCount - 1) {
+ deselectAll ();
+ } else {
+ int length = end - start + 1;
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ for (int i=0; i<length; i++) {
+ widget.deselectRow (i);
+ }
+ widget.setDelegate(widget);
+ }
+}
+
+/**
+ * Deselects the items at the given zero-relative indices in the receiver.
+ * If the item at the given zero-relative index in the receiver
+ * is selected, it is deselected. If the item at the index
+ * was not selected, it remains deselected. Indices that are out
+ * of range and duplicate indices are ignored.
+ *
+ * @param indices the array of indices for the items to deselect
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the set of indices is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselect (int [] indices) {
+ checkWidget();
+ if (indices == null) error (SWT.ERROR_NULL_ARGUMENT);
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ for (int i=0; i<indices.length; i++) {
+ widget.deselectRow (indices [i]);
+ }
+ widget.setDelegate(widget);
+}
+
+/**
+ * Deselects all selected items in the receiver.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselectAll () {
+ checkWidget ();
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ widget.deselectAll(null);
+ widget.setDelegate(widget);
+}
+
+void destroyItem (TableColumn column) {
+ int index = 0;
+ while (index < columnCount) {
+ if (columns [index] == column) break;
+ index++;
+ }
+ for (int i=0; i<itemCount; i++) {
+ TableItem item = items [i];
+ if (item != null) {
+ if (columnCount <= 1) {
+ item.strings = null;
+ item.images = null;
+ item.cellBackground = null;
+ item.cellForeground = null;
+ item.cellFont = null;
+ } else {
+ if (item.strings != null) {
+ String [] strings = item.strings;
+ if (index == 0) {
+ item.text = strings [1] != null ? strings [1] : "";
+ }
+ String [] temp = new String [columnCount - 1];
+ System.arraycopy (strings, 0, temp, 0, index);
+ System.arraycopy (strings, index + 1, temp, index, columnCount - 1 - index);
+ item.strings = temp;
+ } else {
+ if (index == 0) item.text = "";
+ }
+ if (item.images != null) {
+ Image [] images = item.images;
+ if (index == 0) item.image = images [1];
+ Image [] temp = new Image [columnCount - 1];
+ System.arraycopy (images, 0, temp, 0, index);
+ System.arraycopy (images, index + 1, temp, index, columnCount - 1 - index);
+ item.images = temp;
+ } else {
+ if (index == 0) item.image = null;
+ }
+ if (item.cellBackground != null) {
+ Color [] cellBackground = item.cellBackground;
+ Color [] temp = new Color [columnCount - 1];
+ System.arraycopy (cellBackground, 0, temp, 0, index);
+ System.arraycopy (cellBackground, index + 1, temp, index, columnCount - 1 - index);
+ item.cellBackground = temp;
+ }
+ if (item.cellForeground != null) {
+ Color [] cellForeground = item.cellForeground;
+ Color [] temp = new Color [columnCount - 1];
+ System.arraycopy (cellForeground, 0, temp, 0, index);
+ System.arraycopy (cellForeground, index + 1, temp, index, columnCount - 1 - index);
+ item.cellForeground = temp;
+ }
+ if (item.cellFont != null) {
+ Font [] cellFont = item.cellFont;
+ Font [] temp = new Font [columnCount - 1];
+ System.arraycopy (cellFont, 0, temp, 0, index);
+ System.arraycopy (cellFont, index + 1, temp, index, columnCount - 1 - index);
+ item.cellFont = temp;
+ }
+ }
+ }
+ }
+ if (columnCount == 1) {
+ //TODO - reset attributes
+ firstColumn = column.nsColumn;
+ firstColumn.setWidth (0);
+ } else {
+ ((NSTableView)view).removeTableColumn(column.nsColumn);
+ }
+ System.arraycopy (columns, index + 1, columns, index, --columnCount - index);
+ columns [columnCount] = null;
+ for (int i=index; i<columnCount; i++) {
+ columns [i].sendEvent (SWT.Move);
+ }
+}
+
+void destroyItem (TableItem item) {
+ int index = 0;
+ while (index < itemCount) {
+ if (items [index] == item) break;
+ index++;
+ }
+ if (index != itemCount - 1) fixSelection (index, false);
+ System.arraycopy (items, index + 1, items, index, --itemCount - index);
+ items [itemCount] = null;
+ ((NSTableView)view).noteNumberOfRowsChanged();
+ if (itemCount == 0) {
+ setTableEmpty ();
+ } else {
+// fixScrollBar ();
+ }
+}
+
+void fixSelection (int index, boolean add) {
+ int [] selection = getSelectionIndices ();
+ if (selection.length == 0) return;
+ int newCount = 0;
+ boolean fix = false;
+ for (int i = 0; i < selection.length; i++) {
+ if (!add && selection [i] == index) {
+ fix = true;
+ } else {
+ int newIndex = newCount++;
+ selection [newIndex] = selection [i] + 1;
+ if (selection [newIndex] - 1 >= index) {
+ selection [newIndex] += add ? 1 : -1;
+ fix = true;
+ }
+ }
+ }
+ if (fix) select (selection, newCount, true);
+}
+
+/**
+ * Returns the column at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ * Columns are returned in the order that they were created.
+ * If no <code>TableColumn</code>s were created by the programmer,
+ * this method will throw <code>ERROR_INVALID_RANGE</code> despite
+ * the fact that a single column of data may be visible in the table.
+ * This occurs when the programmer uses the table like a list, adding
+ * items but never creating a column.
+ *
+ * @param index the index of the column to return
+ * @return the column at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#getColumnOrder()
+ * @see Table#setColumnOrder(int[])
+ * @see TableColumn#getMoveable()
+ * @see TableColumn#setMoveable(boolean)
+ * @see SWT#Move
+ */
+public TableColumn getColumn (int index) {
+ checkWidget ();
+ if (!(0 <=index && index < columnCount)) error (SWT.ERROR_INVALID_RANGE);
+ return columns [index];
+}
+
+/**
+ * Returns the number of columns contained in the receiver.
+ * If no <code>TableColumn</code>s were created by the programmer,
+ * this value is zero, despite the fact that visually, one column
+ * of items may be visible. This occurs when the programmer uses
+ * the table like a list, adding items but never creating a column.
+ *
+ * @return the number of columns
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getColumnCount () {
+ checkWidget ();
+ return columnCount;
+}
+
+/**
+ * Returns an array of zero-relative integers that map
+ * the creation order of the receiver's items to the
+ * order in which they are currently being displayed.
+ * <p>
+ * Specifically, the indices of the returned array represent
+ * the current visual order of the items, and the contents
+ * of the array represent the creation order of the items.
+ * </p><p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the current visual order of the receiver's items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#setColumnOrder(int[])
+ * @see TableColumn#getMoveable()
+ * @see TableColumn#setMoveable(boolean)
+ * @see SWT#Move
+ *
+ * @since 3.1
+ */
+public int [] getColumnOrder () {
+ checkWidget ();
+ int [] order = new int [columnCount];
+ int [] position = new int [1];
+ for (int i=0; i<columnCount; i++) {
+ TableColumn column = columns [i];
+// OS.GetDataBrowserTableViewColumnPosition (handle, column.id, position);
+// if ((style & SWT.CHECK) != 0) position [0] -= 1;
+ order [position [0]] = i;
+ }
+ return order;
+}
+
+/**
+ * Returns an array of <code>TableColumn</code>s which are the
+ * columns in the receiver. Columns are returned in the order
+ * that they were created. If no <code>TableColumn</code>s were
+ * created by the programmer, the array is empty, despite the fact
+ * that visually, one column of items may be visible. This occurs
+ * when the programmer uses the table like a list, adding items but
+ * never creating a column.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items in the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#getColumnOrder()
+ * @see Table#setColumnOrder(int[])
+ * @see TableColumn#getMoveable()
+ * @see TableColumn#setMoveable(boolean)
+ * @see SWT#Move
+ */
+public TableColumn [] getColumns () {
+ checkWidget ();
+ TableColumn [] result = new TableColumn [columnCount];
+ System.arraycopy (columns, 0, result, 0, columnCount);
+ return result;
+}
+
+/**
+ * Returns the width in pixels of a grid line.
+ *
+ * @return the width of a grid line in pixels
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getGridLineWidth () {
+ checkWidget ();
+ return 0;
+}
+
+/**
+ * Returns the height of the receiver's header
+ *
+ * @return the height of the header or zero if the header is not visible
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public int getHeaderHeight () {
+ checkWidget ();
+ NSTableHeaderView headerView = ((NSTableView)view).headerView();
+ if (headerView == null) return 0;
+ return (int)headerView.bounds().height;
+}
+
+/**
+ * Returns <code>true</code> if the receiver's header is visible,
+ * and <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the receiver's header's visibility state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getHeaderVisible () {
+ checkWidget ();
+ return ((NSTableView)view).headerView() != null;
+}
+
+int getInsetWidth () {
+ //TODO - wrong
+ return 20;
+}
+
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TableItem getItem (int index) {
+ checkWidget ();
+ if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE);
+ return _getItem (index);
+}
+
+/**
+ * Returns the item at the given point in the receiver
+ * or null if no such item exists. The point is in the
+ * coordinate system of the receiver.
+ * <p>
+ * The item that is returned represents an item that could be selected by the user.
+ * For example, if selection only occurs in items in the first column, then null is
+ * returned if the point is outside of the item.
+ * Note that the SWT.FULL_SELECTION style hint, which specifies the selection policy,
+ * determines the extent of the selection.
+ * </p>
+ *
+ * @param point the point used to locate the item
+ * @return the item at the given point, or null if the point is not in a selectable item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TableItem getItem (Point point) {
+ checkWidget ();
+// checkItems (true);
+// if (point == null) error (SWT.ERROR_NULL_ARGUMENT);
+// Rect rect = new Rect ();
+// org.eclipse.swt.internal.carbon.Point pt = new org.eclipse.swt.internal.carbon.Point ();
+// OS.SetPt (pt, (short) point.x, (short) point.y);
+// if (0 < lastHittest && lastHittest <= itemCount && lastHittestColumn != 0) {
+// if (OS.GetDataBrowserItemPartBounds (handle, lastHittest, lastHittestColumn, OS.kDataBrowserPropertyEnclosingPart, rect) == OS.noErr) {
+// if (rect.top <= pt.v && pt.v <= rect.bottom) {
+// if ((style & SWT.FULL_SELECTION) != 0) {
+// return _getItem (lastHittest - 1);
+// } else {
+// return OS.PtInRect (pt, rect) ? _getItem (lastHittest - 1) : null;
+// }
+// }
+// }
+//
+// }
+// int [] top = new int [1], left = new int [1];
+// OS.GetDataBrowserScrollPosition(handle, top, left);
+// short [] height = new short [1];
+// OS.GetDataBrowserTableViewRowHeight (handle, height);
+// short [] header = new short [1];
+// OS.GetDataBrowserListViewHeaderBtnHeight (handle, header);
+// int [] offsets = new int [] {0, 1, -1};
+// for (int i = 0; i < offsets.length; i++) {
+// int index = (top[0] - header [0] + point.y) / height [0] + offsets [i];
+// if (0 <= index && index < itemCount) {
+// if (columnCount == 0) {
+// if (OS.GetDataBrowserItemPartBounds (handle, index + 1, column_id, OS.kDataBrowserPropertyEnclosingPart, rect) == OS.noErr) {
+// if (rect.top <= pt.v && pt.v <= rect.bottom) {
+// if ((style & SWT.FULL_SELECTION) != 0) {
+// return _getItem (index);
+// } else {
+// return OS.PtInRect (pt, rect) ? _getItem (index) : null;
+// }
+// }
+// }
+// } else {
+// for (int j = 0; j < columnCount; j++) {
+// if (OS.GetDataBrowserItemPartBounds (handle, index + 1, columns [j].id, OS.kDataBrowserPropertyEnclosingPart, rect) == OS.noErr) {
+// if (rect.top <= pt.v && pt.v <= rect.bottom) {
+// if ((style & SWT.FULL_SELECTION) != 0) {
+// return _getItem (index);
+// } else {
+// return OS.PtInRect (pt, rect) ? _getItem (index) : null;
+// }
+// }
+// }
+// }
+// }
+// }
+// }
+// //TODO - optimize
+// for (int i=0; i<itemCount; i++) {
+// if (columnCount == 0) {
+// if (OS.GetDataBrowserItemPartBounds (handle, i + 1, column_id, OS.kDataBrowserPropertyEnclosingPart, rect) == OS.noErr) {
+// if (rect.top <= pt.v && pt.v <= rect.bottom) {
+// if ((style & SWT.FULL_SELECTION) != 0) {
+// return _getItem (i);
+// } else {
+// return OS.PtInRect (pt, rect) ? _getItem (i) : null;
+// }
+// }
+// }
+// } else {
+// for (int j = 0; j < columnCount; j++) {
+// if (OS.GetDataBrowserItemPartBounds (handle, i + 1, columns [j].id, OS.kDataBrowserPropertyEnclosingPart, rect) == OS.noErr) {
+// if (rect.top <= pt.v && pt.v <= rect.bottom) {
+// if ((style & SWT.FULL_SELECTION) != 0) {
+// return _getItem (i);
+// } else {
+// return OS.PtInRect (pt, rect) ? _getItem (i) : null;
+// }
+// }
+// }
+// }
+// }
+// }
+ return null;
+}
+
+/**
+ * Returns the number of items contained in the receiver.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+ checkWidget ();
+ return itemCount;
+}
+
+/**
+ * Returns the height of the area which would be used to
+ * display <em>one</em> of the items in the receiver's.
+ *
+ * @return the height of one item
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemHeight () {
+ checkWidget ();
+ return (int)((NSTableView)view).rowHeight();
+}
+
+/**
+ * Returns a (possibly empty) array of <code>TableItem</code>s which
+ * are the items in the receiver.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items in the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TableItem [] getItems () {
+ checkWidget ();
+ TableItem [] result = new TableItem [itemCount];
+ if ((style & SWT.VIRTUAL) != 0) {
+ for (int i=0; i<itemCount; i++) {
+ result [i] = _getItem (i);
+ }
+ } else {
+ System.arraycopy (items, 0, result, 0, itemCount);
+ }
+ return result;
+}
+
+/**
+ * Returns <code>true</code> if the receiver's lines are visible,
+ * and <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the visibility state of the lines
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getLinesVisible () {
+ checkWidget ();
+// if (OS.VERSION >= 0x1040) {
+// int [] attrib = new int [1];
+// OS.DataBrowserGetAttributes (handle, attrib);
+// return (attrib [0] & (OS.kDataBrowserAttributeListViewAlternatingRowColors | OS.kDataBrowserAttributeListViewDrawColumnDividers)) != 0;
+// }
+ return false;
+}
+
+/**
+ * Returns an array of <code>TableItem</code>s that are currently
+ * selected in the receiver. The order of the items is unspecified.
+ * An empty array indicates that no items are selected.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its selection, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ * @return an array representing the selection
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TableItem [] getSelection () {
+ checkWidget ();
+ //BUG ?
+ if (((NSTableView)view).numberOfSelectedRows() == 0) {
+ return new TableItem [0];
+ }
+ NSIndexSet selection = ((NSTableView)view).selectedRowIndexes();
+ int bufferSize = selection.lastIndex() - selection.firstIndex() + 1;
+ int [] indexBuffer = new int [bufferSize];
+ selection.getIndexes(indexBuffer, bufferSize, 0);
+ TableItem [] result = new TableItem [bufferSize];
+ for (int i=0; i<bufferSize; i++) {
+ result [i] = _getItem (indexBuffer [i]);
+ }
+ return result;
+}
+
+/**
+ * Returns the number of selected items contained in the receiver.
+ *
+ * @return the number of selected items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelectionCount () {
+ checkWidget ();
+ return ((NSTableView)view).numberOfSelectedRows();
+}
+
+/**
+ * Returns the zero-relative index of the item which is currently
+ * selected in the receiver, or -1 if no item is selected.
+ *
+ * @return the index of the selected item
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelectionIndex () {
+ checkWidget();
+ //TODO - check empty selection case
+ return ((NSTableView)view).selectedRow();
+}
+
+/**
+ * Returns the zero-relative indices of the items which are currently
+ * selected in the receiver. The order of the indices is unspecified.
+ * The array is empty if no items are selected.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its selection, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ * @return the array of indices of the selected items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int [] getSelectionIndices () {
+ checkWidget ();
+ //BUG
+ if (((NSTableView)view).numberOfSelectedRows() == 0) {
+ return new int [0];
+ }
+ NSIndexSet selection = ((NSTableView)view).selectedRowIndexes();
+ int bufferSize = selection.lastIndex() - selection.firstIndex() + 1;
+ int [] indexBuffer = new int [bufferSize];
+ selection.getIndexes(indexBuffer, bufferSize, 0);
+ return indexBuffer;
+}
+
+/**
+ * Returns the column which shows the sort indicator for
+ * the receiver. The value may be null if no column shows
+ * the sort indicator.
+ *
+ * @return the sort indicator
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setSortColumn(TableColumn)
+ *
+ * @since 3.2
+ */
+public TableColumn getSortColumn () {
+ checkWidget ();
+ return sortColumn;
+}
+
+/**
+ * Returns the direction of the sort indicator for the receiver.
+ * The value will be one of <code>UP</code>, <code>DOWN</code>
+ * or <code>NONE</code>.
+ *
+ * @return the sort direction
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setSortDirection(int)
+ *
+ * @since 3.2
+ */
+public int getSortDirection () {
+ checkWidget ();
+ return sortDirection;
+}
+
+/**
+ * Returns the zero-relative index of the item which is currently
+ * at the top of the receiver. This index can change when items are
+ * scrolled or new items are added or removed.
+ *
+ * @return the index of the top item
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getTopIndex () {
+ checkWidget();
+ //TODO - partial item at the top
+ NSRect rect = scrollView.documentVisibleRect();
+ NSPoint point = new NSPoint();
+ point.x = rect.x;
+ point.y = rect.y;
+ return ((NSTableView)view).rowAtPoint(point);
+}
+
+
+/**
+ * Searches the receiver's list starting at the first column
+ * (index 0) until a column is found that is equal to the
+ * argument, and returns the index of that column. If no column
+ * is found, returns -1.
+ *
+ * @param column the search column
+ * @return the index of the column
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the column is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (TableColumn column) {
+ checkWidget ();
+ if (column == null) error (SWT.ERROR_NULL_ARGUMENT);
+ for (int i=0; i<columnCount; i++) {
+ if (columns [i] == column) return i;
+ }
+ return -1;
+}
+
+/**
+ * Searches the receiver's list starting at the first item
+ * (index 0) until an item is found that is equal to the
+ * argument, and returns the index of that item. If no item
+ * is found, returns -1.
+ *
+ * @param item the search item
+ * @return the index of the item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (TableItem item) {
+ checkWidget ();
+ if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (1 <= lastIndexOf && lastIndexOf < itemCount - 1) {
+ if (items [lastIndexOf] == item) return lastIndexOf;
+ if (items [lastIndexOf + 1] == item) return ++lastIndexOf;
+ if (items [lastIndexOf - 1] == item) return --lastIndexOf;
+ }
+ if (lastIndexOf < itemCount / 2) {
+ for (int i=0; i<itemCount; i++) {
+ if (items [i] == item) return lastIndexOf = i;
+ }
+ } else {
+ for (int i=itemCount - 1; i>=0; --i) {
+ if (items [i] == item) return lastIndexOf = i;
+ }
+ }
+ return -1;
+}
+
+/**
+ * Returns <code>true</code> if the item is selected,
+ * and <code>false</code> otherwise. Indices out of
+ * range are ignored.
+ *
+ * @param index the index of the item
+ * @return the selection state of the item at the index
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean isSelected (int index) {
+ checkWidget();
+ //TODO - range check
+ return ((NSTableView)view).isRowSelected(index);
+}
+
+int numberOfRowsInTableView(int aTableView) {
+ return itemCount;
+}
+
+void releaseChildren (boolean destroy) {
+ if (items != null) {
+ for (int i=0; i<itemCount; i++) {
+ TableItem item = items [i];
+ if (item != null && !item.isDisposed ()) {
+ item.release (false);
+ }
+ }
+ items = null;
+ }
+ if (columns != null) {
+ for (int i=0; i<columnCount; i++) {
+ TableColumn column = columns [i];
+ if (column != null && !column.isDisposed ()) {
+ column.release (false);
+ }
+ }
+ columns = null;
+ }
+ super.releaseChildren (destroy);
+}
+
+void releaseHandle () {
+ super.releaseHandle ();
+ if (headerView != null) headerView.release();
+ headerView = null;
+ if (firstColumn != null) firstColumn.release();
+ firstColumn = null;
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ currentItem = null;
+ sortColumn = null;
+}
+
+/**
+ * Removes the item from the receiver at the given
+ * zero-relative index.
+ *
+ * @param index the index for the item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (int index) {
+ checkWidget();
+ if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE);
+ TableItem item = items [index];
+ if (item != null) item.release (false);
+ if (index != itemCount - 1) fixSelection (index, false);
+ System.arraycopy (items, index + 1, items, index, --itemCount - index);
+ items [itemCount] = null;
+ ((NSTableView)view).noteNumberOfRowsChanged();
+ if (itemCount == 0) {
+ setTableEmpty ();
+ } else {
+// fixScrollBar ();
+ }
+}
+
+/**
+ * Removes the items from the receiver which are
+ * between the given zero-relative start and end
+ * indices (inclusive).
+ *
+ * @param start the start of the range
+ * @param end the end of the range
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if either the start or end are not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (int start, int end) {
+ checkWidget();
+ if (start > end) return;
+ if (!(0 <= start && start <= end && end < itemCount)) {
+ error (SWT.ERROR_INVALID_RANGE);
+ }
+ if (start == 0 && end == itemCount - 1) {
+ removeAll ();
+ } else {
+ int length = end - start + 1;
+ for (int i=0; i<length; i++) remove (start);
+ }
+}
+
+/**
+ * Removes the items from the receiver's list at the given
+ * zero-relative indices.
+ *
+ * @param indices the array of indices of the items
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * <li>ERROR_NULL_ARGUMENT - if the indices array is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void remove (int [] indices) {
+ checkWidget ();
+ if (indices == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (indices.length == 0) return;
+ int [] newIndices = new int [indices.length];
+ System.arraycopy (indices, 0, newIndices, 0, indices.length);
+ sort (newIndices);
+ int start = newIndices [newIndices.length - 1], end = newIndices [0];
+ if (!(0 <= start && start <= end && end < itemCount)) {
+ error (SWT.ERROR_INVALID_RANGE);
+ }
+ int last = -1;
+ for (int i=0; i<newIndices.length; i++) {
+ int index = newIndices [i];
+ if (index != last) {
+ remove (index);
+ last = index;
+ }
+ }
+}
+
+/**
+ * Removes all of the items from the receiver.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void removeAll () {
+ checkWidget();
+ for (int i=0; i<itemCount; i++) {
+ TableItem item = items [i];
+ if (item != null && !item.isDisposed ()) item.release (false);
+ }
+ ((NSTableView)view).noteNumberOfRowsChanged();
+ setTableEmpty ();
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's selection.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener(SelectionListener)
+ */
+public void removeSelectionListener(SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Selection, listener);
+ eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+/**
+ * Selects the item at the given zero-relative index in the receiver.
+ * If the item at the index was already selected, it remains
+ * selected. Indices that are out of range are ignored.
+ *
+ * @param index the index of the item to select
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void select (int index) {
+ checkWidget();
+ if (0 <= index && index < itemCount) {
+ NSIndexSet indexes = (NSIndexSet)new NSIndexSet().alloc();
+ indexes.initWithIndex(index);
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ ((NSTableView)view).selectRowIndexes(indexes, true);
+ widget.setDelegate(view);
+ }
+}
+
+/**
+ * Selects the items in the range specified by the given zero-relative
+ * indices in the receiver. The range of indices is inclusive.
+ * The current selection is not cleared before the new items are selected.
+ * <p>
+ * If an item in the given range is not selected, it is selected.
+ * If an item in the given range was already selected, it remains selected.
+ * Indices that are out of range are ignored and no items will be selected
+ * if start is greater than end.
+ * If the receiver is single-select and there is more than one item in the
+ * given range, then all indices are ignored.
+ * </p>
+ *
+ * @param start the start of the range
+ * @param end the end of the range
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#setSelection(int,int)
+ */
+public void select (int start, int end) {
+ checkWidget ();
+ if (end < 0 || start > end || ((style & SWT.SINGLE) != 0 && start != end)) return;
+ if (itemCount == 0 || start >= itemCount) return;
+ if (start == 0 && end == itemCount - 1) {
+ selectAll ();
+ } else {
+ start = Math.max (0, start);
+ end = Math.min (end, itemCount - 1);
+ int length = end - start + 1;
+ NSIndexSet indexes = (NSIndexSet)new NSIndexSet().alloc();
+ NSRange range = new NSRange();
+ range.location = start;
+ range.length = length;
+ indexes.initWithIndexesInRange(range);
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ widget.selectRowIndexes(indexes, true);
+ widget.setDelegate(widget);
+ }
+}
+
+/**
+ * Selects the items at the given zero-relative indices in the receiver.
+ * The current selection is not cleared before the new items are selected.
+ * <p>
+ * If the item at a given index is not selected, it is selected.
+ * If the item at a given index was already selected, it remains selected.
+ * Indices that are out of range and duplicate indices are ignored.
+ * If the receiver is single-select and multiple indices are specified,
+ * then all indices are ignored.
+ * </p>
+ *
+ * @param indices the array of indices for the items to select
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the array of indices is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#setSelection(int[])
+ */
+public void select (int [] indices) {
+ checkWidget ();
+ if (indices == null) error (SWT.ERROR_NULL_ARGUMENT);
+ int length = indices.length;
+ if (length == 0 || ((style & SWT.SINGLE) != 0 && length > 1)) return;
+ int count = 0;
+ NSMutableIndexSet indexes = (NSMutableIndexSet)new NSMutableIndexSet().alloc().init();
+ for (int i=0; i<length; i++) {
+ int index = indices [length - i - 1];
+ if (index >= 0 && index < itemCount) {
+ indexes.addIndex (indices [i]);
+ }
+ }
+ if (count > 0) {
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ widget.selectRowIndexes(indexes, true);
+ widget.setDelegate(widget);
+ }
+}
+
+void select (int [] ids, int count, boolean clear) {
+ NSMutableIndexSet indexes = (NSMutableIndexSet)new NSMutableIndexSet().alloc().init();
+ for (int i=0; i<count; i++) indexes.addIndex (ids [i] - 1); //WRONG -1
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ widget.selectRowIndexes(indexes, !clear);
+ widget.setDelegate(widget);
+
+}
+
+/**
+ * Selects all of the items in the receiver.
+ * <p>
+ * If the receiver is single-select, do nothing.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void selectAll () {
+ checkWidget ();
+ if ((style & SWT.SINGLE) != 0) return;
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ widget.selectAll(null);
+ widget.setDelegate(widget);
+}
+
+/**
+ * Sets the order that the items in the receiver should
+ * be displayed in to the given argument which is described
+ * in terms of the zero-relative ordering of when the items
+ * were added.
+ *
+ * @param order the new order to display the items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the item order is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the item order is not the same length as the number of items</li>
+ * </ul>
+ *
+ * @see Table#getColumnOrder()
+ * @see TableColumn#getMoveable()
+ * @see TableColumn#setMoveable(boolean)
+ * @see SWT#Move
+ *
+ * @since 3.1
+ */
+public void setColumnOrder (int [] order) {
+ checkWidget ();
+ if (order == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (columnCount == 0) {
+ if (order.length != 0) error (SWT.ERROR_INVALID_ARGUMENT);
+ return;
+ }
+ if (order.length != columnCount) error (SWT.ERROR_INVALID_ARGUMENT);
+ int [] oldOrder = getColumnOrder ();
+ boolean reorder = false;
+ boolean [] seen = new boolean [columnCount];
+ for (int i=0; i<order.length; i++) {
+ int index = order [i];
+ if (index < 0 || index >= columnCount) error (SWT.ERROR_INVALID_ARGUMENT);
+ if (seen [index]) error (SWT.ERROR_INVALID_ARGUMENT);
+ seen [index] = true;
+ if (order [i] != oldOrder [i]) reorder = true;
+ }
+ if (reorder) {
+ int x = 0;
+ short [] width = new short [1];
+ int [] oldX = new int [oldOrder.length];
+ for (int i=0; i<oldOrder.length; i++) {
+ int index = oldOrder [i];
+ TableColumn column = columns [index];
+ oldX [index] = x;
+// OS.GetDataBrowserTableViewNamedColumnWidth(handle, column.id, width);
+ x += width [0];
+ }
+ x = 0;
+ int [] newX = new int [order.length];
+ for (int i=0; i<order.length; i++) {
+ int index = order [i];
+ TableColumn column = columns [index];
+ int position = (style & SWT.CHECK) != 0 ? i + 1 : i;
+// OS.SetDataBrowserTableViewColumnPosition(handle, column.id, position);
+// column.lastPosition = position;
+ newX [index] = x;
+// OS.GetDataBrowserTableViewNamedColumnWidth(handle, column.id, width);
+ x += width [0];
+ }
+ TableColumn[] newColumns = new TableColumn [columnCount];
+ System.arraycopy (columns, 0, newColumns, 0, columnCount);
+ for (int i=0; i<columnCount; i++) {
+ TableColumn column = newColumns [i];
+ if (!column.isDisposed ()) {
+ if (newX [i] != oldX [i]) {
+ column.sendEvent (SWT.Move);
+ }
+ }
+ }
+ }
+}
+
+/**
+ * Marks the receiver's header as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param show the new visibility state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setHeaderVisible (boolean show) {
+ checkWidget ();
+ ((NSTableView)view).setHeaderView (show ? headerView : null);
+}
+
+/**
+ * Sets the number of items contained in the receiver.
+ *
+ * @param count the number of items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setItemCount (int count) {
+ checkWidget ();
+// checkItems (true);
+// count = Math.max (0, count);
+// if (count == itemCount) return;
+// setRedraw (false);
+// int[] top = new int [1], left = new int [1];
+// OS.GetDataBrowserScrollPosition (handle, top, left);
+// DataBrowserCallbacks callbacks = new DataBrowserCallbacks ();
+// OS.GetDataBrowserCallbacks (handle, callbacks);
+// callbacks.v1_itemNotificationCallback = 0;
+// callbacks.v1_itemCompareCallback = 0;
+// OS.SetDataBrowserCallbacks (handle, callbacks);
+// if (count < itemCount) {
+// int index = count;
+// int[] id = new int [itemCount - count];
+// while (index < itemCount) {
+// TableItem item = items [index];
+// if (item != null) item.release (false);
+// id [index-count] = index + 1;
+// index++;
+// }
+// OS.RemoveDataBrowserItems (handle, OS.kDataBrowserNoItem, id.length, id, 0);
+// int [] newItemCount = new int [1];
+// if (OS.GetDataBrowserItemCount (handle, OS.kDataBrowserNoItem, true, OS.kDataBrowserItemAnyState, newItemCount) != OS.noErr) {
+// error (SWT.ERROR_CANNOT_GET_COUNT);
+// }
+// if (count != newItemCount[0]) error (SWT.ERROR_ITEM_NOT_REMOVED);
+// }
+// int length = Math.max (4, (count + 3) / 4 * 4);
+// TableItem [] newItems = new TableItem [length];
+// System.arraycopy (items, 0, newItems, 0, Math.min (count, itemCount));
+// items = newItems;
+// if ((style & SWT.VIRTUAL) == 0) {
+// for (int i=itemCount; i<count; i++) {
+// items [i] = new TableItem (this, SWT.NONE, i, false);
+// }
+// }
+// itemCount = count;
+// OS.AddDataBrowserItems (handle, 0, itemCount, null, OS.kDataBrowserItemNoProperty);
+// callbacks.v1_itemNotificationCallback = display.itemNotificationProc;
+// callbacks.v1_itemCompareCallback = itemCompareProc ();
+// OS.SetDataBrowserCallbacks (handle, callbacks);
+// fixScrollBar ();
+// setRedraw (true);
+}
+
+/*public*/ void setItemHeight (int itemHeight) {
+ checkWidget ();
+ if (itemHeight < -1) error (SWT.ERROR_INVALID_ARGUMENT);
+ if (itemHeight == -1) {
+ //TODO - reset item height, ensure other API's such as setFont don't do this
+ } else {
+// OS.SetDataBrowserTableViewRowHeight (handle, (short) itemHeight);
+ }
+}
+
+/**
+ * Marks the receiver's lines as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param show the new visibility state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setLinesVisible (boolean show) {
+ checkWidget ();
+ ((NSTableView)view).setUsesAlternatingRowBackgroundColors(show);
+}
+
+boolean setScrollWidth (TableItem item) {
+ if (columnCount != 0) return false;
+ if (currentItem != null) {
+// if (currentItem != item) fixScrollWidth = true;
+ return false;
+ }
+ if (drawCount != 0) return false;
+ GC gc = new GC (this);
+ int newWidth = item.calculateWidth (0, gc);
+ gc.dispose ();
+ newWidth += getInsetWidth ();
+// short [] width = new short [1];
+// OS.GetDataBrowserTableViewNamedColumnWidth (handle, column_id, width);
+// if (width [0] < newWidth) {
+// OS.SetDataBrowserTableViewNamedColumnWidth (handle, column_id, (short) newWidth);
+// return true;
+// }
+ if (firstColumn.width() < newWidth) {
+ firstColumn.setWidth (newWidth);
+ }
+ return false;
+}
+
+boolean setScrollWidth (TableItem [] items, boolean set) {
+ if (columnCount != 0) return false;
+ if (currentItem != null) {
+// fixScrollWidth = true;
+ return false;
+ }
+ if (drawCount != 0) return false;
+ GC gc = new GC (this);
+ int newWidth = 0;
+ for (int i = 0; i < items.length; i++) {
+ TableItem item = items [i];
+ if (item != null) {
+ newWidth = Math.max (newWidth, item.calculateWidth (0, gc));
+ }
+ }
+ gc.dispose ();
+ newWidth += getInsetWidth ();
+// if (!set) {
+// short [] width = new short [1];
+// OS.GetDataBrowserTableViewNamedColumnWidth (handle, column_id, width);
+// if (width [0] >= newWidth) return false;
+// }
+// OS.SetDataBrowserTableViewNamedColumnWidth (handle, column_id, (short) newWidth);
+ if (!set) {
+ if (firstColumn.width() > newWidth) return false;
+ }
+ firstColumn.setWidth (newWidth);
+ return true;
+}
+
+/**
+ * Selects the item at the given zero-relative index in the receiver.
+ * The current selection is first cleared, then the new item is selected.
+ *
+ * @param index the index of the item to select
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#deselectAll()
+ * @see Table#select(int)
+ */
+public void setSelection (int index) {
+ checkWidget();
+ //TODO - optimize to use expand flag
+ deselectAll ();
+ setSelection (index, false);
+}
+
+void setSelection (int index, boolean notify) {
+// checkWidget();
+ if (0 <= index && index < itemCount) {
+ select (index);
+ showIndex (index);
+ if (notify) {
+ Event event = new Event ();
+ event.item = _getItem (index);
+ postEvent (SWT.Selection, event);
+ }
+ }
+}
+
+/**
+ * Selects the items in the range specified by the given zero-relative
+ * indices in the receiver. The range of indices is inclusive.
+ * The current selection is cleared before the new items are selected.
+ * <p>
+ * Indices that are out of range are ignored and no items will be selected
+ * if start is greater than end.
+ * If the receiver is single-select and there is more than one item in the
+ * given range, then all indices are ignored.
+ * </p>
+ *
+ * @param start the start index of the items to select
+ * @param end the end index of the items to select
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#deselectAll()
+ * @see Table#select(int,int)
+ */
+public void setSelection (int start, int end) {
+ checkWidget ();
+ //TODO - optimize to use expand flag
+ deselectAll ();
+ if (end < 0 || start > end || ((style & SWT.SINGLE) != 0 && start != end)) return;
+ if (itemCount == 0 || start >= itemCount) return;
+ start = Math.max (0, start);
+ end = Math.min (end, itemCount - 1);
+ select (start, end);
+ showIndex (start);
+}
+
+/**
+ * Selects the items at the given zero-relative indices in the receiver.
+ * The current selection is cleared before the new items are selected.
+ * <p>
+ * Indices that are out of range and duplicate indices are ignored.
+ * If the receiver is single-select and multiple indices are specified,
+ * then all indices are ignored.
+ * </p>
+ *
+ * @param indices the indices of the items to select
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the array of indices is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#deselectAll()
+ * @see Table#select(int[])
+ */
+public void setSelection (int [] indices) {
+ checkWidget ();
+ if (indices == null) error (SWT.ERROR_NULL_ARGUMENT);
+ //TODO - optimize to use expand flag
+ deselectAll ();
+ int length = indices.length;
+ if (length == 0 || ((style & SWT.SINGLE) != 0 && length > 1)) return;
+ select (indices);
+ showIndex (indices [0]);
+}
+
+/**
+ * Sets the receiver's selection to the given item.
+ * The current selection is cleared before the new item is selected.
+ * <p>
+ * If the item is not in the receiver, then it is ignored.
+ * </p>
+ *
+ * @param item the item to select
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setSelection (TableItem item) {
+ checkWidget ();
+ if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
+ setSelection (new TableItem [] {item});
+}
+
+/**
+ * Sets the receiver's selection to be the given array of items.
+ * The current selection is cleared before the new items are selected.
+ * <p>
+ * Items that are not in the receiver are ignored.
+ * If the receiver is single-select and multiple items are specified,
+ * then all items are ignored.
+ * </p>
+ *
+ * @param items the array of items
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the array of items is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if one of the items has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#deselectAll()
+ * @see Table#select(int[])
+ * @see Table#setSelection(int[])
+ */
+public void setSelection (TableItem [] items) {
+ checkWidget ();
+ if (items == null) error (SWT.ERROR_NULL_ARGUMENT);
+ //TODO - optimize to use expand flag
+ deselectAll ();
+ int length = items.length;
+ if (length == 0 || ((style & SWT.SINGLE) != 0 && length > 1)) return;
+ int [] indices = new int [length];
+ int count = 0;
+ for (int i=0; i<length; i++) {
+ int index = indexOf (items [length - i - 1]);
+ if (index != -1) {
+ indices [count++] = index;
+ }
+ }
+ if (count > 0) {
+ select (indices);
+ showIndex (indices [0] - 1);
+ }
+}
+
+/**
+ * Sets the column used by the sort indicator for the receiver. A null
+ * value will clear the sort indicator. The current sort column is cleared
+ * before the new column is set.
+ *
+ * @param column the column used by the sort indicator or <code>null</code>
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the column is disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setSortColumn (TableColumn column) {
+ checkWidget ();
+ if (column != null && column.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ if (column == sortColumn) return;
+// DataBrowserCallbacks callbacks = new DataBrowserCallbacks ();
+// OS.GetDataBrowserCallbacks (handle, callbacks);
+// callbacks.v1_itemCompareCallback = display.itemCompareProc;
+// OS.SetDataBrowserCallbacks (handle, callbacks);
+// if (column == null) {
+// if (sortColumn != null && !sortColumn.isDisposed () && sortDirection != SWT.NONE) {
+// OS.SetDataBrowserSortOrder (handle, (short) OS.kDataBrowserOrderIncreasing);
+// sortColumn = null;
+// OS.SetDataBrowserSortProperty (handle, 0);
+// }
+// }
+// sortColumn = column;
+// if (sortColumn != null && !sortColumn.isDisposed () && sortDirection != SWT.NONE) {
+// OS.SetDataBrowserSortProperty (handle, sortColumn.id);
+// int order = sortDirection == SWT.DOWN ? OS.kDataBrowserOrderDecreasing : OS.kDataBrowserOrderIncreasing;
+// OS.SetDataBrowserSortOrder (handle, (short) order);
+// }
+// callbacks.v1_itemCompareCallback = itemCompareProc ();
+// OS.SetDataBrowserCallbacks (handle, callbacks);
+}
+
+/**
+ * Sets the direction of the sort indicator for the receiver. The value
+ * can be one of <code>UP</code>, <code>DOWN</code> or <code>NONE</code>.
+ *
+ * @param direction the direction of the sort indicator
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setSortDirection (int direction) {
+ checkWidget ();
+ if (direction != SWT.UP && direction != SWT.DOWN && direction != SWT.NONE) return;
+ if (direction == sortDirection) return;
+ sortDirection = direction;
+// DataBrowserCallbacks callbacks = new DataBrowserCallbacks ();
+// OS.GetDataBrowserCallbacks (handle, callbacks);
+// callbacks.v1_itemCompareCallback = display.itemCompareProc;
+// OS.SetDataBrowserCallbacks (handle, callbacks);
+// if (sortColumn != null && !sortColumn.isDisposed ()) {
+// if (sortDirection == SWT.NONE) {
+// OS.SetDataBrowserSortOrder (handle, (short) OS.kDataBrowserOrderIncreasing);
+// TableColumn column = sortColumn;
+// sortColumn = null;
+// OS.SetDataBrowserSortProperty (handle, 0);
+// sortColumn = column;
+// } else {
+// OS.SetDataBrowserSortProperty (handle, 0);
+// OS.SetDataBrowserSortProperty (handle, sortColumn.id);
+// int order = sortDirection == SWT.DOWN ? OS.kDataBrowserOrderDecreasing : OS.kDataBrowserOrderIncreasing;
+// OS.SetDataBrowserSortOrder (handle, (short) order);
+// }
+// }
+// callbacks.v1_itemCompareCallback = itemCompareProc ();
+// OS.SetDataBrowserCallbacks (handle, callbacks);
+}
+
+void setTableEmpty () {
+ itemCount = 0;
+ items = new TableItem [4];
+}
+
+/**
+ * Sets the zero-relative index of the item which is currently
+ * at the top of the receiver. This index can change when items
+ * are scrolled or new items are added and removed.
+ *
+ * @param index the index of the top item
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setTopIndex (int index) {
+ checkWidget();
+ NSRect rect = ((NSTableView)view).rectOfRow(index);
+ ((NSTableView)view).scrollRectToVisible(rect);
+}
+
+/**
+ * Shows the column. If the column is already showing in the receiver,
+ * this method simply returns. Otherwise, the columns are scrolled until
+ * the column is visible.
+ *
+ * @param column the column to be shown
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the column is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the column has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void showColumn (TableColumn column) {
+ checkWidget ();
+ if (column == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (column.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
+ if (column.parent != this) return;
+ int index = indexOf (column);
+ if (columnCount <= 1 || !(0 <= index && index < columnCount)) return;
+ ((NSTableView)view).scrollColumnToVisible(index);
+}
+
+void showIndex (int index) {
+ if (0 <= index && index < itemCount) {
+ ((NSTableView)view).scrollRowToVisible(index);
+ }
+}
+
+/**
+ * Shows the item. If the item is already showing in the receiver,
+ * this method simply returns. Otherwise, the items are scrolled until
+ * the item is visible.
+ *
+ * @param item the item to be shown
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#showSelection()
+ */
+public void showItem (TableItem item) {
+ checkWidget ();
+ if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (item.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
+ int index = indexOf (item);
+ if (index != -1) showIndex (index);
+}
+
+/**
+ * Shows the selection. If the selection is already showing in the receiver,
+ * this method simply returns. Otherwise, the items are scrolled until
+ * the selection is visible.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#showItem(TableItem)
+ */
+public void showSelection () {
+ checkWidget();
+ int index = getSelectionIndex ();
+ if (index >= 0) showIndex (index);
+}
+
+void sendDoubleSelection() {
+ //TODO - post
+ sendEvent (SWT.DefaultSelection);
+
+}
+void tableViewSelectionDidChange (int aNotification) {
+ //TODO - post
+ sendEvent (SWT.Selection);
+}
+
+boolean tableViewshouldEditTableColumnrow(int aTableView, int aTableColumn, int rowIndex) {
+ return false;
+}
+
+void tableViewwillDisplayCellforTableColumnrow(int aTableView, int aCell, int aTableColumn, int rowIndex) {
+ TableItem item = items [rowIndex];
+ Image image = item.image;
+ for (int i=0; i<columnCount; i++) {
+ if (columns [i].nsColumn.id == aTableColumn) {
+ image = item.getImage(i);
+ }
+ }
+ NSBrowserCell cell = new NSBrowserCell(aCell);
+ cell.setImage(image != null ? image.handle : null);
+ cell.setLeaf(true);
+}
+
+int tableViewobjectValueForTableColumnrow(int aTableView, int aTableColumn, int rowIndex) {
+ TableItem item = items [rowIndex];
+ for (int i=0; i<columnCount; i++) {
+ if (columns [i].nsColumn.id == aTableColumn) {
+ return NSString.stringWith(item.getText(i)).id;
+ }
+ }
+ return NSString.stringWith(item.text).id;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableColumn.java
new file mode 100755
index 0000000000..07e5bbad78
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableColumn.java
@@ -0,0 +1,538 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.events.*;
+
+/**
+ * Instances of this class represent a column in a table widget.
+ * <p><dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>LEFT, RIGHT, CENTER</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd> Move, Resize, Selection</dd>
+ * </dl>
+ * </p><p>
+ * Note: Only one of the styles LEFT, RIGHT and CENTER may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ */
+public class TableColumn extends Item {
+ Table parent;
+ NSTableColumn nsColumn;
+ boolean resizable;
+ String toolTipText;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Table</code>) and a style value
+ * describing its behavior and appearance. The item is added
+ * to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#LEFT
+ * @see SWT#RIGHT
+ * @see SWT#CENTER
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public TableColumn (Table parent, int style) {
+ super (parent, checkStyle (style));
+ resizable = true;
+ this.parent = parent;
+ parent.createItem (this, parent.getColumnCount ());
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Table</code>), a style value
+ * describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the zero-relative index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#LEFT
+ * @see SWT#RIGHT
+ * @see SWT#CENTER
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public TableColumn (Table parent, int style, int index) {
+ super (parent, checkStyle (style));
+ resizable = true;
+ this.parent = parent;
+ parent.createItem (this, index);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is moved or resized, by sending
+ * it one of the messages defined in the <code>ControlListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ControlListener
+ * @see #removeControlListener
+ */
+public void addControlListener(ControlListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Resize,typedListener);
+ addListener (SWT.Move,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the column header is selected.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the control is selected by the user
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener (SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Selection,typedListener);
+ addListener (SWT.DefaultSelection,typedListener);
+}
+
+static int checkStyle (int style) {
+ return checkBits (style, SWT.LEFT, SWT.CENTER, SWT.RIGHT, 0, 0, 0);
+}
+
+protected void checkSubclass () {
+ if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+void destroyWidget () {
+ parent.destroyItem (this);
+ releaseHandle ();
+}
+
+/**
+ * Returns a value which describes the position of the
+ * text or image in the receiver. The value will be one of
+ * <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code>.
+ *
+ * @return the alignment
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getAlignment () {
+ checkWidget ();
+ if ((style & SWT.LEFT) != 0) return SWT.LEFT;
+ if ((style & SWT.CENTER) != 0) return SWT.CENTER;
+ if ((style & SWT.RIGHT) != 0) return SWT.RIGHT;
+ return SWT.LEFT;
+}
+
+String getNameText () {
+ return getText ();
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Table</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Table getParent () {
+ checkWidget ();
+ return parent;
+}
+
+/**
+ * Gets the moveable attribute. A column that is
+ * not moveable cannot be reordered by the user
+ * by dragging the header but may be reordered
+ * by the programmer.
+ *
+ * @return the moveable attribute
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#getColumnOrder()
+ * @see Table#setColumnOrder(int[])
+ * @see TableColumn#setMoveable(boolean)
+ * @see SWT#Move
+ *
+ * @since 3.1
+ */
+public boolean getMoveable () {
+ checkWidget ();
+// int [] flags = new int [1];
+// OS.GetDataBrowserPropertyFlags (parent.handle, id, flags);
+// return (flags [0] & OS.kDataBrowserListViewMovableColumn) != 0;
+ return false;
+}
+
+/**
+ * Gets the resizable attribute. A column that is
+ * not resizable cannot be dragged by the user but
+ * may be resized by the programmer.
+ *
+ * @return the resizable attribute
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getResizable () {
+ checkWidget ();
+ return resizable;
+}
+
+/**
+ * Returns the receiver's tool tip text, or null if it has
+ * not been set.
+ *
+ * @return the receiver's tool tip text
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public String getToolTipText () {
+ checkWidget ();
+ return toolTipText;
+}
+
+/**
+ * Gets the width of the receiver.
+ *
+ * @return the width
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getWidth () {
+ checkWidget ();
+ return (int)nsColumn.width();
+}
+
+/**
+ * Causes the receiver to be resized to its preferred size.
+ * For a composite, this involves computing the preferred size
+ * from its layout, if there is one.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ */
+public void pack () {
+ checkWidget ();
+ GC gc = new GC (parent);
+ int width = gc.stringExtent (text).x;
+ //TODO header extra
+ int index = parent.indexOf (this);
+ for (int i=0; i<parent.itemCount; i++) {
+ TableItem item = parent.items [i];
+ if (item != null && item.cached) {
+ width = Math.max (width, item.calculateWidth (index, gc));
+ }
+ }
+ gc.dispose ();
+ setWidth (width + parent.getInsetWidth ());
+}
+
+void releaseHandle () {
+ super.releaseHandle ();
+ if (nsColumn != null) nsColumn.release();
+ nsColumn = null;
+ parent = null;
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ if (parent.sortColumn == this) {
+ parent.sortColumn = null;
+ }
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is moved or resized.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ControlListener
+ * @see #addControlListener
+ */
+public void removeControlListener (ControlListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Move, listener);
+ eventTable.unhook (SWT.Resize, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Selection, listener);
+ eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+/**
+ * Controls how text and images will be displayed in the receiver.
+ * The argument should be one of <code>LEFT</code>, <code>RIGHT</code>
+ * or <code>CENTER</code>.
+ *
+ * @param alignment the new alignment
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setAlignment (int alignment) {
+ checkWidget ();
+ if ((alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER)) == 0) return;
+ int index = parent.indexOf (this);
+ if (index == -1 || index == 0) return;
+ style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+ style |= alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+ //NOT DONE
+}
+
+public void setImage (Image image) {
+ checkWidget();
+ if (image != null && image.isDisposed ()) {
+ error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+// int index = parent.indexOf (this);
+// if (index == -1) return;
+// if (iconRef != 0) {
+// OS.ReleaseIconRef (iconRef);
+// iconRef = 0;
+// }
+// super.setImage (image);
+// if (image != null) {
+// if (OS.VERSION < 0x1040) {
+// iconRef = createIconRef (image);
+// }
+// }
+// updateHeader ();
+}
+
+/**
+ * Sets the moveable attribute. A column that is
+ * moveable can be reordered by the user by dragging
+ * the header. A column that is not moveable cannot be
+ * dragged by the user but may be reordered
+ * by the programmer.
+ *
+ * @param moveable the moveable attribute
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Table#setColumnOrder(int[])
+ * @see Table#getColumnOrder()
+ * @see TableColumn#getMoveable()
+ * @see SWT#Move
+ *
+ * @since 3.1
+ */
+public void setMoveable (boolean moveable) {
+ checkWidget ();
+// int [] flags = new int [1];
+// OS.GetDataBrowserPropertyFlags (parent.handle, id, flags);
+// if (moveable) {
+// flags [0] |= OS.kDataBrowserListViewMovableColumn;
+// } else {
+// flags [0] &= ~OS.kDataBrowserListViewMovableColumn;
+// }
+// OS.SetDataBrowserPropertyFlags (parent.handle, id, flags [0]);
+}
+
+/**
+ * Sets the resizable attribute. A column that is
+ * resizable can be resized by the user dragging the
+ * edge of the header. A column that is not resizable
+ * cannot be dragged by the user but may be resized
+ * by the programmer.
+ *
+ * @param resizable the resize attribute
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setResizable (boolean resizable) {
+ checkWidget ();
+ this.resizable = resizable;
+}
+
+public void setText (String string) {
+ checkWidget ();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ super.setText (string);
+ char [] buffer = new char [text.length ()];
+ text.getChars (0, buffer.length, buffer, 0);
+ int length = fixMnemonic (buffer);
+ nsColumn.headerCell().setTitle(NSString.stringWithCharacters(buffer, length));
+}
+
+/**
+ * Sets the receiver's tool tip text to the argument, which
+ * may be null indicating that no tool tip text should be shown.
+ *
+ * @param string the new tool tip text (or null)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setToolTipText (String string) {
+ checkWidget();
+ toolTipText = string;
+}
+
+/**
+ * Sets the width of the receiver.
+ *
+ * @param width the new width
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setWidth (int width) {
+ checkWidget ();
+ if (width < 0) return;
+ nsColumn.setWidth (width);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableItem.java
new file mode 100755
index 0000000000..d511a135d9
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TableItem.java
@@ -0,0 +1,1030 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+
+/**
+ * Instances of this class represent a selectable user interface object
+ * that represents an item in a table.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ */
+public class TableItem extends Item {
+ Table parent;
+ String [] strings;
+ Image [] images;
+ boolean checked, grayed, cached;
+ Color foreground, background;
+ Color[] cellForeground, cellBackground;
+ Font font;
+ Font[] cellFont;
+ int width = -1;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Table</code>) and a style value
+ * describing its behavior and appearance. The item is added
+ * to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public TableItem (Table parent, int style) {
+ this (parent, style, checkNull (parent).getItemCount (), true);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Table</code>), a style value
+ * describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the zero-relative index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public TableItem (Table parent, int style, int index) {
+ this (parent, style, index, true);
+}
+
+TableItem (Table parent, int style, int index, boolean create) {
+ super (parent, style);
+ this.parent = parent;
+ if (create) parent.createItem (this, index);
+}
+
+static Table checkNull (Table control) {
+ if (control == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ return control;
+}
+
+int calculateWidth (int index, GC gc) {
+ if (index == 0 && width != -1) return width;
+ int width = 0;
+ Image image = getImage (index);
+ String text = getText (index);
+ gc.setFont (getFont (index));
+// if (image != null) width += image.getBounds ().width + parent.getGap ();
+ if (text != null && text.length () > 0) width += gc.stringExtent (text).x;
+// if (parent.hooks (SWT.MeasureItem)) {
+// Event event = new Event ();
+// event.item = this;
+// event.index = index;
+// event.gc = gc;
+// short [] height = new short [1];
+// OS.GetDataBrowserTableViewRowHeight (parent.handle, height);
+// event.width = width;
+// event.height = height[0];
+// parent.sendEvent (SWT.MeasureItem, event);
+// if (parent.itemHeight < event.height) {
+// parent.itemHeight = event.height;
+// OS.SetDataBrowserTableViewRowHeight (parent.handle, (short) event.height);
+// }
+// width = event.width;
+// }
+ if (index == 0) this.width = width;
+ return width;
+}
+
+protected void checkSubclass () {
+ if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+void clear () {
+ text = "";
+ image = null;
+ strings = null;
+ images = null;
+ checked = grayed = cached = false;
+ foreground = background = null;
+ cellForeground = cellBackground = null;
+ font = null;
+ cellFont = null;
+ width = -1;
+}
+
+void destroyWidget () {
+ parent.destroyItem (this);
+ releaseHandle ();
+}
+
+/**
+ * Returns the receiver's background color.
+ *
+ * @return the background color
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public Color getBackground () {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ return background != null ? background : parent.getBackground ();
+}
+
+/**
+ * Returns the background color at the given column index in the receiver.
+ *
+ * @param index the column index
+ * @return the background color
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Color getBackground (int index) {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ int count = Math.max (1, parent.columnCount);
+ if (0 > index || index > count -1) return getBackground ();
+ if (cellBackground == null || cellBackground [index] == null) return getBackground ();
+ return cellBackground [index];
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent.
+ *
+ * @return the receiver's bounding rectangle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public Rectangle getBounds () {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+// Rect rect = new Rect();
+// int itemIndex = parent.indexOf (this);
+// int id = itemIndex + 1;
+// int columnId = parent.columnCount == 0 ? parent.column_id : parent.columns [0].id;
+// if (OS.GetDataBrowserItemPartBounds (parent.handle, id, columnId, OS.kDataBrowserPropertyContentPart, rect) != OS.noErr) {
+// return new Rectangle (0, 0, 0, 0);
+// }
+// int x = rect.left, y = rect.top;
+// int width = 0;
+// if (image != null) {
+// Rectangle bounds = image.getBounds ();
+// x += bounds.width + parent.getGap ();
+// }
+// GC gc = new GC (parent);
+// Point extent = gc.stringExtent (text);
+// gc.dispose ();
+// width += extent.x;
+// if (parent.columnCount > 0) {
+// width = Math.min (width, rect.right - x);
+// }
+// int height = rect.bottom - rect.top;
+// return new Rectangle (x, y, width, height);
+ return null;
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent at a column in the table.
+ *
+ * @param index the index that specifies the column
+ * @return the receiver's bounding column rectangle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Rectangle getBounds (int index) {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+// parent.checkItems (true);
+// if (index != 0 && !(0 <= index && index < parent.columnCount)) return new Rectangle (0, 0, 0, 0);
+// Rect rect = new Rect();
+// int itemIndex = parent.indexOf (this);
+// int id = itemIndex + 1;
+// int columnId = parent.columnCount == 0 ? parent.column_id : parent.columns [index].id;
+// if (OS.GetDataBrowserItemPartBounds (parent.handle, id, columnId, OS.kDataBrowserPropertyEnclosingPart, rect) != OS.noErr) {
+// return new Rectangle (0, 0, 0, 0);
+// }
+// int x, y, width, height;
+// if (OS.VERSION >= 0x1040) {
+// if (parent.getLinesVisible ()) {
+// rect.left += Table.GRID_WIDTH;
+// rect.top += Table.GRID_WIDTH;
+// }
+// x = rect.left;
+// y = rect.top;
+// width = rect.right - rect.left;
+// height = rect.bottom - rect.top;
+// } else {
+// Rect rect2 = new Rect();
+// if (OS.GetDataBrowserItemPartBounds (parent.handle, id, columnId, OS.kDataBrowserPropertyContentPart, rect2) != OS.noErr) {
+// return new Rectangle (0, 0, 0, 0);
+// }
+// x = rect2.left;
+// y = rect2.top;
+// width = rect.right - rect2.left + 1;
+// height = rect2.bottom - rect2.top + 1;
+// }
+// return new Rectangle (x, y, width, height);
+ return null;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is checked,
+ * and false otherwise. When the parent does not have
+ * the <code>CHECK</code> style, return false.
+ *
+ * @return the checked state of the checkbox
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getChecked () {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ if ((parent.style & SWT.CHECK) == 0) return false;
+ return checked;
+}
+
+/**
+ * Returns the font that the receiver will use to paint textual information for this item.
+ *
+ * @return the receiver's font
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Font getFont () {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ return font != null ? font : parent.getFont ();
+}
+
+/**
+ * Returns the font that the receiver will use to paint textual information
+ * for the specified cell in this item.
+ *
+ * @param index the column index
+ * @return the receiver's font
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Font getFont (int index) {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ int count = Math.max (1, parent.columnCount);
+ if (0 > index || index > count -1) return getFont ();
+ if (cellFont == null || cellFont [index] == null) return getFont ();
+ return cellFont [index];
+}
+
+/**
+ * Returns the foreground color that the receiver will use to draw.
+ *
+ * @return the receiver's foreground color
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public Color getForeground () {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ return foreground != null ? foreground : parent.getForeground ();
+}
+
+/**
+ *
+ * Returns the foreground color at the given column index in the receiver.
+ *
+ * @param index the column index
+ * @return the foreground color
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Color getForeground (int index) {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ int count = Math.max (1, parent.columnCount);
+ if (0 > index || index > count -1) return getForeground ();
+ if (cellForeground == null || cellForeground [index] == null) return getForeground ();
+ return cellForeground [index];
+}
+
+/**
+ * Returns <code>true</code> if the receiver is grayed,
+ * and false otherwise. When the parent does not have
+ * the <code>CHECK</code> style, return false.
+ *
+ * @return the grayed state of the checkbox
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getGrayed () {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ if ((parent.style & SWT.CHECK) == 0) return false;
+ return grayed;
+}
+
+public Image getImage () {
+ checkWidget();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ return super.getImage ();
+}
+
+/**
+ * Returns the image stored at the given column index in the receiver,
+ * or null if the image has not been set or if the column does not exist.
+ *
+ * @param index the column index
+ * @return the image stored at the given column index in the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Image getImage (int index) {
+ checkWidget();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ if (index == 0) return getImage ();
+ if (images != null) {
+ if (0 <= index && index < images.length) return images [index];
+ }
+ return null;
+}
+
+/**
+ * Returns a rectangle describing the size and location
+ * relative to its parent of an image at a column in the
+ * table. An empty rectangle is returned if index exceeds
+ * the index of the table's last column.
+ *
+ * @param index the index that specifies the column
+ * @return the receiver's bounding image rectangle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Rectangle getImageBounds (int index) {
+ checkWidget();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+// parent.checkItems (true);
+// if (index != 0 && !(0 <= index && index < parent.columnCount)) return new Rectangle (0, 0, 0, 0);
+// Rect rect = new Rect();
+// int itemIndex = parent.indexOf (this);
+// int id = itemIndex + 1;
+// int columnId = parent.columnCount == 0 ? parent.column_id : parent.columns [index].id;
+// if (OS.GetDataBrowserItemPartBounds (parent.handle, id, columnId, OS.kDataBrowserPropertyContentPart, rect) != OS.noErr) {
+// return new Rectangle (0, 0, 0, 0);
+// }
+// int x = rect.left, y = rect.top;
+// int width = 0;
+// if (index == 0 && image != null) {
+// Rectangle bounds = image.getBounds ();
+// width += bounds.width;
+// }
+// if (index != 0 && images != null && images[index] != null) {
+// Rectangle bounds = images [index].getBounds ();
+// width += bounds.width;
+// }
+// int height = rect.bottom - rect.top + 1;
+// return new Rectangle (x, y, width, height);
+ return null;
+}
+
+/**
+ * Gets the image indent.
+ *
+ * @return the indent
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getImageIndent () {
+ checkWidget();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ return 0;
+}
+
+String getNameText () {
+ if ((parent.style & SWT.VIRTUAL) != 0) {
+ if (!cached) return "*virtual*"; //$NON-NLS-1$
+ }
+ return super.getNameText ();
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Table</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Table getParent () {
+ checkWidget ();
+ return parent;
+}
+
+public String getText () {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ return super.getText ();
+}
+
+/**
+ * Returns the text stored at the given column index in the receiver,
+ * or empty string if the text has not been set.
+ *
+ * @param index the column index
+ * @return the text stored at the given column index in the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText (int index) {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ if (index == 0) return getText ();
+ if (strings != null) {
+ if (0 <= index && index < strings.length) {
+ String string = strings [index];
+ return string != null ? string : "";
+ }
+ }
+ return "";
+}
+
+/**
+ * Returns a rectangle describing the size and location
+ * relative to its parent of the text at a column in the
+ * table. An empty rectangle is returned if index exceeds
+ * the index of the table's last column.
+ *
+ * @param index the index that specifies the column
+ * @return the receiver's bounding text rectangle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public Rectangle getTextBounds (int index) {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+// parent.checkItems (true);
+// if (index != 0 && !(0 <= index && index < parent.columnCount)) return new Rectangle (0, 0, 0, 0);
+// Rect rect = new Rect();
+// int itemIndex = parent.indexOf (this);
+// int id = itemIndex + 1;
+// int columnId = parent.columnCount == 0 ? parent.column_id : parent.columns [index].id;
+// if (OS.GetDataBrowserItemPartBounds (parent.handle, id, columnId, OS.kDataBrowserPropertyEnclosingPart, rect) != OS.noErr) {
+// return new Rectangle (0, 0, 0, 0);
+// }
+// int imageWidth = 0;
+// int margin = parent.getInsetWidth () / 2;
+// Image image = getImage (index);
+// if (image != null) {
+// Rectangle bounds = image.getBounds ();
+// imageWidth = bounds.width + parent.getGap ();
+// }
+// int x, y, width, height;
+// if (OS.VERSION >= 0x1040) {
+// if (parent.getLinesVisible ()) {
+// rect.left += Table.GRID_WIDTH;
+// rect.top += Table.GRID_WIDTH;
+// }
+// x = rect.left + imageWidth + margin;
+// y = rect.top;
+// width = Math.max (0, rect.right - rect.left - imageWidth - margin * 2);
+// height = rect.bottom - rect.top;
+// } else {
+// Rect rect2 = new Rect();
+// if (OS.GetDataBrowserItemPartBounds (parent.handle, id, columnId, OS.kDataBrowserPropertyContentPart, rect2) != OS.noErr) {
+// return new Rectangle (0, 0, 0, 0);
+// }
+// x = rect2.left + imageWidth + margin;
+// y = rect2.top;
+// width = Math.max (0, rect.right - rect2.left + 1 - imageWidth - margin * 2);
+// height = rect2.bottom - rect2.top + 1;
+// }
+// return new Rectangle (x, y, width, height);
+ return null;
+}
+
+void redraw () {
+// 0[aTableView setNeedsDisplayInRect:[aTableView rectOfRow:row]];
+ ((NSTableView)parent.view).reloadData();
+ ((NSTableView)parent.view).tile();
+}
+
+void releaseHandle () {
+ super.releaseHandle ();
+ parent = null;
+}
+
+void releaseParent () {
+ super.releaseParent ();
+// parent.checkItems (true);
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ strings = null;
+ images = null;
+ background = foreground = null;
+ font = null;
+ cellBackground = cellForeground = null;
+ cellFont = null;
+}
+
+/**
+ * Sets the receiver's background color to the color specified
+ * by the argument, or to the default system color for the item
+ * if the argument is null.
+ *
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public void setBackground (Color color) {
+ checkWidget ();
+ if (color != null && color.isDisposed ()) {
+ SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ if (background == color) return;
+ if (background != null && background.equals (color)) return;
+ background = color;
+ cached = true;
+// redraw (OS.kDataBrowserNoItem);
+}
+
+/**
+ * Sets the background color at the given column index in the receiver
+ * to the color specified by the argument, or to the default system color for the item
+ * if the argument is null.
+ *
+ * @param index the column index
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setBackground (int index, Color color) {
+ checkWidget ();
+ if (color != null && color.isDisposed ()) {
+ SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ int count = Math.max (1, parent.columnCount);
+ if (0 > index || index > count - 1) return;
+ if (cellBackground == null) {
+ cellBackground = new Color [count];
+ }
+ if (cellBackground [index] == color) return;
+ if (cellBackground [index] != null && cellBackground [index].equals (color)) return;
+ cellBackground [index] = color;
+ cached = true;
+// redraw (OS.kDataBrowserNoItem);
+}
+
+/**
+ * Sets the checked state of the checkbox for this item. This state change
+ * only applies if the Table was created with the SWT.CHECK style.
+ *
+ * @param checked the new checked state of the checkbox
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setChecked (boolean checked) {
+ checkWidget ();
+ if ((parent.style & SWT.CHECK) == 0) return;
+ if (this.checked == checked) return;
+ this.checked = checked;
+ cached = true;
+// redraw (Table.CHECK_COLUMN_ID);
+}
+
+/**
+ * Sets the font that the receiver will use to paint textual information
+ * for this item to the font specified by the argument, or to the default font
+ * for that kind of control if the argument is null.
+ *
+ * @param font the new font (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setFont (Font font) {
+ checkWidget ();
+ if (font != null && font.isDisposed ()) {
+ SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ if (this.font == font) return;
+ if (this.font != null && this.font.equals (font)) return;
+ this.font = font;
+ cached = true;
+// redraw (OS.kDataBrowserNoItem);
+}
+
+/**
+ * Sets the font that the receiver will use to paint textual information
+ * for the specified cell in this item to the font specified by the
+ * argument, or to the default font for that kind of control if the
+ * argument is null.
+ *
+ * @param index the column index
+ * @param font the new font (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setFont (int index, Font font) {
+ checkWidget ();
+ if (font != null && font.isDisposed ()) {
+ SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ int count = Math.max (1, parent.columnCount);
+ if (0 > index || index > count - 1) return;
+ if (cellFont == null) {
+ cellFont = new Font [count];
+ }
+ if (cellFont [index] == font) return;
+ if (cellFont [index] != null && cellFont [index].equals (font)) return;
+ cellFont [index] = font;
+ cached = true;
+// redraw (OS.kDataBrowserNoItem);
+}
+
+/**
+ * Sets the receiver's foreground color to the color specified
+ * by the argument, or to the default system color for the item
+ * if the argument is null.
+ *
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ */
+public void setForeground (Color color) {
+ checkWidget ();
+ if (color != null && color.isDisposed ()) {
+ SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ if (foreground == color) return;
+ if (foreground != null && foreground.equals (color)) return;
+ foreground = color;
+ cached = true;
+// redraw (OS.kDataBrowserNoItem);
+}
+
+/**
+ * Sets the foreground color at the given column index in the receiver
+ * to the color specified by the argument, or to the default system color for the item
+ * if the argument is null.
+ *
+ * @param index the column index
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setForeground (int index, Color color){
+ checkWidget ();
+ if (color != null && color.isDisposed ()) {
+ SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ int count = Math.max (1, parent.columnCount);
+ if (0 > index || index > count - 1) return;
+ if (cellForeground == null) {
+ cellForeground = new Color [count];
+ }
+ if (cellForeground [index] == color) return;
+ if (cellForeground [index] != null && cellForeground [index].equals (color)) return;
+ cellForeground [index] = color;
+ cached = true;
+// redraw (OS.kDataBrowserNoItem);
+}
+
+/**
+ * Sets the grayed state of the checkbox for this item. This state change
+ * only applies if the Table was created with the SWT.CHECK style.
+ *
+ * @param grayed the new grayed state of the checkbox;
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setGrayed (boolean grayed) {
+ checkWidget ();
+ if ((parent.style & SWT.CHECK) == 0) return;
+ if (this.grayed == grayed) return;
+ this.grayed = grayed;
+ cached = true;
+// redraw (Table.CHECK_COLUMN_ID);
+}
+
+/**
+ * Sets the image for multiple columns in the table.
+ *
+ * @param images the array of new images
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the array of images is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if one of the images has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setImage (Image [] images) {
+ checkWidget();
+ if (images == null) error (SWT.ERROR_NULL_ARGUMENT);
+ for (int i=0; i<images.length; i++) {
+ setImage (i, images [i]);
+ }
+}
+
+/**
+ * Sets the receiver's image at a column.
+ *
+ * @param index the column index
+ * @param image the new image
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setImage (int index, Image image) {
+ checkWidget();
+ if (image != null && image.isDisposed ()) {
+ error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+ int itemIndex = parent.indexOf (this);
+ if (itemIndex == -1) return;
+// if (parent.imageBounds == null && image != null) {
+// parent.setItemHeight (image);
+// }
+ if (index == 0) {
+ if (image != null && image.type == SWT.ICON) {
+ if (image.equals (this.image)) return;
+ }
+ width = -1;
+ super.setImage (image);
+ }
+ int count = Math.max (1, parent.columnCount);
+ if (0 <= index && index < count) {
+ if (images == null) images = new Image [count];
+ if (image != null && image.type == SWT.ICON) {
+ if (image.equals (images [index])) return;
+ }
+ images [index] = image;
+ }
+// cached = true;
+// if (index == 0) parent.setScrollWidth (this);
+// redraw (OS.kDataBrowserNoItem);
+}
+
+public void setImage (Image image) {
+ checkWidget ();
+ setImage (0, image);
+}
+
+/**
+ * Sets the indent of the first column's image, expressed in terms of the image's width.
+ *
+ * @param indent the new indent
+ *
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @deprecated this functionality is not supported on most platforms
+ */
+public void setImageIndent (int indent) {
+ checkWidget();
+ if (indent < 0) return;
+ cached = true;
+ /* Image indent is not supported on the Macintosh */
+}
+
+/**
+ * Sets the text for multiple columns in the table.
+ *
+ * @param strings the array of new strings
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String [] strings) {
+ checkWidget();
+ if (strings == null) error (SWT.ERROR_NULL_ARGUMENT);
+ for (int i=0; i<strings.length; i++) {
+ String string = strings [i];
+ if (string != null) setText (i, string);
+ }
+}
+
+/**
+ * Sets the receiver's text at a column
+ *
+ * @param index the column index
+ * @param string the new text
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (int index, String string) {
+ checkWidget();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (index == 0) {
+ if (string.equals (text)) return;
+ width = -1;
+ super.setText (string);
+ }
+ int count = Math.max (1, parent.columnCount);
+ if (0 <= index && index < count) {
+ if (strings == null) strings = new String [count];
+ if (string.equals (strings [index])) return;
+ strings [index] = string;
+ }
+ cached = true;
+ if (index == 0) parent.setScrollWidth (this);
+// redraw (OS.kDataBrowserNoItem);
+}
+
+public void setText (String string) {
+ checkWidget();
+ setText (0, string);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java
new file mode 100755
index 0000000000..7ac3748039
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java
@@ -0,0 +1,1711 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+
+/**
+ * Instances of this class are selectable user interface
+ * objects that allow the user to enter and modify text.
+ * <p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>CANCEL, CENTER, LEFT, MULTI, PASSWORD, SEARCH, SINGLE, RIGHT, READ_ONLY, WRAP</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>DefaultSelection, Modify, Verify</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles MULTI and SINGLE may be specified,
+ * and only one of the styles LEFT, CENTER, and RIGHT may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ */
+public class Text extends Scrollable {
+ int textLimit = LIMIT, tabs = 8;
+ char echoCharacter;
+ boolean doubleClick;
+ String hiddenText, message;
+
+ /**
+ * The maximum number of characters that can be entered
+ * into a text widget.
+ * <p>
+ * Note that this value is platform dependent, based upon
+ * the native widget implementation.
+ * </p>
+ */
+ public static final int LIMIT;
+
+ /**
+ * The delimiter used by multi-line text widgets. When text
+ * is queried and from the widget, it will be delimited using
+ * this delimiter.
+ */
+ public static final String DELIMITER;
+ static final char PASSWORD = '\u2022';
+
+ /*
+ * These values can be different on different platforms.
+ * Therefore they are not initialized in the declaration
+ * to stop the compiler from inlining.
+ */
+ static {
+ LIMIT = 0x7FFFFFFF;
+ DELIMITER = "\r";
+ }
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#SINGLE
+ * @see SWT#MULTI
+ * @see SWT#READ_ONLY
+ * @see SWT#WRAP
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Text (Composite parent, int style) {
+ super (parent, checkStyle (style));
+ if ((style & SWT.SEARCH) != 0) {
+// int inAttributesToSet = (style & SWT.CANCEL) != 0 ? OS.kHISearchFieldAttributesCancel : 0;
+// OS.HISearchFieldChangeAttributes (handle, inAttributesToSet, 0);
+ /*
+ * Ensure that SWT.CANCEL is set.
+ * NOTE: CANCEL has the same value as H_SCROLL so it is
+ * necessary to first clear these bits to avoid a scroll
+ * bar and then reset the bit using the original style
+ * supplied by the programmer.
+ */
+ if ((style & SWT.CANCEL) != 0) this.style |= SWT.CANCEL;
+ }
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver's text is modified, by sending
+ * it one of the messages defined in the <code>ModifyListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ModifyListener
+ * @see #removeModifyListener
+ */
+public void addModifyListener (ModifyListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Modify, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is not called for texts.
+ * <code>widgetDefaultSelected</code> is typically called when ENTER is pressed in a single-line text,
+ * or when ENTER is pressed in a search text. If the receiver has the <code>SWT.SEARCH | SWT.CANCEL</code> style
+ * and the user cancels the search, the event object detail field contains the value <code>SWT.CANCEL</code>.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the control is selected by the user
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener(listener);
+ addListener(SWT.Selection,typedListener);
+ addListener(SWT.DefaultSelection,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver's text is verified, by sending
+ * it one of the messages defined in the <code>VerifyListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see VerifyListener
+ * @see #removeVerifyListener
+ */
+public void addVerifyListener (VerifyListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Verify, typedListener);
+}
+
+/**
+ * Appends a string.
+ * <p>
+ * The new text is appended to the text at
+ * the end of the widget.
+ * </p>
+ *
+ * @param string the string to be appended
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void append (String string) {
+ checkWidget();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (hooks (SWT.Verify) || filters (SWT.Verify)) {
+ int charCount = getCharCount ();
+ string = verifyText (string, charCount, charCount, null);
+ if (string == null) return;
+ }
+ NSString str = NSString.stringWith(string);
+ if ((style & SWT.SINGLE) != 0) {
+// new NSTextFieldCell(((NSTextField)view).cell()).title().
+ } else {
+ NSTextView widget = (NSTextView)view;
+ NSMutableString mutableString = widget.textStorage().mutableString();
+ mutableString.appendString(str);
+ NSRange range = new NSRange();
+ range.location = mutableString.length();
+ widget.scrollRangeToVisible(range);
+ }
+ if (string.length () != 0) sendEvent (SWT.Modify);
+}
+
+static int checkStyle (int style) {
+ if ((style & SWT.SEARCH) != 0) {
+ style |= SWT.SINGLE | SWT.BORDER;
+ style &= ~SWT.PASSWORD;
+ }
+ if ((style & SWT.SINGLE) != 0 && (style & SWT.MULTI) != 0) {
+ style &= ~SWT.MULTI;
+ }
+ style = checkBits (style, SWT.LEFT, SWT.CENTER, SWT.RIGHT, 0, 0, 0);
+ if ((style & SWT.SINGLE) != 0) style &= ~(SWT.H_SCROLL | SWT.V_SCROLL | SWT.WRAP);
+ if ((style & SWT.WRAP) != 0) {
+ style |= SWT.MULTI;
+ style &= ~SWT.H_SCROLL;
+ }
+ if ((style & SWT.MULTI) != 0) style &= ~SWT.PASSWORD;
+ if ((style & (SWT.SINGLE | SWT.MULTI)) != 0) return style;
+ if ((style & (SWT.H_SCROLL | SWT.V_SCROLL)) != 0) return style | SWT.MULTI;
+ return style | SWT.SINGLE;
+}
+
+/**
+ * Clears the selection.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void clearSelection () {
+ checkWidget();
+ Point selection = getSelection ();
+ setSelection (selection.x);
+}
+
+public Point computeSize (int wHint, int hHint, boolean changed) {
+ checkWidget();
+ int width = 0, height = 0;
+ if ((style & SWT.SINGLE) != 0) {
+ NSTextField widget = (NSTextField)view;
+ NSRect oldRect = widget.frame();
+ widget.sizeToFit();
+ NSRect newRect = widget.frame();
+ widget.setFrame (oldRect);
+ width = (int)newRect.width;
+ height = (int)newRect.height;
+ } else {
+ NSTextView widget = (NSTextView)view;
+ NSRect oldRect = widget.frame();
+ widget.sizeToFit();
+ NSRect newRect = widget.frame();
+ widget.setFrame (oldRect);
+ width = (int)newRect.width;
+ height = (int)newRect.height;
+ }
+ if (width <= 0) width = DEFAULT_WIDTH;
+ if (height <= 0) height = DEFAULT_HEIGHT;
+ if (wHint != SWT.DEFAULT) width = wHint;
+ if (hHint != SWT.DEFAULT) height = hHint;
+ Rectangle trim = computeTrim (0, 0, width, height);
+ width = trim.width;
+ height = trim.height;
+ return new Point (width, height);
+}
+
+/**
+ * Copies the selected text.
+ * <p>
+ * The current selection is copied to the clipboard.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void copy () {
+ checkWidget ();
+ if ((style & SWT.SINGLE) != 0) {
+
+ } else {
+ ((NSTextView)view).copy();
+ }
+}
+
+void createHandle () {
+ if ((style & SWT.SINGLE) != 0) {
+ NSTextField widget;
+ if ((style & SWT.PASSWORD) != 0) {
+ widget = (NSTextField)new NSSecureTextField().alloc();
+ } else if ((style & SWT.SEARCH) != 0) {
+ widget = (NSTextField)new NSSearchField().alloc();
+ } else {
+ widget = (NSTextField)new NSTextField().alloc();
+ }
+ widget.initWithFrame(new NSRect());
+ widget.setEditable((style & SWT.READ_ONLY) == 0);
+// widget.setTarget(widget);
+// widget.setAction(OS.sel_sendSelection);
+ widget.setTag(jniRef);
+ view = widget;
+ parent.contentView().addSubview_(widget);
+ } else {
+ style &= ~SWT.HORIZONTAL;
+ SWTScrollView scrollWidget = (SWTScrollView)new SWTScrollView().alloc();
+ scrollWidget.initWithFrame(new NSRect());
+ scrollWidget.setHasVerticalScroller((style & SWT.VERTICAL) != 0);
+ scrollWidget.setHasHorizontalScroller((style & SWT.HORIZONTAL) != 0);
+ scrollWidget.setAutoresizingMask (OS.NSViewWidthSizable | OS.NSViewHeightSizable);
+ scrollWidget.setTag(jniRef);
+
+ SWTTextView widget = (SWTTextView)new SWTTextView().alloc();
+ widget.initWithFrame(new NSRect());
+ widget.setEditable((style & SWT.READ_ONLY) == 0);
+
+ NSSize size = new NSSize ();
+ size.width = size.height = Float.MAX_VALUE;
+ widget.setMaxSize (size);
+ widget.setVerticallyResizable ((style & SWT.VERTICAL) != 0);
+ widget.setHorizontallyResizable ((style & SWT.HORIZONTAL) != 0);
+ int mask = 0;
+ if ((style & SWT.VERTICAL) != 0) mask |= OS.NSViewWidthSizable;
+ if ((style & SWT.HORIZONTAL) != 0) mask |= OS.NSViewHeightSizable;
+ widget.setAutoresizingMask (mask);
+
+ widget.textContainer().setContainerSize (size);
+ if ((style & SWT.VERTICAL) != 0 && (style & SWT.HORIZONTAL) == 0) {
+ widget.textContainer().setWidthTracksTextView (true);
+ }
+ if ((style & SWT.VERTICAL) != 0 && (style & SWT.HORIZONTAL) != 0) {
+ widget.textContainer().setWidthTracksTextView (false);
+ }
+
+// widget.setTarget(widget);
+// widget.setAction(OS.sel_sendSelection);
+ widget.setTag(jniRef);
+
+ view = widget;
+ scrollView = scrollWidget;
+ scrollView.setDocumentView(widget);
+ parent.contentView().addSubview_(scrollView);
+ }
+
+// int [] outControl = new int [1];
+// if ((style & SWT.MULTI) != 0 || (style & (SWT.BORDER | SWT.SEARCH)) == 0) {
+// if ((style & (SWT.H_SCROLL | SWT.V_SCROLL)) != 0) {
+// int options = 0;
+// if ((style & (SWT.H_SCROLL | SWT.V_SCROLL)) == (SWT.H_SCROLL | SWT.V_SCROLL)) options |= OS.kHIScrollViewOptionsAllowGrow;
+// if ((style & SWT.H_SCROLL) != 0) options |= OS.kHIScrollViewOptionsHorizScroll;
+// if ((style & SWT.V_SCROLL) != 0) options |= OS.kHIScrollViewOptionsVertScroll;
+// OS.HIScrollViewCreate (options, outControl);
+// if (outControl [0] == 0) error (SWT.ERROR_NO_HANDLES);
+// scrolledHandle = outControl [0];
+// OS.HIViewSetVisible (scrolledHandle, true);
+// }
+// int iFrameOptions = OS.kTXNDontDrawCaretWhenInactiveMask | OS.kTXNMonostyledTextMask;
+// /*
+// * Bug in the Macintosh. For some reason a single line text does not
+// * display properly when it is right aligned. The fix is to use a
+// * multi line text when right aligned.
+// */
+// if ((style & SWT.RIGHT) == 0) {
+// if ((style & SWT.SINGLE) != 0) iFrameOptions |= OS.kTXNSingleLineOnlyMask;
+// }
+// if ((style & SWT.WRAP) != 0) iFrameOptions |= OS.kTXNAlwaysWrapAtViewEdgeMask;
+// OS.HITextViewCreate (null, 0, iFrameOptions, outControl);
+// if (outControl [0] == 0) error (SWT.ERROR_NO_HANDLES);
+// handle = outControl [0];
+// OS.HIViewSetVisible (handle, true);
+// if ((style & SWT.MULTI) != 0 && (style & SWT.BORDER) != 0) {
+// int features = OS.kControlSupportsEmbedding;
+// OS.CreateUserPaneControl (0, null, features, outControl);
+// if (outControl [0] == 0) error (SWT.ERROR_NO_HANDLES);
+// frameHandle = outControl [0];
+// }
+// txnObject = OS.HITextViewGetTXNObject (handle);
+// int ptr = OS.NewPtr (Rect.sizeof);
+// Rect rect = (style & SWT.SINGLE) != 0 ? inset () : new Rect ();
+// OS.memmove (ptr, rect, Rect.sizeof);
+// int [] tags = new int [] {
+// OS.kTXNDisableDragAndDropTag,
+// OS.kTXNDoFontSubstitution,
+// OS.kTXNIOPrivilegesTag,
+// OS.kTXNMarginsTag,
+// OS.kTXNJustificationTag,
+// };
+// int just = OS.kTXNFlushLeft;
+// if ((style & SWT.CENTER) != 0) just = OS.kTXNCenter;
+// if ((style & SWT.RIGHT) != 0) just = OS.kTXNFlushRight;
+// int [] datas = new int [] {
+// 1,
+// 1,
+// (style & SWT.READ_ONLY) != 0 ? 1 : 0,
+// ptr,
+// just,
+// };
+// OS.TXNSetTXNObjectControls (txnObject, false, tags.length, tags, datas);
+// OS.DisposePtr (ptr);
+// } else {
+// if ((style & SWT.SEARCH) != 0) {
+// int attributes = (style & SWT.CANCEL) != 0 ? OS.kHISearchFieldAttributesCancel : 0;
+// OS.HISearchFieldCreate (null, attributes, 0, 0, outControl);
+// } else {
+// int window = OS.GetControlOwner (parent.handle);
+// OS.CreateEditUnicodeTextControl (window, null, 0, (style & SWT.PASSWORD) != 0, null, outControl);
+// }
+// if (outControl [0] == 0) error (SWT.ERROR_NO_HANDLES);
+// handle = outControl [0];
+// if ((style & SWT.SEARCH) != 0 && display.smallFonts) {
+// OS.SetControlData (handle, OS.kControlEntireControl, OS.kControlSizeTag, 2, new short [] {OS.kControlSizeSmall});
+// }
+// /*
+// * Bug in the Macintosh. For some reason a single line text does not
+// * display selection properly when it is right aligned. The fix is to use a
+// * multi line text when right aligned.
+// */
+// if ((style & SWT.RIGHT) == 0) {
+// OS.SetControlData (handle, OS.kControlEntireControl, OS.kControlEditTextSingleLineTag, 1, new byte [] {1});
+// }
+// if ((style & SWT.READ_ONLY) != 0) {
+// OS.SetControlData (handle, OS.kControlEntireControl, OS.kControlEditTextLockedTag, 1, new byte [] {1});
+// }
+// if ((style & (SWT.RIGHT | SWT.CENTER)) != 0) {
+// ControlFontStyleRec fontStyle = new ControlFontStyleRec ();
+// fontStyle.flags |= OS.kControlUseJustMask;
+// if ((style & SWT.CENTER) != 0) fontStyle.just = OS.teJustCenter;
+// if ((style & SWT.RIGHT) != 0) fontStyle.just = OS.teJustRight;
+// OS.SetControlFontStyle (handle, fontStyle);
+// }
+// if ((style & SWT.SEARCH) != 0) {
+// OS.HIViewSetVisible (handle, true);
+// }
+// }
+}
+
+void createWidget () {
+ super.createWidget ();
+ doubleClick = true;
+ message = "";
+}
+
+/**
+ * Cuts the selected text.
+ * <p>
+ * The current selection is first copied to the
+ * clipboard and then deleted from the widget.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void cut () {
+ checkWidget();
+ if ((style & SWT.READ_ONLY) != 0) return;
+ if ((style & SWT.SINGLE) != 0) {
+
+ } else {
+ ((NSTextView)view).cut(null);
+ }
+// boolean cut = true;
+// char [] oldText = null;
+// Point oldSelection = getSelection ();
+// if (hooks (SWT.Verify) || filters (SWT.Verify)) {
+// if (oldSelection.x != oldSelection.y) {
+// oldText = getEditText (oldSelection.x, oldSelection.y - 1);
+// String newText = verifyText ("", oldSelection.x, oldSelection.y, null);
+// if (newText == null) return;
+// if (newText.length () != 0) {
+// copyToClipboard (oldText);
+// if (txnObject == 0) {
+// insertEditText (newText);
+// } else {
+// setTXNText (OS.kTXNUseCurrentSelection, OS.kTXNUseCurrentSelection, newText);
+// OS.TXNShowSelection (txnObject, false);
+// }
+// cut = false;
+// }
+// }
+// }
+// if (cut) {
+// if (txnObject == 0) {
+// if (oldText == null) oldText = getEditText (oldSelection.x, oldSelection.y - 1);
+// copyToClipboard (oldText);
+// insertEditText ("");
+// } else {
+// OS.TXNCut (txnObject);
+//
+// /*
+// * Feature in the Macintosh. When an empty string is set in the TXNObject,
+// * the font attributes are cleared. The fix is to reset them.
+// */
+// if (OS.TXNDataSize (txnObject) / 2 == 0) setFontStyle (font);
+// }
+// }
+// Point newSelection = getSelection ();
+// if (!cut || !oldSelection.equals (newSelection)) sendEvent (SWT.Modify);
+}
+
+Color defaultBackground () {
+ return display.getSystemColor (SWT.COLOR_LIST_BACKGROUND);
+}
+
+Color defaultForeground () {
+ return display.getSystemColor (SWT.COLOR_LIST_FOREGROUND);
+}
+
+boolean dragDetect (int x, int y, boolean filter, boolean [] consume) {
+ if (filter) {
+ Point selection = getSelection ();
+ if (selection.x != selection.y) {
+ int position = getPosition (x, y);
+ if (selection.x <= position && position < selection.y) {
+ if (super.dragDetect (x, y, filter, consume)) {
+ if (consume != null) consume [0] = true;
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ return super.dragDetect (x, y, filter, consume);
+}
+
+/**
+ * Returns the line number of the caret.
+ * <p>
+ * The line number of the caret is returned.
+ * </p>
+ *
+ * @return the line number
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getCaretLineNumber () {
+ checkWidget();
+ if ((style & SWT.SINGLE) != 0) return 0;
+ return (getTopPixel () + getCaretLocation ().y) / getLineHeight ();
+}
+
+/**
+ * Returns a point describing the receiver's location relative
+ * to its parent (or its display if its parent is null).
+ * <p>
+ * The location of the caret is returned.
+ * </p>
+ *
+ * @return a point, the location of the caret
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getCaretLocation () {
+ checkWidget();
+ if ((style & SWT.SINGLE) != 0) {
+ //TODO - caret location for unicode text
+ return new Point (0, 0);
+ }
+// NSText
+ NSRange range = ((NSTextView)view).selectedRange();
+ System.out.println(range.location + " " + range.length);
+ return null;
+}
+
+/**
+ * Returns the character position of the caret.
+ * <p>
+ * Indexing is zero based.
+ * </p>
+ *
+ * @return the position of the caret
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getCaretPosition () {
+ checkWidget();
+ if ((style & SWT.SINGLE) != 0) {
+ //TODO
+ return 0;
+ } else {
+ NSRange range = ((NSTextView)view).selectedRange();
+ return range.location;
+ }
+}
+
+/**
+ * Returns the number of characters.
+ *
+ * @return number of characters in the widget
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getCharCount () {
+ checkWidget ();
+ if ((style & SWT.SINGLE) != 0) {
+ return new NSCell(((NSControl)view).cell()).title().length();
+ } else {
+ //TODO
+ return 0;
+ }
+}
+
+/**
+ * Returns the double click enabled flag.
+ * <p>
+ * The double click flag enables or disables the
+ * default action of the text widget when the user
+ * double clicks.
+ * </p>
+ *
+ * @return whether or not double click is enabled
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getDoubleClickEnabled () {
+ checkWidget();
+ return doubleClick;
+}
+
+/**
+ * Returns the echo character.
+ * <p>
+ * The echo character is the character that is
+ * displayed when the user enters text or the
+ * text is changed by the programmer.
+ * </p>
+ *
+ * @return the echo character
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setEchoChar
+ */
+public char getEchoChar () {
+ checkWidget();
+ return echoCharacter;
+}
+
+/**
+ * Returns the editable state.
+ *
+ * @return whether or not the receiver is editable
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getEditable () {
+ checkWidget();
+ return (style & SWT.READ_ONLY) == 0;
+}
+
+/**
+ * Returns the number of lines.
+ *
+ * @return the number of lines in the widget
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getLineCount () {
+ checkWidget();
+ if ((style & SWT.SINGLE) != 0) return 1;
+ return ((NSTextView)view).textStorage().paragraphs().count();
+}
+
+/**
+ * Returns the line delimiter.
+ *
+ * @return a string that is the line delimiter
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #DELIMITER
+ */
+public String getLineDelimiter () {
+ checkWidget();
+ return DELIMITER;
+}
+
+/**
+ * Returns the height of a line.
+ *
+ * @return the height of a row of text
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getLineHeight () {
+ checkWidget();
+ //TODO
+ return 16;
+}
+
+/**
+ * Returns the orientation of the receiver, which will be one of the
+ * constants <code>SWT.LEFT_TO_RIGHT</code> or <code>SWT.RIGHT_TO_LEFT</code>.
+ *
+ * @return the orientation style
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public int getOrientation () {
+ checkWidget();
+ return style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT);
+}
+
+/**
+ * Returns the widget message. When the widget is created
+ * with the style <code>SWT.SEARCH</code>, the message text
+ * is displayed as a hint for the user, indicating the
+ * purpose of the field.
+ * <p>
+ * Note: This operation is a <em>HINT</em> and is not
+ * supported on platforms that do not have this concept.
+ * </p>
+ *
+ * @return the widget message
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public String getMessage () {
+ checkWidget ();
+ return message;
+}
+
+int getPosition (int x, int y) {
+// checkWidget ();
+ //TODO
+ return 0;
+}
+
+public int getPosition (Point point) {
+ checkWidget ();
+ if (point == null) error (SWT.ERROR_NULL_ARGUMENT);
+ return getPosition (point.x, point.y);
+}
+
+/**
+ * Returns a <code>Point</code> whose x coordinate is the
+ * character position representing the start of the selected
+ * text, and whose y coordinate is the character position
+ * representing the end of the selection. An "empty" selection
+ * is indicated by the x and y coordinates having the same value.
+ * <p>
+ * Indexing is zero based. The range of a selection is from
+ * 0..N where N is the number of characters in the widget.
+ * </p>
+ *
+ * @return a point representing the selection start and end
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Point getSelection () {
+ checkWidget();
+ if ((style & SWT.SINGLE) != 0) {
+// new NSTextFieldCell(((NSTextField)view).cell()).title().
+ return new Point(0, 0);
+ } else {
+ NSTextView widget = (NSTextView)view;
+ NSRange range = widget.selectedRange();
+ return new Point(range.location, range.location + range.length);
+ }
+}
+
+/**
+ * Returns the number of selected characters.
+ *
+ * @return the number of selected characters.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelectionCount () {
+ checkWidget();
+ if ((style & SWT.SINGLE) != 0) {
+// new NSTextFieldCell(((NSTextField)view).cell()).title().
+ return -1;
+ } else {
+ NSTextView widget = (NSTextView)view;
+ NSRange range = widget.selectedRange();
+ return range.length;
+ }
+}
+
+/**
+ * Gets the selected text, or an empty string if there is no current selection.
+ *
+ * @return the selected text
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getSelectionText () {
+ checkWidget();
+ if ((style & SWT.SINGLE) != 0) {
+ //TODO
+ return "";
+ } else {
+ NSTextView widget = (NSTextView)view;
+ NSRange range = widget.selectedRange();
+ NSString str = widget.textStorage().string();
+ char[] buffer = new char[range.length];
+ str.getCharacters_range_(buffer, range);
+ return new String(buffer);
+ }
+}
+
+/**
+ * Returns the number of tabs.
+ * <p>
+ * Tab stop spacing is specified in terms of the
+ * space (' ') character. The width of a single
+ * tab stop is the pixel width of the spaces.
+ * </p>
+ *
+ * @return the number of tab characters
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getTabs () {
+ checkWidget();
+ return tabs;
+}
+
+/**
+ * Returns the widget text.
+ * <p>
+ * The text for a text widget is the characters in the widget, or
+ * an empty string if this has never been set.
+ * </p>
+ *
+ * @return the widget text
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText () {
+ checkWidget();
+ NSString str;
+ if ((style & SWT.SINGLE) != 0) {
+ str = new NSTextFieldCell(((NSTextField)view).cell()).title();
+
+ } else {
+ str = ((NSTextView)view).textStorage().string();
+ }
+ if (str == null) return "";
+ char[] buffer = new char[str.length()];
+ str.getCharacters_(buffer);
+ return new String(buffer);
+}
+
+/**
+ * Returns a range of text. Returns an empty string if the
+ * start of the range is greater than the end.
+ * <p>
+ * Indexing is zero based. The range of
+ * a selection is from 0..N-1 where N is
+ * the number of characters in the widget.
+ * </p>
+ *
+ * @param start the start of the range
+ * @param end the end of the range
+ * @return the range of text
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getText (int start, int end) {
+ checkWidget ();
+ NSString str;
+ if ((style & SWT.SINGLE) != 0) {
+ str = new NSTextFieldCell(((NSTextField)view).cell()).title();
+
+ } else {
+ str = null;
+// return getTXNText (OS.kTXNStartOffset, OS.kTXNEndOffset);
+ }
+ if (str == null) return "";
+ char[] buffer = new char[str.length()];
+ str.getCharacters_(buffer);
+ return new String(buffer, start, end - start);
+}
+
+/**
+ * Returns the maximum number of characters that the receiver is capable of holding.
+ * <p>
+ * If this has not been changed by <code>setTextLimit()</code>,
+ * it will be the constant <code>Text.LIMIT</code>.
+ * </p>
+ *
+ * @return the text limit
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #LIMIT
+ */
+public int getTextLimit () {
+ checkWidget();
+ return textLimit;
+}
+
+/**
+ * Returns the zero-relative index of the line which is currently
+ * at the top of the receiver.
+ * <p>
+ * This index can change when lines are scrolled or new lines are added or removed.
+ * </p>
+ *
+ * @return the index of the top line
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getTopIndex () {
+ checkWidget();
+ if ((style & SWT.SINGLE) != 0) return 0;
+ return getTopPixel () / getLineHeight ();
+}
+
+/**
+ * Returns the top pixel.
+ * <p>
+ * The top pixel is the pixel position of the line
+ * that is currently at the top of the widget. On
+ * some platforms, a text widget can be scrolled by
+ * pixels instead of lines so that a partial line
+ * is displayed at the top of the widget.
+ * </p><p>
+ * The top pixel changes when the widget is scrolled.
+ * The top pixel does not include the widget trimming.
+ * </p>
+ *
+ * @return the pixel position of the top line
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getTopPixel () {
+ checkWidget();
+ if ((style & SWT.SINGLE) != 0) return 0;
+ //TODO
+ return 0;
+}
+
+/**
+ * Inserts a string.
+ * <p>
+ * The old selection is replaced with the new text.
+ * </p>
+ *
+ * @param string the string
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is <code>null</code></li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void insert (String string) {
+ checkWidget();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (hooks (SWT.Verify) || filters (SWT.Verify)) {
+ Point selection = getSelection ();
+ string = verifyText (string, selection.x, selection.y, null);
+ if (string == null) return;
+ }
+ if ((style & SWT.SINGLE) != 0) {
+// new NSTextFieldCell(((NSTextField)view).cell()).title().
+ } else {
+ //
+ NSString str = NSString.stringWith(string);
+ NSTextView widget = (NSTextView)view;
+ NSRange range = widget.selectedRange();
+ widget.textStorage().replaceCharactersInRange_withString_(range, str);
+ }
+ if (string.length () != 0) sendEvent (SWT.Modify);
+}
+
+/**
+ * Pastes text from clipboard.
+ * <p>
+ * The selected text is deleted from the widget
+ * and new text inserted from the clipboard.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void paste () {
+ checkWidget();
+ if ((style & SWT.READ_ONLY) != 0) return;
+// boolean paste = true;
+// String oldText = null;
+// if (hooks (SWT.Verify) || filters (SWT.Verify)) {
+// oldText = getClipboardText ();
+// if (oldText != null) {
+// Point selection = getSelection ();
+// String newText = verifyText (oldText, selection.x, selection.y, null);
+// if (newText == null) return;
+// if (!newText.equals (oldText)) {
+// if (txnObject == 0) {
+// insertEditText (newText);
+// } else {
+// setTXNText (OS.kTXNUseCurrentSelection, OS.kTXNUseCurrentSelection, newText);
+// OS.TXNShowSelection (txnObject, false);
+// }
+// paste = false;
+// }
+// }
+// }
+// if (paste) {
+// if (txnObject == 0) {
+// if (oldText == null) oldText = getClipboardText ();
+// insertEditText (oldText);
+// } else {
+// if (textLimit != LIMIT) {
+// if (oldText == null) oldText = getClipboardText ();
+// setTXNText (OS.kTXNUseCurrentSelection, OS.kTXNUseCurrentSelection, oldText);
+// OS.TXNShowSelection (txnObject, false);
+// } else {
+// OS.TXNPaste (txnObject);
+// }
+// }
+// }
+// sendEvent (SWT.Modify);
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ hiddenText = message = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the receiver's text is modified.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ModifyListener
+ * @see #addModifyListener
+ */
+public void removeModifyListener (ModifyListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Modify, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook(SWT.Selection, listener);
+ eventTable.unhook(SWT.DefaultSelection,listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is verified.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see VerifyListener
+ * @see #addVerifyListener
+ */
+public void removeVerifyListener (VerifyListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Verify, listener);
+}
+
+/**
+ * Selects all the text in the receiver.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void selectAll () {
+ checkWidget();
+ if ((style & SWT.SINGLE) != 0) {
+ setSelection (0, getCharCount ());
+ } else {
+ ((NSTextView)view).selectAll(null);
+ }
+}
+
+boolean sendKeyEvent (int type, Event event) {
+ if (!super.sendKeyEvent (type, event)) {
+ return false;
+ }
+ if (type != SWT.KeyDown) return true;
+ if ((style & SWT.READ_ONLY) != 0) return true;
+ if (event.character == 0) return true;
+ if ((event.stateMask & SWT.COMMAND) != 0) return true;
+ String oldText = "";
+ int charCount = getCharCount ();
+ Point selection = getSelection ();
+ int start = selection.x, end = selection.y;
+ switch (event.character) {
+ case SWT.BS:
+ if (start == end) {
+ if (start == 0) return true;
+ start = Math.max (0, start - 1);
+ }
+ break;
+ case SWT.DEL:
+ if (start == end) {
+ if (start == charCount) return true;
+ end = Math.min (end + 1, charCount);
+ }
+ break;
+ case SWT.CR:
+ if ((style & SWT.SINGLE) != 0) return true;
+ oldText = DELIMITER;
+ break;
+ default:
+ if (event.character != '\t' && event.character < 0x20) return true;
+ oldText = new String (new char [] {event.character});
+ }
+ String newText = verifyText (oldText, start, end, event);
+ if (newText == null) return false;
+ if (charCount - (end - start) + newText.length () > textLimit) {
+ return false;
+ }
+ boolean result = newText == oldText;
+ if (newText != oldText || hiddenText != null) {
+// if (txnObject == 0) {
+// String text = new String (getEditText (0, -1));
+// String leftText = text.substring (0, start);
+// String rightText = text.substring (end, text.length ());
+// setEditText (leftText + newText + rightText);
+// start += newText.length ();
+// setSelection (new Point (start, start));
+// result = false;
+// } else {
+// setTXNText (start, end, newText);
+// }
+ }
+ /*
+ * Post the modify event so that the character will be inserted
+ * into the widget when the modify event is delivered. Normally,
+ * modify events are sent but it is safe to post the event here
+ * because this method is called from the event loop.
+ */
+ postEvent (SWT.Modify);
+ return result;
+}
+
+/**
+ * Sets the double click enabled flag.
+ * <p>
+ * The double click flag enables or disables the
+ * default action of the text widget when the user
+ * double clicks.
+ * </p><p>
+ * Note: This operation is a hint and is not supported on
+ * platforms that do not have this concept.
+ * </p>
+ *
+ * @param doubleClick the new double click flag
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setDoubleClickEnabled (boolean doubleClick) {
+ checkWidget();
+ this.doubleClick = doubleClick;
+}
+
+/**
+ * Sets the echo character.
+ * <p>
+ * The echo character is the character that is
+ * displayed when the user enters text or the
+ * text is changed by the programmer. Setting
+ * the echo character to '\0' clears the echo
+ * character and redraws the original text.
+ * If for any reason the echo character is invalid,
+ * or if the platform does not allow modification
+ * of the echo character, the default echo character
+ * for the platform is used.
+ * </p>
+ *
+ * @param echo the new echo character
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setEchoChar (char echo) {
+ checkWidget();
+ if ((style & SWT.MULTI) != 0) return;
+// if (txnObject == 0) {
+// if ((style & SWT.PASSWORD) == 0) {
+// Point selection = getSelection ();
+// String text = getText ();
+// echoCharacter = echo;
+// setEditText (text);
+// setSelection (selection);
+// }
+// } else {
+// OS.TXNEchoMode (txnObject, echo, OS.kTextEncodingMacUnicode, echo != '\0');
+// }
+ echoCharacter = echo;
+}
+
+/**
+ * Sets the editable state.
+ *
+ * @param editable the new editable state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setEditable (boolean editable) {
+ checkWidget();
+ if (editable) {
+ style &= ~SWT.READ_ONLY;
+ } else {
+ style |= SWT.READ_ONLY;
+ }
+ if ((style & SWT.SINGLE) != 0) {
+ ((NSTextField)view).setEditable(editable);
+ } else {
+ ((NSTextView)view).setEditable(editable);
+ }
+}
+
+/**
+ * Sets the orientation of the receiver, which must be one
+ * of the constants <code>SWT.LEFT_TO_RIGHT</code> or <code>SWT.RIGHT_TO_LEFT</code>.
+ * <p>
+ * Note: This operation is a hint and is not supported on
+ * platforms that do not have this concept.
+ * </p>
+ *
+ * @param orientation new orientation style
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1.2
+ */
+public void setOrientation (int orientation) {
+ checkWidget();
+}
+
+/**
+ * Sets the widget message. When the widget is created
+ * with the style <code>SWT.SEARCH</code>, the message text
+ * is displayed as a hint for the user, indicating the
+ * purpose of the field.
+ * <p>
+ * Note: This operation is a <em>HINT</em> and is not
+ * supported on platforms that do not have this concept.
+ * </p>
+ *
+ * @param message the new message
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the message is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public void setMessage (String message) {
+ checkWidget ();
+ if (message == null) error (SWT.ERROR_NULL_ARGUMENT);
+ this.message = message;
+// if ((style & SWT.SEARCH) != 0) {
+// char [] buffer = new char [message.length ()];
+// message.getChars (0, buffer.length, buffer, 0);
+// int ptr = OS.CFStringCreateWithCharacters (OS.kCFAllocatorDefault, buffer, buffer.length);
+// if (ptr == 0) error (SWT.ERROR_CANNOT_SET_TEXT);
+// OS.HISearchFieldSetDescriptiveText (handle, ptr);
+// OS.CFRelease (ptr);
+// }
+}
+
+/**
+ * Sets the selection.
+ * <p>
+ * Indexing is zero based. The range of
+ * a selection is from 0..N where N is
+ * the number of characters in the widget.
+ * </p><p>
+ * Text selections are specified in terms of
+ * caret positions. In a text widget that
+ * contains N characters, there are N+1 caret
+ * positions, ranging from 0..N. This differs
+ * from other functions that address character
+ * position such as getText () that use the
+ * regular array indexing rules.
+ * </p>
+ *
+ * @param start new caret position
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (int start) {
+ checkWidget();
+ setSelection (start, start);
+}
+
+/**
+ * Sets the selection to the range specified
+ * by the given start and end indices.
+ * <p>
+ * Indexing is zero based. The range of
+ * a selection is from 0..N where N is
+ * the number of characters in the widget.
+ * </p><p>
+ * Text selections are specified in terms of
+ * caret positions. In a text widget that
+ * contains N characters, there are N+1 caret
+ * positions, ranging from 0..N. This differs
+ * from other functions that address character
+ * position such as getText () that use the
+ * usual array indexing rules.
+ * </p>
+ *
+ * @param start the start of the range
+ * @param end the end of the range
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (int start, int end) {
+ checkWidget();
+ if ((style & SWT.SINGLE) != 0) {
+// int length = getCharCount ();
+// ControlEditTextSelectionRec selection = new ControlEditTextSelectionRec ();
+// selection.selStart = (short) Math.min (Math.max (Math.min (start, end), 0), length);
+// selection.selEnd = (short) Math.min (Math.max (Math.max (start, end), 0), length);
+// if (hasFocus ()) {
+// OS.SetControlData (handle, OS.kControlEntireControl, OS.kControlEditTextSelectionTag, 4, selection);
+// } else {
+// this.selection = selection;
+// }
+ } else {
+ //TODO - range test
+ NSRange range = new NSRange ();
+ range.location = start;
+ range.length = end - start + 1;
+ ((NSTextView)view).setSelectedRange (range);
+ }
+}
+
+/**
+ * Sets the selection to the range specified
+ * by the given point, where the x coordinate
+ * represents the start index and the y coordinate
+ * represents the end index.
+ * <p>
+ * Indexing is zero based. The range of
+ * a selection is from 0..N where N is
+ * the number of characters in the widget.
+ * </p><p>
+ * Text selections are specified in terms of
+ * caret positions. In a text widget that
+ * contains N characters, there are N+1 caret
+ * positions, ranging from 0..N. This differs
+ * from other functions that address character
+ * position such as getText () that use the
+ * usual array indexing rules.
+ * </p>
+ *
+ * @param selection the point
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (Point selection) {
+ checkWidget();
+ if (selection == null) error (SWT.ERROR_NULL_ARGUMENT);
+ setSelection (selection.x, selection.y);
+}
+
+/**
+ * Sets the number of tabs.
+ * <p>
+ * Tab stop spacing is specified in terms of the
+ * space (' ') character. The width of a single
+ * tab stop is the pixel width of the spaces.
+ * </p>
+ *
+ * @param tabs the number of tabs
+ *
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setTabs (int tabs) {
+ checkWidget();
+ if (this.tabs == tabs) return;
+// if (txnObject == 0) return;
+// this.tabs = tabs;
+// TXNTab tab = new TXNTab ();
+// tab.value = (short) (textExtent (new char[]{' '}, 0).x * tabs);
+// int [] tags = new int [] {OS.kTXNTabSettingsTag};
+// int [] datas = new int [1];
+// OS.memmove (datas, tab, TXNTab.sizeof);
+// OS.TXNSetTXNObjectControls (txnObject, false, tags.length, tags, datas);
+}
+
+/**
+ * Sets the contents of the receiver to the given string. If the receiver has style
+ * SINGLE and the argument contains multiple lines of text, the result of this
+ * operation is undefined and may vary from platform to platform.
+ *
+ * @param string the new text
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+ checkWidget();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (hooks (SWT.Verify) || filters (SWT.Verify)) {
+ string = verifyText (string, 0, getCharCount (), null);
+ if (string == null) return;
+ }
+ NSString str = NSString.stringWith(string);
+ if ((style & SWT.SINGLE) != 0) {
+ new NSCell(((NSTextField)view).cell()).setTitle(str);
+ } else {
+ ((NSTextView)view).setString(str);
+ }
+ sendEvent (SWT.Modify);
+}
+
+/**
+ * Sets the maximum number of characters that the receiver
+ * is capable of holding to be the argument.
+ * <p>
+ * Instead of trying to set the text limit to zero, consider
+ * creating a read-only text widget.
+ * </p><p>
+ * To reset this value to the default, use <code>setTextLimit(Text.LIMIT)</code>.
+ * Specifying a limit value larger than <code>Text.LIMIT</code> sets the
+ * receiver's limit to <code>Text.LIMIT</code>.
+ * </p>
+ *
+ * @param limit new text limit
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_CANNOT_BE_ZERO - if the limit is zero</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #LIMIT
+ */
+public void setTextLimit (int limit) {
+ checkWidget();
+ if (limit == 0) error (SWT.ERROR_CANNOT_BE_ZERO);
+ textLimit = limit;
+}
+
+/**
+ * Sets the zero-relative index of the line which is currently
+ * at the top of the receiver. This index can change when lines
+ * are scrolled or new lines are added and removed.
+ *
+ * @param index the index of the top item
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setTopIndex (int index) {
+ checkWidget();
+ if ((style & SWT.SINGLE) != 0) return;
+ //TODO no working
+ NSTextView widget = (NSTextView)view;
+ NSRange range = new NSRange();
+ NSRect rect = widget.firstRectForCharacterRange(range);
+ view.scrollRectToVisible(rect);
+}
+
+/**
+ * Shows the selection.
+ * <p>
+ * If the selection is already showing
+ * in the receiver, this method simply returns. Otherwise,
+ * lines are scrolled until the selection is visible.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void showSelection () {
+ checkWidget();
+ if ((style & SWT.SINGLE) != 0) {
+ setSelection (getSelection());
+ } else {
+ NSTextView widget = (NSTextView)view;
+ widget.scrollRangeToVisible(widget.selectedRange());
+ }
+}
+
+int traversalCode (int key, int theEvent) {
+ int bits = super.traversalCode (key, theEvent);
+ if ((style & SWT.READ_ONLY) != 0) return bits;
+ if ((style & SWT.MULTI) != 0) {
+ bits &= ~SWT.TRAVERSE_RETURN;
+// if (key == 48 /* Tab */ && theEvent != 0) {
+// int [] modifiers = new int [1];
+// OS.GetEventParameter (theEvent, OS.kEventParamKeyModifiers, OS.typeUInt32, null, 4, null, modifiers);
+// boolean next = (modifiers [0] & OS.shiftKey) == 0;
+// if (next && (modifiers [0] & OS.controlKey) == 0) {
+// bits &= ~(SWT.TRAVERSE_TAB_NEXT | SWT.TRAVERSE_TAB_PREVIOUS);
+// }
+// }
+ }
+ return bits;
+}
+
+String verifyText (String string, int start, int end, Event keyEvent) {
+ Event event = new Event ();
+ event.text = string;
+ event.start = start;
+ event.end = end;
+ if (keyEvent != null) {
+ event.character = keyEvent.character;
+ event.keyCode = keyEvent.keyCode;
+ event.stateMask = keyEvent.stateMask;
+ }
+ /*
+ * It is possible (but unlikely), that application
+ * code could have disposed the widget in the verify
+ * event. If this happens, answer null to cancel
+ * the operation.
+ */
+ sendEvent (SWT.Verify, event);
+ if (!event.doit || isDisposed ()) return null;
+ return event.text;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java
new file mode 100755
index 0000000000..ced71c4740
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolBar.java
@@ -0,0 +1,447 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+
+/**
+ * Instances of this class support the layout of selectable
+ * tool bar items.
+ * <p>
+ * The item children that may be added to instances of this class
+ * must be of type <code>ToolItem</code>.
+ * </p><p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to add <code>Control</code> children to it,
+ * or set a layout on it.
+ * </p><p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>FLAT, WRAP, RIGHT, HORIZONTAL, VERTICAL, SHADOW_OUT</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles HORIZONTAL and VERTICAL may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ */
+public class ToolBar extends Composite {
+ int itemCount;
+ ToolItem [] items;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#FLAT
+ * @see SWT#WRAP
+ * @see SWT#RIGHT
+ * @see SWT#HORIZONTAL
+ * @see SWT#SHADOW_OUT
+ * @see SWT#VERTICAL
+ * @see Widget#checkSubclass()
+ * @see Widget#getStyle()
+ */
+public ToolBar (Composite parent, int style) {
+ super (parent, checkStyle (style));
+
+ /*
+ * Ensure that either of HORIZONTAL or VERTICAL is set.
+ * NOTE: HORIZONTAL and VERTICAL have the same values
+ * as H_SCROLL and V_SCROLL so it is necessary to first
+ * clear these bits to avoid scroll bars and then reset
+ * the bits using the original style supplied by the
+ * programmer.
+ */
+ if ((style & SWT.VERTICAL) != 0) {
+ this.style |= SWT.VERTICAL;
+ } else {
+ this.style |= SWT.HORIZONTAL;
+ }
+}
+
+static int checkStyle (int style) {
+ /*
+ * Even though it is legal to create this widget
+ * with scroll bars, they serve no useful purpose
+ * because they do not automatically scroll the
+ * widget's client area. The fix is to clear
+ * the SWT style.
+ */
+ return style & ~(SWT.H_SCROLL | SWT.V_SCROLL);
+}
+
+protected void checkSubclass () {
+ if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+public Point computeSize (int wHint, int hHint, boolean changed) {
+ checkWidget();
+ int width = wHint, height = hHint;
+ if (wHint == SWT.DEFAULT) width = 0x7FFFFFFF;
+ if (hHint == SWT.DEFAULT) height = 0x7FFFFFFF;
+ int [] result = layout (width, height, false);
+ Point extent = new Point (result [1], result [2]);
+ if (wHint != SWT.DEFAULT) extent.x = wHint;
+ if (hHint != SWT.DEFAULT) extent.y = hHint;
+ return extent;
+}
+
+void createHandle () {
+ SWTView widget = (SWTView)new SWTView().alloc();
+ widget.initWithFrame(new NSRect());
+// widget.setDrawsBackground(false);
+ widget.setTag(jniRef);
+ view = widget;
+ parent.contentView().addSubview_(widget);
+}
+
+void createItem (ToolItem item, int index) {
+ if (!(0 <= index && index <= itemCount)) error (SWT.ERROR_INVALID_RANGE);
+ if (itemCount == items.length) {
+ ToolItem [] newItems = new ToolItem [itemCount + 4];
+ System.arraycopy (items, 0, newItems, 0, items.length);
+ items = newItems;
+ }
+ item.createJNIRef ();
+ if ((item.style & SWT.SEPARATOR) != 0) {
+ SWTBox widget = (SWTBox)new SWTBox().alloc();
+ widget.initWithFrame(new NSRect());
+ widget.setBoxType(OS.NSBoxSeparator);
+ widget.setTag(item.jniRef);
+ item.view = widget;
+ } else {
+ NSButton widget = (NSButton)new SWTButton().alloc();
+ widget.initWithFrame(new NSRect());
+// widget.setBordered((style & SWT.FLAT) == 0);
+ widget.setBordered(false);
+ widget.setAction(OS.sel_sendSelection);
+ widget.setTarget(widget);
+ widget.setTag(item.jniRef);
+ widget.setImagePosition(OS.NSImageOverlaps);
+ widget.setTitle(NSString.stringWith(""));
+ item.view = widget;
+ }
+ view.addSubview_(item.view);
+ System.arraycopy (items, index, items, index + 1, itemCount++ - index);
+ items [index] = item;
+ relayout ();
+}
+
+void createWidget () {
+ super.createWidget ();
+ items = new ToolItem [4];
+ itemCount = 0;
+}
+
+void destroyItem (ToolItem item) {
+ int index = 0;
+ while (index < itemCount) {
+ if (items [index] == item) break;
+ index++;
+ }
+ if (index == itemCount) return;
+ System.arraycopy (items, index + 1, items, index, --itemCount - index);
+ items [itemCount] = null;
+ NSView nsItem = item.view;
+ nsItem.removeFromSuperview();
+ item.view = null;
+ relayout ();
+}
+
+public Rectangle getClientArea () {
+ checkWidget();
+ NSRect rect = view.bounds();
+ return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+}
+
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public ToolItem getItem (int index) {
+ checkWidget();
+ if (0 <= index && index < itemCount) return items [index];
+ error (SWT.ERROR_INVALID_RANGE);
+ return null;
+}
+
+/**
+ * Returns the item at the given point in the receiver
+ * or null if no such item exists. The point is in the
+ * coordinate system of the receiver.
+ *
+ * @param point the point used to locate the item
+ * @return the item at the given point
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public ToolItem getItem (Point pt) {
+ checkWidget();
+ if (pt == null) error (SWT.ERROR_NULL_ARGUMENT);
+ for (int i=0; i<itemCount; i++) {
+ Rectangle rect = items [i].getBounds ();
+ if (rect.contains (pt)) return items [i];
+ }
+ return null;
+}
+
+/**
+ * Returns the number of items contained in the receiver.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+ checkWidget();
+ return itemCount;
+}
+
+/**
+ * Returns an array of <code>ToolItem</code>s which are the items
+ * in the receiver.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items in the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public ToolItem [] getItems () {
+ checkWidget();
+ ToolItem [] result = new ToolItem [itemCount];
+ System.arraycopy (items, 0, result, 0, itemCount);
+ return result;
+}
+
+/**
+ * Returns the number of rows in the receiver. When
+ * the receiver has the <code>WRAP</code> style, the
+ * number of rows can be greater than one. Otherwise,
+ * the number of rows is always one.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getRowCount () {
+ checkWidget();
+ Rectangle rect = getClientArea ();
+ return layout (rect.width, rect.height, false) [0];
+}
+
+/**
+ * Searches the receiver's list starting at the first item
+ * (index 0) until an item is found that is equal to the
+ * argument, and returns the index of that item. If no item
+ * is found, returns -1.
+ *
+ * @param item the search item
+ * @return the index of the item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the tool item is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the tool item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int indexOf (ToolItem item) {
+ checkWidget();
+ if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (item.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
+ for (int i=0; i<itemCount; i++) {
+ if (items [i] == item) return i;
+ }
+ return -1;
+}
+
+int [] layoutHorizontal (int width, int height, boolean resize) {
+ int xSpacing = 0, ySpacing = 2;
+ int marginWidth = 0, marginHeight = 0;
+ int x = marginWidth, y = marginHeight;
+ int maxX = 0, rows = 1;
+ boolean wrap = (style & SWT.WRAP) != 0;
+ int itemHeight = 0;
+ Point [] sizes = new Point [itemCount];
+ for (int i=0; i<itemCount; i++) {
+ Point size = sizes [i] = items [i].computeSize ();
+ itemHeight = Math.max (itemHeight, size.y);
+ }
+ for (int i=0; i<itemCount; i++) {
+ ToolItem item = items [i];
+ Point size = sizes [i];
+ if (wrap && i != 0 && x + size.x > width) {
+ rows++;
+ x = marginWidth;
+ y += ySpacing + itemHeight;
+ }
+ if (resize) {
+ item.setBounds (x, y, size.x, itemHeight);
+ boolean visible = x + size.x <= width && y + itemHeight <= height;
+ item.setVisible (visible);
+ Control control = item.control;
+ if (control != null) {
+ int controlY = y + (itemHeight - size.y) / 2;
+ control.setBounds (x, controlY, size.x, itemHeight - (controlY - y));
+ }
+ }
+ x += xSpacing + size.x;
+ maxX = Math.max (maxX, x);
+ }
+
+ return new int [] {rows, maxX, y + itemHeight};
+}
+
+int [] layoutVertical (int width, int height, boolean resize) {
+ int xSpacing = 2, ySpacing = 0;
+ int marginWidth = 0, marginHeight = 0;
+ int x = marginWidth, y = marginHeight;
+ int maxY = 0, cols = 1;
+ boolean wrap = (style & SWT.WRAP) != 0;
+ int itemWidth = 0;
+ Point [] sizes = new Point [itemCount];
+ for (int i=0; i<itemCount; i++) {
+ Point size = sizes [i] = items [i].computeSize ();
+ itemWidth = Math.max (itemWidth, size.x);
+ }
+ for (int i=0; i<itemCount; i++) {
+ ToolItem item = items [i];
+ Point size = sizes [i];
+ if (wrap && i != 0 && y + size.y > height) {
+ cols++;
+ x += xSpacing + itemWidth;
+ y = marginHeight;
+ }
+ if (resize) {
+ item.setBounds (x, y, itemWidth, size.y);
+ boolean visible = x + itemWidth <= width && y + size.y <= height;
+ item.setVisible (visible);
+ Control control = item.control;
+ if (control != null) {
+ int controlX = x + (itemWidth - size.x) / 2;
+ control.setBounds (controlX, y, itemWidth - (controlX - x), size.y);
+ }
+ }
+ y += ySpacing + size.y;
+ maxY = Math.max (maxY, y);
+ }
+
+ return new int [] {cols, x + itemWidth, maxY};
+}
+
+int [] layout (int nWidth, int nHeight, boolean resize) {
+ if ((style & SWT.VERTICAL) != 0) {
+ return layoutVertical (nWidth, nHeight, resize);
+ } else {
+ return layoutHorizontal (nWidth, nHeight, resize);
+ }
+}
+
+void relayout () {
+ if (drawCount != 0) return;
+ Rectangle rect = getClientArea ();
+ layout (rect.width, rect.height, true);
+}
+
+void releaseChildren (boolean destroy) {
+ if (items != null) {
+ for (int i=0; i<itemCount; i++) {
+ ToolItem item = items [i];
+ if (item != null && !item.isDisposed ()) {
+ item.release (false);
+ }
+ }
+ itemCount = 0;
+ items = null;
+ }
+ super.releaseChildren (destroy);
+}
+
+void removeControl (Control control) {
+ super.removeControl (control);
+ for (int i=0; i<itemCount; i++) {
+ ToolItem item = items [i];
+ if (item.control == control) item.setControl (null);
+ }
+}
+
+int setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
+ int result = super.setBounds (x, y, width, height, move, resize);
+ if ((result & RESIZED) != 0) relayout ();
+ return result;
+}
+
+public void setRedraw (boolean redraw) {
+ checkWidget();
+ super.setRedraw (redraw);
+ if (redraw && drawCount == 0) relayout();
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java
new file mode 100755
index 0000000000..bd49617969
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/ToolItem.java
@@ -0,0 +1,736 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+
+/**
+ * Instances of this class represent a selectable user interface object
+ * that represents a button in a tool bar.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>PUSH, CHECK, RADIO, SEPARATOR, DROP_DOWN</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection</dd>
+ * </dl>
+ * <p>
+ * Note: Only one of the styles CHECK, PUSH, RADIO, SEPARATOR and DROP_DOWN
+ * may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ */
+public class ToolItem extends Item {
+ NSView view;
+ int width = DEFAULT_SEPARATOR_WIDTH;
+ ToolBar parent;
+ Image hotImage, disabledImage;
+ String toolTipText;
+ Control control;
+ boolean selection;
+
+ static final int DEFAULT_WIDTH = 24;
+ static final int DEFAULT_HEIGHT = 22;
+ static final int DEFAULT_SEPARATOR_WIDTH = 6;
+ static final int INSET = 3;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>ToolBar</code>) and a style value
+ * describing its behavior and appearance. The item is added
+ * to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#PUSH
+ * @see SWT#CHECK
+ * @see SWT#RADIO
+ * @see SWT#SEPARATOR
+ * @see SWT#DROP_DOWN
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public ToolItem (ToolBar parent, int style) {
+ super (parent, checkStyle (style));
+ this.parent = parent;
+ parent.createItem (this, parent.getItemCount ());
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>ToolBar</code>), a style value
+ * describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the zero-relative index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#PUSH
+ * @see SWT#CHECK
+ * @see SWT#RADIO
+ * @see SWT#SEPARATOR
+ * @see SWT#DROP_DOWN
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public ToolItem (ToolBar parent, int style, int index) {
+ super (parent, checkStyle (style));
+ this.parent = parent;
+ parent.createItem (this, index);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * When <code>widgetSelected</code> is called when the mouse is over the arrow portion of a drop-down tool,
+ * the event object detail field contains the value <code>SWT.ARROW</code>.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the control is selected by the user,
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener(listener);
+ addListener(SWT.Selection,typedListener);
+ addListener(SWT.DefaultSelection,typedListener);
+}
+
+static int checkStyle (int style) {
+ return checkBits (style, SWT.PUSH, SWT.CHECK, SWT.RADIO, SWT.SEPARATOR, SWT.DROP_DOWN, 0);
+}
+
+protected void checkSubclass () {
+ if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+Point computeSize () {
+// checkWidget();
+ int width = 0, height = 0;
+ if ((style & SWT.SEPARATOR) != 0) {
+ if ((parent.style & SWT.HORIZONTAL) != 0) {
+ width = getWidth ();
+ height = DEFAULT_HEIGHT;
+ } else {
+ width = DEFAULT_WIDTH;
+ height = getWidth ();
+ }
+ if (control != null) {
+ height = Math.max (height, control.getMininumHeight ());
+ }
+ } else {
+ ((NSButton)view).sizeToFit ();
+ NSRect rect = view.frame();
+ width = (int)rect.width + INSET;
+ height = (int)rect.height + INSET;
+ view.setNeedsDisplay(true);
+ }
+ return new Point (width, height);
+}
+
+void drawRect(int id, NSRect rect) {
+ super.drawRect(id, rect);
+ if (getSelection ()) {
+ NSRect bounds = view.bounds();
+ NSGraphicsContext context = NSGraphicsContext.currentContext();
+ context.saveGraphicsState();
+ NSColor.colorWithDeviceRed(0.1f, 0.1f, 0.1f, 0.1f).setFill();
+ NSColor.colorWithDeviceRed(0.2f, 0.2f, 0.2f, 0.2f).setStroke();
+ NSBezierPath.fillRect(bounds);
+ bounds.x += 0.5f;
+ bounds.y += 0.5f;
+ bounds.width -= 1;
+ bounds.height -= 1;
+ NSBezierPath.strokeRect(bounds);
+ context.restoreGraphicsState();
+ }
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent.
+ *
+ * @return the receiver's bounding rectangle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Rectangle getBounds () {
+ checkWidget();
+ NSRect rect = view.frame();
+ return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
+}
+
+/**
+ * Returns the control that is used to fill the bounds of
+ * the item when the item is a <code>SEPARATOR</code>.
+ *
+ * @return the control
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Control getControl () {
+ checkWidget();
+ return control;
+}
+
+/**
+ * Returns the receiver's disabled image if it has one, or null
+ * if it does not.
+ * <p>
+ * The disabled image is displayed when the receiver is disabled.
+ * </p>
+ *
+ * @return the receiver's disabled image
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Image getDisabledImage () {
+ checkWidget();
+ return disabledImage;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled, and
+ * <code>false</code> otherwise. A disabled control is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #isEnabled
+ */
+public boolean getEnabled () {
+ checkWidget();
+ return (state & DISABLED) == 0;
+}
+
+/**
+ * Returns the receiver's hot image if it has one, or null
+ * if it does not.
+ * <p>
+ * The hot image is displayed when the mouse enters the receiver.
+ * </p>
+ *
+ * @return the receiver's hot image
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Image getHotImage () {
+ checkWidget();
+ return hotImage;
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>ToolBar</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public ToolBar getParent () {
+ checkWidget();
+ return parent;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is selected,
+ * and false otherwise.
+ * <p>
+ * When the receiver is of type <code>CHECK</code> or <code>RADIO</code>,
+ * it is selected when it is checked (which some platforms draw as a
+ * pushed in button). If the receiver is of any other type, this method
+ * returns false.
+ * </p>
+ *
+ * @return the selection state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getSelection () {
+ checkWidget();
+ if ((style & (SWT.CHECK | SWT.RADIO)) == 0) return false;
+ return selection;
+}
+
+/**
+ * Returns the receiver's tool tip text, or null if it has not been set.
+ *
+ * @return the receiver's tool tip text
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getToolTipText () {
+ checkWidget();
+ return toolTipText;
+}
+
+/**
+ * Gets the width of the receiver.
+ *
+ * @return the width
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getWidth () {
+ checkWidget();
+ return width;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is enabled and all
+ * of the receiver's ancestors are enabled, and <code>false</code>
+ * otherwise. A disabled control is typically not selectable from the
+ * user interface and draws with an inactive or "grayed" look.
+ *
+ * @return the receiver's enabled state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getEnabled
+ */
+public boolean isEnabled () {
+ checkWidget();
+ return getEnabled () && parent.isEnabled ();
+}
+
+void releaseParent () {
+ super.releaseParent ();
+ setVisible (false);
+}
+
+void releaseHandle () {
+ super.releaseHandle ();
+ if (view != null) {
+ OS.objc_msgSend(view.id, OS.sel_setTag_1, -1);
+ view.release();
+ }
+ view = null;
+ parent = null;
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ control = null;
+ toolTipText = null;
+ image = disabledImage = hotImage = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook(SWT.Selection, listener);
+ eventTable.unhook(SWT.DefaultSelection,listener);
+}
+
+void selectRadio () {
+ int index = 0;
+ ToolItem [] items = parent.getItems ();
+ while (index < items.length && items [index] != this) index++;
+ int i = index - 1;
+ while (i >= 0 && items [i].setRadioSelection (false)) --i;
+ int j = index + 1;
+ while (j < items.length && items [j].setRadioSelection (false)) j++;
+ setSelection (true);
+}
+
+void sendSelection () {
+ if ((style & SWT.RADIO) != 0) {
+ if ((parent.getStyle () & SWT.NO_RADIO_GROUP) == 0) {
+ selectRadio ();
+ }
+ }
+ if ((style & SWT.CHECK) != 0) setSelection (!getSelection ());
+ //TODO post
+ sendEvent (SWT.Selection);
+}
+
+void setBounds (int x, int y, int width, int height) {
+ NSRect rect = new NSRect();
+ rect.x = x;
+ rect.y = y;
+ rect.width = width;
+ rect.height = height;
+ view.setFrame(rect);
+}
+
+/**
+ * Sets the control that is used to fill the bounds of
+ * the item when the item is a <code>SEPARATOR</code>.
+ *
+ * @param control the new control
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li>
+ * <li>ERROR_INVALID_PARENT - if the control is not in the same widget tree</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setControl (Control control) {
+ checkWidget();
+ if (control != null) {
+ if (control.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
+ if (control.parent != parent) error (SWT.ERROR_INVALID_PARENT);
+ }
+ if ((style & SWT.SEPARATOR) == 0) return;
+ if (this.control == control) return;
+ this.control = control;
+ view.setHidden(control != null);
+ if (control != null && !control.isDisposed ()) {
+ control.moveAbove (null);
+ }
+ parent.relayout ();
+}
+
+/**
+ * Enables the receiver if the argument is <code>true</code>,
+ * and disables it otherwise.
+ * <p>
+ * A disabled control is typically
+ * not selectable from the user interface and draws with an
+ * inactive or "grayed" look.
+ * </p>
+ *
+ * @param enabled the new enabled state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setEnabled (boolean enabled) {
+ checkWidget();
+ if ((state & DISABLED) == 0 && enabled) return;
+ if (enabled) {
+ state &= ~DISABLED;
+ } else {
+ state |= DISABLED;
+ }
+ if ((style & SWT.SEPARATOR) == 0) {
+ ((NSButton)view).setEnabled(enabled);
+ }
+}
+
+/**
+ * Sets the receiver's disabled image to the argument, which may be
+ * null indicating that no disabled image should be displayed.
+ * <p>
+ * The disabled image is displayed when the receiver is disabled.
+ * </p>
+ *
+ * @param image the disabled image to display on the receiver (may be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setDisabledImage (Image image) {
+ checkWidget();
+ if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
+ if ((style & SWT.SEPARATOR) != 0) return;
+ disabledImage = image;
+ updateImage (true);
+}
+
+/**
+ * Sets the receiver's hot image to the argument, which may be
+ * null indicating that no hot image should be displayed.
+ * <p>
+ * The hot image is displayed when the mouse enters the receiver.
+ * </p>
+ *
+ * @param image the hot image to display on the receiver (may be null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setHotImage (Image image) {
+ checkWidget();
+ if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
+ if ((style & SWT.SEPARATOR) != 0) return;
+ hotImage = image;
+ updateImage (true);
+}
+
+public void setImage (Image image) {
+ checkWidget();
+ if (image != null && image.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
+ if ((style & SWT.SEPARATOR) != 0) return;
+ super.setImage (image);
+ updateImage (true);
+}
+
+boolean setRadioSelection (boolean value) {
+ if ((style & SWT.RADIO) == 0) return false;
+ if (getSelection () != value) {
+ setSelection (value);
+ postEvent (SWT.Selection);
+ }
+ return true;
+}
+
+/**
+ * Sets the selection state of the receiver.
+ * <p>
+ * When the receiver is of type <code>CHECK</code> or <code>RADIO</code>,
+ * it is selected when it is checked (which some platforms draw as a
+ * pushed in button).
+ * </p>
+ *
+ * @param selected the new selection state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setSelection (boolean selected) {
+ checkWidget();
+ if ((style & (SWT.CHECK | SWT.RADIO)) == 0) return;
+ this.selection = selected;
+ view.setNeedsDisplay(true);
+}
+
+/**
+ * Sets the receiver's text. The string may include
+ * the mnemonic character.
+ * </p>
+ * <p>
+ * Mnemonics are indicated by an '&amp;' that causes the next
+ * character to be the mnemonic. When the user presses a
+ * key sequence that matches the mnemonic, a selection
+ * event occurs. On most platforms, the mnemonic appears
+ * underlined but may be emphasised in a platform specific
+ * manner. The mnemonic indicator character '&amp;' can be
+ * escaped by doubling it in the string, causing a single
+ * '&amp;' to be displayed.
+ * </p>
+ *
+ * @param string the new text
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setText (String string) {
+ checkWidget();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if ((style & SWT.SEPARATOR) != 0) return;
+ super.setText (string);
+ NSString str = NSString.stringWith(string);
+ ((NSButton)view).setTitle(str);
+ parent.relayout ();
+ if (text.length() != 0 && image != null) {
+ if ((parent.style & SWT.RIGHT) != 0) {
+ ((NSButton)view).setImagePosition(OS.NSImageLeft);
+ } else {
+ ((NSButton)view).setImagePosition(OS.NSImageAbove);
+ }
+ } else {
+ ((NSButton)view).setImagePosition(OS.NSImageOverlaps);
+ }
+}
+
+/**
+ * Sets the receiver's tool tip text to the argument, which
+ * may be null indicating that no tool tip text should be shown.
+ *
+ * @param string the new tool tip text (or null)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setToolTipText (String string) {
+ checkWidget();
+ toolTipText = string;
+ view.setToolTip(NSString.stringWith(string));
+}
+
+void setVisible (boolean visible) {
+ if (visible) {
+ if ((state & HIDDEN) == 0) return;
+ state &= ~HIDDEN;
+ } else {
+ if ((state & HIDDEN) != 0) return;
+ state |= HIDDEN;
+ }
+ view.setHidden(!visible);
+}
+
+/**
+ * Sets the width of the receiver, for <code>SEPARATOR</code> ToolItems.
+ *
+ * @param width the new width
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setWidth (int width) {
+ checkWidget();
+ if ((style & SWT.SEPARATOR) == 0) return;
+ if (width < 0 || this.width == width) return;
+ this.width = width;
+ parent.relayout();
+}
+
+void updateImage (boolean layout) {
+ if ((style & SWT.SEPARATOR) != 0) return;
+ Image image = null;
+ if (hotImage != null) {
+ image = hotImage;
+ } else {
+ if (this.image != null) {
+ image = this.image;
+ } else {
+ image = disabledImage;
+ }
+ }
+ ((NSButton)view).setImage(image != null ? image.handle : null);
+ if (text.length() != 0 && image != null) {
+ if ((parent.style & SWT.RIGHT) != 0) {
+ ((NSButton)view).setImagePosition(OS.NSImageLeft);
+ } else {
+ ((NSButton)view).setImagePosition(OS.NSImageAbove);
+ }
+ } else {
+ ((NSButton)view).setImagePosition(OS.NSImageOverlaps);
+ }
+ parent.relayout();
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tracker.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tracker.java
new file mode 100755
index 0000000000..0a2612c886
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tracker.java
@@ -0,0 +1,1061 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * Instances of this class implement rubber banding rectangles that are
+ * drawn onto a parent <code>Composite</code> or <code>Display</code>.
+ * These rectangles can be specified to respond to mouse and key events
+ * by either moving or resizing themselves accordingly. Trackers are
+ * typically used to represent window geometries in a lightweight manner.
+ *
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>LEFT, RIGHT, UP, DOWN, RESIZE</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Move, Resize</dd>
+ * </dl>
+ * <p>
+ * Note: Rectangle move behavior is assumed unless RESIZE is specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ */
+public class Tracker extends Widget {
+ Control parent;
+ boolean tracking, cancelled, stippled;
+ Cursor clientCursor, resizeCursor;
+ Rectangle [] rectangles = new Rectangle [0], proportions = rectangles;
+ Rectangle bounds;
+ int cursorOrientation = SWT.NONE;
+ boolean inEvent = false;
+ NSWindow window;
+ int oldX, oldY;
+
+ /*
+ * The following values mirror step sizes on Windows
+ */
+ final static int STEPSIZE_SMALL = 1;
+ final static int STEPSIZE_LARGE = 9;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#LEFT
+ * @see SWT#RIGHT
+ * @see SWT#UP
+ * @see SWT#DOWN
+ * @see SWT#RESIZE
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Tracker (Composite parent, int style) {
+ super (parent, checkStyle (style));
+ this.parent = parent;
+}
+
+/**
+ * Constructs a new instance of this class given the display
+ * to create it on and a style value describing its behavior
+ * and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p><p>
+ * Note: Currently, null can be passed in for the display argument.
+ * This has the effect of creating the tracker on the currently active
+ * display if there is one. If there is no current display, the
+ * tracker is created on a "default" display. <b>Passing in null as
+ * the display argument is not considered to be good coding style,
+ * and may not be supported in a future release of SWT.</b>
+ * </p>
+ *
+ * @param display the display to create the tracker on
+ * @param style the style of control to construct
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#LEFT
+ * @see SWT#RIGHT
+ * @see SWT#UP
+ * @see SWT#DOWN
+ */
+public Tracker (Display display, int style) {
+ if (display == null) display = Display.getCurrent ();
+ if (display == null) display = Display.getDefault ();
+ if (!display.isValidThread ()) {
+ error (SWT.ERROR_THREAD_INVALID_ACCESS);
+ }
+ this.style = checkStyle (style);
+ this.display = display;
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is moved or resized, by sending
+ * it one of the messages defined in the <code>ControlListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ControlListener
+ * @see #removeControlListener
+ */
+public void addControlListener (ControlListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Resize, typedListener);
+ addListener (SWT.Move, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when keys are pressed and released on the system keyboard, by sending
+ * it one of the messages defined in the <code>KeyListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see KeyListener
+ * @see #removeKeyListener
+ */
+public void addKeyListener(KeyListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener(SWT.KeyUp,typedListener);
+ addListener(SWT.KeyDown,typedListener);
+}
+
+Point adjustMoveCursor () {
+ if (bounds == null) return null;
+ int newX = bounds.x + bounds.width / 2;
+ int newY = bounds.y;
+ /*
+ * Convert to screen coordinates if needed
+ */
+ if (parent != null) {
+ Point pt = parent.toDisplay (newX, newY);
+ newX = pt.x;
+ newY = pt.y;
+ }
+ display.setCursorLocation(newX, newY);
+ return new Point (newX, newY);
+}
+
+Point adjustResizeCursor (boolean movePointer) {
+ if (bounds == null) return null;
+ int newX, newY;
+
+ if ((cursorOrientation & SWT.LEFT) != 0) {
+ newX = bounds.x;
+ } else if ((cursorOrientation & SWT.RIGHT) != 0) {
+ newX = bounds.x + bounds.width;
+ } else {
+ newX = bounds.x + bounds.width / 2;
+ }
+
+ if ((cursorOrientation & SWT.UP) != 0) {
+ newY = bounds.y;
+ } else if ((cursorOrientation & SWT.DOWN) != 0) {
+ newY = bounds.y + bounds.height;
+ } else {
+ newY = bounds.y + bounds.height / 2;
+ }
+
+ /*
+ * Convert to screen coordinates if needed
+ */
+ if (parent != null) {
+ Point pt = parent.toDisplay (newX, newY);
+ newX = pt.x;
+ newY = pt.y;
+ }
+ if (movePointer) {
+ display.setCursorLocation(newX, newY);
+ }
+
+ /*
+ * If the client has not provided a custom cursor then determine
+ * the appropriate resize cursor.
+ */
+ if (clientCursor == null) {
+ Cursor newCursor = null;
+ switch (cursorOrientation) {
+ case SWT.UP:
+ newCursor = new Cursor(display, SWT.CURSOR_SIZENS);
+ break;
+ case SWT.DOWN:
+ newCursor = new Cursor(display, SWT.CURSOR_SIZENS);
+ break;
+ case SWT.LEFT:
+ newCursor = new Cursor(display, SWT.CURSOR_SIZEWE);
+ break;
+ case SWT.RIGHT:
+ newCursor = new Cursor(display, SWT.CURSOR_SIZEWE);
+ break;
+ case SWT.LEFT | SWT.UP:
+ newCursor = new Cursor(display, SWT.CURSOR_SIZENWSE);
+ break;
+ case SWT.RIGHT | SWT.DOWN:
+ newCursor = new Cursor(display, SWT.CURSOR_SIZENWSE);
+ break;
+ case SWT.LEFT | SWT.DOWN:
+ newCursor = new Cursor(display, SWT.CURSOR_SIZENESW);
+ break;
+ case SWT.RIGHT | SWT.UP:
+ newCursor = new Cursor(display, SWT.CURSOR_SIZENESW);
+ break;
+ default:
+ newCursor = new Cursor(display, SWT.CURSOR_SIZEALL);
+ break;
+ }
+ newCursor.handle.set();
+ if (resizeCursor != null) {
+ resizeCursor.dispose ();
+ }
+ resizeCursor = newCursor;
+ }
+
+ return new Point (newX, newY);
+}
+
+static int checkStyle (int style) {
+ if ((style & (SWT.LEFT | SWT.RIGHT | SWT.UP | SWT.DOWN)) == 0) {
+ style |= SWT.LEFT | SWT.RIGHT | SWT.UP | SWT.DOWN;
+ }
+ return style;
+}
+
+/**
+ * Stops displaying the tracker rectangles. Note that this is not considered
+ * to be a cancelation by the user.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void close () {
+ checkWidget ();
+ tracking = false;
+}
+Rectangle computeBounds () {
+ if (rectangles.length == 0) return null;
+ int xMin = rectangles [0].x;
+ int yMin = rectangles [0].y;
+ int xMax = rectangles [0].x + rectangles [0].width;
+ int yMax = rectangles [0].y + rectangles [0].height;
+
+ for (int i = 1; i < rectangles.length; i++) {
+ if (rectangles [i].x < xMin) xMin = rectangles [i].x;
+ if (rectangles [i].y < yMin) yMin = rectangles [i].y;
+ int rectRight = rectangles [i].x + rectangles [i].width;
+ if (rectRight > xMax) xMax = rectRight;
+ int rectBottom = rectangles [i].y + rectangles [i].height;
+ if (rectBottom > yMax) yMax = rectBottom;
+ }
+
+ return new Rectangle (xMin, yMin, xMax - xMin, yMax - yMin);
+}
+
+Rectangle [] computeProportions (Rectangle [] rects) {
+ Rectangle [] result = new Rectangle [rects.length];
+ bounds = computeBounds ();
+ if (bounds != null) {
+ for (int i = 0; i < rects.length; i++) {
+ int x = 0, y = 0, width = 0, height = 0;
+ if (bounds.width != 0) {
+ x = (rects [i].x - bounds.x) * 100 / bounds.width;
+ width = rects [i].width * 100 / bounds.width;
+ } else {
+ width = 100;
+ }
+ if (bounds.height != 0) {
+ y = (rects [i].y - bounds.y) * 100 / bounds.height;
+ height = rects [i].height * 100 / bounds.height;
+ } else {
+ height = 100;
+ }
+ result [i] = new Rectangle (x, y, width, height);
+ }
+ }
+ return result;
+}
+
+void drawRectangles (NSWindow window, Rectangle [] rects, boolean erase) {
+ NSRect frame = window.frame();
+ NSGraphicsContext context = window.graphicsContext();
+ NSGraphicsContext.setCurrentContext(context);
+ NSAffineTransform transform = NSAffineTransform.transform();
+ context.saveGraphicsState();
+ transform.scaleXBy(1, -1);
+ transform.translateXBy(0, -frame.height);
+ transform.concat();
+ Point parentOrigin;
+ if (parent != null) {
+ parentOrigin = display.map (parent, null, 0, 0);
+ } else {
+ parentOrigin = new Point (0, 0);
+ }
+ context.setCompositingOperation(erase ? OS.NSCompositeClear : OS.NSCompositeSourceOver);
+ for (int i=0; i<rects.length; i++) {
+ Rectangle rect = rects [i];
+ frame.x = rect.x + parentOrigin.x;
+ frame.y = rect.y + parentOrigin.y;
+ frame.width = rect.width;
+ frame.height = rect.height;
+ if (erase) {
+ frame.width++;
+ frame.height++;
+ NSBezierPath.fillRect(frame);
+ } else {
+ frame.x += 0.5f;
+ frame.y += 0.5f;
+ NSBezierPath.strokeRect(frame);
+ }
+ }
+ context.flushGraphics();
+ context.restoreGraphicsState();
+}
+
+/**
+ * Returns the bounds that are being drawn, expressed relative to the parent
+ * widget. If the parent is a <code>Display</code> then these are screen
+ * coordinates.
+ *
+ * @return the bounds of the Rectangles being drawn
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Rectangle [] getRectangles () {
+ checkWidget();
+ Rectangle [] result = new Rectangle [rectangles.length];
+ for (int i = 0; i < rectangles.length; i++) {
+ Rectangle current = rectangles [i];
+ result [i] = new Rectangle (current.x, current.y, current.width, current.height);
+ }
+ return result;
+}
+
+/**
+ * Returns <code>true</code> if the rectangles are drawn with a stippled line, <code>false</code> otherwise.
+ *
+ * @return the stippled effect of the rectangles
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getStippled () {
+ checkWidget ();
+ return stippled;
+}
+
+void mouse (NSEvent nsEvent) {
+ NSPoint location = nsEvent.locationInWindow();
+ if (parent != null) {
+ location = parent.view.convertPoint_toView_(location, parent.view);
+ } else {
+ NSWindow eventWindow = nsEvent.window();
+ location = eventWindow.convertBaseToScreen(location);
+ location.y = eventWindow.screen().frame().height - location.y;
+ }
+ int newX = (int)location.x, newY = (int)location.y;
+ if (newX != oldX || newY != oldY) {
+ Rectangle [] oldRectangles = rectangles;
+ Rectangle [] rectsToErase = new Rectangle [rectangles.length];
+ for (int i = 0; i < rectangles.length; i++) {
+ Rectangle current = rectangles [i];
+ rectsToErase [i] = new Rectangle (current.x, current.y, current.width, current.height);
+ }
+ Event event = new Event ();
+ event.x = newX;
+ event.y = newY;
+ if ((style & SWT.RESIZE) != 0) {
+ boolean orientationInit = resizeRectangles (newX - oldX, newY - oldY);
+ inEvent = true;
+ sendEvent (SWT.Resize, event);
+ inEvent = false;
+ /*
+ * It is possible (but unlikely), that application
+ * code could have disposed the widget in the move
+ * event. If this happens, return false to indicate
+ * that the tracking has failed.
+ */
+ if (isDisposed ()) {
+ cancelled = true;
+ return;
+ }
+ boolean draw = false;
+ /*
+ * It is possible that application code could have
+ * changed the rectangles in the resize event. If this
+ * happens then only redraw the tracker if the rectangle
+ * values have changed.
+ */
+ if (rectangles != oldRectangles) {
+ int length = rectangles.length;
+ if (length != rectsToErase.length) {
+ draw = true;
+ } else {
+ for (int i = 0; i < length; i++) {
+ if (!rectangles [i].equals (rectsToErase [i])) {
+ draw = true;
+ break;
+ }
+ }
+ }
+ }
+ else {
+ draw = true;
+ }
+ if (draw) {
+ drawRectangles (window, rectsToErase, true);
+ drawRectangles (window, rectangles, false);
+ }
+ Point cursorPos = adjustResizeCursor (orientationInit);
+ if (cursorPos != null) {
+ newX = cursorPos.x;
+ newY = cursorPos.y;
+ }
+ } else {
+ moveRectangles (newX - oldX, newY - oldY);
+ inEvent = true;
+ sendEvent (SWT.Move, event);
+ inEvent = false;
+ /*
+ * It is possible (but unlikely), that application
+ * code could have disposed the widget in the move
+ * event. If this happens, return false to indicate
+ * that the tracking has failed.
+ */
+ if (isDisposed ()) {
+ cancelled = true;
+ return;
+ }
+ boolean draw = false;
+ /*
+ * It is possible that application code could have
+ * changed the rectangles in the move event. If this
+ * happens then only redraw the tracker if the rectangle
+ * values have changed.
+ */
+ if (rectangles != oldRectangles) {
+ int length = rectangles.length;
+ if (length != rectsToErase.length) {
+ draw = true;
+ } else {
+ for (int i = 0; i < length; i++) {
+ if (!rectangles [i].equals (rectsToErase [i])) {
+ draw = true;
+ break;
+ }
+ }
+ }
+ } else {
+ draw = true;
+ }
+ if (draw) {
+ drawRectangles (window, rectsToErase, true);
+ drawRectangles (window, rectangles, false);
+ }
+ }
+ oldX = newX; oldY = newY;
+ }
+ switch (nsEvent.type()) {
+ case OS.NSLeftMouseUp:
+ case OS.NSRightMouseUp:
+ case OS.NSOtherMouseUp:
+ tracking = false;
+ }
+}
+
+void key (NSEvent nsEvent) {
+ //TODO send event
+// if (!sendKeyEvent (SWT.KeyDown, theEvent)) return OS.noErr;
+ int modifierFlags = nsEvent.modifierFlags();
+ int stepSize = (modifierFlags & OS.NSControlKeyMask) != 0 ? STEPSIZE_SMALL : STEPSIZE_LARGE;
+ int xChange = 0, yChange = 0;
+ switch (nsEvent.keyCode()) {
+ case 53: /* Esc */
+ cancelled = true;
+ tracking = false;
+ break;
+ case 76: /* KP Enter */
+ case 36: /* Return */
+ tracking = false;
+ break;
+ case 123: /* Left arrow */
+ xChange = -stepSize;
+ break;
+ case 124: /* Right arrow */
+ xChange = stepSize;
+ break;
+ case 126: /* Up arrow */
+ yChange = -stepSize;
+ break;
+ case 125: /* Down arrow */
+ yChange = stepSize;
+ break;
+ }
+ if (xChange != 0 || yChange != 0) {
+ Rectangle [] oldRectangles = rectangles;
+ Rectangle [] rectsToErase = new Rectangle [rectangles.length];
+ for (int i = 0; i < rectangles.length; i++) {
+ Rectangle current = rectangles [i];
+ rectsToErase [i] = new Rectangle (current.x, current.y, current.width, current.height);
+ }
+ Event event = new Event ();
+ int newX = oldX + xChange;
+ int newY = oldY + yChange;
+ event.x = newX;
+ event.y = newY;
+ Point cursorPos;
+ if ((style & SWT.RESIZE) != 0) {
+ resizeRectangles (xChange, yChange);
+ inEvent = true;
+ sendEvent (SWT.Resize, event);
+ inEvent = false;
+ /*
+ * It is possible (but unlikely) that application
+ * code could have disposed the widget in the move
+ * event. If this happens return false to indicate
+ * that the tracking has failed.
+ */
+ if (isDisposed ()) {
+ cancelled = true;
+ return;
+ }
+ boolean draw = false;
+ /*
+ * It is possible that application code could have
+ * changed the rectangles in the resize event. If this
+ * happens then only redraw the tracker if the rectangle
+ * values have changed.
+ */
+ if (rectangles != oldRectangles) {
+ int length = rectangles.length;
+ if (length != rectsToErase.length) {
+ draw = true;
+ } else {
+ for (int i = 0; i < length; i++) {
+ if (!rectangles [i].equals (rectsToErase [i])) {
+ draw = true;
+ break;
+ }
+ }
+ }
+ } else {
+ draw = true;
+ }
+ if (draw) {
+ drawRectangles (window, rectsToErase, true);
+ drawRectangles (window, rectangles, false);
+ }
+ cursorPos = adjustResizeCursor (true);
+ } else {
+ moveRectangles (xChange, yChange);
+ inEvent = true;
+ sendEvent (SWT.Move, event);
+ inEvent = false;
+ /*
+ * It is possible (but unlikely) that application
+ * code could have disposed the widget in the move
+ * event. If this happens return false to indicate
+ * that the tracking has failed.
+ */
+ if (isDisposed ()) {
+ cancelled = true;
+ return;
+ }
+ boolean draw = false;
+ /*
+ * It is possible that application code could have
+ * changed the rectangles in the move event. If this
+ * happens then only redraw the tracker if the rectangle
+ * values have changed.
+ */
+ if (rectangles != oldRectangles) {
+ int length = rectangles.length;
+ if (length != rectsToErase.length) {
+ draw = true;
+ } else {
+ for (int i = 0; i < length; i++) {
+ if (!rectangles [i].equals (rectsToErase [i])) {
+ draw = true;
+ break;
+ }
+ }
+ }
+ } else {
+ draw = true;
+ }
+ if (draw) {
+ drawRectangles (window, rectsToErase, true);
+ drawRectangles (window, rectangles, false);
+ }
+ cursorPos = adjustMoveCursor ();
+ }
+ if (cursorPos != null) {
+ oldX = cursorPos.x;
+ oldY = cursorPos.y;
+ }
+ }
+}
+
+void moveRectangles (int xChange, int yChange) {
+ if (bounds == null) return;
+ if (xChange < 0 && ((style & SWT.LEFT) == 0)) xChange = 0;
+ if (xChange > 0 && ((style & SWT.RIGHT) == 0)) xChange = 0;
+ if (yChange < 0 && ((style & SWT.UP) == 0)) yChange = 0;
+ if (yChange > 0 && ((style & SWT.DOWN) == 0)) yChange = 0;
+ if (xChange == 0 && yChange == 0) return;
+ bounds.x += xChange; bounds.y += yChange;
+ for (int i = 0; i < rectangles.length; i++) {
+ rectangles [i].x += xChange;
+ rectangles [i].y += yChange;
+ }
+}
+
+/**
+ * Displays the Tracker rectangles for manipulation by the user. Returns when
+ * the user has either finished manipulating the rectangles or has cancelled the
+ * Tracker.
+ *
+ * @return <code>true</code> if the user did not cancel the Tracker, <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean open () {
+ checkWidget ();
+ cancelled = false;
+ tracking = true;
+ window = (NSWindow)new NSWindow().alloc();
+ NSRect frame = NSScreen.mainScreen().frame();
+ window = window.initWithContentRect_styleMask_backing_defer_(frame, OS.NSBorderlessWindowMask, OS.NSBackingStoreBuffered, false);
+ window.setOpaque(false);
+ window.setContentView(null);
+ NSGraphicsContext context = window.graphicsContext();
+ NSGraphicsContext.setCurrentContext(context);
+ context.setCompositingOperation(OS.NSCompositeClear);
+ NSBezierPath.fillRect(frame);
+ window.orderFrontRegardless();
+
+ drawRectangles (window, rectangles, false);
+
+ /*
+ * If exactly one of UP/DOWN is specified as a style then set the cursor
+ * orientation accordingly (the same is done for LEFT/RIGHT styles below).
+ */
+ int vStyle = style & (SWT.UP | SWT.DOWN);
+ if (vStyle == SWT.UP || vStyle == SWT.DOWN) {
+ cursorOrientation |= vStyle;
+ }
+ int hStyle = style & (SWT.LEFT | SWT.RIGHT);
+ if (hStyle == SWT.LEFT || hStyle == SWT.RIGHT) {
+ cursorOrientation |= hStyle;
+ }
+
+ Point cursorPos;
+ boolean down = false;
+ NSApplication application = NSApplication.sharedApplication();
+ NSEvent currentEvent = application.currentEvent();
+ switch (currentEvent.type()) {
+ case OS.NSLeftMouseDown:
+ case OS.NSRightMouseDown:
+ case OS.NSOtherMouseDown:
+ down = true;
+ }
+ if (down) {
+ cursorPos = display.getCursorLocation();
+ } else {
+ if ((style & SWT.RESIZE) != 0) {
+ cursorPos = adjustResizeCursor (true);
+ } else {
+ cursorPos = adjustMoveCursor ();
+ }
+ }
+ if (cursorPos != null) {
+ oldX = cursorPos.x;
+ oldY = cursorPos.y;
+ }
+
+ /* Tracker behaves like a Dialog with its own OS event loop. */
+ while (tracking && !cancelled) {
+ NSAutoreleasePool pool = (NSAutoreleasePool)new NSAutoreleasePool().alloc().init();
+ NSEvent event = application.nextEventMatchingMask(0, NSDate.distantFuture(), OS.NSDefaultRunLoopMode, true);
+ if (event == null) continue;
+ int type = event.type();
+ switch (type) {
+ case OS.NSLeftMouseUp:
+ case OS.NSRightMouseUp:
+ case OS.NSOtherMouseUp:
+ case OS.NSMouseMoved:
+ case OS.NSLeftMouseDragged:
+ case OS.NSRightMouseDragged:
+ case OS.NSOtherMouseDragged:
+ mouse(event);
+ break;
+ case OS.NSKeyDown:
+// case OS.NSKeyUp:
+ case OS.NSFlagsChanged:
+ key(event);
+ break;
+ }
+ /*
+ * Don't dispatch mouse and key events in general, EXCEPT once this
+ * tracker has finished its work.
+ */
+ boolean dispatch = true;
+ if (!(tracking && !cancelled)) {
+ switch (type) {
+ case OS.NSLeftMouseDown:
+ case OS.NSLeftMouseUp:
+ case OS.NSRightMouseDown:
+ case OS.NSRightMouseUp:
+ case OS.NSOtherMouseDown:
+ case OS.NSOtherMouseUp:
+ case OS.NSMouseMoved:
+ case OS.NSLeftMouseDragged:
+ case OS.NSRightMouseDragged:
+ case OS.NSOtherMouseDragged:
+ case OS.NSMouseEntered:
+ case OS.NSMouseExited:
+ case OS.NSKeyDown:
+ case OS.NSKeyUp:
+ case OS.NSFlagsChanged:
+ dispatch = false;
+ }
+ }
+ if (dispatch) application.sendEvent(event);
+ if (clientCursor != null && resizeCursor == null) {
+ clientCursor.handle.set();
+ }
+ pool.release();
+ }
+ if (!isDisposed()) {
+ drawRectangles (window, rectangles, true);
+ }
+ if (window != null) window.close();
+ tracking = false;
+ window = null;
+ return !cancelled;
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ parent = null;
+ rectangles = proportions = null;
+ bounds = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is moved or resized.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ControlListener
+ * @see #addControlListener
+ */
+public void removeControlListener (ControlListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Resize, listener);
+ eventTable.unhook (SWT.Move, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when keys are pressed and released on the system keyboard.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see KeyListener
+ * @see #addKeyListener
+ */
+public void removeKeyListener(KeyListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook(SWT.KeyUp, listener);
+ eventTable.unhook(SWT.KeyDown, listener);
+}
+
+/*
+ * Returns true if the pointer's orientation was initialized in some dimension,
+ * and false otherwise.
+ */
+boolean resizeRectangles (int xChange, int yChange) {
+ if (bounds == null) return false;
+ boolean orientationInit = false;
+ /*
+ * If the cursor orientation has not been set in the orientation of
+ * this change then try to set it here.
+ */
+ if (xChange < 0 && ((style & SWT.LEFT) != 0) && ((cursorOrientation & SWT.RIGHT) == 0)) {
+ if ((cursorOrientation & SWT.LEFT) == 0) {
+ cursorOrientation |= SWT.LEFT;
+ orientationInit = true;
+ }
+ }
+ if (xChange > 0 && ((style & SWT.RIGHT) != 0) && ((cursorOrientation & SWT.LEFT) == 0)) {
+ if ((cursorOrientation & SWT.RIGHT) == 0) {
+ cursorOrientation |= SWT.RIGHT;
+ orientationInit = true;
+ }
+ }
+ if (yChange < 0 && ((style & SWT.UP) != 0) && ((cursorOrientation & SWT.DOWN) == 0)) {
+ if ((cursorOrientation & SWT.UP) == 0) {
+ cursorOrientation |= SWT.UP;
+ orientationInit = true;
+ }
+ }
+ if (yChange > 0 && ((style & SWT.DOWN) != 0) && ((cursorOrientation & SWT.UP) == 0)) {
+ if ((cursorOrientation & SWT.DOWN) == 0) {
+ cursorOrientation |= SWT.DOWN;
+ orientationInit = true;
+ }
+ }
+
+ /*
+ * If the bounds will flip about the x or y axis then apply the adjustment
+ * up to the axis (ie.- where bounds width/height becomes 0), change the
+ * cursor's orientation accordingly, and flip each Rectangle's origin (only
+ * necessary for > 1 Rectangles)
+ */
+ if ((cursorOrientation & SWT.LEFT) != 0) {
+ if (xChange > bounds.width) {
+ if ((style & SWT.RIGHT) == 0) return orientationInit;
+ cursorOrientation |= SWT.RIGHT;
+ cursorOrientation &= ~SWT.LEFT;
+ bounds.x += bounds.width;
+ xChange -= bounds.width;
+ bounds.width = 0;
+ if (proportions.length > 1) {
+ for (int i = 0; i < proportions.length; i++) {
+ Rectangle proportion = proportions [i];
+ proportion.x = 100 - proportion.x - proportion.width;
+ }
+ }
+ }
+ } else if ((cursorOrientation & SWT.RIGHT) != 0) {
+ if (bounds.width < -xChange) {
+ if ((style & SWT.LEFT) == 0) return orientationInit;
+ cursorOrientation |= SWT.LEFT;
+ cursorOrientation &= ~SWT.RIGHT;
+ xChange += bounds.width;
+ bounds.width = 0;
+ if (proportions.length > 1) {
+ for (int i = 0; i < proportions.length; i++) {
+ Rectangle proportion = proportions [i];
+ proportion.x = 100 - proportion.x - proportion.width;
+ }
+ }
+ }
+ }
+ if ((cursorOrientation & SWT.UP) != 0) {
+ if (yChange > bounds.height) {
+ if ((style & SWT.DOWN) == 0) return orientationInit;
+ cursorOrientation |= SWT.DOWN;
+ cursorOrientation &= ~SWT.UP;
+ bounds.y += bounds.height;
+ yChange -= bounds.height;
+ bounds.height = 0;
+ if (proportions.length > 1) {
+ for (int i = 0; i < proportions.length; i++) {
+ Rectangle proportion = proportions [i];
+ proportion.y = 100 - proportion.y - proportion.height;
+ }
+ }
+ }
+ } else if ((cursorOrientation & SWT.DOWN) != 0) {
+ if (bounds.height < -yChange) {
+ if ((style & SWT.UP) == 0) return orientationInit;
+ cursorOrientation |= SWT.UP;
+ cursorOrientation &= ~SWT.DOWN;
+ yChange += bounds.height;
+ bounds.height = 0;
+ if (proportions.length > 1) {
+ for (int i = 0; i < proportions.length; i++) {
+ Rectangle proportion = proportions [i];
+ proportion.y = 100 - proportion.y - proportion.height;
+ }
+ }
+ }
+ }
+
+ // apply the bounds adjustment
+ if ((cursorOrientation & SWT.LEFT) != 0) {
+ bounds.x += xChange;
+ bounds.width -= xChange;
+ } else if ((cursorOrientation & SWT.RIGHT) != 0) {
+ bounds.width += xChange;
+ }
+ if ((cursorOrientation & SWT.UP) != 0) {
+ bounds.y += yChange;
+ bounds.height -= yChange;
+ } else if ((cursorOrientation & SWT.DOWN) != 0) {
+ bounds.height += yChange;
+ }
+
+ Rectangle [] newRects = new Rectangle [rectangles.length];
+ for (int i = 0; i < rectangles.length; i++) {
+ Rectangle proportion = proportions[i];
+ newRects[i] = new Rectangle (
+ proportion.x * bounds.width / 100 + bounds.x,
+ proportion.y * bounds.height / 100 + bounds.y,
+ proportion.width * bounds.width / 100,
+ proportion.height * bounds.height / 100);
+ }
+ rectangles = newRects;
+ return orientationInit;
+}
+
+/**
+ * Sets the <code>Cursor</code> of the Tracker. If this cursor is <code>null</code>
+ * then the cursor reverts to the default.
+ *
+ * @param newCursor the new <code>Cursor</code> to display
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setCursor (Cursor newCursor) {
+ checkWidget ();
+ clientCursor = newCursor;
+ if (newCursor != null) {
+ if (inEvent) newCursor.handle.set();
+ }
+}
+
+/**
+ * Specifies the rectangles that should be drawn, expressed relative to the parent
+ * widget. If the parent is a Display then these are screen coordinates.
+ *
+ * @param rectangles the bounds of the rectangles to be drawn
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the set of rectangles is null or contains a null rectangle</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setRectangles (Rectangle [] rectangles) {
+ checkWidget ();
+ if (rectangles == null) error (SWT.ERROR_NULL_ARGUMENT);
+ int length = rectangles.length;
+ this.rectangles = new Rectangle [length];
+ for (int i = 0; i < length; i++) {
+ Rectangle current = rectangles [i];
+ if (current == null) error (SWT.ERROR_NULL_ARGUMENT);
+ this.rectangles [i] = new Rectangle (current.x, current.y, current.width, current.height);
+ }
+ proportions = computeProportions (rectangles);
+}
+
+/**
+ * Changes the appearance of the line used to draw the rectangles.
+ *
+ * @param stippled <code>true</code> if rectangle should appear stippled
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setStippled (boolean stippled) {
+ checkWidget ();
+ this.stippled = stippled;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TrayItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TrayItem.java
new file mode 100755
index 0000000000..5c7f509e6f
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TrayItem.java
@@ -0,0 +1,440 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+/**
+ * Instances of this class represent icons that can be placed on the
+ * system tray or task bar status area.
+ * <p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>DefaultSelection, MenuDetect, Selection</dd>
+ * </dl>
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @since 3.0
+ */
+public class TrayItem extends Item {
+ Tray parent;
+ ToolTip toolTip;
+ String toolTipText;
+ boolean visible = true, highlight;
+ NSStatusItem item;
+ NSImageView view;
+
+ static final float BORDER = 8f;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Tray</code>) and a style value
+ * describing its behavior and appearance. The item is added
+ * to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public TrayItem (Tray parent, int style) {
+ super (parent, style);
+ this.parent = parent;
+ parent.createItem (this, parent.getItemCount ());
+ createWidget ();
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the platform-specific context menu trigger
+ * has occurred, by sending it one of the messages defined in
+ * the <code>MenuDetectListener</code> interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MenuDetectListener
+ * @see #removeMenuDetectListener
+ *
+ * @since 3.3
+ */
+public void addMenuDetectListener (MenuDetectListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.MenuDetect, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the receiver is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the receiver is selected
+ * <code>widgetDefaultSelected</code> is called when the receiver is double-clicked
+ * </p>
+ *
+ * @param listener the listener which should be notified when the receiver is selected by the user
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Selection,typedListener);
+ addListener (SWT.DefaultSelection,typedListener);
+}
+
+protected void checkSubclass () {
+ if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+void createWidget () {
+ NSStatusBar statusBar = NSStatusBar.systemStatusBar();
+ item = statusBar.statusItemWithLength(0);
+ if (item == null) error (SWT.ERROR_NO_HANDLES);
+ item.retain();
+ item.setHighlightMode(true);
+ NSRect rect = new NSRect();
+ view = (NSImageView)new SWTImageView().alloc();
+ if (view == null) error (SWT.ERROR_NO_HANDLES);
+ view.initWithFrame(rect);
+ item.setView(view);
+ createJNIRef();
+ view.setTag(jniRef);
+}
+
+void destroyWidget () {
+ parent.destroyItem (this);
+ releaseHandle ();
+}
+
+Point getLocation () {
+ NSRect rect = view.frame();
+ NSRect windowRect = view.window().frame();
+ NSPoint pt = new NSPoint();
+ pt.x = rect.width / 2;
+ pt.y = rect.height;
+ pt = view.convertPoint_fromView_(pt, null);
+ pt.x += windowRect.x;
+ return new Point ((int)pt.x, (int)pt.y);
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Tray</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public Tray getParent () {
+ checkWidget ();
+ return parent;
+}
+
+/**
+ * Returns the receiver's tool tip, or null if it has
+ * not been set.
+ *
+ * @return the receiver's tool tip text
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public ToolTip getToolTip () {
+ checkWidget ();
+ return toolTip;
+}
+
+/**
+ * Returns the receiver's tool tip text, or null if it has
+ * not been set.
+ *
+ * @return the receiver's tool tip text
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public String getToolTipText () {
+ checkWidget ();
+ return toolTipText;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is visible and
+ * <code>false</code> otherwise.
+ *
+ * @return the receiver's visibility
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getVisible () {
+ checkWidget ();
+ return visible;
+}
+
+void releaseHandle () {
+ super.releaseHandle ();
+ parent = null;
+ if (item != null) item.release();
+ if (view != null) {
+ view.setTag(-1);
+ view.release();
+ }
+ item = null;
+ view = null;
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ NSStatusBar statusBar = NSStatusBar.systemStatusBar();
+ statusBar.removeStatusItem(item);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the platform-specific context menu trigger has
+ * occurred.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see MenuDetectListener
+ * @see #addMenuDetectListener
+ *
+ * @since 3.3
+ */
+public void removeMenuDetectListener (MenuDetectListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.MenuDetect, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the receiver is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Selection, listener);
+ eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+/**
+ * Sets the receiver's image.
+ *
+ * @param image the new image
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setImage (Image image) {
+ checkWidget ();
+ if (image != null && image.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ super.setImage (image);
+ view.setImage(image != null ? image.handle : null);
+ float width = image != null && visible ? image.handle.size().width + BORDER : 0;
+ item.setLength(width);
+}
+
+/**
+ * Sets the receiver's tool tip to the argument, which
+ * may be null indicating that no tool tip should be shown.
+ *
+ * @param toolTip the new tool tip (or null)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setToolTip (ToolTip toolTip) {
+ checkWidget ();
+ ToolTip oldTip = this.toolTip, newTip = toolTip;
+ if (oldTip != null) oldTip.item = null;
+ this.toolTip = newTip;
+ if (newTip != null) newTip.item = this;
+}
+
+/**
+ * Sets the receiver's tool tip text to the argument, which
+ * may be null indicating that no tool tip text should be shown.
+ *
+ * @param value the new tool tip text (or null)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setToolTipText (String string) {
+ checkWidget ();
+ toolTipText = string;
+ _setToolTipText (string);
+}
+
+void _setToolTipText (String string) {
+ NSString str = null;
+ if (string != null) str = NSString.stringWith(string);
+ view.setToolTip(str);
+}
+
+/**
+ * Makes the receiver visible if the argument is <code>true</code>,
+ * and makes it invisible otherwise.
+ *
+ * @param visible the new visibility state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setVisible (boolean visible) {
+ checkWidget ();
+ if (this.visible == visible) return;
+ if (visible) {
+ sendEvent (SWT.Show);
+ if (isDisposed ()) return;
+ }
+ this.visible = visible;
+ float width = image != null && visible ? image.handle.size().width + BORDER : 0;
+ item.setLength(width);
+ if (!visible) sendEvent (SWT.Hide);
+}
+
+void showMenu () {
+ _setToolTipText (null);
+ sendEvent (SWT.MenuDetect);
+ if (isDisposed ()) return;
+// display.runPopups ();
+ if (isDisposed ()) return;
+ _setToolTipText (toolTipText);
+}
+
+void mouseDown(int event) {
+ NSEvent nsEvent = new NSEvent(event);
+ int mask = nsEvent.modifierFlags() & OS.NSDeviceIndependentModifierFlagsMask;
+ if (mask == OS.NSControlKeyMask) {
+ showMenu();
+ } else {
+ highlight = true;
+ view.setNeedsDisplay(true);
+ int clickCount = nsEvent.clickCount();
+ //TODO post
+ sendEvent(clickCount == 2 ? SWT.DefaultSelection : SWT.Selection);
+ }
+}
+
+void mouseUp(int event) {
+ highlight = false;
+ view.setNeedsDisplay(true);
+}
+
+void rightMouseDown(int event) {
+ showMenu();
+}
+
+void drawRect(int id, NSRect rect) {
+ item.drawStatusBarBackgroundInRect(rect, highlight);
+ super.drawRect(id, rect);
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java
new file mode 100755
index 0000000000..d36ffb8206
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java
@@ -0,0 +1,2264 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.*;
+
+/**
+ * Instances of this class provide a selectable user interface object
+ * that displays a hierarchy of items and issues notification when an
+ * item in the hierarchy is selected.
+ * <p>
+ * The item children that may be added to instances of this class
+ * must be of type <code>TreeItem</code>.
+ * </p><p>
+ * Style <code>VIRTUAL</code> is used to create a <code>Tree</code> whose
+ * <code>TreeItem</code>s are to be populated by the client on an on-demand basis
+ * instead of up-front. This can provide significant performance improvements for
+ * trees that are very large or for which <code>TreeItem</code> population is
+ * expensive (for example, retrieving values from an external source).
+ * </p><p>
+ * Here is an example of using a <code>Tree</code> with style <code>VIRTUAL</code>:
+ * <code><pre>
+ * final Tree tree = new Tree(parent, SWT.VIRTUAL | SWT.BORDER);
+ * tree.setItemCount(20);
+ * tree.addListener(SWT.SetData, new Listener() {
+ * public void handleEvent(Event event) {
+ * TreeItem item = (TreeItem)event.item;
+ * TreeItem parentItem = item.getParentItem();
+ * String text = null;
+ * if (parentItem == null) {
+ * text = "node " + tree.indexOf(item);
+ * } else {
+ * text = parentItem.getText() + " - " + parentItem.indexOf(item);
+ * }
+ * item.setText(text);
+ * System.out.println(text);
+ * item.setItemCount(10);
+ * }
+ * });
+ * </pre></code>
+ * </p><p>
+ * Note that although this class is a subclass of <code>Composite</code>,
+ * it does not make sense to add <code>Control</code> children to it,
+ * or set a layout on it.
+ * </p><p>
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>SINGLE, MULTI, CHECK, FULL_SELECTION, VIRTUAL</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Selection, DefaultSelection, Collapse, Expand, SetData, MeasureItem, EraseItem, PaintItem</dd>
+ * </dl>
+ * </p><p>
+ * Note: Only one of the styles SINGLE and MULTI may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ */
+public class Tree extends Composite {
+ NSTableColumn firstColumn, checkColumn;
+ NSTableHeaderView headerView;
+ TreeItem [] items;
+ int itemCount;
+ TreeColumn [] columns;
+ TreeColumn sortColumn;
+ int columnCount;
+ int sortDirection;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#SINGLE
+ * @see SWT#MULTI
+ * @see SWT#CHECK
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public Tree (Composite parent, int style) {
+ super (parent, checkStyle (style));
+}
+
+void _addListener (int eventType, Listener listener) {
+ super._addListener (eventType, listener);
+ for (int i = 0; i < items.length; i++) {
+ if (items [i] != null) items [i].width = -1;
+ }
+}
+
+TreeItem _getItem (TreeItem parentItem, int index) {
+ int count;
+ TreeItem[] items;
+ if (parentItem != null) {
+ count = parentItem.itemCount;
+ items = parentItem.items;
+ } else {
+ count = this.itemCount;
+ items = this.items;
+ }
+ if (index < 0 || index >= count) return null;
+ TreeItem item = items [index];
+ if (item != null || (style & SWT.VIRTUAL) == 0) return item;
+ item = new TreeItem (this, parentItem, SWT.NONE, index, false);
+ items [index] = item;
+ return item;
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the user changes the receiver's selection, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * When <code>widgetSelected</code> is called, the item field of the event object is valid.
+ * If the receiver has the <code>SWT.CHECK</code> style and the check selection changes,
+ * the event object detail field contains the value <code>SWT.CHECK</code>.
+ * <code>widgetDefaultSelected</code> is typically called when an item is double-clicked.
+ * The item field of the event object is valid for default selection, but the detail field is not used.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the user changes the receiver's selection
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener(SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Selection, typedListener);
+ addListener (SWT.DefaultSelection, typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when an item in the receiver is expanded or collapsed
+ * by sending it one of the messages defined in the <code>TreeListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see TreeListener
+ * @see #removeTreeListener
+ */
+public void addTreeListener(TreeListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Expand, typedListener);
+ addListener (SWT.Collapse, typedListener);
+}
+
+boolean checkData (TreeItem item, boolean redraw) {
+ if (item.cached) return true;
+ if ((style & SWT.VIRTUAL) != 0) {
+ item.cached = true;
+ Event event = new Event ();
+ TreeItem parentItem = item.getParentItem ();
+ event.item = item;
+ event.index = parentItem == null ? indexOf (item) : parentItem.indexOf (item);
+// ignoreRedraw = true;
+ sendEvent (SWT.SetData, event);
+ //widget could be disposed at this point
+// ignoreRedraw = false;
+ if (isDisposed () || item.isDisposed ()) return false;
+ if (redraw) {
+// if (!setScrollWidth (item)) item.redraw (OS.kDataBrowserNoItem);
+ }
+ }
+ return true;
+}
+
+static int checkStyle (int style) {
+ /*
+ * Feature in Windows. It is not possible to create
+ * a tree that scrolls and does not have scroll bars.
+ * The TVS_NOSCROLL style will remove the scroll bars
+ * but the tree will never scroll. Therefore, no matter
+ * what style bits are specified, set the H_SCROLL and
+ * V_SCROLL bits so that the SWT style will match the
+ * widget that Windows creates.
+ */
+ style |= SWT.H_SCROLL | SWT.V_SCROLL;
+ return checkBits (style, SWT.SINGLE, SWT.MULTI, 0, 0, 0, 0);
+}
+
+protected void checkSubclass () {
+ if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+void clear (TreeItem parentItem, int index, boolean all) {
+// int [] ids = parentItem == null ? childIds : parentItem.childIds;
+// TreeItem item = _getItem (ids [index], false);
+// if (item != null) {
+// item.clear();
+// if (all) {
+// clearAll (item, true);
+// } else {
+// int container = parentItem == null ? OS.kDataBrowserNoItem : parentItem.id;
+// OS.UpdateDataBrowserItems (handle, container, 1, new int[] {item.id}, OS.kDataBrowserItemNoProperty, OS.kDataBrowserNoItem);
+// }
+// }
+}
+
+void clearAll (TreeItem parentItem, boolean all) {
+// boolean update = !inClearAll;
+// int count = getItemCount (parentItem);
+// if (count == 0) return;
+// inClearAll = true;
+// int [] ids = parentItem == null ? childIds : parentItem.childIds;
+// for (int i=0; i<count; i++) {
+// TreeItem item = _getItem (ids [i], false);
+// if (item != null) {
+// item.clear ();
+// if (all) clearAll (item, true);
+// }
+// }
+// if (update) {
+// OS.UpdateDataBrowserItems (handle, 0, 0, null, OS.kDataBrowserItemNoProperty, OS.kDataBrowserNoItem);
+// inClearAll = false;
+// }
+}
+
+/**
+ * Clears the item at the given zero-relative index in the receiver.
+ * The text, icon and other attributes of the item are set to the default
+ * value. If the tree was created with the <code>SWT.VIRTUAL</code> style,
+ * these attributes are requested again as needed.
+ *
+ * @param index the index of the item to clear
+ * @param all <code>true</code> if all child items of the indexed item should be
+ * cleared recursively, and <code>false</code> otherwise
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT#VIRTUAL
+ * @see SWT#SetData
+ *
+ * @since 3.2
+ */
+public void clear (int index, boolean all) {
+ checkWidget ();
+ int count = getItemCount ();
+ if (index < 0 || index >= count) error (SWT.ERROR_INVALID_RANGE);
+ clear (null, index, all);
+}
+
+/**
+ * Clears all the items in the receiver. The text, icon and other
+ * attributes of the items are set to their default values. If the
+ * tree was created with the <code>SWT.VIRTUAL</code> style, these
+ * attributes are requested again as needed.
+ *
+ * @param all <code>true</code> if all child items should be cleared
+ * recursively, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT#VIRTUAL
+ * @see SWT#SetData
+ *
+ * @since 3.2
+ */
+public void clearAll (boolean all) {
+ checkWidget ();
+ clearAll (null, all);
+}
+
+public Point computeSize (int wHint, int hHint, boolean changed) {
+ checkWidget ();
+ int width = 0, height = 0;
+ if (wHint == SWT.DEFAULT) {
+ if (columnCount != 0) {
+ for (int i=0; i<columnCount; i++) {
+ width += columns [i].getWidth ();
+ }
+ } else {
+// int levelIndent = DISCLOSURE_COLUMN_LEVEL_INDENT;
+// if (OS.VERSION >= 0x1040) {
+// float [] metric = new float [1];
+// OS.DataBrowserGetMetric (handle, OS.kDataBrowserMetricDisclosureColumnPerDepthGap, null, metric);
+// levelIndent = (int) metric [0];
+// }
+// GC gc = new GC (this);
+// width = calculateWidth (childIds, gc, true, 0, levelIndent);
+// gc.dispose ();
+// width += getInsetWidth (column_id, true);
+ }
+ } else {
+ width = wHint;
+ }
+ if (hHint == SWT.DEFAULT) {
+ height = ((NSTableView)view).numberOfRows() * getItemHeight () + getHeaderHeight();
+ } else {
+ height = hHint;
+ }
+ if (width <= 0) width = DEFAULT_WIDTH;
+ if (height <= 0) height = DEFAULT_HEIGHT;
+ Rectangle rect = computeTrim (0, 0, width, height);
+ return new Point (rect.width, rect.height);
+}
+
+void createHandle () {
+ SWTScrollView scrollWidget = (SWTScrollView)new SWTScrollView().alloc();
+ scrollWidget.initWithFrame(new NSRect ());
+ scrollWidget.setHasHorizontalScroller(true);
+ scrollWidget.setHasVerticalScroller(true);
+ scrollWidget.setBorderType(hasBorder() ? OS.NSBezelBorder : OS.NSNoBorder);
+ scrollWidget.setTag(jniRef);
+
+ NSOutlineView widget = (NSOutlineView)new SWTOutlineView().alloc();
+ widget.initWithFrame(new NSRect());
+ widget.setAllowsMultipleSelection((style & SWT.MULTI) != 0);
+ widget.setAutoresizesOutlineColumn(false);
+ widget.setAutosaveExpandedItems(true);
+ widget.setDataSource(widget);
+ widget.setDelegate(widget);
+ widget.setTag(jniRef);
+ widget.setDoubleAction(OS.sel_sendDoubleSelection);
+
+ headerView = widget.headerView();
+ headerView.retain();
+ widget.setHeaderView(null);
+
+ NSString str = NSString.stringWith("");
+ if ((style & SWT.CHECK) != 0) {
+ checkColumn = (NSTableColumn)new NSTableColumn().alloc();
+ checkColumn.initWithIdentifier(str);
+ checkColumn.headerCell().setTitle(str);
+ widget.addTableColumn (checkColumn);
+ widget.setOutlineTableColumn(checkColumn);
+ NSButtonCell cell = (NSButtonCell)new NSButtonCell().alloc().init();
+ checkColumn.setDataCell(cell);
+ cell.setButtonType(OS.NSSwitchButton);
+ cell.setImagePosition(OS.NSImageOnly);
+ cell.setAllowsMixedState(true);
+ //TODO - compute width
+ checkColumn.setWidth(20);
+ checkColumn.setResizingMask(OS.NSTableColumnNoResizing);
+ checkColumn.setEditable(false);
+ cell.release();
+ }
+
+ firstColumn = (NSTableColumn)new NSTableColumn().alloc();
+ firstColumn.initWithIdentifier(str);
+ firstColumn.headerCell().setTitle(str);
+ widget.addTableColumn (firstColumn);
+ widget.setOutlineTableColumn(firstColumn);
+ NSBrowserCell cell = (NSBrowserCell)new NSBrowserCell().alloc().init();
+ cell.setLeaf(true);
+ firstColumn.setDataCell(cell);
+ cell.release();
+
+ scrollView = scrollWidget;
+ view = widget;
+ scrollView.setDocumentView(widget);
+ parent.contentView().addSubview_(scrollView);
+}
+
+void createItem (TreeColumn column, int index) {
+ if (!(0 <= index && index <= columnCount)) error (SWT.ERROR_INVALID_RANGE);
+ if (index == 0) {
+ // first column must be left aligned
+ column.style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+ column.style |= SWT.LEFT;
+ }
+ if (columnCount == columns.length) {
+ TreeColumn [] newColumns = new TreeColumn [columnCount + 4];
+ System.arraycopy (columns, 0, newColumns, 0, columns.length);
+ columns = newColumns;
+ }
+ NSTableColumn nsColumn;
+ if (columnCount == 0) {
+ //TODO - clear attributes, alignment etc.
+ nsColumn = firstColumn;
+ firstColumn = null;
+ } else {
+ //TODO - set attributes, alignment etc.
+ NSString str = NSString.stringWith("");
+ nsColumn = (NSTableColumn)new NSTableColumn().alloc();
+ nsColumn.initWithIdentifier(str);
+ nsColumn.headerCell().setTitle(str);
+ ((NSTableView)view).addTableColumn (nsColumn);
+ ((NSTableView)view).moveColumn (columnCount, index);
+ NSBrowserCell cell = (NSBrowserCell)new NSBrowserCell().alloc().init();
+ cell.setLeaf(true);
+ nsColumn.setDataCell(cell);
+ cell.release();
+ }
+ column.nsColumn = nsColumn;
+ nsColumn.headerCell().setTitle(NSString.stringWith(""));
+ nsColumn.setWidth(0);
+ System.arraycopy (columns, index, columns, index + 1, columnCount++ - index);
+ columns [index] = column;
+ if (columnCount > 1) {
+ for (int i=0; i<items.length; i++) {
+ TreeItem item = items [i];
+ if (item != null) {
+ String [] strings = item.strings;
+ if (strings != null) {
+ String [] temp = new String [columnCount];
+ System.arraycopy (strings, 0, temp, 0, index);
+ System.arraycopy (strings, index, temp, index+1, columnCount-index-1);
+ temp [index] = "";
+ item.strings = temp;
+ }
+ if (index == 0) item.text = "";
+ Image [] images = item.images;
+ if (images != null) {
+ Image [] temp = new Image [columnCount];
+ System.arraycopy (images, 0, temp, 0, index);
+ System.arraycopy (images, index, temp, index+1, columnCount-index-1);
+ item.images = temp;
+ }
+ if (index == 0) item.image = null;
+ Color [] cellBackground = item.cellBackground;
+ if (cellBackground != null) {
+ Color [] temp = new Color [columnCount];
+ System.arraycopy (cellBackground, 0, temp, 0, index);
+ System.arraycopy (cellBackground, index, temp, index+1, columnCount-index-1);
+ item.cellBackground = temp;
+ }
+ Color [] cellForeground = item.cellForeground;
+ if (cellForeground != null) {
+ Color [] temp = new Color [columnCount];
+ System.arraycopy (cellForeground, 0, temp, 0, index);
+ System.arraycopy (cellForeground, index, temp, index+1, columnCount-index-1);
+ item.cellForeground = temp;
+ }
+ Font [] cellFont = item.cellFont;
+ if (cellFont != null) {
+ Font [] temp = new Font [columnCount];
+ System.arraycopy (cellFont, 0, temp, 0, index);
+ System.arraycopy (cellFont, index, temp, index+1, columnCount-index-1);
+ item.cellFont = temp;
+ }
+ }
+ }
+ }
+}
+
+void createItem (TreeItem item, TreeItem parentItem, int index) {
+ int count;
+ TreeItem[] items;
+ if (parentItem != null) {
+ count = parentItem.itemCount;
+ items = parentItem.items;
+ } else {
+ count = this.itemCount;
+ items = this.items;
+ }
+ if (index == -1) index = count;
+ if (!(0 <= index && index <= count)) error (SWT.ERROR_INVALID_RANGE);
+ if (count == items.length) {
+ TreeItem [] newItems = new TreeItem [items.length + 4];
+ System.arraycopy (items, 0, newItems, 0, items.length);
+ items = newItems;
+ if (parentItem != null) {
+ parentItem.items = items;
+ } else {
+ this.items = items;
+ }
+ }
+ System.arraycopy (items, index, items, index + 1, count++ - index);
+ items [index] = item;
+ item.items = new TreeItem[4];
+ item.createJNIRef();
+ SWTTreeItem handle = (SWTTreeItem)new SWTTreeItem().alloc().init();
+ handle.setTag(item.jniRef);
+ item.handle = handle;
+ if (parentItem != null) {
+ parentItem.itemCount = count;
+ } else {
+ this.itemCount = count;
+ }
+ //TODO ?
+ ((NSTableView)view).reloadData();
+}
+
+void createWidget () {
+ super.createWidget ();
+ items = new TreeItem [4];
+ columns = new TreeColumn [4];
+}
+
+Color defaultBackground () {
+ return display.getSystemColor (SWT.COLOR_LIST_BACKGROUND);
+}
+
+Color defaultForeground () {
+ return display.getSystemColor (SWT.COLOR_LIST_FOREGROUND);
+}
+
+/**
+ * Deselects all selected items in the receiver.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void deselectAll () {
+ checkWidget ();
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ widget.deselectAll(null);
+ widget.setDelegate(widget);
+}
+
+public void deselect (TreeItem item) {
+ checkWidget ();
+ if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+// ignoreSelect = true;
+// /*
+// * Bug in the Macintosh. When the DataBroswer selection flags includes
+// * both kDataBrowserNeverEmptySelectionSet and kDataBrowserSelectOnlyOne,
+// * two items are selected when SetDataBrowserSelectedItems() is called
+// * with kDataBrowserItemsAssign to assign a new seletion despite the fact
+// * that kDataBrowserSelectOnlyOne was specified. The fix is to save and
+// * restore kDataBrowserNeverEmptySelectionSet around each call to
+// * SetDataBrowserSelectedItems().
+// */
+// int [] selectionFlags = null;
+// if ((style & SWT.SINGLE) != 0) {
+// selectionFlags = new int [1];
+// OS.GetDataBrowserSelectionFlags (handle, selectionFlags);
+// OS.SetDataBrowserSelectionFlags (handle, selectionFlags [0] & ~OS.kDataBrowserNeverEmptySelectionSet);
+// }
+// OS.SetDataBrowserSelectedItems (handle, 1, new int [] {item.id}, OS.kDataBrowserItemsRemove);
+// if ((style & SWT.SINGLE) != 0) {
+// OS.SetDataBrowserSelectionFlags (handle, selectionFlags [0]);
+// }
+// ignoreSelect = false;
+}
+
+
+void destroyItem (TreeColumn column) {
+ int index = 0;
+ while (index < columnCount) {
+ if (columns [index] == column) break;
+ index++;
+ }
+ for (int i=0; i<items.length; i++) {
+ TreeItem item = items [i];
+ if (item != null) {
+ if (columnCount <= 1) {
+ item.strings = null;
+ item.images = null;
+ item.cellBackground = null;
+ item.cellForeground = null;
+ item.cellFont = null;
+ } else {
+ if (item.strings != null) {
+ String [] strings = item.strings;
+ if (index == 0) {
+ item.text = strings [1] != null ? strings [1] : "";
+ }
+ String [] temp = new String [columnCount - 1];
+ System.arraycopy (strings, 0, temp, 0, index);
+ System.arraycopy (strings, index + 1, temp, index, columnCount - 1 - index);
+ item.strings = temp;
+ } else {
+ if (index == 0) item.text = "";
+ }
+ if (item.images != null) {
+ Image [] images = item.images;
+ if (index == 0) item.image = images [1];
+ Image [] temp = new Image [columnCount - 1];
+ System.arraycopy (images, 0, temp, 0, index);
+ System.arraycopy (images, index + 1, temp, index, columnCount - 1 - index);
+ item.images = temp;
+ } else {
+ if (index == 0) item.image = null;
+ }
+ if (item.cellBackground != null) {
+ Color [] cellBackground = item.cellBackground;
+ Color [] temp = new Color [columnCount - 1];
+ System.arraycopy (cellBackground, 0, temp, 0, index);
+ System.arraycopy (cellBackground, index + 1, temp, index, columnCount - 1 - index);
+ item.cellBackground = temp;
+ }
+ if (item.cellForeground != null) {
+ Color [] cellForeground = item.cellForeground;
+ Color [] temp = new Color [columnCount - 1];
+ System.arraycopy (cellForeground, 0, temp, 0, index);
+ System.arraycopy (cellForeground, index + 1, temp, index, columnCount - 1 - index);
+ item.cellForeground = temp;
+ }
+ if (item.cellFont != null) {
+ Font [] cellFont = item.cellFont;
+ Font [] temp = new Font [columnCount - 1];
+ System.arraycopy (cellFont, 0, temp, 0, index);
+ System.arraycopy (cellFont, index + 1, temp, index, columnCount - 1 - index);
+ item.cellFont = temp;
+ }
+ }
+ }
+ }
+// if (columnCount == 1) {
+// column_id = column.id; idCount = 0;
+// DataBrowserListViewHeaderDesc desc = new DataBrowserListViewHeaderDesc ();
+// desc.version = OS.kDataBrowserListViewLatestHeaderDesc;
+// short [] width = new short [1];
+// OS.GetDataBrowserTableViewNamedColumnWidth (handle, column_id, width);
+// desc.minimumWidth = desc.maximumWidth = width [0];
+// int str = OS.CFStringCreateWithCharacters (OS.kCFAllocatorDefault, null, 0);
+// desc.titleString = str;
+// OS.SetDataBrowserListViewHeaderDesc (handle, column_id, desc);
+// OS.CFRelease (str);
+// } else {
+// int [] disclosure = new int [1];
+// boolean [] expandableRows = new boolean [1];
+// OS.GetDataBrowserListViewDisclosureColumn (handle, disclosure, expandableRows);
+// if (disclosure [0] == column.id) {
+// TreeColumn firstColumn = columns [1];
+// firstColumn.style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+// firstColumn.style |= SWT.LEFT;
+// firstColumn.updateHeader();
+// OS.SetDataBrowserListViewDisclosureColumn (handle, firstColumn.id, expandableRows [0]);
+// }
+// if (OS.RemoveDataBrowserTableViewColumn (handle, column.id) != OS.noErr) {
+// error (SWT.ERROR_ITEM_NOT_REMOVED);
+// }
+// }
+ System.arraycopy (columns, index + 1, columns, index, --columnCount - index);
+ columns [columnCount] = null;
+ for (int i=index; i<columnCount; i++) {
+ columns [i].sendEvent (SWT.Move);
+ }
+}
+
+void destroyItem (TreeItem item) {
+ int count;
+ TreeItem[] items;
+ TreeItem parentItem = item.parentItem;
+ if (parentItem != null) {
+ count = parentItem.itemCount;
+ items = parentItem.items;
+ } else {
+ count = this.itemCount;
+ items = this.items;
+ }
+ int index = 0;
+ while (index < count) {
+ if (items [index] == item) break;
+ index++;
+ }
+// if (index != itemCount - 1) fixSelection (index, false);
+ System.arraycopy (items, index + 1, items, index, --count - index);
+ items [count] = null;
+ if (parentItem != null) {
+ parentItem.itemCount = count;
+ } else {
+ this.itemCount = count;
+ }
+ ((NSTableView)view).noteNumberOfRowsChanged();
+// setScrollWidth (true);
+// fixScrollBar ();
+}
+
+
+void fixScrollBar () {
+ /*
+ * Bug in the Macintosh. For some reason, the data browser does not update
+ * the vertical scrollbar when it is scrolled to the bottom and items are
+ * removed. The fix is to check if the scrollbar value is bigger the
+ * maximum number of visible items and clamp it when needed.
+ */
+// int [] top = new int [1], left = new int [1];
+// OS.GetDataBrowserScrollPosition (handle, top, left);
+// int maximum = Math.max (0, getItemHeight () * visibleCount - getClientArea ().height);
+// if (top [0] > maximum) {
+// OS.SetDataBrowserScrollPosition (handle, maximum, left [0]);
+// }
+}
+
+/**
+ * Returns the column at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ * Columns are returned in the order that they were created.
+ * If no <code>TreeColumn</code>s were created by the programmer,
+ * this method will throw <code>ERROR_INVALID_RANGE</code> despite
+ * the fact that a single column of data may be visible in the tree.
+ * This occurs when the programmer uses the tree like a list, adding
+ * items but never creating a column.
+ *
+ * @param index the index of the column to return
+ * @return the column at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Tree#getColumnOrder()
+ * @see Tree#setColumnOrder(int[])
+ * @see TreeColumn#getMoveable()
+ * @see TreeColumn#setMoveable(boolean)
+ * @see SWT#Move
+ *
+ * @since 3.1
+ */
+public TreeColumn getColumn (int index) {
+ checkWidget ();
+ if (!(0 <=index && index < columnCount)) error (SWT.ERROR_INVALID_RANGE);
+ return columns [index];
+}
+
+/**
+ * Returns the number of columns contained in the receiver.
+ * If no <code>TreeColumn</code>s were created by the programmer,
+ * this value is zero, despite the fact that visually, one column
+ * of items may be visible. This occurs when the programmer uses
+ * the tree like a list, adding items but never creating a column.
+ *
+ * @return the number of columns
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int getColumnCount () {
+ checkWidget ();
+ return columnCount;
+}
+
+/**
+ * Returns an array of zero-relative integers that map
+ * the creation order of the receiver's items to the
+ * order in which they are currently being displayed.
+ * <p>
+ * Specifically, the indices of the returned array represent
+ * the current visual order of the items, and the contents
+ * of the array represent the creation order of the items.
+ * </p><p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the current visual order of the receiver's items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Tree#setColumnOrder(int[])
+ * @see TreeColumn#getMoveable()
+ * @see TreeColumn#setMoveable(boolean)
+ * @see SWT#Move
+ *
+ * @since 3.2
+ */
+public int [] getColumnOrder () {
+ checkWidget ();
+ int [] order = new int [columnCount];
+ int [] position = new int [1];
+ for (int i=0; i<columnCount; i++) {
+ TreeColumn column = columns [i];
+// OS.GetDataBrowserTableViewColumnPosition (handle, column.id, position);
+// if ((style & SWT.CHECK) != 0) position [0] -= 1;
+ order [position [0]] = i;
+ }
+ return order;
+}
+
+/**
+ * Returns an array of <code>TreeColumn</code>s which are the
+ * columns in the receiver. Columns are returned in the order
+ * that they were created. If no <code>TreeColumn</code>s were
+ * created by the programmer, the array is empty, despite the fact
+ * that visually, one column of items may be visible. This occurs
+ * when the programmer uses the tree like a list, adding items but
+ * never creating a column.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items in the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Tree#getColumnOrder()
+ * @see Tree#setColumnOrder(int[])
+ * @see TreeColumn#getMoveable()
+ * @see TreeColumn#setMoveable(boolean)
+ * @see SWT#Move
+ *
+ * @since 3.1
+ */
+public TreeColumn [] getColumns () {
+ checkWidget ();
+ TreeColumn [] result = new TreeColumn [columnCount];
+ System.arraycopy (columns, 0, result, 0, columnCount);
+ return result;
+}
+
+/**
+ * Returns the width in pixels of a grid line.
+ *
+ * @return the width of a grid line in pixels
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int getGridLineWidth () {
+ checkWidget ();
+ return 0;
+}
+
+/**
+ * Returns the height of the receiver's header
+ *
+ * @return the height of the header or zero if the header is not visible
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int getHeaderHeight () {
+ checkWidget ();
+ NSTableHeaderView headerView = ((NSTableView)view).headerView();
+ if (headerView == null) return 0;
+ return (int)headerView.bounds().height;
+}
+
+/**
+ * Returns <code>true</code> if the receiver's header is visible,
+ * and <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the receiver's header's visibility state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public boolean getHeaderVisible () {
+ checkWidget ();
+ return ((NSTableView)view).headerView() != null;
+}
+
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public TreeItem getItem (int index) {
+ checkWidget ();
+ int count = getItemCount ();
+ if (index < 0 || index >= count) error (SWT.ERROR_INVALID_RANGE);
+ return _getItem (null, index);
+}
+
+/**
+ * Returns the item at the given point in the receiver
+ * or null if no such item exists. The point is in the
+ * coordinate system of the receiver.
+ * <p>
+ * The item that is returned represents an item that could be selected by the user.
+ * For example, if selection only occurs in items in the first column, then null is
+ * returned if the point is outside of the item.
+ * Note that the SWT.FULL_SELECTION style hint, which specifies the selection policy,
+ * determines the extent of the selection.
+ * </p>
+ *
+ * @param point the point used to locate the item
+ * @return the item at the given point, or null if the point is not in a selectable item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the point is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TreeItem getItem (Point point) {
+ checkWidget ();
+ if (point == null) error (SWT.ERROR_NULL_ARGUMENT);
+// Rect rect = new Rect ();
+// org.eclipse.swt.internal.carbon.Point pt = new org.eclipse.swt.internal.carbon.Point ();
+// OS.SetPt (pt, (short) point.x, (short) point.y);
+// if (0 < lastHittest && lastHittest <= items.length && lastHittestColumn != 0) {
+// TreeItem item = _getItem (lastHittest, false);
+// if (item != null) {
+// if (OS.GetDataBrowserItemPartBounds (handle, item.id, lastHittestColumn, OS.kDataBrowserPropertyDisclosurePart, rect) == OS.noErr) {
+// if (OS.PtInRect (pt, rect)) return null;
+// }
+// if (OS.GetDataBrowserItemPartBounds (handle, item.id, lastHittestColumn, OS.kDataBrowserPropertyEnclosingPart, rect) == OS.noErr) {
+// if (rect.top <= pt.v && pt.v <= rect.bottom) {
+// if ((style & SWT.FULL_SELECTION) != 0) {
+// return item;
+// } else {
+// return OS.PtInRect (pt, rect) ? item : null;
+// }
+// }
+// }
+// }
+// }
+// //TODO - optimize
+// for (int i=0; i<items.length; i++) {
+// TreeItem item = items [i];
+// if (item != null) {
+// if (OS.GetDataBrowserItemPartBounds (handle, item.id, column_id, OS.kDataBrowserPropertyDisclosurePart, rect) == OS.noErr) {
+// if (OS.PtInRect (pt, rect)) return null;
+// }
+// if (columnCount == 0) {
+// if (OS.GetDataBrowserItemPartBounds (handle, item.id, column_id, OS.kDataBrowserPropertyEnclosingPart, rect) == OS.noErr) {
+// if (rect.top <= pt.v && pt.v <= rect.bottom) {
+// if ((style & SWT.FULL_SELECTION) != 0) {
+// return item;
+// } else {
+// return OS.PtInRect (pt, rect) ? item : null;
+// }
+// }
+// }
+// } else {
+// for (int j = 0; j < columnCount; j++) {
+// if (OS.GetDataBrowserItemPartBounds (handle, item.id, columns [j].id, OS.kDataBrowserPropertyEnclosingPart, rect) == OS.noErr) {
+// if (rect.top <= pt.v && pt.v <= rect.bottom) {
+// if ((style & SWT.FULL_SELECTION) != 0) {
+// return item;
+// } else {
+// return OS.PtInRect (pt, rect) ? item : null;
+// }
+// }
+// }
+// }
+// }
+// }
+// }
+ return null;
+}
+
+/**
+ * Returns the number of items contained in the receiver
+ * that are direct item children of the receiver. The
+ * number that is returned is the number of roots in the
+ * tree.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+ checkWidget ();
+ return itemCount;
+}
+
+/**
+ * Returns the height of the area which would be used to
+ * display <em>one</em> of the items in the tree.
+ *
+ * @return the height of one item
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemHeight () {
+ checkWidget ();
+ return (int)((NSTableView)view).rowHeight();
+}
+
+/**
+ * Returns a (possibly empty) array of items contained in the
+ * receiver that are direct item children of the receiver. These
+ * are the roots of the tree.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TreeItem [] getItems () {
+ checkWidget ();
+ TreeItem [] result = new TreeItem [itemCount];
+ for (int i=0; i<itemCount; i++) {
+ result [i] = _getItem (null, i);
+ }
+ return result;
+}
+
+/**
+ * Returns <code>true</code> if the receiver's lines are visible,
+ * and <code>false</code> otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, this method
+ * may still indicate that it is considered visible even though
+ * it may not actually be showing.
+ * </p>
+ *
+ * @return the visibility state of the lines
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public boolean getLinesVisible () {
+ checkWidget ();
+// if (OS.VERSION >= 0x1040) {
+// int [] attrib = new int [1];
+// OS.DataBrowserGetAttributes (handle, attrib);
+// return (attrib [0] & (OS.kDataBrowserAttributeListViewAlternatingRowColors | OS.kDataBrowserAttributeListViewDrawColumnDividers)) != 0;
+// }
+ return false;
+}
+
+/**
+ * Returns the receiver's parent item, which must be a
+ * <code>TreeItem</code> or null when the receiver is a
+ * root.
+ *
+ * @return the receiver's parent item
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TreeItem getParentItem () {
+ checkWidget ();
+ return null;
+}
+
+/**
+ * Returns an array of <code>TreeItem</code>s that are currently
+ * selected in the receiver. The order of the items is unspecified.
+ * An empty array indicates that no items are selected.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its selection, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ * @return an array representing the selection
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TreeItem [] getSelection () {
+ checkWidget ();
+// int [] count = new int [1];
+// if (OS.GetDataBrowserItemCount (handle, OS.kDataBrowserNoItem, true, OS.kDataBrowserItemIsSelected, count) != OS.noErr) {
+// error (SWT.ERROR_CANNOT_GET_COUNT);
+// }
+// TreeItem [] result = new TreeItem [count[0]];
+// if (count[0] > 0) {
+// int ptr = OS.NewHandle (0);
+// if (count[0] == 1) {
+// if (OS.GetDataBrowserItems (handle, OS.kDataBrowserNoItem, true, OS.kDataBrowserItemIsSelected, ptr) != OS.noErr) {
+// error (SWT.ERROR_CANNOT_GET_SELECTION);
+// }
+// OS.HLock (ptr);
+// int [] id = new int [1];
+// OS.memmove (id, ptr, 4);
+// OS.memmove (id, id [0], 4);
+// result [0] = _getItem (id [0], true);
+// OS.HUnlock (ptr);
+// } else {
+// getSelection (result, OS.kDataBrowserNoItem, ptr, 0);
+// }
+// OS.DisposeHandle (ptr);
+// }
+// return result;
+ return null;
+}
+
+/**
+ * Returns the number of selected items contained in the receiver.
+ *
+ * @return the number of selected items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getSelectionCount () {
+ checkWidget ();
+ int [] count = new int [1];
+// if (OS.GetDataBrowserItemCount (handle, OS.kDataBrowserNoItem, true, OS.kDataBrowserItemIsSelected, count) != OS.noErr) {
+// error (SWT.ERROR_CANNOT_GET_COUNT);
+// }
+ return count [0];
+}
+
+/**
+ * Returns the column which shows the sort indicator for
+ * the receiver. The value may be null if no column shows
+ * the sort indicator.
+ *
+ * @return the sort indicator
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setSortColumn(TreeColumn)
+ *
+ * @since 3.2
+ */
+public TreeColumn getSortColumn () {
+ checkWidget ();
+ return sortColumn;
+}
+
+/**
+ * Returns the direction of the sort indicator for the receiver.
+ * The value will be one of <code>UP</code>, <code>DOWN</code>
+ * or <code>NONE</code>.
+ *
+ * @return the sort direction
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setSortDirection(int)
+ *
+ * @since 3.2
+ */
+public int getSortDirection () {
+ checkWidget ();
+ return sortDirection;
+}
+
+/**
+ * Returns the item which is currently at the top of the receiver.
+ * This item can change when items are expanded, collapsed, scrolled
+ * or new items are added or removed.
+ *
+ * @return the item at the top of the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.1
+ */
+public TreeItem getTopItem () {
+ checkWidget();
+// //TODO - optimize
+// Rect rect = new Rect ();
+// int y = getBorder () + getHeaderHeight ();
+// for (int i=0; i<items.length; i++) {
+// TreeItem item = items [i];
+// if (item != null) {
+// int columnId = (columnCount == 0) ? column_id : columns [0].id;
+// if (OS.GetDataBrowserItemPartBounds (handle, item.id, columnId, OS.kDataBrowserPropertyEnclosingPart, rect) == OS.noErr) {
+// if (rect.top <= y && y <= rect.bottom) return item;
+// }
+// }
+// }
+ return null;
+}
+
+/**
+ * Searches the receiver's list starting at the first column
+ * (index 0) until a column is found that is equal to the
+ * argument, and returns the index of that column. If no column
+ * is found, returns -1.
+ *
+ * @param column the search column
+ * @return the index of the column
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the column is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int indexOf (TreeColumn column) {
+ checkWidget ();
+ if (column == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (column.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ for (int i=0; i<columnCount; i++) {
+ if (columns [i] == column) return i;
+ }
+ return -1;
+}
+
+/**
+ * Searches the receiver's list starting at the first item
+ * (index 0) until an item is found that is equal to the
+ * argument, and returns the index of that item. If no item
+ * is found, returns -1.
+ *
+ * @param item the search item
+ * @return the index of the item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int indexOf (TreeItem item) {
+ checkWidget ();
+ if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ if (item.parentItem != null) return -1;
+ for (int i = 0; i < itemCount; i++) {
+ if (item == items[i]) return i;
+ }
+ return -1;
+}
+
+int outlineView_child_ofItem(int outlineView, int index, int ref) {
+ TreeItem parent = null;
+ if (ref != 0) parent = (TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag));
+ TreeItem item = _getItem(parent, index);
+ return item.handle.id;
+}
+
+int outlineView_objectValueForTableColumn_byItem(int outlineView, int tableColumn, int ref) {
+ TreeItem item = (TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag));
+ if (checkColumn != null && tableColumn == checkColumn.id) {
+ NSNumber value;
+ if (item.checked && item.grayed) {
+ value = NSNumber.numberWithInt(OS.NSMixedState);
+ } else {
+ value = NSNumber.numberWithInt(item.checked ? OS.NSOnState : OS.NSOffState);
+ }
+ return value.id;
+ }
+ for (int i=0; i<columnCount; i++) {
+ if (columns [i].nsColumn.id == tableColumn) {
+ return item.createString(i).id;
+ }
+ }
+ return item.createString(0).id;
+}
+
+boolean outlineView_isItemExpandable(int outlineView, int ref) {
+ if (ref == 0) return true;
+ return ((TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag))).itemCount != 0;
+}
+
+int outlineView_numberOfChildrenOfItem(int outlineView, int ref) {
+ if (ref == 0) return itemCount;
+ return ((TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag))).itemCount;
+}
+
+void outlineView_willDisplayCell_forTableColumn_item(int outlineView, int cell, int tableColumn, int ref) {
+ if (checkColumn != null && tableColumn == checkColumn.id) return;
+ TreeItem item = (TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag));
+ Image image = item.image;
+ for (int i=0; i<columnCount; i++) {
+ if (columns [i].nsColumn.id == tableColumn) {
+ image = item.getImage(i);
+ }
+ }
+ NSBrowserCell browserCell = new NSBrowserCell(cell);
+ browserCell.setImage(image != null ? image.handle : null);
+}
+
+void outlineView_setObjectValue_forTableColumn_byItem(int outlineView, int object, int tableColumn, int ref) {
+ TreeItem item = (TreeItem)OS.JNIGetObject(OS.objc_msgSend(ref, OS.sel_tag));
+ if (checkColumn != null && tableColumn == checkColumn.id) {
+ int value = new NSNumber(object).intValue();
+ switch (value) {
+ case OS.NSMixedState:
+ item.checked = true;
+ item.grayed = true;
+ break;
+ case OS.NSOnState:
+ item.checked = true;
+ item.grayed = false;
+ break;
+ case OS.NSOffState:
+ item.checked = false;
+ item.grayed = false;
+ break;
+ }
+ Event event = new Event();
+ event.detail = SWT.CHECK;
+ postEvent(SWT.Selection, event);
+ }
+}
+
+void releaseChildren (boolean destroy) {
+ for (int i=0; i<items.length; i++) {
+ TreeItem item = items [i];
+ if (item != null && !item.isDisposed ()) {
+ item.release (false);
+ }
+ }
+ items = null;
+ if (columns != null) {
+ for (int i=0; i<columnCount; i++) {
+ TreeColumn column = columns [i];
+ if (column != null && !column.isDisposed ()) {
+ column.release (false);
+ }
+ }
+ columns = null;
+ }
+ super.releaseChildren (destroy);
+}
+
+void releaseHandle () {
+ super.releaseHandle ();
+ if (headerView != null) headerView.release();
+ headerView = null;
+ if (firstColumn != null) firstColumn.release();
+ firstColumn = null;
+ if (checkColumn != null) checkColumn.release();
+ checkColumn = null;
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ //release handle
+ sortColumn = null;
+}
+
+/**
+ * Removes all of the items from the receiver.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void removeAll () {
+ checkWidget ();
+ for (int i=0; i<items.length; i++) {
+ TreeItem item = items [i];
+ if (item != null && !item.isDisposed ()) item.release (false);
+ }
+ items = new TreeItem [4];
+ itemCount = 0;
+ ((NSTableView)view).noteNumberOfRowsChanged();
+// setScrollWidth (true);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the user changes the receiver's selection.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener (SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ eventTable.unhook (SWT.Selection, listener);
+ eventTable.unhook (SWT.DefaultSelection, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when items in the receiver are expanded or collapsed.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see TreeListener
+ * @see #addTreeListener
+ */
+public void removeTreeListener(TreeListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Expand, listener);
+ eventTable.unhook (SWT.Collapse, listener);
+}
+
+/**
+ * Display a mark indicating the point at which an item will be inserted.
+ * The drop insert item has a visual hint to show where a dragged item
+ * will be inserted when dropped on the tree.
+ *
+ * @param item the insert item. Null will clear the insertion mark.
+ * @param before true places the insert mark above 'item'. false places
+ * the insert mark below 'item'.
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setInsertMark (TreeItem item, boolean before) {
+ checkWidget ();
+ if (item != null) {
+ if (item.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+}
+
+/**
+ * Selects all of the items in the receiver.
+ * <p>
+ * If the receiver is single-select, do nothing.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void selectAll () {
+ checkWidget ();
+ if ((style & SWT.SINGLE) != 0) return;
+ NSTableView widget = (NSTableView)view;
+ widget.setDelegate(null);
+ widget.selectAll(null);
+ widget.setDelegate(widget);
+}
+
+public void select (TreeItem item) {
+ checkWidget ();
+ if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+// showItem (item, false);
+// ignoreSelect = true;
+// /*
+// * Bug in the Macintosh. When the DataBroswer selection flags includes
+// * both kDataBrowserNeverEmptySelectionSet and kDataBrowserSelectOnlyOne,
+// * two items are selected when SetDataBrowserSelectedItems() is called
+// * with kDataBrowserItemsAssign to assign a new seletion despite the fact
+// * that kDataBrowserSelectOnlyOne was specified. The fix is to save and
+// * restore kDataBrowserNeverEmptySelectionSet around each call to
+// * SetDataBrowserSelectedItems().
+// */
+// int [] selectionFlags = null;
+// if ((style & SWT.SINGLE) != 0) {
+// selectionFlags = new int [1];
+// OS.GetDataBrowserSelectionFlags (handle, selectionFlags);
+// OS.SetDataBrowserSelectionFlags (handle, selectionFlags [0] & ~OS.kDataBrowserNeverEmptySelectionSet);
+// }
+// OS.SetDataBrowserSelectedItems (handle, 1, new int [] {item.id}, OS.kDataBrowserItemsAssign);
+// if ((style & SWT.SINGLE) != 0) {
+// OS.SetDataBrowserSelectionFlags (handle, selectionFlags [0]);
+// }
+// ignoreSelect = false;
+}
+
+/**
+ * Sets the order that the items in the receiver should
+ * be displayed in to the given argument which is described
+ * in terms of the zero-relative ordering of when the items
+ * were added.
+ *
+ * @param order the new order to display the items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the item order is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the item order is not the same length as the number of items</li>
+ * </ul>
+ *
+ * @see Tree#getColumnOrder()
+ * @see TreeColumn#getMoveable()
+ * @see TreeColumn#setMoveable(boolean)
+ * @see SWT#Move
+ *
+ * @since 3.2
+ */
+public void setColumnOrder (int [] order) {
+ checkWidget ();
+ if (order == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (columnCount == 0) {
+ if (order.length != 0) error (SWT.ERROR_INVALID_ARGUMENT);
+ return;
+ }
+ if (order.length != columnCount) error (SWT.ERROR_INVALID_ARGUMENT);
+ int [] oldOrder = getColumnOrder ();
+ boolean reorder = false;
+ boolean [] seen = new boolean [columnCount];
+ for (int i=0; i<order.length; i++) {
+ int index = order [i];
+ if (index < 0 || index >= columnCount) error (SWT.ERROR_INVALID_ARGUMENT);
+ if (seen [index]) error (SWT.ERROR_INVALID_ARGUMENT);
+ seen [index] = true;
+ if (order [i] != oldOrder [i]) reorder = true;
+ }
+ if (reorder) {
+ int [] disclosure = new int [1];
+ boolean [] expandableRows = new boolean [1];
+// OS.GetDataBrowserListViewDisclosureColumn (handle, disclosure, expandableRows);
+ TreeColumn firstColumn = columns [order [0]];
+// if (disclosure [0] != firstColumn.id) {
+// OS.SetDataBrowserListViewDisclosureColumn (handle, firstColumn.id, expandableRows [0]);
+// }
+ int x = 0;
+ short [] width = new short [1];
+ int [] oldX = new int [oldOrder.length];
+ for (int i=0; i<oldOrder.length; i++) {
+ int index = oldOrder [i];
+ TreeColumn column = columns [index];
+ oldX [index] = x;
+// OS.GetDataBrowserTableViewNamedColumnWidth(handle, column.id, width);
+ x += width [0];
+ }
+ x = 0;
+ int [] newX = new int [order.length];
+ for (int i=0; i<order.length; i++) {
+ int index = order [i];
+ TreeColumn column = columns [index];
+ int position = (style & SWT.CHECK) != 0 ? i + 1 : i;
+// OS.SetDataBrowserTableViewColumnPosition(handle, column.id, position);
+// column.lastPosition = position;
+ newX [index] = x;
+// OS.GetDataBrowserTableViewNamedColumnWidth(handle, column.id, width);
+ x += width [0];
+ }
+ TreeColumn[] newColumns = new TreeColumn [columnCount];
+ System.arraycopy (columns, 0, newColumns, 0, columnCount);
+ for (int i=0; i<columnCount; i++) {
+ TreeColumn column = newColumns [i];
+ if (!column.isDisposed ()) {
+ if (newX [i] != oldX [i]) {
+ column.sendEvent (SWT.Move);
+ }
+ }
+ }
+ }
+}
+
+/**
+ * Marks the receiver's header as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param show the new visibility state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setHeaderVisible (boolean show) {
+ checkWidget ();
+ ((NSTableView)view).setHeaderView (show ? headerView : null);
+}
+
+/**
+ * Sets the number of root-level items contained in the receiver.
+ *
+ * @param count the number of items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setItemCount (int count) {
+ checkWidget ();
+ count = Math.max (0, count);
+ setItemCount (null, count);
+}
+
+void setItemCount (TreeItem parentItem, int count) {
+// int itemCount = getItemCount (parentItem);
+// if (count == itemCount) return;
+// setRedraw (false);
+// int [] top = new int [1], left = new int [1];
+// OS.GetDataBrowserScrollPosition (handle, top, left);
+// DataBrowserCallbacks callbacks = new DataBrowserCallbacks ();
+// OS.GetDataBrowserCallbacks (handle, callbacks);
+// callbacks.v1_itemNotificationCallback = 0;
+// callbacks.v1_itemCompareCallback = 0;
+// OS.SetDataBrowserCallbacks (handle, callbacks);
+// int[] ids = parentItem == null ? childIds : parentItem.childIds;
+// if (count < itemCount) {
+// for (int index = ids.length - 1; index >= count; index--) {
+// int id = ids [index];
+// if (id != 0) {
+// TreeItem item = _getItem (id, false);
+// if (item != null && !item.isDisposed ()) {
+// item.dispose ();
+// } else {
+// if (parentItem == null || parentItem.getExpanded ()) {
+// if (OS.RemoveDataBrowserItems (handle, OS.kDataBrowserNoItem, 1, new int [] {id}, 0) != OS.noErr) {
+// error (SWT.ERROR_ITEM_NOT_REMOVED);
+// break;
+// }
+// visibleCount--;
+// }
+// }
+// }
+// }
+// //TODO - move shrink to paint event
+// // shrink items array
+// int lastIndex = items.length;
+// for (int i=items.length; i>0; i--) {
+// if (items [i-1] != null) {
+// lastIndex = i;
+// break;
+// }
+// }
+// if (lastIndex < items.length - 4) {
+// int length = Math.max (4, (lastIndex + 3) / 4 * 4);
+// TreeItem [] newItems = new TreeItem [length];
+// System.arraycopy(items, 0, newItems, 0, Math.min(items.length, lastIndex));
+// }
+// }
+//
+// if (parentItem != null) parentItem.itemCount = count;
+// int length = Math.max (4, (count + 3) / 4 * 4);
+// int [] newIds = new int [length];
+// if (ids != null) {
+// System.arraycopy (ids, 0, newIds, 0, Math.min (count, itemCount));
+// }
+// ids = newIds;
+// if (parentItem == null) {
+// childIds = newIds;
+// } else {
+// parentItem.childIds = newIds;
+// }
+//
+// if (count > itemCount) {
+// if ((getStyle() & SWT.VIRTUAL) == 0) {
+// int delta = Math.max (4, (count - itemCount + 3) / 4 * 4);
+// TreeItem [] newItems = new TreeItem [items.length + delta];
+// System.arraycopy (items, 0, newItems, 0, items.length);
+// items = newItems;
+// for (int i=itemCount; i<count; i++) {
+// items [i] = new TreeItem (this, parentItem, SWT.NONE, i, true);
+// }
+// } else {
+// if (parentItem == null || parentItem.getExpanded ()) {
+// int parentID = parentItem == null ? OS.kDataBrowserNoItem : parentItem.id;
+// int [] addIds = _getIds (count - itemCount);
+// if (OS.AddDataBrowserItems (handle, parentID, addIds.length, addIds, OS.kDataBrowserItemNoProperty) != OS.noErr) {
+// error (SWT.ERROR_ITEM_NOT_ADDED);
+// }
+// visibleCount += (count - itemCount);
+// System.arraycopy (addIds, 0, ids, itemCount, addIds.length);
+// }
+// }
+// }
+//
+// callbacks.v1_itemNotificationCallback = display.itemNotificationProc;
+// callbacks.v1_itemCompareCallback = display.itemCompareProc;
+// OS.SetDataBrowserCallbacks (handle, callbacks);
+// setRedraw (true);
+// if (itemCount == 0 && parentItem != null) parentItem.redraw (OS.kDataBrowserNoItem);
+}
+
+/*public*/ void setItemHeight (int itemHeight) {
+ checkWidget ();
+ if (itemHeight < -1) error (SWT.ERROR_INVALID_ARGUMENT);
+ if (itemHeight == -1) {
+ //TODO - reset item height, ensure other API's such as setFont don't do this
+ } else {
+// OS.SetDataBrowserTableViewRowHeight (handle, (short) itemHeight);
+ }
+}
+
+void setItemHeight (Image image) {
+// Rectangle bounds = image != null ? image.getBounds () : imageBounds;
+// if (bounds == null) return;
+// imageBounds = bounds;
+// short [] height = new short [1];
+// if (OS.GetDataBrowserTableViewRowHeight (handle, height) == OS.noErr) {
+// if (height [0] < bounds.height) {
+// OS.SetDataBrowserTableViewRowHeight (handle, (short) bounds.height);
+// }
+// }
+}
+
+/**
+ * Marks the receiver's lines as visible if the argument is <code>true</code>,
+ * and marks it invisible otherwise.
+ * <p>
+ * If one of the receiver's ancestors is not visible or some
+ * other condition makes the receiver not visible, marking
+ * it visible may not actually cause it to be displayed.
+ * </p>
+ *
+ * @param show the new visibility state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setLinesVisible (boolean show) {
+ checkWidget ();
+ ((NSTableView)view).setUsesAlternatingRowBackgroundColors(show);
+}
+
+public void setRedraw (boolean redraw) {
+ checkWidget();
+ super.setRedraw (redraw);
+ if (redraw && drawCount == 0) {
+ setScrollWidth (true);
+ }
+}
+
+boolean setScrollWidth (TreeItem item) {
+// if (ignoreRedraw || drawCount != 0) return false;
+ if (columnCount != 0) return false;
+// TreeItem parentItem = item.parentItem;
+// if (parentItem != null && !parentItem._getExpanded ()) return false;
+// GC gc = new GC (this);
+// int newWidth = item.calculateWidth (0, gc);
+// gc.dispose ();
+// newWidth += getInsetWidth (column_id, false);
+// short [] width = new short [1];
+// OS.GetDataBrowserTableViewNamedColumnWidth (handle, column_id, width);
+// if (width [0] < newWidth) {
+// OS.SetDataBrowserTableViewNamedColumnWidth (handle, column_id, (short) newWidth);
+// return true;
+// }
+// firstColumn.setWidth(400);
+ return false;
+}
+
+boolean setScrollWidth (boolean set) {
+// return setScrollWidth(set, childIds, true);
+ return false;
+}
+
+boolean setScrollWidth (boolean set, int[] childIds, boolean recurse) {
+// if (ignoreRedraw || drawCount != 0) return false;
+// if (columnCount != 0 || childIds == null) return false;
+// GC gc = new GC (this);
+// int newWidth = calculateWidth (childIds, gc, recurse, 0, 0);
+// gc.dispose ();
+// newWidth += getInsetWidth (column_id, false);
+// if (!set) {
+// short [] width = new short [1];
+// OS.GetDataBrowserTableViewNamedColumnWidth (handle, column_id, width);
+// if (width [0] >= newWidth) return false;
+// }
+// OS.SetDataBrowserTableViewNamedColumnWidth (handle, column_id, (short) newWidth);
+ return true;
+}
+
+/**
+ * Sets the receiver's selection to the given item.
+ * The current selection is cleared before the new item is selected.
+ * <p>
+ * If the item is not in the receiver, then it is ignored.
+ * </p>
+ *
+ * @param item the item to select
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setSelection (TreeItem item) {
+ checkWidget ();
+ if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
+ setSelection (new TreeItem [] {item});
+}
+
+/**
+ * Sets the receiver's selection to be the given array of items.
+ * The current selection is cleared before the new items are selected.
+ * <p>
+ * Items that are not in the receiver are ignored.
+ * If the receiver is single-select and multiple items are specified,
+ * then all items are ignored.
+ * </p>
+ *
+ * @param items the array of items
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the array of items is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if one of the items has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Tree#deselectAll()
+ */
+public void setSelection (TreeItem [] items) {
+ checkWidget ();
+ if (items == null) error (SWT.ERROR_NULL_ARGUMENT);
+ deselectAll ();
+// int length = items.length;
+// if (length == 0 || ((style & SWT.SINGLE) != 0 && length > 1)) return;
+// int count = 0;
+// int[] ids = new int [length];
+// for (int i=0; i<length; i++) {
+// if (items [i] != null) {
+// if (items [i].isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+// ids [count++] = items [i].id;
+// showItem (items [i], false);
+// }
+// }
+// ignoreSelect = true;
+// /*
+// * Bug in the Macintosh. When the DataBroswer selection flags includes
+// * both kDataBrowserNeverEmptySelectionSet and kDataBrowserSelectOnlyOne,
+// * two items are selected when SetDataBrowserSelectedItems() is called
+// * with kDataBrowserItemsAssign to assign a new seletion despite the fact
+// * that kDataBrowserSelectOnlyOne was specified. The fix is to save and
+// * restore kDataBrowserNeverEmptySelectionSet around each call to
+// * SetDataBrowserSelectedItems().
+// */
+// int [] selectionFlags = null;
+// if ((style & SWT.SINGLE) != 0) {
+// selectionFlags = new int [1];
+// OS.GetDataBrowserSelectionFlags (handle, selectionFlags);
+// OS.SetDataBrowserSelectionFlags (handle, selectionFlags [0] & ~OS.kDataBrowserNeverEmptySelectionSet);
+// }
+// OS.SetDataBrowserSelectedItems (handle, count, ids, OS.kDataBrowserItemsAssign);
+// if ((style & SWT.SINGLE) != 0) {
+// OS.SetDataBrowserSelectionFlags (handle, selectionFlags [0]);
+// }
+// ignoreSelect = false;
+// if (length > 0) {
+// int index = -1;
+// for (int i=0; i<items.length; i++) {
+// if (items [i] != null) {
+// index = i;
+// break;
+// }
+// }
+// if (index != -1) showItem (items [index], true);
+// }
+}
+
+/**
+ * Sets the column used by the sort indicator for the receiver. A null
+ * value will clear the sort indicator. The current sort column is cleared
+ * before the new column is set.
+ *
+ * @param column the column used by the sort indicator or <code>null</code>
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the column is disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setSortColumn (TreeColumn column) {
+ checkWidget ();
+ if (column != null && column.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ if (column == sortColumn) return;
+// if (column == null) {
+// if (sortColumn != null && !sortColumn.isDisposed () && sortDirection != SWT.NONE) {
+// OS.SetDataBrowserSortOrder (handle, (short) OS.kDataBrowserOrderIncreasing);
+// sortColumn = null;
+// OS.SetDataBrowserSortProperty (handle, 0);
+// }
+// }
+// sortColumn = column;
+// if (sortColumn != null && !sortColumn.isDisposed () && sortDirection != SWT.NONE) {
+// OS.SetDataBrowserSortProperty (handle, sortColumn.id);
+// int order = sortDirection == SWT.DOWN ? OS.kDataBrowserOrderDecreasing : OS.kDataBrowserOrderIncreasing;
+// OS.SetDataBrowserSortOrder (handle, (short) order);
+// }
+}
+
+/**
+ * Sets the direction of the sort indicator for the receiver. The value
+ * can be one of <code>UP</code>, <code>DOWN</code> or <code>NONE</code>.
+ *
+ * @param direction the direction of the sort indicator
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setSortDirection (int direction) {
+ checkWidget ();
+ if (direction != SWT.UP && direction != SWT.DOWN && direction != SWT.NONE) return;
+// if (direction == sortDirection) return;
+// sortDirection = direction;
+// if (sortColumn != null && !sortColumn.isDisposed ()) {
+// if (sortDirection == SWT.NONE) {
+// OS.SetDataBrowserSortOrder (handle, (short) OS.kDataBrowserOrderIncreasing);
+// TreeColumn column = sortColumn;
+// sortColumn = null;
+// OS.SetDataBrowserSortProperty (handle, 0);
+// sortColumn = column;
+// } else {
+// OS.SetDataBrowserSortProperty (handle, 0);
+// OS.SetDataBrowserSortProperty (handle, sortColumn.id);
+// int order = sortDirection == SWT.DOWN ? OS.kDataBrowserOrderDecreasing : OS.kDataBrowserOrderIncreasing;
+// OS.SetDataBrowserSortOrder (handle, (short) order);
+// }
+// }
+}
+
+/**
+ * Sets the item which is currently at the top of the receiver.
+ * This item can change when items are expanded, collapsed, scrolled
+ * or new items are added or removed.
+ *
+ * @param item the item to be shown
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Tree#getTopItem()
+ *
+ * @since 2.1
+ */
+public void setTopItem (TreeItem item) {
+ checkWidget();
+ if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+// showItem (item, false);
+// int columnId = (columnCount == 0) ? column_id : columns [0].id;
+// OS.RevealDataBrowserItem (handle, item.id, columnId, (byte) OS.kDataBrowserRevealWithoutSelecting);
+// Rect rect = new Rect ();
+// if (OS.GetDataBrowserItemPartBounds (handle, item.id, column_id, OS.kDataBrowserPropertyEnclosingPart, rect) == OS.noErr) {
+// int border = getBorder ();
+// int [] top = new int [1], left = new int [1];
+// OS.GetDataBrowserScrollPosition (handle, top, left);
+// OS.SetDataBrowserScrollPosition (handle, Math.max (0, top [0] + rect.top - border - getHeaderHeight ()), left [0]);
+// }
+}
+
+/**
+ * Shows the column. If the column is already showing in the receiver,
+ * this method simply returns. Otherwise, the columns are scrolled until
+ * the column is visible.
+ *
+ * @param column the column to be shown
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void showColumn (TreeColumn column) {
+ checkWidget ();
+ if (column == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (column.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
+ if (column.parent != this) return;
+ int index = indexOf (column);
+ if (columnCount <= 1 || !(0 <= index && index < columnCount)) return;
+ ((NSTableView)view).scrollColumnToVisible(index);
+}
+
+/**
+ * Shows the item. If the item is already showing in the receiver,
+ * this method simply returns. Otherwise, the items are scrolled
+ * and expanded until the item is visible.
+ *
+ * @param item the item to be shown
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Tree#showSelection()
+ */
+public void showItem (TreeItem item) {
+ checkWidget ();
+ if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ showItem (item, true);
+}
+
+void showItem (TreeItem item, boolean scroll) {
+ int count = 0;
+// TreeItem parentItem = item.parentItem;
+// while (parentItem != null && !parentItem._getExpanded ()) {
+// count++;
+// parentItem = parentItem.parentItem;
+// }
+// int index = 0;
+// parentItem = item.parentItem;
+// TreeItem [] path = new TreeItem [count];
+// while (parentItem != null && !parentItem._getExpanded ()) {
+// path [index++] = parentItem;
+// parentItem = parentItem.parentItem;
+// }
+// for (int i=path.length-1; i>=0; --i) {
+// path [i].setExpanded (true);
+// }
+// if (scroll) {
+// /*
+// * Bug in the Macintosh. When there is not room to show a
+// * single item in the data browser, RevealDataBrowserItem()
+// * scrolls the item such that it is above the top of the data
+// * browser. The fix is to remember the index and scroll when
+// * the data browser is resized.
+// *
+// * Bug in the Macintosh. When items are added to the data
+// * browser after is has been hidden, RevealDataBrowserItem()
+// * when called before the controls behind the data browser
+// * are repainted causes a redraw. This redraw happens right
+// * away causing pixel corruption. The fix is to remember the
+// * index and scroll when the data browser is shown.
+// */
+// Rectangle rect = getClientArea ();
+// if (rect.height < getItemHeight () || !OS.IsControlVisible (handle)) {
+// showItem = item;
+// return;
+// }
+// showItem = null;
+// Rectangle itemRect = item.getBounds ();
+// if (!itemRect.isEmpty()) {
+// if (rect.contains (itemRect.x, itemRect.y)
+// && rect.contains (itemRect.x, itemRect.y + itemRect.height)) return;
+// }
+// int [] top = new int [1], left = new int [1];
+// OS.GetDataBrowserScrollPosition (handle, top, left);
+// int columnId = (columnCount == 0) ? column_id : columns [0].id;
+// int options = OS.kDataBrowserRevealWithoutSelecting;
+// /*
+// * This code is intentionally commented, since kDataBrowserRevealAndCenterInView
+// * does not scroll the item to the center always (it seems to scroll to the
+// * end in some cases).
+// */
+// //options |= OS.kDataBrowserRevealAndCenterInView;
+// OS.RevealDataBrowserItem (handle, item.id, columnId, (byte) options);
+// int [] newTop = new int [1], newLeft = new int [1];
+// if (columnCount == 0) {
+// boolean fixScroll = false;
+// Rect content = new Rect ();
+// if (OS.GetDataBrowserItemPartBounds (handle, item.id, columnId, OS.kDataBrowserPropertyContentPart, content) == OS.noErr) {
+// fixScroll = content.left < rect.x || content.left >= rect.x + rect.width;
+// if (!fixScroll) {
+// GC gc = new GC (this);
+// int contentWidth = calculateWidth (new int[]{item.id}, gc, false, 0, 0);
+// gc.dispose ();
+// fixScroll = content.left + contentWidth > rect.x + rect.width;
+// }
+// }
+// if (fixScroll) {
+// int leftScroll = getLeftDisclosureInset (columnId);
+// int levelIndent = DISCLOSURE_COLUMN_LEVEL_INDENT;
+// if (OS.VERSION >= 0x1040) {
+// float [] metric = new float [1];
+// OS.DataBrowserGetMetric (handle, OS.kDataBrowserMetricDisclosureColumnPerDepthGap, null, metric);
+// levelIndent = (int) metric [0];
+// }
+// TreeItem temp = item;
+// while (temp.parentItem != null) {
+// leftScroll += levelIndent;
+// temp = temp.parentItem;
+// }
+// OS.GetDataBrowserScrollPosition (handle, newTop, newLeft);
+// OS.SetDataBrowserScrollPosition (handle, newTop [0], leftScroll);
+// }
+// }
+//
+// /*
+// * Bug in the Macintosh. For some reason, when the DataBrowser is scrolled
+// * by RevealDataBrowserItem(), the scrollbars are not redrawn. The fix is to
+// * force a redraw.
+// */
+// OS.GetDataBrowserScrollPosition (handle, newTop, newLeft);
+// if (horizontalBar != null && newLeft [0] != left [0]) horizontalBar.redraw ();
+// if (verticalBar != null && newTop [0] != top [0]) verticalBar.redraw ();
+// }
+}
+
+/**
+ * Shows the selection. If the selection is already showing in the receiver,
+ * this method simply returns. Otherwise, the items are scrolled until
+ * the selection is visible.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Tree#showItem(TreeItem)
+ */
+public void showSelection () {
+ checkWidget ();
+ //checkItems (false);
+ //TODO - optimize
+ TreeItem [] selection = getSelection ();
+ if (selection.length > 0) showItem (selection [0], true);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java
new file mode 100755
index 0000000000..511e8d16c7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeColumn.java
@@ -0,0 +1,534 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.events.*;
+
+/**
+ * Instances of this class represent a column in a tree widget.
+ * <p><dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>LEFT, RIGHT, CENTER</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd> Move, Resize, Selection</dd>
+ * </dl>
+ * </p><p>
+ * Note: Only one of the styles LEFT, RIGHT and CENTER may be specified.
+ * </p><p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ *
+ * @since 3.1
+ */
+public class TreeColumn extends Item {
+ NSTableColumn nsColumn;
+ Tree parent;
+ String toolTipText;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Tree</code>) and a style value
+ * describing its behavior and appearance. The item is added
+ * to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#LEFT
+ * @see SWT#RIGHT
+ * @see SWT#CENTER
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public TreeColumn (Tree parent, int style) {
+ super (parent, checkStyle (style));
+ this.parent = parent;
+ parent.createItem (this, parent.getColumnCount ());
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Tree</code>), a style value
+ * describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the zero-relative index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT#LEFT
+ * @see SWT#RIGHT
+ * @see SWT#CENTER
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public TreeColumn (Tree parent, int style, int index) {
+ super (parent, checkStyle (style));
+ this.parent = parent;
+ parent.createItem (this, index);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is moved or resized, by sending
+ * it one of the messages defined in the <code>ControlListener</code>
+ * interface.
+ *
+ * @param listener the listener which should be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ControlListener
+ * @see #removeControlListener
+ */
+public void addControlListener(ControlListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Resize,typedListener);
+ addListener (SWT.Move,typedListener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the control is selected by the user, by sending
+ * it one of the messages defined in the <code>SelectionListener</code>
+ * interface.
+ * <p>
+ * <code>widgetSelected</code> is called when the column header is selected.
+ * <code>widgetDefaultSelected</code> is not called.
+ * </p>
+ *
+ * @param listener the listener which should be notified when the control is selected by the user
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #removeSelectionListener
+ * @see SelectionEvent
+ */
+public void addSelectionListener (SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Selection,typedListener);
+ addListener (SWT.DefaultSelection,typedListener);
+}
+
+static int checkStyle (int style) {
+ return checkBits (style, SWT.LEFT, SWT.CENTER, SWT.RIGHT, 0, 0, 0);
+}
+
+protected void checkSubclass () {
+ if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+void destroyWidget () {
+ parent.destroyItem (this);
+ releaseHandle ();
+}
+
+/**
+ * Returns a value which describes the position of the
+ * text or image in the receiver. The value will be one of
+ * <code>LEFT</code>, <code>RIGHT</code> or <code>CENTER</code>.
+ *
+ * @return the alignment
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getAlignment () {
+ checkWidget ();
+ if ((style & SWT.LEFT) != 0) return SWT.LEFT;
+ if ((style & SWT.CENTER) != 0) return SWT.CENTER;
+ if ((style & SWT.RIGHT) != 0) return SWT.RIGHT;
+ return SWT.LEFT;
+}
+
+String getNameText () {
+ return getText ();
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Tree</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Tree getParent () {
+ checkWidget ();
+ return parent;
+}
+
+/**
+ * Gets the moveable attribute. A column that is
+ * not moveable cannot be reordered by the user
+ * by dragging the header but may be reordered
+ * by the programmer.
+ *
+ * @return the moveable attribute
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Tree#getColumnOrder()
+ * @see Tree#setColumnOrder(int[])
+ * @see TreeColumn#setMoveable(boolean)
+ * @see SWT#Move
+ *
+ * @since 3.2
+ */
+public boolean getMoveable () {
+ checkWidget ();
+// int [] flags = new int [1];
+// OS.GetDataBrowserPropertyFlags (parent.handle, id, flags);
+// return (flags [0] & OS.kDataBrowserListViewMovableColumn) != 0;
+ return false;
+}
+
+/**
+ * Gets the resizable attribute. A column that is
+ * not resizable cannot be dragged by the user but
+ * may be resized by the programmer.
+ *
+ * @return the resizable attribute
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getResizable () {
+ checkWidget ();
+ return nsColumn.resizingMask() != OS.NSTableColumnNoResizing;
+}
+
+/**
+ * Returns the receiver's tool tip text, or null if it has
+ * not been set.
+ *
+ * @return the receiver's tool tip text
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public String getToolTipText () {
+ checkWidget ();
+ return toolTipText;
+}
+
+/**
+ * Gets the width of the receiver.
+ *
+ * @return the width
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getWidth () {
+ checkWidget ();
+ return (int)nsColumn.width();
+}
+
+/**
+ * Causes the receiver to be resized to its preferred size.
+ * For a composite, this involves computing the preferred size
+ * from its layout, if there is one.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ */
+public void pack () {
+ checkWidget ();
+// GC gc = new GC (parent);
+// int width = gc.stringExtent (text).x;
+ //TODO extra header
+// int index = parent.indexOf (this);
+// width = Math.max (width, calculateWidth (parent.childIds, index, gc, width));
+//
+// gc.dispose ();
+// setWidth (width + parent.getInsetWidth (id, true));
+}
+
+void releaseHandle () {
+ super.releaseHandle ();
+ if (nsColumn != null) {
+ //TODO - crashes tree
+// ((NSTableView)parent.view).removeTableColumn (nsColumn);
+// nsColumn.autorelease();
+ }
+ nsColumn.release();
+ parent = null;
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ if (parent.sortColumn == this) {
+ parent.sortColumn = null;
+ }
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is moved or resized.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see ControlListener
+ * @see #addControlListener
+ */
+public void removeControlListener (ControlListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Move, listener);
+ eventTable.unhook (SWT.Resize, listener);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the control is selected by the user.
+ *
+ * @param listener the listener which should no longer be notified
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SelectionListener
+ * @see #addSelectionListener
+ */
+public void removeSelectionListener(SelectionListener listener) {
+ checkWidget ();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Selection, listener);
+ eventTable.unhook (SWT.DefaultSelection,listener);
+}
+
+/**
+ * Controls how text and images will be displayed in the receiver.
+ * The argument should be one of <code>LEFT</code>, <code>RIGHT</code>
+ * or <code>CENTER</code>.
+ *
+ * @param alignment the new alignment
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setAlignment (int alignment) {
+ checkWidget ();
+ if ((alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER)) == 0) return;
+ int index = parent.indexOf (this);
+ if (index == -1 || index == 0) return;
+ style &= ~(SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+ style |= alignment & (SWT.LEFT | SWT.RIGHT | SWT.CENTER);
+ //TODO
+}
+
+public void setImage (Image image) {
+ checkWidget();
+ if (image != null && image.isDisposed ()) {
+ error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+// int index = parent.indexOf (this);
+// if (index == -1) return;
+// if (iconRef != 0) {
+// OS.ReleaseIconRef (iconRef);
+// iconRef = 0;
+// }
+// super.setImage (image);
+// if (image != null) {
+// if (OS.VERSION < 0x1040) {
+// iconRef = createIconRef (image);
+// }
+// }
+// updateHeader ();
+}
+
+/**
+ * Sets the moveable attribute. A column that is
+ * moveable can be reordered by the user by dragging
+ * the header. A column that is not moveable cannot be
+ * dragged by the user but may be reordered
+ * by the programmer.
+ *
+ * @param moveable the moveable attribute
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Tree#setColumnOrder(int[])
+ * @see Tree#getColumnOrder()
+ * @see TreeColumn#getMoveable()
+ * @see SWT#Move
+ *
+ * @since 3.2
+ */
+public void setMoveable (boolean moveable) {
+ checkWidget ();
+// int [] flags = new int [1];
+// OS.GetDataBrowserPropertyFlags (parent.handle, id, flags);
+// if (moveable) {
+// flags [0] |= OS.kDataBrowserListViewMovableColumn;
+// } else {
+// flags [0] &= ~OS.kDataBrowserListViewMovableColumn;
+// }
+// OS.SetDataBrowserPropertyFlags (parent.handle, id, flags [0]);
+}
+
+/**
+ * Sets the resizable attribute. A column that is
+ * not resizable cannot be dragged by the user but
+ * may be resized by the programmer.
+ *
+ * @param resizable the resize attribute
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setResizable (boolean resizable) {
+ checkWidget ();
+ nsColumn.setResizingMask(resizable ? OS.NSTableColumnUserResizingMask : OS.NSTableColumnNoResizing);
+}
+
+public void setText (String string) {
+ checkWidget ();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ super.setText (string);
+ char [] buffer = new char [text.length ()];
+ text.getChars (0, buffer.length, buffer, 0);
+ int length = fixMnemonic (buffer);
+ nsColumn.headerCell().setTitle(NSString.stringWithCharacters(buffer, length));
+}
+
+/**
+ * Sets the receiver's tool tip text to the argument, which
+ * may be null indicating that no tool tip text should be shown.
+ *
+ * @param string the new tool tip text (or null)
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setToolTipText (String string) {
+ checkWidget();
+ toolTipText = string;
+}
+
+/**
+ * Sets the width of the receiver.
+ *
+ * @param width the new width
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setWidth (int width) {
+ checkWidget ();
+ if (width < 0) return;
+ nsColumn.setWidth (width);
+}
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeItem.java
new file mode 100755
index 0000000000..a8c377f905
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/TreeItem.java
@@ -0,0 +1,1385 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.graphics.*;
+
+/**
+ * Instances of this class represent a selectable user interface object
+ * that represents a hierarchy of tree items in a tree widget.
+ *
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>(none)</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is <em>not</em> intended to be subclassed.
+ * </p>
+ */
+public class TreeItem extends Item {
+ Tree parent;
+ TreeItem parentItem;
+ TreeItem[] items;
+ int itemCount;
+ String [] strings;
+ Image [] images;
+ boolean checked, grayed, cached, expanded;
+ Color foreground, background;
+ Color[] cellForeground, cellBackground;
+ Font font;
+ Font[] cellFont;
+ int width = -1;
+ //
+ SWTTreeItem handle;
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Tree</code> or a <code>TreeItem</code>)
+ * and a style value describing its behavior and appearance.
+ * The item is added to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a tree control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public TreeItem (Tree parent, int style) {
+ this (checkNull (parent), null, style, -1, true);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Tree</code> or a <code>TreeItem</code>),
+ * a style value describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a tree control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the zero-relative index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public TreeItem (Tree parent, int style, int index) {
+ this (checkNull (parent), null, style, checkIndex (index), true);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Tree</code> or a <code>TreeItem</code>)
+ * and a style value describing its behavior and appearance.
+ * The item is added to the end of the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parentItem a tree control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public TreeItem (TreeItem parentItem, int style) {
+ this (checkNull (parentItem).parent, parentItem, style, -1, true);
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * (which must be a <code>Tree</code> or a <code>TreeItem</code>),
+ * a style value describing its behavior and appearance, and the index
+ * at which to place it in the items maintained by its parent.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parentItem a tree control which will be the parent of the new instance (cannot be null)
+ * @param style the style of control to construct
+ * @param index the zero-relative index to store the receiver in its parent
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see Widget#checkSubclass
+ * @see Widget#getStyle
+ */
+public TreeItem (TreeItem parentItem, int style, int index) {
+ this (checkNull (parentItem).parent, parentItem, style, checkIndex (index), true);
+}
+
+TreeItem (Tree parent, TreeItem parentItem, int style, int index, boolean create) {
+ super (parent, style);
+ this.parent = parent;
+ this.parentItem = parentItem;
+ if (create) parent.createItem (this, parentItem, index);
+}
+
+static TreeItem checkNull (TreeItem item) {
+ if (item == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ return item;
+}
+
+static Tree checkNull (Tree parent) {
+ if (parent == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
+ return parent;
+}
+
+static int checkIndex (int index) {
+ if (index < 0) SWT.error (SWT.ERROR_INVALID_RANGE);
+ return index;
+}
+
+int calculateWidth (int index, GC gc) {
+ if (index == 0 && width != -1) return width;
+ int width = 0;
+ Image image = getImage (index);
+ String text = getText (index);
+ gc.setFont (getFont (index));
+// if (image != null) width += image.getBounds ().width + parent.getGap ();
+ if (text != null && text.length () > 0) width += gc.stringExtent (text).x;
+// if (parent.hooks (SWT.MeasureItem)) {
+// Event event = new Event ();
+// event.item = this;
+// event.index = index;
+// event.gc = gc;
+// short [] height = new short [1];
+// OS.GetDataBrowserTableViewRowHeight (parent.handle, height);
+// event.width = width;
+// event.height = height [0];
+// parent.sendEvent (SWT.MeasureItem, event);
+// if (parent.itemHeight < event.height) {
+// parent.itemHeight = event.height;
+// OS.SetDataBrowserTableViewRowHeight (parent.handle, (short) event.height);
+// }
+// width = event.width;
+// }
+ if (index == 0) this.width = width;
+ return width;
+}
+
+protected void checkSubclass () {
+ if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+void clear () {
+ cached = false;
+ text = "";
+ image = null;
+ strings = null;
+ images = null;
+ checked = grayed = false;
+ foreground = background = null;
+ cellForeground = cellBackground = null;
+ font = null;
+ cellFont = null;
+}
+
+/**
+ * Clears the item at the given zero-relative index in the receiver.
+ * The text, icon and other attributes of the item are set to the default
+ * value. If the tree was created with the <code>SWT.VIRTUAL</code> style,
+ * these attributes are requested again as needed.
+ *
+ * @param index the index of the item to clear
+ * @param all <code>true</code> if all child items of the indexed item should be
+ * cleared recursively, and <code>false</code> otherwise
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT#VIRTUAL
+ * @see SWT#SetData
+ *
+ * @since 3.2
+ */
+public void clear (int index, boolean all) {
+ checkWidget ();
+ int count = getItemCount ();
+ if (index < 0 || index >= count) SWT.error (SWT.ERROR_INVALID_RANGE);
+ parent.clear (this, index, all);
+}
+
+
+/**
+ * Clears all the items in the receiver. The text, icon and other
+ * attributes of the items are set to their default values. If the
+ * tree was created with the <code>SWT.VIRTUAL</code> style, these
+ * attributes are requested again as needed.
+ *
+ * @param all <code>true</code> if all child items should be cleared
+ * recursively, and <code>false</code> otherwise
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT#VIRTUAL
+ * @see SWT#SetData
+ *
+ * @since 3.2
+ */
+public void clearAll (boolean all) {
+ checkWidget ();
+ parent.clearAll (this, all);
+}
+
+NSAttributedString createString(int index) {
+ NSMutableDictionary dict = NSMutableDictionary.dictionaryWithCapacity(4);
+ Color foreground = cellForeground != null ? cellForeground [index] : null;
+ if (foreground == null) foreground = this.foreground;
+ if (foreground == null) foreground = parent.foreground;
+ if (foreground != null) {
+ NSColor color = NSColor.colorWithDeviceRed(foreground.handle[0], foreground.handle[1], foreground.handle[2], 1);
+ dict.setObject(color, OS.NSForegroundColorAttributeName());
+ }
+ Font font = cellFont != null ? cellFont [index] : null;
+ if (font == null) font = this.font;
+// if (font == null) font = parent.font;
+ if (font != null) {
+ dict.setObject(font.handle, OS.NSFontAttributeName());
+ }
+ Color background = cellBackground != null ? cellBackground [index] : null;
+ if (background == null) background = this.background;
+ if (background != null) {
+ NSColor color = NSColor.colorWithDeviceRed(background.handle[0], background.handle[1], background.handle[2], 1);
+ dict.setObject(color, OS.NSBackgroundColorAttributeName());
+ }
+ String text = getText (index);
+ int length = text.length();
+ char[] chars = new char[length];
+ text.getChars(0, length, chars, 0);
+ NSString str = NSString.stringWithCharacters(chars, length);
+ NSAttributedString attribStr = ((NSAttributedString)new NSAttributedString().alloc()).initWithString_attributes_(str, dict);
+ attribStr.autorelease();
+ return attribStr;
+}
+
+void destroyWidget () {
+ parent.destroyItem (this);
+ releaseHandle ();
+}
+
+/**
+ * Returns the receiver's background color.
+ *
+ * @return the background color
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ *
+ */
+public Color getBackground () {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ return background != null ? background : parent.getBackground ();
+}
+
+/**
+ * Returns the background color at the given column index in the receiver.
+ *
+ * @param index the column index
+ * @return the background color
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public Color getBackground (int index) {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ int count = Math.max (1, parent.columnCount);
+ if (0 > index || index > count -1) return getBackground ();
+ if (cellBackground == null || cellBackground [index] == null) return getBackground ();
+ return cellBackground [index];
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent.
+ *
+ * @return the receiver's bounding rectangle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Rectangle getBounds () {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+// Rect rect = new Rect();
+// int columnId = parent.columnCount == 0 ? parent.column_id : parent.columns [0].id;
+// if (OS.GetDataBrowserItemPartBounds (parent.handle, id, columnId, OS.kDataBrowserPropertyContentPart, rect) != OS.noErr) {
+// return new Rectangle (0, 0, 0, 0);
+// }
+// int x = rect.left, y = rect.top;
+// int width = 0;
+// if (image != null) {
+// Rectangle bounds = image.getBounds ();
+// x += bounds.width + parent.getGap ();
+// }
+// GC gc = new GC (parent);
+// Point extent = gc.stringExtent (text);
+// gc.dispose ();
+// width += extent.x;
+// if (parent.columnCount > 0) {
+// width = Math.min (width, rect.right - x);
+// }
+// int height = rect.bottom - rect.top;
+// return new Rectangle (x, y, width, height);
+ return null;
+}
+
+/**
+ * Returns a rectangle describing the receiver's size and location
+ * relative to its parent at a column in the tree.
+ *
+ * @param index the index that specifies the column
+ * @return the receiver's bounding column rectangle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public Rectangle getBounds (int index) {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+// if (index != 0 && !(0 <= index && index < parent.columnCount)) return new Rectangle (0, 0, 0, 0);
+// Rect rect = new Rect();
+// int columnId = parent.columnCount == 0 ? parent.column_id : parent.columns [index].id;
+// if (OS.GetDataBrowserItemPartBounds (parent.handle, id, columnId, OS.kDataBrowserPropertyEnclosingPart, rect) != OS.noErr) {
+// return new Rectangle (0, 0, 0, 0);
+// }
+// int[] disclosure = new int [1];
+// OS.GetDataBrowserListViewDisclosureColumn (parent.handle, disclosure, new boolean [1]);
+// int x, y, width, height;
+// if (OS.VERSION >= 0x1040 && disclosure [0] != columnId) {
+// if (parent.getLinesVisible ()) {
+// rect.left += Tree.GRID_WIDTH;
+// rect.top += Tree.GRID_WIDTH;
+// }
+// x = rect.left;
+// y = rect.top;
+// width = rect.right - rect.left;
+// height = rect.bottom - rect.top;
+// } else {
+// Rect rect2 = new Rect();
+// if (OS.GetDataBrowserItemPartBounds (parent.handle, id, columnId, OS.kDataBrowserPropertyContentPart, rect2) != OS.noErr) {
+// return new Rectangle (0, 0, 0, 0);
+// }
+// x = rect2.left;
+// y = rect2.top;
+// width = rect.right - rect2.left + 1;
+// height = rect2.bottom - rect2.top + 1;
+// }
+// return new Rectangle (x, y, width, height);
+ return null;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is checked,
+ * and false otherwise. When the parent does not have
+ * the <code>CHECK style, return false.
+ * <p>
+ *
+ * @return the checked state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getChecked () {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ if ((parent.style & SWT.CHECK) == 0) return false;
+ return checked;
+}
+
+/**
+ * Returns <code>true</code> if the receiver is expanded,
+ * and false otherwise.
+ * <p>
+ *
+ * @return the expanded state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getExpanded () {
+ checkWidget ();
+ return expanded;
+}
+
+/**
+ * Returns the font that the receiver will use to paint textual information for this item.
+ *
+ * @return the receiver's font
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public Font getFont () {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ return font != null ? font : parent.getFont ();
+}
+
+/**
+ * Returns the font that the receiver will use to paint textual information
+ * for the specified cell in this item.
+ *
+ * @param index the column index
+ * @return the receiver's font
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public Font getFont (int index) {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ int count = Math.max (1, parent.columnCount);
+ if (0 > index || index > count -1) return getFont ();
+ if (cellFont == null || cellFont [index] == null) return getFont ();
+ return cellFont [index];
+}
+
+/**
+ * Returns the foreground color that the receiver will use to draw.
+ *
+ * @return the receiver's foreground color
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ *
+ */
+public Color getForeground () {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ return foreground != null ? foreground : parent.getForeground ();
+}
+
+/**
+ *
+ * Returns the foreground color at the given column index in the receiver.
+ *
+ * @param index the column index
+ * @return the foreground color
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public Color getForeground (int index) {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ int count = Math.max (1, parent.columnCount);
+ if (0 > index || index > count -1) return getForeground ();
+ if (cellForeground == null || cellForeground [index] == null) return getForeground ();
+ return cellForeground [index];
+}
+
+/**
+ * Returns <code>true</code> if the receiver is grayed,
+ * and false otherwise. When the parent does not have
+ * the <code>CHECK style, return false.
+ * <p>
+ *
+ * @return the grayed state of the checkbox
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public boolean getGrayed () {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ if ((parent.style & SWT.CHECK) == 0) return false;
+ return grayed;
+}
+
+public Image getImage () {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ return super.getImage ();
+}
+
+/**
+ * Returns the image stored at the given column index in the receiver,
+ * or null if the image has not been set or if the column does not exist.
+ *
+ * @param index the column index
+ * @return the image stored at the given column index in the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public Image getImage (int index) {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ if (index == 0) return getImage ();
+ if (images != null) {
+ if (0 <= index && index < images.length) return images [index];
+ }
+ return null;
+}
+
+/**
+ * Returns a rectangle describing the size and location
+ * relative to its parent of an image at a column in the
+ * tree.
+ *
+ * @param index the index that specifies the column
+ * @return the receiver's bounding image rectangle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public Rectangle getImageBounds (int index) {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+// if (index != 0 && !(0 <= index && index < parent.columnCount)) return new Rectangle (0, 0, 0, 0);
+// Rect rect = new Rect();
+// int columnId = parent.columnCount == 0 ? parent.column_id : parent.columns [index].id;
+// if (OS.GetDataBrowserItemPartBounds (parent.handle, id, columnId, OS.kDataBrowserPropertyContentPart, rect) != OS.noErr) {
+// return new Rectangle (0, 0, 0, 0);
+// }
+// int x = rect.left, y = rect.top;
+// int width = 0;
+// if (index == 0 && image != null) {
+// Rectangle bounds = image.getBounds ();
+// width += bounds.width;
+// }
+// if (index != 0 && images != null && images[index] != null) {
+// Rectangle bounds = images [index].getBounds ();
+// width += bounds.width;
+// }
+// int height = rect.bottom - rect.top + 1;
+// return new Rectangle (x, y, width, height);
+ return null;
+}
+
+/**
+ * Returns the item at the given, zero-relative index in the
+ * receiver. Throws an exception if the index is out of range.
+ *
+ * @param index the index of the item to return
+ * @return the item at the given index
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public TreeItem getItem (int index) {
+ checkWidget ();
+ if (index < 0) error (SWT.ERROR_INVALID_RANGE);
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ if (index >= itemCount) error (SWT.ERROR_INVALID_RANGE);
+ return parent._getItem (this, index);
+}
+
+/**
+ * Returns the number of items contained in the receiver
+ * that are direct item children of the receiver.
+ *
+ * @return the number of items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getItemCount () {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ return itemCount;
+}
+
+/**
+ * Returns a (possibly empty) array of <code>TreeItem</code>s which
+ * are the direct item children of the receiver.
+ * <p>
+ * Note: This is not the actual structure used by the receiver
+ * to maintain its list of items, so modifying the array will
+ * not affect the receiver.
+ * </p>
+ *
+ * @return the receiver's items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TreeItem [] getItems () {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ TreeItem [] result = new TreeItem [itemCount];
+ for (int i=0; i<itemCount; i++) {
+ result [i] = parent._getItem (this, i);
+ }
+ return result;
+}
+
+String getNameText () {
+ if ((parent.style & SWT.VIRTUAL) != 0) {
+ if (!cached) return "*virtual*"; //$NON-NLS-1$
+ }
+ return super.getNameText ();
+}
+
+/**
+ * Returns the receiver's parent, which must be a <code>Tree</code>.
+ *
+ * @return the receiver's parent
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public Tree getParent () {
+ checkWidget ();
+ return parent;
+}
+
+/**
+ * Returns the receiver's parent item, which must be a
+ * <code>TreeItem</code> or null when the receiver is a
+ * root.
+ *
+ * @return the receiver's parent item
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public TreeItem getParentItem () {
+ checkWidget ();
+ return parentItem;
+}
+
+public String getText () {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ return super.getText ();
+}
+
+/**
+ * Returns the text stored at the given column index in the receiver,
+ * or empty string if the text has not been set.
+ *
+ * @param index the column index
+ * @return the text stored at the given column index in the receiver
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public String getText (int index) {
+ checkWidget ();
+ if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+ if (index == 0) return getText ();
+ if (strings != null) {
+ if (0 <= index && index < strings.length) {
+ String string = strings [index];
+ return string != null ? string : "";
+ }
+ }
+ return "";
+}
+
+/**
+ * Returns a rectangle describing the size and location
+ * relative to its parent of the text at a column in the
+ * tree.
+ *
+ * @param index the index that specifies the column
+ * @return the receiver's bounding text rectangle
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.3
+ */
+public Rectangle getTextBounds (int index) {
+ checkWidget ();
+// if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
+// if (index != 0 && !(0 <= index && index < parent.columnCount)) return new Rectangle (0, 0, 0, 0);
+// Rect rect = new Rect();
+// int columnId = parent.columnCount == 0 ? parent.column_id : parent.columns [index].id;
+// if (OS.GetDataBrowserItemPartBounds (parent.handle, id, columnId, OS.kDataBrowserPropertyEnclosingPart, rect) != OS.noErr) {
+// return new Rectangle (0, 0, 0, 0);
+// }
+// int[] disclosure = new int [1];
+// OS.GetDataBrowserListViewDisclosureColumn (parent.handle, disclosure, new boolean [1]);
+// int imageWidth = 0;
+// int margin = index == 0 ? 0 : parent.getInsetWidth (columnId, false) / 2;
+// Image image = getImage (index);
+// if (image != null) {
+// Rectangle bounds = image.getBounds ();
+// imageWidth = bounds.width + parent.getGap ();
+// }
+// int x, y, width, height;
+// if (OS.VERSION >= 0x1040 && disclosure [0] != columnId) {
+// if (parent.getLinesVisible ()) {
+// rect.left += Tree.GRID_WIDTH;
+// rect.top += Tree.GRID_WIDTH;
+// }
+// x = rect.left + imageWidth + margin;
+// y = rect.top;
+// width = Math.max (0, rect.right - rect.left - imageWidth - margin * 2);;
+// height = rect.bottom - rect.top;
+// } else {
+// Rect rect2 = new Rect();
+// if (OS.GetDataBrowserItemPartBounds (parent.handle, id, columnId, OS.kDataBrowserPropertyContentPart, rect2) != OS.noErr) {
+// return new Rectangle (0, 0, 0, 0);
+// }
+// x = rect2.left + imageWidth + margin;
+// y = rect2.top;
+// width = Math.max (0, rect.right - rect2.left + 1 - imageWidth - margin * 2);
+// height = rect2.bottom - rect2.top + 1;
+// }
+// return new Rectangle (x, y, width, height);
+ return null;
+}
+
+/**
+ * Searches the receiver's list starting at the first item
+ * (index 0) until an item is found that is equal to the
+ * argument, and returns the index of that item. If no item
+ * is found, returns -1.
+ *
+ * @param item the search item
+ * @return the index of the item
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the item is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the item has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public int indexOf (TreeItem item) {
+ checkWidget ();
+ if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ if (item.parentItem != this) return -1;
+ for (int i = 0; i < itemCount; i++) {
+ if (item == items[i]) return i;
+ }
+ return -1;
+}
+
+void releaseChildren (boolean destroy) {
+ for (int i=0; i<items.length; i++) {
+ TreeItem item = items [i];
+ if (item != null && !item.isDisposed ()) {
+ item.release (false);
+ }
+ }
+ items = null;
+ itemCount = 0;
+ super.releaseChildren (destroy);
+}
+
+void releaseHandle () {
+ super.releaseHandle ();
+ if (handle != null) handle.release();
+ handle = null;
+ parentItem = null;
+ parent = null;
+}
+
+void releaseWidget () {
+ super.releaseWidget ();
+ strings = null;
+ images = null;
+ background = foreground = null;
+ font = null;
+ cellBackground = cellForeground = null;
+ cellFont = null;
+}
+
+/**
+ * Removes all of the items from the receiver.
+ * <p>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void removeAll () {
+ checkWidget ();
+// for (int i=itemCount - 1; i >= 0; i--) {
+// TreeItem item = parent._getItem (childIds [i], false);
+// if (item != null && !item.isDisposed ()) {
+// item.dispose ();
+// }
+// }
+}
+
+/**
+ * Sets the receiver's background color to the color specified
+ * by the argument, or to the default system color for the item
+ * if the argument is null.
+ *
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ *
+ */
+public void setBackground (Color color) {
+ checkWidget ();
+ if (color != null && color.isDisposed ()) {
+ SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ if (background == color) return;
+ if (background != null && background.equals (color)) return;
+ background = color;
+ cached = true;
+ ((NSOutlineView)parent.view).reloadItem_(handle);
+}
+
+/**
+ * Sets the background color at the given column index in the receiver
+ * to the color specified by the argument, or to the default system color for the item
+ * if the argument is null.
+ *
+ * @param index the column index
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ *
+ */
+public void setBackground (int index, Color color) {
+ checkWidget ();
+ if (color != null && color.isDisposed ()) {
+ SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ int count = Math.max (1, parent.columnCount);
+ if (0 > index || index > count - 1) return;
+ if (cellBackground == null) {
+ cellBackground = new Color [count];
+ }
+ if (cellBackground [index] == color) return;
+ if (cellBackground [index] != null && cellBackground [index].equals (color)) return;
+ cellBackground [index] = color;
+ cached = true;
+ ((NSOutlineView)parent.view).reloadItem_(handle);
+}
+
+/**
+ * Sets the checked state of the receiver.
+ * <p>
+ *
+ * @param checked the new checked state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setChecked (boolean checked) {
+ checkWidget ();
+ if ((parent.style & SWT.CHECK) == 0) return;
+ if (this.checked == checked) return;
+ this.checked = checked;
+ cached = true;
+// redraw (Tree.CHECK_COLUMN_ID);
+}
+
+/**
+ * Sets the expanded state of the receiver.
+ * <p>
+ *
+ * @param expanded the new expanded state
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setExpanded (boolean expanded) {
+ checkWidget ();
+ if (expanded == getExpanded ()) return;
+// parent.ignoreExpand = true;
+ if (expanded) {
+ ((NSOutlineView)parent.view).expandItem_(new id(jniRef));
+ } else {
+ ((NSOutlineView)parent.view).collapseItem_(new id(jniRef));
+ }
+// parent.ignoreExpand = false;
+ cached = true;
+// if (expanded) {
+// parent.setScrollWidth (false, childIds, false);
+// } else {
+// parent.setScrollWidth (true);
+// parent.fixScrollBar ();
+// }
+}
+
+/**
+ * Sets the font that the receiver will use to paint textual information
+ * for this item to the font specified by the argument, or to the default font
+ * for that kind of control if the argument is null.
+ *
+ * @param font the new font (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.0
+ */
+public void setFont (Font font) {
+ checkWidget ();
+ if (font != null && font.isDisposed ()) {
+ SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ if (this.font == font) return;
+ if (this.font != null && this.font.equals (font)) return;
+ this.font = font;
+ cached = true;
+ ((NSOutlineView)parent.view).reloadItem_(handle);
+}
+
+/**
+ * Sets the font that the receiver will use to paint textual information
+ * for the specified cell in this item to the font specified by the
+ * argument, or to the default font for that kind of control if the
+ * argument is null.
+ *
+ * @param index the column index
+ * @param font the new font (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setFont (int index, Font font) {
+ checkWidget ();
+ if (font != null && font.isDisposed ()) {
+ SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ int count = Math.max (1, parent.columnCount);
+ if (0 > index || index > count - 1) return;
+ if (cellFont == null) {
+ cellFont = new Font [count];
+ }
+ if (cellFont [index] == font) return;
+ if (cellFont [index] != null && cellFont [index].equals (font)) return;
+ cellFont [index] = font;
+ cached = true;
+ ((NSOutlineView)parent.view).reloadItem_(handle);
+}
+
+/**
+ * Sets the receiver's foreground color to the color specified
+ * by the argument, or to the default system color for the item
+ * if the argument is null.
+ *
+ * @param color the new color (or null)
+ *
+ * @since 2.0
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 2.0
+ *
+ */
+public void setForeground (Color color) {
+ checkWidget ();
+ if (color != null && color.isDisposed ()) {
+ SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ if (foreground == color) return;
+ if (foreground != null && foreground.equals (color)) return;
+ foreground = color;
+ cached = true;
+ ((NSOutlineView)parent.view).reloadItem_(handle);
+}
+
+/**
+ * Sets the foreground color at the given column index in the receiver
+ * to the color specified by the argument, or to the default system color for the item
+ * if the argument is null.
+ *
+ * @param index the column index
+ * @param color the new color (or null)
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ *
+ */
+public void setForeground (int index, Color color){
+ checkWidget ();
+ if (color != null && color.isDisposed ()) {
+ SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+ }
+ int count = Math.max (1, parent.columnCount);
+ if (0 > index || index > count - 1) return;
+ if (cellForeground == null) {
+ cellForeground = new Color [count];
+ }
+ if (cellForeground [index] == color) return;
+ if (cellForeground [index] != null && cellForeground [index].equals (color)) return;
+ cellForeground [index] = color;
+ cached = true;
+ ((NSOutlineView)parent.view).reloadItem_(handle);
+}
+
+/**
+ * Sets the grayed state of the checkbox for this item. This state change
+ * only applies if the Tree was created with the SWT.CHECK style.
+ *
+ * @param grayed the new grayed state of the checkbox
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public void setGrayed (boolean grayed) {
+ checkWidget ();
+ if ((parent.style & SWT.CHECK) == 0) return;
+ if (this.grayed == grayed) return;
+ this.grayed = grayed;
+ cached = true;
+// redraw (Tree.CHECK_COLUMN_ID);
+}
+
+/**
+ * Sets the image for multiple columns in the tree.
+ *
+ * @param images the array of new images
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the array of images is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if one of the images has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setImage (Image [] images) {
+ checkWidget ();
+ if (images == null) error (SWT.ERROR_NULL_ARGUMENT);
+ for (int i=0; i<images.length; i++) {
+ setImage (i, images [i]);
+ }
+}
+
+/**
+ * Sets the receiver's image at a column.
+ *
+ * @param index the column index
+ * @param image the new image
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setImage (int index, Image image) {
+ checkWidget ();
+ if (image != null && image.isDisposed ()) {
+ error(SWT.ERROR_INVALID_ARGUMENT);
+ }
+// if (parent.imageBounds == null && image != null) {
+// parent.setItemHeight (image);
+// }
+ if (index == 0) {
+ if (image != null && image.type == SWT.ICON) {
+ if (image.equals (this.image)) return;
+ }
+ width = -1;
+ super.setImage (image);
+ }
+ int count = Math.max (1, parent.columnCount);
+ if (0 <= index && index < count) {
+ if (images == null) images = new Image [count];
+ if (image != null && image.type == SWT.ICON) {
+ if (image.equals (images [index])) return;
+ }
+ images [index] = image;
+ }
+// cached = true;
+// if (index == 0) parent.setScrollWidth (this);
+ ((NSOutlineView)parent.view).reloadItem_(handle);
+}
+
+public void setImage (Image image) {
+ checkWidget ();
+ setImage (0, image);
+}
+
+/**
+ * Sets the number of child items contained in the receiver.
+ *
+ * @param count the number of items
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.2
+ */
+public void setItemCount (int count) {
+ checkWidget ();
+ count = Math.max (0, count);
+ parent.setItemCount (this, count);
+}
+
+/**
+ * Sets the text for multiple columns in the tree.
+ *
+ * @param strings the array of new strings
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setText (String [] strings) {
+ checkWidget ();
+ if (strings == null) error (SWT.ERROR_NULL_ARGUMENT);
+ for (int i=0; i<strings.length; i++) {
+ String string = strings [i];
+ if (string != null) setText (i, string);
+ }
+}
+
+/**
+ * Sets the receiver's text at a column
+ *
+ * @param index the column index
+ * @param string the new text
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the text is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.1
+ */
+public void setText (int index, String string) {
+ checkWidget ();
+ if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (index == 0) {
+ if (string.equals (text)) return;
+ width = -1;
+ super.setText (string);
+ }
+ int count = Math.max (1, parent.columnCount);
+ if (0 <= index && index < count) {
+ if (strings == null) strings = new String [count];
+ if (string.equals (strings [index])) return;
+ strings [index] = string;
+ }
+ cached = true;
+ if (index == 0) parent.setScrollWidth (this);
+ ((NSOutlineView)parent.view).reloadItem_(handle);
+}
+
+public void setText (String string) {
+ checkWidget ();
+ setText (0, string);
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java
new file mode 100755
index 0000000000..4139c5c612
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java
@@ -0,0 +1,1183 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.widgets;
+
+
+import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.cocoa.*;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.events.*;
+
+/**
+ * This class is the abstract superclass of all user interface objects.
+ * Widgets are created, disposed and issue notification to listeners
+ * when events occur which affect them.
+ * <dl>
+ * <dt><b>Styles:</b></dt>
+ * <dd>(none)</dd>
+ * <dt><b>Events:</b></dt>
+ * <dd>Dispose</dd>
+ * </dl>
+ * <p>
+ * IMPORTANT: This class is intended to be subclassed <em>only</em>
+ * within the SWT implementation. However, it has not been marked
+ * final to allow those outside of the SWT development team to implement
+ * patched versions of the class in order to get around specific
+ * limitations in advance of when those limitations can be addressed
+ * by the team. Any class built using subclassing to access the internals
+ * of this class will likely fail to compile or run between releases and
+ * may be strongly platform specific. Subclassing should not be attempted
+ * without an intimate and detailed understanding of the workings of the
+ * hierarchy. No support is provided for user-written classes which are
+ * implemented as subclasses of this class.
+ * </p>
+ *
+ * @see #checkSubclass
+ */
+public abstract class Widget {
+ int style, state;
+ Display display;
+ EventTable eventTable;
+ Object data;
+
+ int jniRef;
+
+ /* Global state flags */
+ static final int DISPOSED = 1 << 0;
+ static final int CANVAS = 1 << 1;
+ static final int KEYED_DATA = 1 << 2;
+ static final int DISABLED = 1 << 3;
+ static final int HIDDEN = 1 << 4;
+ static final int GRAB = 1 << 5;
+ static final int MOVED = 1 << 6;
+ static final int RESIZED = 1 << 7;
+ static final int EXPANDING = 1 << 8;
+ static final int IGNORE_WHEEL = 1 << 9;
+ static final int PARENT_BACKGROUND = 1 << 10;
+ static final int THEME_BACKGROUND = 1 << 11;
+
+ /* A layout was requested on this widget */
+ static final int LAYOUT_NEEDED = 1<<12;
+
+ /* The preferred size of a child has changed */
+ static final int LAYOUT_CHANGED = 1<<13;
+
+ /* A layout was requested in this widget hierachy */
+ static final int LAYOUT_CHILD = 1<<14;
+
+ /* More global state flags */
+ static final int RELEASED = 1<<15;
+ static final int DISPOSE_SENT = 1<<16;
+ static final int FOREIGN_HANDLE = 1<<17;
+ static final int DRAG_DETECT = 1<<18;
+
+ /* Default size for widgets */
+ static final int DEFAULT_WIDTH = 64;
+ static final int DEFAULT_HEIGHT = 64;
+
+Widget () {
+ /* Do nothing */
+}
+
+/**
+ * Constructs a new instance of this class given its parent
+ * and a style value describing its behavior and appearance.
+ * <p>
+ * The style value is either one of the style constants defined in
+ * class <code>SWT</code> which is applicable to instances of this
+ * class, or must be built by <em>bitwise OR</em>'ing together
+ * (that is, using the <code>int</code> "|" operator) two or more
+ * of those <code>SWT</code> style constants. The class description
+ * lists the style constants that are applicable to the class.
+ * Style bits are also inherited from superclasses.
+ * </p>
+ *
+ * @param parent a widget which will be the parent of the new instance (cannot be null)
+ * @param style the style of widget to construct
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
+ * <li>ERROR_INVALID_ARGUMENT - if the parent is disposed</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see #checkSubclass
+ * @see #getStyle
+ */
+public Widget (Widget parent, int style) {
+ checkSubclass ();
+ checkParent (parent);
+ this.style = style;
+ display = parent.display;
+}
+
+boolean acceptsFirstResponder () {
+ return false;
+}
+
+boolean becomeFirstResponder () {
+ return true;
+}
+
+boolean resignFirstResponder () {
+ return true;
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when an event of the given type occurs. When the
+ * event does occur in the widget, the listener is notified by
+ * sending it the <code>handleEvent()</code> message. The event
+ * type is one of the event constants defined in class <code>SWT</code>.
+ *
+ * @param eventType the type of event to listen for
+ * @param listener the listener which should be notified when the event occurs
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Listener
+ * @see SWT
+ * @see #removeListener(int, Listener)
+ * @see #notifyListeners
+ */
+public void addListener (int eventType, Listener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ _addListener (eventType, listener);
+}
+
+void _addListener (int eventType, Listener listener) {
+ if (eventTable == null) eventTable = new EventTable ();
+ eventTable.hook (eventType, listener);
+}
+
+/**
+ * Adds the listener to the collection of listeners who will
+ * be notified when the widget is disposed. When the widget is
+ * disposed, the listener is notified by sending it the
+ * <code>widgetDisposed()</code> message.
+ *
+ * @param listener the listener which should be notified when the receiver is disposed
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see DisposeListener
+ * @see #removeDisposeListener
+ */
+public void addDisposeListener (DisposeListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ TypedListener typedListener = new TypedListener (listener);
+ addListener (SWT.Dispose, typedListener);
+}
+
+static int checkBits (int style, int int0, int int1, int int2, int int3, int int4, int int5) {
+ int mask = int0 | int1 | int2 | int3 | int4 | int5;
+ if ((style & mask) == 0) style |= int0;
+ if ((style & int0) != 0) style = (style & ~mask) | int0;
+ if ((style & int1) != 0) style = (style & ~mask) | int1;
+ if ((style & int2) != 0) style = (style & ~mask) | int2;
+ if ((style & int3) != 0) style = (style & ~mask) | int3;
+ if ((style & int4) != 0) style = (style & ~mask) | int4;
+ if ((style & int5) != 0) style = (style & ~mask) | int5;
+ return style;
+}
+
+void checkOpen () {
+ /* Do nothing */
+}
+
+void checkOrientation (Widget parent) {
+ style &= ~SWT.MIRRORED;
+ if ((style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT)) == 0) {
+ if (parent != null) {
+ if ((parent.style & SWT.LEFT_TO_RIGHT) != 0) style |= SWT.LEFT_TO_RIGHT;
+ if ((parent.style & SWT.RIGHT_TO_LEFT) != 0) style |= SWT.RIGHT_TO_LEFT;
+ }
+ }
+ style = checkBits (style, SWT.LEFT_TO_RIGHT, SWT.RIGHT_TO_LEFT, 0, 0, 0, 0);
+}
+
+void checkParent (Widget parent) {
+ if (parent == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (parent.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
+ parent.checkWidget ();
+ parent.checkOpen ();
+}
+
+/**
+ * Checks that this class can be subclassed.
+ * <p>
+ * The SWT class library is intended to be subclassed
+ * only at specific, controlled points (most notably,
+ * <code>Composite</code> and <code>Canvas</code> when
+ * implementing new widgets). This method enforces this
+ * rule unless it is overridden.
+ * </p><p>
+ * <em>IMPORTANT:</em> By providing an implementation of this
+ * method that allows a subclass of a class which does not
+ * normally allow subclassing to be created, the implementer
+ * agrees to be fully responsible for the fact that any such
+ * subclass will likely fail between SWT releases and will be
+ * strongly platform specific. No support is provided for
+ * user-written classes which are implemented in this fashion.
+ * </p><p>
+ * The ability to subclass outside of the allowed SWT classes
+ * is intended purely to enable those not on the SWT development
+ * team to implement patches in order to get around specific
+ * limitations in advance of when those limitations can be
+ * addressed by the team. Subclassing should not be attempted
+ * without an intimate and detailed understanding of the hierarchy.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
+ * </ul>
+ */
+protected void checkSubclass () {
+ if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
+}
+
+/**
+ * Throws an <code>SWTException</code> if the receiver can not
+ * be accessed by the caller. This may include both checks on
+ * the state of the receiver and more generally on the entire
+ * execution context. This method <em>should</em> be called by
+ * widget implementors to enforce the standard SWT invariants.
+ * <p>
+ * Currently, it is an error to invoke any method (other than
+ * <code>isDisposed()</code>) on a widget that has had its
+ * <code>dispose()</code> method called. It is also an error
+ * to call widget methods from any thread that is different
+ * from the thread that created the widget.
+ * </p><p>
+ * In future releases of SWT, there may be more or fewer error
+ * checks and exceptions may be thrown for different reasons.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+protected void checkWidget () {
+ Display display = this.display;
+ if (display == null) error (SWT.ERROR_WIDGET_DISPOSED);
+ if (display.thread != Thread.currentThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
+ if ((state & DISPOSED) != 0) error (SWT.ERROR_WIDGET_DISPOSED);
+}
+
+boolean clickOnLink(int textView, int link, int charIndex) {
+ return true;
+}
+
+void comboBoxSelectionDidChange(int notification) {
+}
+
+void createHandle () {
+}
+
+void createJNIRef () {
+ jniRef = OS.NewGlobalRef(this);
+ if (jniRef == 0) error (SWT.ERROR_NO_HANDLES);
+}
+
+void createWidget () {
+ createJNIRef ();
+ createHandle ();
+}
+
+void destroyWidget () {
+ releaseHandle ();
+}
+
+/**
+ * Disposes of the operating system resources associated with
+ * the receiver and all its descendants. After this method has
+ * been invoked, the receiver and all descendants will answer
+ * <code>true</code> when sent the message <code>isDisposed()</code>.
+ * Any internal connections between the widgets in the tree will
+ * have been removed to facilitate garbage collection.
+ * <p>
+ * NOTE: This method is not called recursively on the descendants
+ * of the receiver. This means that, widget implementers can not
+ * detect when a widget is being disposed of by re-implementing
+ * this method, but should instead listen for the <code>Dispose</code>
+ * event.
+ * </p>
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #addDisposeListener
+ * @see #removeDisposeListener
+ * @see #checkWidget
+ */
+public void dispose () {
+ /*
+ * Note: It is valid to attempt to dispose a widget
+ * more than once. If this happens, fail silently.
+ */
+ if (isDisposed ()) return;
+ if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
+ release (true);
+}
+
+void drawBackground (int control, int context) {
+ /* Do nothing */
+}
+
+void drawRect(int id, NSRect rect) {
+ objc_super super_struct = new objc_super();
+ super_struct.receiver = id;
+ super_struct.cls = OS.objc_msgSend(id, OS.sel_superclass);
+ OS.objc_msgSendSuper(super_struct, OS.sel_drawRect_1, rect);
+}
+
+void drawWidget (int control, int context, int damageRgn, int visibleRgn, int theEvent) {
+}
+
+void error (int code) {
+ SWT.error(code);
+}
+
+boolean filters (int eventType) {
+ return display.filters (eventType);
+}
+
+int fixMnemonic (char [] buffer) {
+ int i=0, j=0;
+ while (i < buffer.length) {
+ if ((buffer [j++] = buffer [i++]) == '&') {
+ if (i == buffer.length) {continue;}
+ if (buffer [i] == '&') {i++; continue;}
+ j--;
+ }
+ }
+ return j;
+}
+
+/**
+ * Returns the application defined widget data associated
+ * with the receiver, or null if it has not been set. The
+ * <em>widget data</em> is a single, unnamed field that is
+ * stored with every widget.
+ * <p>
+ * Applications may put arbitrary objects in this field. If
+ * the object stored in the widget data needs to be notified
+ * when the widget is disposed of, it is the application's
+ * responsibility to hook the Dispose event on the widget and
+ * do so.
+ * </p>
+ *
+ * @return the widget data
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - when the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - when called from the wrong thread</li>
+ * </ul>
+ *
+ * @see #setData(Object)
+ */
+public Object getData () {
+ checkWidget();
+ return (state & KEYED_DATA) != 0 ? ((Object []) data) [0] : data;
+}
+
+/**
+ * Returns the application defined property of the receiver
+ * with the specified name, or null if it has not been set.
+ * <p>
+ * Applications may have associated arbitrary objects with the
+ * receiver in this fashion. If the objects stored in the
+ * properties need to be notified when the widget is disposed
+ * of, it is the application's responsibility to hook the
+ * Dispose event on the widget and do so.
+ * </p>
+ *
+ * @param key the name of the property
+ * @return the value of the property or null if it has not been set
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the key is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #setData(String, Object)
+ */
+public Object getData (String key) {
+ checkWidget();
+ if (key == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if ((state & KEYED_DATA) != 0) {
+ Object [] table = (Object []) data;
+ for (int i=1; i<table.length; i+=2) {
+ if (key.equals (table [i])) return table [i+1];
+ }
+ }
+ return null;
+}
+
+/**
+ * Returns the <code>Display</code> that is associated with
+ * the receiver.
+ * <p>
+ * A widget's display is either provided when it is created
+ * (for example, top level <code>Shell</code>s) or is the
+ * same as its parent's display.
+ * </p>
+ *
+ * @return the receiver's display
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Display getDisplay () {
+ Display display = this.display;
+ if (display == null) error (SWT.ERROR_WIDGET_DISPOSED);
+ return display;
+}
+
+String getName () {
+ String string = getClass ().getName ();
+ int index = string.lastIndexOf ('.');
+ if (index == -1) return string;
+ return string.substring (index + 1, string.length ());
+}
+
+String getNameText () {
+ return "";
+}
+
+/**
+ * Returns the receiver's style information.
+ * <p>
+ * Note that the value which is returned by this method <em>may
+ * not match</em> the value which was provided to the constructor
+ * when the receiver was created. This can occur when the underlying
+ * operating system does not support a particular combination of
+ * requested styles. For example, if the platform widget used to
+ * implement a particular SWT widget always has scroll bars, the
+ * result of calling this method would always have the
+ * <code>SWT.H_SCROLL</code> and <code>SWT.V_SCROLL</code> bits set.
+ * </p>
+ *
+ * @return the style bits
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ */
+public int getStyle () {
+ checkWidget();
+ return style;
+}
+
+boolean hooks (int eventType) {
+ if (eventTable == null) return false;
+ return eventTable.hooks (eventType);
+}
+
+/**
+ * Returns <code>true</code> if the widget has been disposed,
+ * and <code>false</code> otherwise.
+ * <p>
+ * This method gets the dispose state for the widget.
+ * When a widget has been disposed, it is an error to
+ * invoke any other method using the widget.
+ * </p>
+ *
+ * @return <code>true</code> when the widget is disposed and <code>false</code> otherwise
+ */
+public boolean isDisposed () {
+ return (state & DISPOSED) != 0;
+}
+
+boolean isFlipped () {
+ return true;
+}
+
+/**
+ * Returns <code>true</code> if there are any listeners
+ * for the specified event type associated with the receiver,
+ * and <code>false</code> otherwise. The event type is one of
+ * the event constants defined in class <code>SWT</code>.
+ *
+ * @param eventType the type of event
+ * @return true if the event is hooked
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT
+ */
+public boolean isListening (int eventType) {
+ checkWidget();
+ return hooks (eventType);
+}
+
+boolean isTrimHandle (int trimHandle) {
+ return false;
+}
+
+boolean isValidSubclass () {
+ return Display.isValidClass (getClass ());
+}
+
+boolean isValidThread () {
+ return getDisplay ().isValidThread ();
+}
+
+void keyDown(int event) {
+}
+
+void keyUp(int event) {
+}
+
+void mouseDragged(int event) {
+}
+
+void mouseDown(int event) {
+}
+
+void rightMouseDown(int event) {
+}
+
+void mouseEntered(int event) {
+}
+
+void mouseUp(int event) {
+}
+
+int menuForEvent (int event) {
+ return 0;
+}
+
+int numberOfRowsInTableView(int aTableView) {
+ return 0;
+}
+
+int outlineView_child_ofItem(int outlineView, int index, int item) {
+ return 0;
+}
+
+int outlineView_objectValueForTableColumn_byItem(int outlineView, int tableColumn, int item) {
+ return 0;
+}
+
+boolean outlineView_isItemExpandable(int outlineView, int item) {
+ return false;
+}
+
+int outlineView_numberOfChildrenOfItem(int outlineView, int item) {
+ return 0;
+}
+
+void outlineView_willDisplayCell_forTableColumn_item(int outlineView, int cell, int tableColumn, int item) {
+}
+
+void outlineView_setObjectValue_forTableColumn_byItem(int outlineView, int object, int tableColumn, int item) {
+}
+
+/**
+ * Notifies all of the receiver's listeners for events
+ * of the given type that one such event has occurred by
+ * invoking their <code>handleEvent()</code> method. The
+ * event type is one of the event constants defined in class
+ * <code>SWT</code>.
+ *
+ * @param eventType the type of event which has occurred
+ * @param event the event data
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see SWT
+ * @see #addListener
+ * @see #removeListener(int, Listener)
+ */
+public void notifyListeners (int eventType, Event event) {
+ checkWidget();
+ if (event == null) event = new Event ();
+ sendEvent (eventType, event);
+}
+
+void postEvent (int eventType) {
+ sendEvent (eventType, null, false);
+}
+
+void postEvent (int eventType, Event event) {
+ sendEvent (eventType, event, false);
+}
+
+void release (boolean destroy) {
+ if ((state & DISPOSE_SENT) == 0) {
+ state |= DISPOSE_SENT;
+ sendEvent (SWT.Dispose);
+ }
+ if ((state & DISPOSED) == 0) {
+ releaseChildren (destroy);
+ }
+ if ((state & RELEASED) == 0) {
+ state |= RELEASED;
+ if (destroy) {
+ releaseParent ();
+ releaseWidget ();
+ destroyWidget ();
+ } else {
+ releaseWidget ();
+ releaseHandle ();
+ }
+ }
+}
+
+void releaseChildren (boolean destroy) {
+}
+
+void releaseHandle () {
+ state |= DISPOSED;
+ display = null;
+ if (jniRef != 0) OS.DeleteGlobalRef(jniRef);
+ jniRef = 0;
+}
+
+void releaseParent () {
+ /* Do nothing */
+}
+
+void releaseWidget () {
+ eventTable = null;
+ data = null;
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when an event of the given type occurs. The event
+ * type is one of the event constants defined in class <code>SWT</code>.
+ *
+ * @param eventType the type of event to listen for
+ * @param listener the listener which should no longer be notified when the event occurs
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Listener
+ * @see SWT
+ * @see #addListener
+ * @see #notifyListeners
+ */
+public void removeListener (int eventType, Listener handler) {
+ checkWidget();
+ if (handler == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (eventType, handler);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when an event of the given type occurs.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the SWT
+ * public API. It is marked public only so that it can be shared
+ * within the packages provided by SWT. It should never be
+ * referenced from application code.
+ * </p>
+ *
+ * @param eventType the type of event to listen for
+ * @param listener the listener which should no longer be notified when the event occurs
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see Listener
+ * @see #addListener
+ */
+protected void removeListener (int eventType, SWTEventListener handler) {
+ checkWidget();
+ if (handler == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (eventType, handler);
+}
+
+/**
+ * Removes the listener from the collection of listeners who will
+ * be notified when the widget is disposed.
+ *
+ * @param listener the listener which should no longer be notified when the receiver is disposed
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see DisposeListener
+ * @see #addDisposeListener
+ */
+public void removeDisposeListener (DisposeListener listener) {
+ checkWidget();
+ if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (eventTable == null) return;
+ eventTable.unhook (SWT.Dispose, listener);
+}
+
+void sendEvent (Event event) {
+ Display display = event.display;
+ if (!display.filterEvent (event)) {
+ if (eventTable != null) eventTable.sendEvent (event);
+ }
+}
+
+void sendEvent (int eventType) {
+ sendEvent (eventType, null, true);
+}
+
+void sendEvent (int eventType, Event event) {
+ sendEvent (eventType, event, true);
+}
+
+void sendEvent (int eventType, Event event, boolean send) {
+ if (eventTable == null && !display.filters (eventType)) {
+ return;
+ }
+ if (event == null) event = new Event ();
+ event.type = eventType;
+ event.display = display;
+ event.widget = this;
+ if (event.time == 0) {
+ event.time = display.getLastEventTime ();
+ }
+ if (send) {
+ sendEvent (event);
+ } else {
+ display.postEvent (event);
+ }
+}
+
+boolean sendKeyEvent (int type, int theEvent) {
+// int [] length = new int [1];
+// int status = OS.GetEventParameter (theEvent, OS.kEventParamKeyUnicodes, OS.typeUnicodeText, null, 4, length, (char[])null);
+// if (status == OS.noErr && length [0] > 2) {
+// int count = 0;
+// int [] chord = new int [1];
+// OS.GetEventParameter (theEvent, OS.kEventParamMouseChord, OS.typeUInt32, null, 4, null, chord);
+// int [] modifiers = new int [1];
+// OS.GetEventParameter (theEvent, OS.kEventParamKeyModifiers, OS.typeUInt32, null, 4, null, modifiers);
+// char [] chars = new char [length [0] / 2];
+// OS.GetEventParameter (theEvent, OS.kEventParamKeyUnicodes, OS.typeUnicodeText, null, chars.length * 2, null, chars);
+// for (int i=0; i<chars.length; i++) {
+// Event event = new Event ();
+// event.character = chars [i];
+// setInputState (event, type, chord [0], modifiers [0]);
+// if (sendKeyEvent (type, event)) chars [count++] = chars [i];
+// }
+// if (count == 0) return false;
+// if (count != chars.length - 1) {
+// OS.SetEventParameter (theEvent, OS.kEventParamKeyUnicodes, OS.typeUnicodeText, count * 2, chars);
+// }
+// return true;
+// } else {
+// Event event = new Event ();
+// if (!setKeyState (event, type, theEvent)) return true;
+// return sendKeyEvent (type, event);
+// }
+ return false;
+}
+
+boolean sendKeyEvent (int type, Event event) {
+ sendEvent (type, event);
+ // widget could be disposed at this point
+
+ /*
+ * It is possible (but unlikely), that application
+ * code could have disposed the widget in the key
+ * events. If this happens, end the processing of
+ * the key by returning false.
+ */
+ if (isDisposed ()) return false;
+ return event.doit;
+}
+
+void sendDoubleSelection() {
+}
+
+void sendHorizontalSelection () {
+}
+
+void sendSelection () {
+}
+
+void sendVerticalSelection () {
+}
+
+/**
+ * Sets the application defined widget data associated
+ * with the receiver to be the argument. The <em>widget
+ * data</em> is a single, unnamed field that is stored
+ * with every widget.
+ * <p>
+ * Applications may put arbitrary objects in this field. If
+ * the object stored in the widget data needs to be notified
+ * when the widget is disposed of, it is the application's
+ * responsibility to hook the Dispose event on the widget and
+ * do so.
+ * </p>
+ *
+ * @param data the widget data
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - when the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - when called from the wrong thread</li>
+ * </ul>
+ *
+ * @see #getData()
+ */
+public void setData (Object data) {
+ checkWidget();
+ if ((state & KEYED_DATA) != 0) {
+ ((Object []) this.data) [0] = data;
+ } else {
+ this.data = data;
+ }
+}
+
+/**
+ * Sets the application defined property of the receiver
+ * with the specified name to the given value.
+ * <p>
+ * Applications may associate arbitrary objects with the
+ * receiver in this fashion. If the objects stored in the
+ * properties need to be notified when the widget is disposed
+ * of, it is the application's responsibility to hook the
+ * Dispose event on the widget and do so.
+ * </p>
+ *
+ * @param key the name of the property
+ * @param value the new value for the property
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the key is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @see #getData(String)
+ */
+public void setData (String key, Object value) {
+ checkWidget();
+ if (key == null) error (SWT.ERROR_NULL_ARGUMENT);
+ int index = 1;
+ Object [] table = null;
+ if ((state & KEYED_DATA) != 0) {
+ table = (Object []) data;
+ while (index < table.length) {
+ if (key.equals (table [index])) break;
+ index += 2;
+ }
+ }
+ if (value != null) {
+ if ((state & KEYED_DATA) != 0) {
+ if (index == table.length) {
+ Object [] newTable = new Object [table.length + 2];
+ System.arraycopy (table, 0, newTable, 0, table.length);
+ data = table = newTable;
+ }
+ } else {
+ table = new Object [3];
+ table [0] = data;
+ data = table;
+ state |= KEYED_DATA;
+ }
+ table [index] = key;
+ table [index + 1] = value;
+ } else {
+ if ((state & KEYED_DATA) != 0) {
+ if (index != table.length) {
+ int length = table.length - 2;
+ if (length == 1) {
+ data = table [0];
+ state &= ~KEYED_DATA;
+ } else {
+ Object [] newTable = new Object [length];
+ System.arraycopy (table, 0, newTable, 0, index);
+ System.arraycopy (table, index + 2, newTable, index, length - index);
+ data = newTable;
+ }
+ }
+ }
+ }
+}
+
+boolean setInputState (Event event, int type, int chord, int modifiers) {
+// if ((chord & 0x01) != 0) event.stateMask |= SWT.BUTTON1;
+// if ((chord & 0x02) != 0) event.stateMask |= SWT.BUTTON3;
+// if ((chord & 0x04) != 0) event.stateMask |= SWT.BUTTON2;
+// if ((chord & 0x08) != 0) event.stateMask |= SWT.BUTTON4;
+// if ((chord & 0x10) != 0) event.stateMask |= SWT.BUTTON5;
+//
+// if ((modifiers & OS.optionKey) != 0) event.stateMask |= SWT.ALT;
+// if ((modifiers & OS.shiftKey) != 0) event.stateMask |= SWT.SHIFT;
+// if ((modifiers & OS.controlKey) != 0) event.stateMask |= SWT.CONTROL;
+// if ((modifiers & OS.cmdKey) != 0) event.stateMask |= SWT.COMMAND;
+// switch (type) {
+// case SWT.MouseDown:
+// case SWT.MouseDoubleClick:
+// if (event.button == 1) event.stateMask &= ~SWT.BUTTON1;
+// if (event.button == 2) event.stateMask &= ~SWT.BUTTON2;
+// if (event.button == 3) event.stateMask &= ~SWT.BUTTON3;
+// if (event.button == 4) event.stateMask &= ~SWT.BUTTON4;
+// if (event.button == 5) event.stateMask &= ~SWT.BUTTON5;
+// break;
+// case SWT.MouseUp:
+// if (event.button == 1) event.stateMask |= SWT.BUTTON1;
+// if (event.button == 2) event.stateMask |= SWT.BUTTON2;
+// if (event.button == 3) event.stateMask |= SWT.BUTTON3;
+// if (event.button == 4) event.stateMask |= SWT.BUTTON4;
+// if (event.button == 5) event.stateMask |= SWT.BUTTON5;
+// break;
+// case SWT.KeyDown:
+// case SWT.Traverse: {
+// if (event.keyCode != 0 || event.character != 0) return true;
+// int lastModifiers = display.lastModifiers;
+// if ((modifiers & OS.alphaLock) != 0 && (lastModifiers & OS.alphaLock) == 0) {
+// event.keyCode = SWT.CAPS_LOCK;
+// return true;
+// }
+// if ((modifiers & OS.shiftKey) != 0 && (lastModifiers & OS.shiftKey) == 0) {
+// event.stateMask &= ~SWT.SHIFT;
+// event.keyCode = SWT.SHIFT;
+// return true;
+// }
+// if ((modifiers & OS.controlKey) != 0 && (lastModifiers & OS.controlKey) == 0) {
+// event.stateMask &= ~SWT.CONTROL;
+// event.keyCode = SWT.CONTROL;
+// return true;
+// }
+// if ((modifiers & OS.cmdKey) != 0 && (lastModifiers & OS.cmdKey) == 0) {
+// event.stateMask &= ~SWT.COMMAND;
+// event.keyCode = SWT.COMMAND;
+// return true;
+// }
+// if ((modifiers & OS.optionKey) != 0 && (lastModifiers & OS.optionKey) == 0) {
+// event.stateMask &= ~SWT.ALT;
+// event.keyCode = SWT.ALT;
+// return true;
+// }
+// break;
+// }
+// case SWT.KeyUp: {
+// if (event.keyCode != 0 || event.character != 0) return true;
+// int lastModifiers = display.lastModifiers;
+// if ((modifiers & OS.alphaLock) == 0 && (lastModifiers & OS.alphaLock) != 0) {
+// event.keyCode = SWT.CAPS_LOCK;
+// return true;
+// }
+// if ((modifiers & OS.shiftKey) == 0 && (lastModifiers & OS.shiftKey) != 0) {
+// event.stateMask |= SWT.SHIFT;
+// event.keyCode = SWT.SHIFT;
+// return true;
+// }
+// if ((modifiers & OS.controlKey) == 0 && (lastModifiers & OS.controlKey) != 0) {
+// event.stateMask |= SWT.CONTROL;
+// event.keyCode = SWT.CONTROL;
+// return true;
+// }
+// if ((modifiers & OS.cmdKey) == 0 && (lastModifiers & OS.cmdKey) != 0) {
+// event.stateMask |= SWT.COMMAND;
+// event.keyCode = SWT.COMMAND;
+// return true;
+// }
+// if ((modifiers & OS.optionKey) == 0 && (lastModifiers & OS.optionKey) != 0) {
+// event.stateMask |= SWT.ALT;
+// event.keyCode = SWT.ALT;
+// return true;
+// }
+// break;
+// }
+// }
+ return true;
+}
+
+boolean setKeyState (Event event, int type, int theEvent) {
+// boolean isNull = false;
+// int [] keyCode = new int [1];
+// OS.GetEventParameter (theEvent, OS.kEventParamKeyCode, OS.typeUInt32, null, keyCode.length * 4, null, keyCode);
+// event.keyCode = Display.translateKey (keyCode [0]);
+// switch (event.keyCode) {
+// case SWT.LF: {
+// /*
+// * Feature in the Macintosh. When the numeric key pad
+// * Enter key is pressed, it generates '\n'. This is the
+// * correct platform behavior but is not portable. The
+// * fix is to convert the '\n' into '\r'.
+// */
+// event.keyCode = SWT.KEYPAD_CR;
+// event.character = '\r';
+// break;
+// }
+// case SWT.BS: event.character = '\b'; break;
+// case SWT.CR: event.character = '\r'; break;
+// case SWT.DEL: event.character = 0x7F; break;
+// case SWT.ESC: event.character = 0x1B; break;
+// case SWT.TAB: event.character = '\t'; break;
+// default: {
+// if (event.keyCode == 0 || (SWT.KEYPAD_MULTIPLY <= event.keyCode && event.keyCode <= SWT.KEYPAD_CR)) {
+// int [] length = new int [1];
+// int status = OS.GetEventParameter (theEvent, OS.kEventParamKeyUnicodes, OS.typeUnicodeText, null, 4, length, (char[])null);
+// if (status == OS.noErr && length [0] != 0) {
+// char [] chars = new char [1];
+// OS.GetEventParameter (theEvent, OS.kEventParamKeyUnicodes, OS.typeUnicodeText, null, 2, null, chars);
+// event.character = chars [0];
+// }
+// /*
+// * Bug in the Mactonish. For some reason, Ctrl+Shift+'2' and Ctrl+Shift+'6'
+// * fail to give 0x0 (^@ or ASCII NUL) and 0x1e (^^). Other control character
+// * key sequences such as ^A or even Ctrl+Shift+'-' (^_ or 0x1f) are correctly
+// * translated to control characters. Since it is not possible to know which
+// * key combination gives '@' on an international keyboard, there is no way to
+// * test for either character and convert it to a control character (Shift+'2'
+// * gives '@' only on an English keyboard) to work around the problem.
+// *
+// * There is no fix at this time.
+// */
+// }
+// if (event.keyCode == 0) {
+// int kchrPtr = OS.GetScriptManagerVariable ((short) OS.smKCHRCache);
+// if (display.kchrPtr != kchrPtr) {
+// display.kchrPtr = kchrPtr;
+// display.kchrState [0] = 0;
+// }
+// int result = OS.KeyTranslate (display.kchrPtr, (short)keyCode [0], display.kchrState);
+// if (result <= 0x7f) {
+// event.keyCode = result & 0x7f;
+// } else {
+// int [] encoding = new int [1];
+// short keyScript = (short) OS.GetScriptManagerVariable ((short) OS.smKeyScript);
+// short regionCode = (short) OS.GetScriptManagerVariable ((short) OS.smRegionCode);
+// if (OS.UpgradeScriptInfoToTextEncoding (keyScript, (short) OS.kTextLanguageDontCare, regionCode, null, encoding) == OS.paramErr) {
+// if (OS.UpgradeScriptInfoToTextEncoding (keyScript, (short) OS.kTextLanguageDontCare, (short) OS.kTextRegionDontCare, null, encoding) == OS.paramErr) {
+// encoding [0] = OS.kTextEncodingMacRoman;
+// }
+// }
+// int [] encodingInfo = new int [1];
+// OS.CreateTextToUnicodeInfoByEncoding (encoding [0], encodingInfo);
+// if (encodingInfo [0] != 0) {
+// char [] chars = new char [1];
+// int [] nchars = new int [1];
+// byte [] buffer = new byte [2];
+// buffer [0] = 1;
+// buffer [1] = (byte) (result & 0xFF);
+// OS.ConvertFromPStringToUnicode (encodingInfo [0], buffer, chars.length * 2, nchars, chars);
+// OS.DisposeTextToUnicodeInfo (encodingInfo);
+// event.keyCode = chars [0];
+// }
+// }
+// }
+// break;
+// }
+// }
+// if (event.keyCode == 0 && event.character == 0) {
+// if (!isNull) return false;
+// }
+// int [] chord = new int [1];
+// OS.GetEventParameter (theEvent, OS.kEventParamMouseChord, OS.typeUInt32, null, 4, null, chord);
+// int [] modifiers = new int [1];
+// OS.GetEventParameter (theEvent, OS.kEventParamKeyModifiers, OS.typeUInt32, null, 4, null, modifiers);
+// return setInputState (event, type, chord [0], modifiers [0]);
+ return false;
+}
+
+void tableViewSelectionDidChange (int aNotification) {
+}
+
+boolean tableViewshouldEditTableColumnrow(int aTableView, int aTableColumn, int rowIndex) {
+ return true;
+}
+
+int tableViewobjectValueForTableColumnrow(int aTableView, int aTableColumn, int rowIndex) {
+ return 0;
+}
+
+void tableViewwillDisplayCellforTableColumnrow(int aTableView, int aCell, int aTableColumn, int rowIndex) {
+}
+
+/**
+ * Returns a string containing a concise, human-readable
+ * description of the receiver.
+ *
+ * @return a string representation of the receiver
+ */
+public String toString () {
+ String string = "*Disposed*";
+ if (!isDisposed ()) {
+ string = "*Wrong Thread*";
+ if (isValidThread ()) string = getNameText ();
+ }
+ return getName () + " {" + string + "}";
+}
+
+void willSelectTabViewItem(int tabView, int tabViewItem) {
+}
+
+void windowDidMove(int notification) {
+}
+
+void windowDidResize(int notification) {
+}
+
+boolean windowShouldClose(int window) {
+ return false;
+}
+
+void windowWillClose(int notification) {
+}
+
+}