AppKit header file collection

This commit is contained in:
Lubos Dolezel 2014-01-27 14:43:29 +01:00
parent dcb213e1d2
commit 8d2e3d5a06
194 changed files with 23688 additions and 39 deletions

1
src/AppKit/AppKit Symbolic link
View File

@ -0,0 +1 @@
.

View File

@ -1,20 +1,186 @@
#ifndef APPKIT_H_ #import <Foundation/Foundation.h>
#define APPKIT_H_ #import <AppKit/AppKitDefines.h>
#import <AppKit/AppKitErrors.h>
#ifndef BEGIN_EXTERN_C #import <AppKit/NSGraphicsContext.h>
# ifdef __cplusplus #import <AppKit/NSAccessibility.h>
# define BEGIN_EXTERN_C extern "C" { #import <AppKit/NSActionCell.h>
# define END_EXTERN_C } #import <AppKit/NSAlert.h>
# else #import <AppKit/NSAnimationContext.h>
# define BEGIN_EXTERN_C #import <AppKit/NSApplication.h>
# define END_EXTERN_C #import <AppKit/NSBox.h>
# endif #import <AppKit/NSButton.h>
#endif #import <AppKit/NSButtonCell.h>
#import <AppKit/NSCell.h>
#ifdef DARLING_BUILD #import <AppKit/NSClipView.h>
# define DEFINE_CONSTANT(name) NSString* name = @ #name #import <AppKit/NSControl.h>
#endif #import <AppKit/NSDockTile.h>
#import <AppKit/NSFont.h>
#include "NSApplication.h" #import <AppKit/NSFontCollection.h>
#import <AppKit/NSFontDescriptor.h>
#endif #import <AppKit/NSFontManager.h>
#import <AppKit/NSFontPanel.h>
#import <AppKit/NSForm.h>
#import <AppKit/NSFormCell.h>
#import <AppKit/NSMatrix.h>
#import <AppKit/NSMenu.h>
#import <AppKit/NSMenuItem.h>
#import <AppKit/NSColor.h>
#import <AppKit/NSColorSpace.h>
#import <AppKit/NSBitmapImageRep.h>
#import <AppKit/NSBrowser.h>
#import <AppKit/NSBrowserCell.h>
#import <AppKit/NSCachedImageRep.h>
#import <AppKit/NSCIImageRep.h>
#import <AppKit/NSColorList.h>
#import <AppKit/NSColorPanel.h>
#import <AppKit/NSColorPicking.h>
#import <AppKit/NSColorPicker.h>
#import <AppKit/NSColorWell.h>
#import <AppKit/NSCursor.h>
#import <AppKit/NSCustomImageRep.h>
#import <AppKit/NSDocument.h>
#import <AppKit/NSDocumentController.h>
#import <AppKit/NSDragging.h>
#import <AppKit/NSDraggingItem.h>
#import <AppKit/NSDraggingSession.h>
#import <AppKit/NSEPSImageRep.h>
#import <AppKit/NSErrors.h>
#import <AppKit/NSEvent.h>
#import <AppKit/NSHelpManager.h>
#import <AppKit/NSGradient.h>
#import <AppKit/NSGraphics.h>
#import <AppKit/NSImage.h>
#import <AppKit/NSImageCell.h>
#import <AppKit/NSImageRep.h>
#import <AppKit/NSImageView.h>
#import <AppKit/NSLayoutConstraint.h>
#import <AppKit/NSNib.h>
#import <AppKit/NSNibLoading.h>
#import <AppKit/NSPrinter.h>
#import <AppKit/NSSpeechRecognizer.h>
#import <AppKit/NSSpeechSynthesizer.h>
#import <AppKit/NSSpellChecker.h>
#import <AppKit/NSSplitView.h>
#import <AppKit/NSOpenPanel.h>
#import <AppKit/NSPageLayout.h>
#import <AppKit/NSPanel.h>
#import <AppKit/NSPasteboard.h>
#import <AppKit/NSPasteboardItem.h>
#import <AppKit/NSPopUpButton.h>
#import <AppKit/NSPrintInfo.h>
#import <AppKit/NSPrintOperation.h>
#import <AppKit/NSPrintPanel.h>
#import <AppKit/NSResponder.h>
#import <AppKit/NSSavePanel.h>
#import <AppKit/NSScreen.h>
#import <AppKit/NSScrollView.h>
#import <AppKit/NSScroller.h>
#import <AppKit/NSSegmentedControl.h>
#import <AppKit/NSSegmentedCell.h>
#import <AppKit/NSSharingService.h>
#import <AppKit/NSSlider.h>
#import <AppKit/NSSliderCell.h>
#import <AppKit/NSSpellProtocol.h>
#import <AppKit/NSText.h>
#import <AppKit/NSTextField.h>
#import <AppKit/NSTextFieldCell.h>
#import <AppKit/NSText.h>
#import <AppKit/NSTokenField.h>
#import <AppKit/NSTokenFieldCell.h>
#import <AppKit/NSTrackingArea.h>
#import <AppKit/NSView.h>
#import <AppKit/NSViewController.h>
#import <AppKit/NSWindow.h>
#import <AppKit/NSWindowController.h>
#import <AppKit/NSWorkspace.h>
#import <AppKit/NSRunningApplication.h>
#import <AppKit/NSComboBox.h>
#import <AppKit/NSComboBoxCell.h>
#import <AppKit/NSTableCellView.h>
#import <AppKit/NSTableColumn.h>
#import <AppKit/NSTableHeaderCell.h>
#import <AppKit/NSTableHeaderView.h>
#import <AppKit/NSTableRowView.h>
#import <AppKit/NSTableView.h>
#import <AppKit/NSOutlineView.h>
#import <AppKit/NSAttributedString.h>
#import <AppKit/NSLayoutManager.h>
#import <AppKit/NSParagraphStyle.h>
#import <AppKit/NSTextStorage.h>
#import <AppKit/NSTextView.h>
#import <AppKit/NSTextContainer.h>
#import <AppKit/NSTextAttachment.h>
#import <AppKit/NSInputManager.h>
#import <AppKit/NSInputServer.h>
#import <AppKit/NSStringDrawing.h>
#import <AppKit/NSRulerMarker.h>
#import <AppKit/NSRulerView.h>
#import <AppKit/NSSecureTextField.h>
#import <AppKit/NSInterfaceStyle.h>
#import <AppKit/NSNibDeclarations.h>
#import <AppKit/NSProgressIndicator.h>
#import <AppKit/NSTabView.h>
#import <AppKit/NSTabViewItem.h>
#import <AppKit/NSMenuView.h>
#import <AppKit/NSMenuItemCell.h>
#import <AppKit/NSPopUpButtonCell.h>
#import <AppKit/NSAffineTransform.h>
#import <AppKit/NSBezierPath.h>
#import <AppKit/NSPICTImageRep.h>
#import <AppKit/NSStatusBar.h>
#import <AppKit/NSStatusItem.h>
#import <AppKit/NSSound.h>
#import <AppKit/NSMovie.h>
#import <AppKit/NSMovieView.h>
#import <AppKit/NSPDFImageRep.h>
#import <AppKit/NSQuickDrawView.h>
#import <AppKit/NSDrawer.h>
#import <AppKit/NSOpenGL.h>
#import <AppKit/NSOpenGLLayer.h>
#import <AppKit/NSOpenGLView.h>
#import <AppKit/NSApplicationScripting.h>
#import <AppKit/NSDocumentScripting.h>
#import <AppKit/NSTextStorageScripting.h>
#import <AppKit/NSToolbar.h>
#import <AppKit/NSToolbarItem.h>
#import <AppKit/NSToolbarItemGroup.h>
#import <AppKit/NSWindowScripting.h>
#import <AppKit/NSStepper.h>
#import <AppKit/NSStepperCell.h>
#import <AppKit/NSGlyphInfo.h>
#import <AppKit/NSShadow.h>
#import <AppKit/NSATSTypesetter.h>
#import <AppKit/NSGlyphGenerator.h>
#import <AppKit/NSSearchField.h>
#import <AppKit/NSSearchFieldCell.h>
#import <AppKit/NSController.h>
#import <AppKit/NSObjectController.h>
#import <AppKit/NSArrayController.h>
#import <AppKit/NSDictionaryController.h>
#import <AppKit/NSTreeNode.h>
#import <AppKit/NSTreeController.h>
#import <AppKit/NSUserDefaultsController.h>
#import <AppKit/NSKeyValueBinding.h>
#import <AppKit/NSTextList.h>
#import <AppKit/NSTextTable.h>
#import <AppKit/NSDatePickerCell.h>
#import <AppKit/NSDatePicker.h>
#import <AppKit/NSLevelIndicatorCell.h>
#import <AppKit/NSLevelIndicator.h>
#import <AppKit/NSAnimation.h>
#import <AppKit/NSPersistentDocument.h>
#import <AppKit/NSRuleEditor.h>
#import <AppKit/NSPredicateEditor.h>
#import <AppKit/NSPredicateEditorRowTemplate.h>
#import <AppKit/NSPathCell.h>
#import <AppKit/NSPathControl.h>
#import <AppKit/NSPathComponentCell.h>
#import <AppKit/NSPageController.h>
#import <AppKit/NSPopover.h>
#import <AppKit/NSCollectionView.h>
#import <AppKit/NSTextInputClient.h>
#import <AppKit/NSTextInputContext.h>
#import <AppKit/NSUserInterfaceItemSearching.h>
#import <AppKit/NSTouch.h>
#import <AppKit/NSWindowRestoration.h>
#import <AppKit/NSTextAlternatives.h>

View File

@ -0,0 +1,31 @@
#ifndef APPKIT_DEFINES_H
#define APPKIT_DEFINES_H
#define NS_BLOCKS_AVAILABLE 1 /* Blocks are required for Darling */
typedef void* CGImageRef;
typedef long long NSAlignmentOptions; /* This should be in Foundation */
#ifndef BEGIN_EXTERN_C
# ifdef __cplusplus
# define BEGIN_EXTERN_C extern "C" {
# define END_EXTERN_C }
# else
# define BEGIN_EXTERN_C
# define END_EXTERN_C
# endif
#endif
#ifndef EXTERN_C
# ifdef __cplusplus
# define EXTERN_C extern "C"
# else
# define EXTERN_C extern
# endif
#endif
#ifdef DARLING_BUILD
# define DEFINE_CONSTANT(name) NSString* name = @ #name
#endif
#endif

25
src/AppKit/AppKitErrors.h Normal file
View File

@ -0,0 +1,25 @@
#import <Foundation/NSObject.h>
enum {
NSTextReadInapplicableDocumentTypeError = 65806,
NSTextWriteInapplicableDocumentTypeError = 66062,
NSTextReadWriteErrorMinimum = 65792,
NSTextReadWriteErrorMaximum = 66303,
NSServiceApplicationNotFoundError = 66560,
NSServiceApplicationLaunchFailedError = 66561,
NSServiceRequestTimedOutError = 66562,
NSServiceInvalidPasteboardDataError = 66563,
NSServiceMalformedServiceDictionaryError = 66564,
NSServiceMiscellaneousError = 66800,
NSServiceErrorMinimum = 66560,
NSServiceErrorMaximum = 66817
};

View File

@ -0,0 +1,130 @@
#import <AppKit/NSTypesetter.h>
#import <AppKit/NSParagraphStyle.h>
@interface NSATSTypesetter : NSTypesetter {
NSAttributedString *attributedString;
NSRange paragraphGlyphRange;
NSRange paragraphSeparatorGlyphRange;
CGFloat lineFragmentPadding;
NSLayoutManager *layoutManager;
NSArray *textContainers;
NSTextContainer *currentTextContainer;
NSUInteger currentTextContainerIndex;
NSSize currentTextContainerSize;
NSParagraphStyle *currentParagraphStyle;
@private
void *_atsReserved[8];
id _private;
}
+ (id)sharedTypesetter;
@end
@interface NSATSTypesetter (NSPantherCompatibility)
- (NSRect)lineFragmentRectForProposedRect:(NSRect)proposedRect remainingRect:(NSRectPointer)remainingRect;
@end
@interface NSATSTypesetter (NSPrimitiveInterface)
- (BOOL)usesFontLeading;
- (void)setUsesFontLeading:(BOOL)flag;
- (NSTypesetterBehavior)typesetterBehavior;
- (void)setTypesetterBehavior:(NSTypesetterBehavior)behavior;
- (float)hyphenationFactor;
- (void)setHyphenationFactor:(float)factor;
- (CGFloat)lineFragmentPadding;
- (void)setLineFragmentPadding:(CGFloat)padding;
- (NSFont *)substituteFontForFont:(NSFont *)originalFont;
- (NSTextTab *)textTabForGlyphLocation:(CGFloat)glyphLocation writingDirection:(NSWritingDirection)direction maxLocation:(CGFloat)maxLocation;
- (BOOL)bidiProcessingEnabled;
- (void)setBidiProcessingEnabled:(BOOL)flag;
- (void)setAttributedString:(NSAttributedString *)attrString;
- (NSAttributedString *)attributedString;
- (void)setParagraphGlyphRange:(NSRange)paragraphRange separatorGlyphRange:(NSRange)paragraphSeparatorRange;
- (NSRange)paragraphGlyphRange;
- (NSRange)paragraphSeparatorGlyphRange;
- (NSUInteger)layoutParagraphAtPoint:(NSPoint *)lineFragmentOrigin;
- (CGFloat)lineSpacingAfterGlyphAtIndex:(NSUInteger)glyphIndex withProposedLineFragmentRect:(NSRect)rect;
- (CGFloat)paragraphSpacingBeforeGlyphAtIndex:(NSUInteger)glyphIndex withProposedLineFragmentRect:(NSRect)rect;
- (CGFloat)paragraphSpacingAfterGlyphAtIndex:(NSUInteger)glyphIndex withProposedLineFragmentRect:(NSRect)rect;
- (NSLayoutManager *)layoutManager;
- (NSTextContainer *)currentTextContainer;
- (void)setHardInvalidation:(BOOL)flag forGlyphRange:(NSRange)glyphRange;
- (void)getLineFragmentRect:(NSRect *)lineFragmentRect usedRect:(NSRect *)lineFragmentUsedRect forParagraphSeparatorGlyphRange:(NSRange)paragraphSeparatorGlyphRange atProposedOrigin:(NSPoint)lineOrigin;
@end
@interface NSATSTypesetter (NSLayoutPhaseInterface)
- (void)willSetLineFragmentRect:(NSRect *)lineRect forGlyphRange:(NSRange)glyphRange usedRect:(NSRect *)usedRect baselineOffset:(CGFloat *)baselineOffset;
- (BOOL)shouldBreakLineByWordBeforeCharacterAtIndex:(NSUInteger)charIndex;
- (BOOL)shouldBreakLineByHyphenatingBeforeCharacterAtIndex:(NSUInteger)charIndex;
- (float)hyphenationFactorForGlyphAtIndex:(NSUInteger)glyphIndex;
- (UTF32Char)hyphenCharacterForGlyphAtIndex:(NSUInteger)glyphIndex;
- (NSRect)boundingBoxForControlGlyphAtIndex:(NSUInteger)glyphIndex forTextContainer:(NSTextContainer *)textContainer proposedLineFragment:(NSRect)proposedRect glyphPosition:(NSPoint)glyphPosition characterIndex:(NSUInteger)charIndex;
@end
@interface NSATSTypesetter (NSGlyphStorageInterface)
- (NSRange)characterRangeForGlyphRange:(NSRange)glyphRange actualGlyphRange:(NSRangePointer)actualGlyphRange;
- (NSRange)glyphRangeForCharacterRange:(NSRange)charRange actualCharacterRange:(NSRangePointer)actualCharRange;
- (NSUInteger)getGlyphsInRange:(NSRange)glyphsRange glyphs:(NSGlyph *)glyphBuffer characterIndexes:(NSUInteger *)charIndexBuffer glyphInscriptions:(NSGlyphInscription *)inscribeBuffer elasticBits:(BOOL *)elasticBuffer;
- (void)setLineFragmentRect:(NSRect)fragmentRect forGlyphRange:(NSRange)glyphRange usedRect:(NSRect)usedRect baselineOffset:(CGFloat)baselineOffset;
- (void)substituteGlyphsInRange:(NSRange)glyphRange withGlyphs:(NSGlyph *)glyphs;
- (void)insertGlyph:(NSGlyph)glyph atGlyphIndex:(NSUInteger)glyphIndex characterIndex:(NSUInteger)characterIndex;
- (void)deleteGlyphsInRange:(NSRange)glyphRange;
- (void)setNotShownAttribute:(BOOL)flag forGlyphRange:(NSRange)glyphRange;
- (void)setDrawsOutsideLineFragment:(BOOL)flag forGlyphRange:(NSRange)glyphRange;
- (void)setLocation:(NSPoint)location withAdvancements:(const CGFloat *)advancements forStartOfGlyphRange:(NSRange)glyphRange;
- (void)setAttachmentSize:(NSSize)attachmentSize forGlyphRange:(NSRange)glyphRange;
- (void)setBidiLevels:(const uint8_t *)levels forGlyphRange:(NSRange)glyphRange;
@end

View File

@ -0,0 +1,515 @@
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSErrors.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSObject.h>
@class NSString, NSArray;
@interface NSObject (NSAccessibility)
- (NSArray *)accessibilityAttributeNames;
- (id)accessibilityAttributeValue:(NSString *)attribute;
- (BOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
- (void)accessibilitySetValue:(id)value forAttribute:(NSString *)attribute;
- (NSArray *)accessibilityParameterizedAttributeNames;
- (id)accessibilityAttributeValue:(NSString *)attribute forParameter:(id)parameter;
- (NSArray *)accessibilityActionNames;
- (NSString *)accessibilityActionDescription:(NSString *)action;
- (void)accessibilityPerformAction:(NSString *)action;
- (BOOL)accessibilityIsIgnored;
- (id)accessibilityHitTest:(NSPoint)point;
- (id)accessibilityFocusedUIElement;
- (NSUInteger)accessibilityIndexOfChild:(id)child;
- (NSUInteger)accessibilityArrayAttributeCount:(NSString *)attribute;
- (NSArray *)accessibilityArrayAttributeValues:(NSString *)attribute index:(NSUInteger)index maxCount:(NSUInteger)maxCount;
@end
@interface NSObject (NSAccessibilityAdditions)
- (BOOL)accessibilitySetOverrideValue:(id)value forAttribute:(NSString *)attribute;
@end
EXTERN_C NSString *NSAccessibilityRoleDescription(NSString *role, NSString *subrole);
EXTERN_C NSString *NSAccessibilityRoleDescriptionForUIElement(id element);
EXTERN_C NSString *NSAccessibilityActionDescription(NSString *action);
EXTERN_C void NSAccessibilityRaiseBadArgumentException(id element, NSString *attribute, id value);
EXTERN_C id NSAccessibilityUnignoredAncestor(id element);
EXTERN_C id NSAccessibilityUnignoredDescendant(id element);
EXTERN_C NSArray *NSAccessibilityUnignoredChildren(NSArray *originalChildren);
EXTERN_C NSArray *NSAccessibilityUnignoredChildrenForOnlyChild(id originalChild);
EXTERN_C void NSAccessibilityPostNotification(id element, NSString *notification);
EXTERN_C NSString *const NSAccessibilityErrorCodeExceptionInfo;
EXTERN_C NSString *const NSAccessibilityRoleAttribute;
EXTERN_C NSString *const NSAccessibilityRoleDescriptionAttribute;
EXTERN_C NSString *const NSAccessibilitySubroleAttribute;
EXTERN_C NSString *const NSAccessibilityHelpAttribute;
EXTERN_C NSString *const NSAccessibilityValueAttribute;
EXTERN_C NSString *const NSAccessibilityMinValueAttribute;
EXTERN_C NSString *const NSAccessibilityMaxValueAttribute;
EXTERN_C NSString *const NSAccessibilityEnabledAttribute;
EXTERN_C NSString *const NSAccessibilityFocusedAttribute;
EXTERN_C NSString *const NSAccessibilityParentAttribute;
EXTERN_C NSString *const NSAccessibilityChildrenAttribute;
EXTERN_C NSString *const NSAccessibilityWindowAttribute;
EXTERN_C NSString *const NSAccessibilityTopLevelUIElementAttribute;
EXTERN_C NSString *const NSAccessibilitySelectedChildrenAttribute;
EXTERN_C NSString *const NSAccessibilityVisibleChildrenAttribute;
EXTERN_C NSString *const NSAccessibilityPositionAttribute;
EXTERN_C NSString *const NSAccessibilitySizeAttribute;
EXTERN_C NSString *const NSAccessibilityContentsAttribute;
EXTERN_C NSString *const NSAccessibilityTitleAttribute;
EXTERN_C NSString *const NSAccessibilityDescriptionAttribute;
EXTERN_C NSString *const NSAccessibilityShownMenuAttribute;
EXTERN_C NSString *const NSAccessibilityValueDescriptionAttribute
;
EXTERN_C NSString *const NSAccessibilityPreviousContentsAttribute;
EXTERN_C NSString *const NSAccessibilityNextContentsAttribute;
EXTERN_C NSString *const NSAccessibilityHeaderAttribute;
EXTERN_C NSString *const NSAccessibilityEditedAttribute;
EXTERN_C NSString *const NSAccessibilityTabsAttribute;
EXTERN_C NSString *const NSAccessibilityHorizontalScrollBarAttribute;
EXTERN_C NSString *const NSAccessibilityVerticalScrollBarAttribute;
EXTERN_C NSString *const NSAccessibilityOverflowButtonAttribute;
EXTERN_C NSString *const NSAccessibilityIncrementButtonAttribute;
EXTERN_C NSString *const NSAccessibilityDecrementButtonAttribute;
EXTERN_C NSString *const NSAccessibilityFilenameAttribute;
EXTERN_C NSString *const NSAccessibilityExpandedAttribute;
EXTERN_C NSString *const NSAccessibilitySelectedAttribute;
EXTERN_C NSString *const NSAccessibilitySplittersAttribute;
EXTERN_C NSString *const NSAccessibilityDocumentAttribute;
EXTERN_C NSString *const NSAccessibilityURLAttribute;
EXTERN_C NSString *const NSAccessibilityIndexAttribute;
EXTERN_C NSString *const NSAccessibilityRowCountAttribute
;
EXTERN_C NSString *const NSAccessibilityColumnCountAttribute
;
EXTERN_C NSString *const NSAccessibilityOrderedByRowAttribute
;
EXTERN_C NSString *const NSAccessibilityWarningValueAttribute
;
EXTERN_C NSString *const NSAccessibilityCriticalValueAttribute
;
EXTERN_C NSString *const NSAccessibilityPlaceholderValueAttribute
;
EXTERN_C NSString *const NSAccessibilityTitleUIElementAttribute;
EXTERN_C NSString *const NSAccessibilityServesAsTitleForUIElementsAttribute;
EXTERN_C NSString *const NSAccessibilityLinkedUIElementsAttribute;
EXTERN_C NSString *const NSAccessibilitySelectedTextAttribute;
EXTERN_C NSString *const NSAccessibilitySelectedTextRangeAttribute;
EXTERN_C NSString *const NSAccessibilityNumberOfCharactersAttribute;
EXTERN_C NSString *const NSAccessibilityVisibleCharacterRangeAttribute;
EXTERN_C NSString *const NSAccessibilitySharedTextUIElementsAttribute;
EXTERN_C NSString *const NSAccessibilitySharedCharacterRangeAttribute;
EXTERN_C NSString *const NSAccessibilityInsertionPointLineNumberAttribute;
EXTERN_C NSString *const NSAccessibilitySelectedTextRangesAttribute
;
EXTERN_C NSString *const NSAccessibilityLineForIndexParameterizedAttribute;
EXTERN_C NSString *const NSAccessibilityRangeForLineParameterizedAttribute;
EXTERN_C NSString *const NSAccessibilityStringForRangeParameterizedAttribute;
EXTERN_C NSString *const NSAccessibilityRangeForPositionParameterizedAttribute;
EXTERN_C NSString *const NSAccessibilityRangeForIndexParameterizedAttribute;
EXTERN_C NSString *const NSAccessibilityBoundsForRangeParameterizedAttribute;
EXTERN_C NSString *const NSAccessibilityRTFForRangeParameterizedAttribute;
EXTERN_C NSString *const NSAccessibilityStyleRangeForIndexParameterizedAttribute;
EXTERN_C NSString *const NSAccessibilityAttributedStringForRangeParameterizedAttribute;
EXTERN_C NSString *const NSAccessibilityFontTextAttribute;
EXTERN_C NSString *const NSAccessibilityForegroundColorTextAttribute;
EXTERN_C NSString *const NSAccessibilityBackgroundColorTextAttribute;
EXTERN_C NSString *const NSAccessibilityUnderlineColorTextAttribute;
EXTERN_C NSString *const NSAccessibilityStrikethroughColorTextAttribute;
EXTERN_C NSString *const NSAccessibilityUnderlineTextAttribute;
EXTERN_C NSString *const NSAccessibilitySuperscriptTextAttribute;
EXTERN_C NSString *const NSAccessibilityStrikethroughTextAttribute;
EXTERN_C NSString *const NSAccessibilityShadowTextAttribute;
EXTERN_C NSString *const NSAccessibilityAttachmentTextAttribute;
EXTERN_C NSString *const NSAccessibilityLinkTextAttribute;
EXTERN_C NSString *const NSAccessibilityMisspelledTextAttribute;
EXTERN_C NSString *const NSAccessibilityAutocorrectedTextAttribute;
EXTERN_C NSString *const NSAccessibilityFontNameKey;
EXTERN_C NSString *const NSAccessibilityFontFamilyKey;
EXTERN_C NSString *const NSAccessibilityVisibleNameKey;
EXTERN_C NSString *const NSAccessibilityFontSizeKey;
EXTERN_C NSString *const NSAccessibilityMainAttribute;
EXTERN_C NSString *const NSAccessibilityMinimizedAttribute;
EXTERN_C NSString *const NSAccessibilityCloseButtonAttribute;
EXTERN_C NSString *const NSAccessibilityZoomButtonAttribute;
EXTERN_C NSString *const NSAccessibilityMinimizeButtonAttribute;
EXTERN_C NSString *const NSAccessibilityToolbarButtonAttribute;
EXTERN_C NSString *const NSAccessibilityProxyAttribute;
EXTERN_C NSString *const NSAccessibilityGrowAreaAttribute;
EXTERN_C NSString *const NSAccessibilityModalAttribute;
EXTERN_C NSString *const NSAccessibilityDefaultButtonAttribute;
EXTERN_C NSString *const NSAccessibilityCancelButtonAttribute;
EXTERN_C NSString *const NSAccessibilityFullScreenButtonAttribute;
EXTERN_C NSString *const NSAccessibilityMenuBarAttribute;
EXTERN_C NSString *const NSAccessibilityWindowsAttribute;
EXTERN_C NSString *const NSAccessibilityFrontmostAttribute;
EXTERN_C NSString *const NSAccessibilityHiddenAttribute;
EXTERN_C NSString *const NSAccessibilityMainWindowAttribute;
EXTERN_C NSString *const NSAccessibilityFocusedWindowAttribute;
EXTERN_C NSString *const NSAccessibilityFocusedUIElementAttribute;
EXTERN_C NSString *const NSAccessibilityExtrasMenuBarAttribute;
EXTERN_C NSString *const NSAccessibilityOrientationAttribute;
EXTERN_C NSString *const NSAccessibilityVerticalOrientationValue;
EXTERN_C NSString *const NSAccessibilityHorizontalOrientationValue;
EXTERN_C NSString *const NSAccessibilityUnknownOrientationValue;
EXTERN_C NSString *const NSAccessibilityColumnTitlesAttribute;
EXTERN_C NSString *const NSAccessibilitySearchButtonAttribute;
EXTERN_C NSString *const NSAccessibilitySearchMenuAttribute;
EXTERN_C NSString *const NSAccessibilityClearButtonAttribute;
EXTERN_C NSString *const NSAccessibilityRowsAttribute;
EXTERN_C NSString *const NSAccessibilityVisibleRowsAttribute;
EXTERN_C NSString *const NSAccessibilitySelectedRowsAttribute;
EXTERN_C NSString *const NSAccessibilityColumnsAttribute;
EXTERN_C NSString *const NSAccessibilityVisibleColumnsAttribute;
EXTERN_C NSString *const NSAccessibilitySelectedColumnsAttribute;
EXTERN_C NSString *const NSAccessibilitySortDirectionAttribute;
EXTERN_C NSString *const NSAccessibilitySelectedCellsAttribute;
EXTERN_C NSString *const NSAccessibilityVisibleCellsAttribute;
EXTERN_C NSString *const NSAccessibilityRowHeaderUIElementsAttribute;
EXTERN_C NSString *const NSAccessibilityColumnHeaderUIElementsAttribute;
EXTERN_C NSString *const NSAccessibilityCellForColumnAndRowParameterizedAttribute;
EXTERN_C NSString *const NSAccessibilityRowIndexRangeAttribute;
EXTERN_C NSString *const NSAccessibilityColumnIndexRangeAttribute;
EXTERN_C NSString *const NSAccessibilityHorizontalUnitsAttribute;
EXTERN_C NSString *const NSAccessibilityVerticalUnitsAttribute;
EXTERN_C NSString *const NSAccessibilityHorizontalUnitDescriptionAttribute;
EXTERN_C NSString *const NSAccessibilityVerticalUnitDescriptionAttribute;
EXTERN_C NSString *const NSAccessibilityLayoutPointForScreenPointParameterizedAttribute;
EXTERN_C NSString *const NSAccessibilityLayoutSizeForScreenSizeParameterizedAttribute;
EXTERN_C NSString *const NSAccessibilityScreenPointForLayoutPointParameterizedAttribute;
EXTERN_C NSString *const NSAccessibilityScreenSizeForLayoutSizeParameterizedAttribute;
EXTERN_C NSString *const NSAccessibilityHandlesAttribute;
EXTERN_C NSString *const NSAccessibilityAscendingSortDirectionValue;
EXTERN_C NSString *const NSAccessibilityDescendingSortDirectionValue;
EXTERN_C NSString *const NSAccessibilityUnknownSortDirectionValue;
EXTERN_C NSString *const NSAccessibilityDisclosingAttribute;
EXTERN_C NSString *const NSAccessibilityDisclosedRowsAttribute;
EXTERN_C NSString *const NSAccessibilityDisclosedByRowAttribute;
EXTERN_C NSString *const NSAccessibilityDisclosureLevelAttribute;
EXTERN_C NSString *const NSAccessibilityAllowedValuesAttribute;
EXTERN_C NSString *const NSAccessibilityLabelUIElementsAttribute;
EXTERN_C NSString *const NSAccessibilityLabelValueAttribute;
EXTERN_C NSString *const NSAccessibilityMatteHoleAttribute;
EXTERN_C NSString *const NSAccessibilityMatteContentUIElementAttribute;
EXTERN_C NSString *const NSAccessibilityMarkerUIElementsAttribute;
EXTERN_C NSString *const NSAccessibilityMarkerValuesAttribute;
EXTERN_C NSString *const NSAccessibilityMarkerGroupUIElementAttribute;
EXTERN_C NSString *const NSAccessibilityUnitsAttribute;
EXTERN_C NSString *const NSAccessibilityUnitDescriptionAttribute;
EXTERN_C NSString *const NSAccessibilityMarkerTypeAttribute;
EXTERN_C NSString *const NSAccessibilityMarkerTypeDescriptionAttribute;
EXTERN_C NSString *const NSAccessibilityIdentifierAttribute
;
EXTERN_C NSString *const NSAccessibilityLeftTabStopMarkerTypeValue;
EXTERN_C NSString *const NSAccessibilityRightTabStopMarkerTypeValue;
EXTERN_C NSString *const NSAccessibilityCenterTabStopMarkerTypeValue;
EXTERN_C NSString *const NSAccessibilityDecimalTabStopMarkerTypeValue;
EXTERN_C NSString *const NSAccessibilityHeadIndentMarkerTypeValue;
EXTERN_C NSString *const NSAccessibilityTailIndentMarkerTypeValue;
EXTERN_C NSString *const NSAccessibilityFirstLineIndentMarkerTypeValue;
EXTERN_C NSString *const NSAccessibilityUnknownMarkerTypeValue;
EXTERN_C NSString *const NSAccessibilityInchesUnitValue;
EXTERN_C NSString *const NSAccessibilityCentimetersUnitValue;
EXTERN_C NSString *const NSAccessibilityPointsUnitValue;
EXTERN_C NSString *const NSAccessibilityPicasUnitValue;
EXTERN_C NSString *const NSAccessibilityUnknownUnitValue;
EXTERN_C NSString *const NSAccessibilityPressAction;
EXTERN_C NSString *const NSAccessibilityIncrementAction;
EXTERN_C NSString *const NSAccessibilityDecrementAction;
EXTERN_C NSString *const NSAccessibilityConfirmAction;
EXTERN_C NSString *const NSAccessibilityPickAction;
EXTERN_C NSString *const NSAccessibilityCancelAction;
EXTERN_C NSString *const NSAccessibilityRaiseAction;
EXTERN_C NSString *const NSAccessibilityShowMenuAction;
EXTERN_C NSString *const NSAccessibilityDeleteAction;
EXTERN_C NSString *const NSAccessibilityMainWindowChangedNotification;
EXTERN_C NSString *const NSAccessibilityFocusedWindowChangedNotification;
EXTERN_C NSString *const NSAccessibilityFocusedUIElementChangedNotification;
EXTERN_C NSString *const NSAccessibilityApplicationActivatedNotification;
EXTERN_C NSString *const NSAccessibilityApplicationDeactivatedNotification;
EXTERN_C NSString *const NSAccessibilityApplicationHiddenNotification;
EXTERN_C NSString *const NSAccessibilityApplicationShownNotification;
EXTERN_C NSString *const NSAccessibilityWindowCreatedNotification;
EXTERN_C NSString *const NSAccessibilityWindowMovedNotification;
EXTERN_C NSString *const NSAccessibilityWindowResizedNotification;
EXTERN_C NSString *const NSAccessibilityWindowMiniaturizedNotification;
EXTERN_C NSString *const NSAccessibilityWindowDeminiaturizedNotification;
EXTERN_C NSString *const NSAccessibilityDrawerCreatedNotification;
EXTERN_C NSString *const NSAccessibilitySheetCreatedNotification;
EXTERN_C NSString *const NSAccessibilityUIElementDestroyedNotification;
EXTERN_C NSString *const NSAccessibilityValueChangedNotification;
EXTERN_C NSString *const NSAccessibilityTitleChangedNotification;
EXTERN_C NSString *const NSAccessibilityResizedNotification;
EXTERN_C NSString *const NSAccessibilityMovedNotification;
EXTERN_C NSString *const NSAccessibilityCreatedNotification;
EXTERN_C NSString *const NSAccessibilityHelpTagCreatedNotification;
EXTERN_C NSString *const NSAccessibilitySelectedTextChangedNotification;
EXTERN_C NSString *const NSAccessibilityRowCountChangedNotification;
EXTERN_C NSString *const NSAccessibilitySelectedChildrenChangedNotification;
EXTERN_C NSString *const NSAccessibilitySelectedRowsChangedNotification;
EXTERN_C NSString *const NSAccessibilitySelectedColumnsChangedNotification;
EXTERN_C NSString *const NSAccessibilityRowExpandedNotification;
EXTERN_C NSString *const NSAccessibilityRowCollapsedNotification;
EXTERN_C NSString *const NSAccessibilitySelectedCellsChangedNotification;
EXTERN_C NSString *const NSAccessibilityUnitsChangedNotification;
EXTERN_C NSString *const NSAccessibilitySelectedChildrenMovedNotification;
EXTERN_C NSString *const NSAccessibilityUnknownRole;
EXTERN_C NSString *const NSAccessibilityButtonRole;
EXTERN_C NSString *const NSAccessibilityRadioButtonRole;
EXTERN_C NSString *const NSAccessibilityCheckBoxRole;
EXTERN_C NSString *const NSAccessibilitySliderRole;
EXTERN_C NSString *const NSAccessibilityTabGroupRole;
EXTERN_C NSString *const NSAccessibilityTextFieldRole;
EXTERN_C NSString *const NSAccessibilityStaticTextRole;
EXTERN_C NSString *const NSAccessibilityTextAreaRole;
EXTERN_C NSString *const NSAccessibilityScrollAreaRole;
EXTERN_C NSString *const NSAccessibilityPopUpButtonRole;
EXTERN_C NSString *const NSAccessibilityMenuButtonRole;
EXTERN_C NSString *const NSAccessibilityTableRole;
EXTERN_C NSString *const NSAccessibilityApplicationRole;
EXTERN_C NSString *const NSAccessibilityGroupRole;
EXTERN_C NSString *const NSAccessibilityRadioGroupRole;
EXTERN_C NSString *const NSAccessibilityListRole;
EXTERN_C NSString *const NSAccessibilityScrollBarRole;
EXTERN_C NSString *const NSAccessibilityValueIndicatorRole;
EXTERN_C NSString *const NSAccessibilityImageRole;
EXTERN_C NSString *const NSAccessibilityMenuBarRole;
EXTERN_C NSString *const NSAccessibilityMenuRole;
EXTERN_C NSString *const NSAccessibilityMenuItemRole;
EXTERN_C NSString *const NSAccessibilityColumnRole;
EXTERN_C NSString *const NSAccessibilityRowRole;
EXTERN_C NSString *const NSAccessibilityToolbarRole;
EXTERN_C NSString *const NSAccessibilityBusyIndicatorRole;
EXTERN_C NSString *const NSAccessibilityProgressIndicatorRole;
EXTERN_C NSString *const NSAccessibilityWindowRole;
EXTERN_C NSString *const NSAccessibilityDrawerRole;
EXTERN_C NSString *const NSAccessibilitySystemWideRole;
EXTERN_C NSString *const NSAccessibilityOutlineRole;
EXTERN_C NSString *const NSAccessibilityIncrementorRole;
EXTERN_C NSString *const NSAccessibilityBrowserRole;
EXTERN_C NSString *const NSAccessibilityComboBoxRole;
EXTERN_C NSString *const NSAccessibilitySplitGroupRole;
EXTERN_C NSString *const NSAccessibilitySplitterRole;
EXTERN_C NSString *const NSAccessibilityColorWellRole;
EXTERN_C NSString *const NSAccessibilityGrowAreaRole;
EXTERN_C NSString *const NSAccessibilitySheetRole;
EXTERN_C NSString *const NSAccessibilityHelpTagRole;
EXTERN_C NSString *const NSAccessibilityMatteRole;
EXTERN_C NSString *const NSAccessibilityRulerRole;
EXTERN_C NSString *const NSAccessibilityRulerMarkerRole;
EXTERN_C NSString *const NSAccessibilityLinkRole;
EXTERN_C NSString *const NSAccessibilityDisclosureTriangleRole;
EXTERN_C NSString *const NSAccessibilityGridRole;
EXTERN_C NSString *const NSAccessibilityRelevanceIndicatorRole;
EXTERN_C NSString *const NSAccessibilityLevelIndicatorRole;
EXTERN_C NSString *const NSAccessibilityCellRole;
EXTERN_C NSString *const NSAccessibilityPopoverRole;
EXTERN_C NSString *const NSAccessibilityLayoutAreaRole;
EXTERN_C NSString *const NSAccessibilityLayoutItemRole;
EXTERN_C NSString *const NSAccessibilityHandleRole;
EXTERN_C NSString *const NSAccessibilityUnknownSubrole;
EXTERN_C NSString *const NSAccessibilityCloseButtonSubrole;
EXTERN_C NSString *const NSAccessibilityZoomButtonSubrole;
EXTERN_C NSString *const NSAccessibilityMinimizeButtonSubrole;
EXTERN_C NSString *const NSAccessibilityToolbarButtonSubrole;
EXTERN_C NSString *const NSAccessibilityTableRowSubrole;
EXTERN_C NSString *const NSAccessibilityOutlineRowSubrole;
EXTERN_C NSString *const NSAccessibilitySecureTextFieldSubrole;
EXTERN_C NSString *const NSAccessibilityStandardWindowSubrole;
EXTERN_C NSString *const NSAccessibilityDialogSubrole;
EXTERN_C NSString *const NSAccessibilitySystemDialogSubrole;
EXTERN_C NSString *const NSAccessibilityFloatingWindowSubrole;
EXTERN_C NSString *const NSAccessibilitySystemFloatingWindowSubrole;
EXTERN_C NSString *const NSAccessibilityIncrementArrowSubrole;
EXTERN_C NSString *const NSAccessibilityDecrementArrowSubrole;
EXTERN_C NSString *const NSAccessibilityIncrementPageSubrole;
EXTERN_C NSString *const NSAccessibilityDecrementPageSubrole;
EXTERN_C NSString *const NSAccessibilitySearchFieldSubrole;
EXTERN_C NSString *const NSAccessibilityTextAttachmentSubrole;
EXTERN_C NSString *const NSAccessibilityTextLinkSubrole;
EXTERN_C NSString *const NSAccessibilityTimelineSubrole;
EXTERN_C NSString *const NSAccessibilitySortButtonSubrole;
EXTERN_C NSString *const NSAccessibilityRatingIndicatorSubrole;
EXTERN_C NSString *const NSAccessibilityContentListSubrole;
EXTERN_C NSString *const NSAccessibilityDefinitionListSubrole;
EXTERN_C NSString *const NSAccessibilityFullScreenButtonSubrole;
EXTERN_C NSString *const NSAccessibilitySortButtonRole;

19
src/AppKit/NSActionCell.h Normal file
View File

@ -0,0 +1,19 @@
#import <AppKit/NSCell.h>
@interface NSActionCell : NSCell
{
NSInteger _tag;
id _target;
SEL _action;
id _controlView;
}
- (id)target;
- (void)setTarget:(id)anObject;
- (SEL)action;
- (void)setAction:(SEL)aSelector;
- (NSInteger)tag;
- (void)setTag:(NSInteger)anInt;
@end

View File

@ -0,0 +1,12 @@
#import <Foundation/NSAffineTransform.h>
@class NSBezierPath;
@interface NSAffineTransform (NSAppKitAdditons)
- (NSBezierPath *)transformBezierPath:(NSBezierPath *)aPath;
- (void)set;
- (void)concat;
@end

137
src/AppKit/NSAlert.h Normal file
View File

@ -0,0 +1,137 @@
#import <Foundation/NSObject.h>
#import <AppKit/NSGraphics.h>
@class NSTextField, NSPanel, NSArray, NSWindow, NSImage, NSButton, NSError;
@protocol NSAlertDelegate;
enum {
NSWarningAlertStyle = 0,
NSInformationalAlertStyle = 1,
NSCriticalAlertStyle = 2
};
typedef NSUInteger NSAlertStyle;
@interface NSAlert : NSObject
{
@private
NSTextField *_informationField;
id _first;
id _second;
id _third;
NSArray *_buttons;
NSPanel *_panel;
id _messageField;
id _imageView;
NSSize _minButtonSize;
CGFloat _buttonSpacing;
CGFloat _buttonPadding;
CGFloat _messagePadding;
CGFloat _buttonSpacingMaxX;
CGFloat _buttonSpacingY;
id _modalDelegate;
NSWindow *_docWindow;
SEL _didEndSelector;
SEL _didDismissSelector;
NSImage *_unbadgedImage;
NSSize _defaultPanelSize;
id _helpButton;
id _delegate;
NSAlertStyle _alertStyle;
id _helpAnchor;
BOOL _layoutDone;
BOOL _showsHelp;
BOOL _showsSuppressionButton;
BOOL reserved;
id _suppressionButton;
id _accessoryView;
}
+ (NSAlert *)alertWithError:(NSError *)error;
+ (NSAlert *)alertWithMessageText:(NSString *)message defaultButton:(NSString *)defaultButton alternateButton:(NSString *)alternateButton otherButton:(NSString *)otherButton informativeTextWithFormat:(NSString *)format, ...;
- (void)setMessageText:(NSString *)messageText;
- (void)setInformativeText:(NSString *)informativeText;
- (NSString *)messageText;
- (NSString *)informativeText;
- (void)setIcon:(NSImage *)icon;
- (NSImage *)icon;
- (NSButton *)addButtonWithTitle:(NSString *)title;
- (NSArray *)buttons;
enum {
NSAlertFirstButtonReturn = 1000,
NSAlertSecondButtonReturn = 1001,
NSAlertThirdButtonReturn = 1002
};
- (void)setShowsHelp:(BOOL)showsHelp;
- (BOOL)showsHelp;
- (void)setHelpAnchor:(NSString *)anchor;
- (NSString *)helpAnchor;
- (void)setAlertStyle:(NSAlertStyle)style;
- (NSAlertStyle)alertStyle;
- (void)setDelegate:(id <NSAlertDelegate>)delegate;
- (id <NSAlertDelegate>)delegate;
- (void)setShowsSuppressionButton:(BOOL)flag;
- (BOOL)showsSuppressionButton;
- (NSButton *)suppressionButton;
- (void)setAccessoryView:(NSView *)view;
- (NSView *)accessoryView;
- (void)layout;
- (NSInteger)runModal;
- (void)beginSheetModalForWindow:(NSWindow *)window modalDelegate:(id)delegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo;
- (id)window;
@end
@protocol NSAlertDelegate <NSObject>
@optional
- (BOOL)alertShowHelp:(NSAlert *)alert;
@end

169
src/AppKit/NSAnimation.h Normal file
View File

@ -0,0 +1,169 @@
#import <AppKit/AppKitDefines.h>
#import <Foundation/Foundation.h>
@class NSArray, NSGraphicsContext, NSMutableArray, NSString, NSTimer;
@protocol NSAnimationDelegate;
enum {
NSAnimationEaseInOut,
NSAnimationEaseIn,
NSAnimationEaseOut,
NSAnimationLinear
};
typedef NSUInteger NSAnimationCurve;
enum {
NSAnimationBlocking,
NSAnimationNonblocking,
NSAnimationNonblockingThreaded
};
typedef NSUInteger NSAnimationBlockingMode;
typedef float NSAnimationProgress;
extern NSString *NSAnimationProgressMarkNotification;
extern NSString *NSAnimationProgressMark;
@interface NSAnimation : NSObject <NSCopying, NSCoding> {
@private
NSTimeInterval _duration;
NSAnimationProgress _currentProgress;
float _framesPerSecond;
id _delegate;
NSTimer *_timer;
NSTimeInterval _startTime;
NSMutableArray *_progressMarks;
NSAnimation *_startAnimation;
NSAnimation *_stopAnimation;
int _nextProgressMark;
struct __aFlags {
unsigned int delegateAnimationShouldStart:1;
unsigned int delegateAnimationDidStop:1;
unsigned int delegateAnimationDidEnd:1;
unsigned int delegateAnimationValueForProgress:1;
unsigned int delegateAnimationDidReachProgressMark:1;
unsigned int animating:1;
unsigned int blocking:1;
unsigned int reserved:25;
} _aFlags;
struct __aSettings {
unsigned int animationCurve:8;
unsigned int animationBlockingMode:2;
unsigned int reserved:22;
} _aSettings;
NSRunLoop *_scheduledRunLoop;
NSInteger _reserved2;
NSInteger _reserved3;
NSInteger _reserved4;
}
- (id)initWithDuration:(NSTimeInterval)duration animationCurve:(NSAnimationCurve)animationCurve;
- (void)startAnimation;
- (void)stopAnimation;
- (BOOL)isAnimating;
- (NSAnimationProgress)currentProgress;
- (void)setCurrentProgress:(NSAnimationProgress)progress;
- (void)setDuration:(NSTimeInterval)duration;
- (NSTimeInterval)duration;
- (NSAnimationBlockingMode)animationBlockingMode;
- (void)setAnimationBlockingMode:(NSAnimationBlockingMode)animationBlockingMode;
- (void)setFrameRate:(float)framesPerSecond;
- (float)frameRate;
- (void)setAnimationCurve:(NSAnimationCurve)curve;
- (NSAnimationCurve)animationCurve;
- (float)currentValue;
- (void)setDelegate:(id <NSAnimationDelegate>)delegate;
- (id <NSAnimationDelegate>)delegate;
- (NSArray *)progressMarks;
- (void)setProgressMarks:(NSArray *)progressMarks;
- (void)addProgressMark:(NSAnimationProgress)progressMark;
- (void)removeProgressMark:(NSAnimationProgress)progressMark;
- (void)startWhenAnimation:(NSAnimation*)animation reachesProgress:(NSAnimationProgress)startProgress;
- (void)stopWhenAnimation:(NSAnimation*)animation reachesProgress:(NSAnimationProgress)stopProgress;
- (void)clearStartAnimation;
- (void)clearStopAnimation;
- (NSArray *)runLoopModesForAnimating;
@end
@protocol NSAnimationDelegate <NSObject>
@optional
- (BOOL)animationShouldStart:(NSAnimation*)animation;
- (void)animationDidStop:(NSAnimation*)animation;
- (void)animationDidEnd:(NSAnimation*)animation;
- (float)animation:(NSAnimation*)animation valueForProgress:(NSAnimationProgress)progress;
- (void)animation:(NSAnimation*)animation didReachProgressMark:(NSAnimationProgress)progress;
@end
EXTERN_C NSString* NSViewAnimationTargetKey;
EXTERN_C NSString* NSViewAnimationStartFrameKey;
EXTERN_C NSString* NSViewAnimationEndFrameKey;
EXTERN_C NSString* NSViewAnimationEffectKey;
EXTERN_C NSString* NSViewAnimationFadeInEffect;
EXTERN_C NSString* NSViewAnimationFadeOutEffect;
@interface NSViewAnimation : NSAnimation {
@private
NSArray* _viewAnimations;
id _viewAnimationInfo;
id _windowAnimationInfo;
NSUInteger _reserved4a;
NSUInteger _reserved4b;
NSUInteger _reserved4c;
struct __vaFlags {
unsigned int reserved:32;
} _vaFlags;
NSUInteger _reserved5;
NSUInteger _reserved6;
NSUInteger _reserved7;
NSUInteger _reserved8;
}
- (id)initWithViewAnimations:(NSArray*)viewAnimations;
- (NSArray*)viewAnimations;
- (void)setViewAnimations:(NSArray*)viewAnimations;
@end
@protocol NSAnimatablePropertyContainer
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
- (id)animator;
- (NSDictionary *)animations;
- (void)setAnimations:(NSDictionary *)animations;
- (id)animationForKey:(NSString *)key;
+ (id)defaultAnimationForKey:(NSString *)key;
#endif
@end
EXTERN_C NSString *NSAnimationTriggerOrderIn;
EXTERN_C NSString *NSAnimationTriggerOrderOut;

View File

@ -0,0 +1,35 @@
#import <AppKit/AppKitDefines.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSDate.h>
@class CAMediaTimingFunction;
@interface NSAnimationContext : NSObject {
@private
NSTimeInterval _duration;
id _reserved[4];
unsigned int _allowsImplicitAnimation:1;
unsigned int _isImplicitContext:1;
unsigned int __reserved:30;
}
+ (void)runAnimationGroup:(void (^)(NSAnimationContext *context))changes completionHandler:(void (^)(void))completionHandler;
+ (void)beginGrouping;
+ (void)endGrouping;
+ (NSAnimationContext *)currentContext;
@property NSTimeInterval duration;
@property(retain) CAMediaTimingFunction *timingFunction;
#if NS_BLOCKS_AVAILABLE
@property(copy) void (^completionHandler)(void);
#endif
@property BOOL allowsImplicitAnimation;
@end

View File

@ -1,9 +1,5 @@
#ifndef NSAPPLICATION_H #ifndef NSAPPLICATION_H
#define NSAPPLICATION_H #define NSAPPLICATION_H
#include "AppKit.h"
#include "NSResponder.h"
#include "NSApplicationDelegate.h"
#ifdef DARLING_BUILD #ifdef DARLING_BUILD
# include <QEventLoop> # include <QEventLoop>
# include <QApplication> # include <QApplication>
@ -12,6 +8,10 @@
class NSApplicationEventFilter; class NSApplicationEventFilter;
#endif #endif
#include "NSResponder.h"
#include "NSApplicationDelegate.h"
#include "AppKitDefines.h"
@class NSEvent; @class NSEvent;
@interface NSApplication : NSResponder @interface NSApplication : NSResponder
@ -90,5 +90,39 @@ extern NSString *NSApplicationDidChangeScreenParametersNotification;
END_EXTERN_C END_EXTERN_C
enum {
NSUserInterfaceLayoutDirectionLeftToRight = 0,
NSUserInterfaceLayoutDirectionRightToLeft = 1
};
typedef NSInteger NSUserInterfaceLayoutDirection;
@interface NSApplication (NSApplicationLayoutDirection)
- (NSUserInterfaceLayoutDirection)userInterfaceLayoutDirection;
@end
enum {
NSApplicationPresentationDefault = 0,
NSApplicationPresentationAutoHideDock = (1 << 0),
NSApplicationPresentationHideDock = (1 << 1),
NSApplicationPresentationAutoHideMenuBar = (1 << 2),
NSApplicationPresentationHideMenuBar = (1 << 3),
NSApplicationPresentationDisableAppleMenu = (1 << 4),
NSApplicationPresentationDisableProcessSwitching = (1 << 5),
NSApplicationPresentationDisableForceQuit = (1 << 6),
NSApplicationPresentationDisableSessionTermination = (1 << 7),
NSApplicationPresentationDisableHideApplication = (1 << 8),
NSApplicationPresentationDisableMenuBarTransparency = (1 << 9)
};
enum {
NSApplicationPresentationFullScreen = (1 << 10),
NSApplicationPresentationAutoHideToolbar = (1 << 11)
};
typedef NSUInteger NSApplicationPresentationOptions;
#endif #endif

View File

@ -0,0 +1,18 @@
#import <AppKit/NSApplication.h>
@interface NSApplication(NSScripting)
- (NSArray *)orderedDocuments;
- (NSArray *)orderedWindows;
@end
@interface NSObject(NSApplicationScriptingDelegation)
- (BOOL)application:(NSApplication *)sender delegateHandlesKey:(NSString *)key;
@end

View File

@ -0,0 +1,104 @@
#import <AppKit/NSObjectController.h>
#import <Foundation/NSPredicate.h>
@class NSArray, NSIndexSet, NSMutableArray, NSMutableIndexSet;
@interface NSArrayController : NSObjectController {
@private
void *_reserved4;
id _rearrangementExtensions;
NSMutableArray *_temporaryWorkObjects;
struct __arrayControllerFlags {
unsigned int _avoidsEmptySelection:1;
unsigned int _preservesSelection:1;
unsigned int _selectsInsertedObjects:1;
unsigned int _alwaysUsesMultipleValuesMarker:1;
unsigned int _refreshesAllModelObjects:1;
unsigned int _filterRestrictsInsertion:1;
unsigned int _overridesArrangeObjects:1;
unsigned int _overridesDidChangeArrangementCriteria:1;
unsigned int _explicitlyCannotInsert:1;
unsigned int _generatedEmptyArray:1;
unsigned int _isObservingKeyPathsThroughArrangedObjects:1;
unsigned int _arrangedObjectsIsMutable:1;
unsigned int _clearsFilterPredicateOnInsertion:1;
unsigned int _skipSortingAfterFetch:1;
unsigned int _automaticallyRearrangesObjects:1;
unsigned int _reservedArrayController:17;
} _arrayControllerFlags;
NSUInteger _observedIndexHint;
NSMutableIndexSet *_selectionIndexes;
NSMutableArray *_objects;
NSIndexSet *_cachedSelectedIndexes;
NSArray *_cachedSelectedObjects;
NSArray *_arrangedObjects;
}
- (void)rearrangeObjects;
- (void)setAutomaticallyRearrangesObjects:(BOOL)flag;
- (BOOL)automaticallyRearrangesObjects;
- (NSArray *)automaticRearrangementKeyPaths;
- (void)didChangeArrangementCriteria;
- (void)setSortDescriptors:(NSArray *)sortDescriptors;
- (NSArray *)sortDescriptors;
- (void)setFilterPredicate:(NSPredicate *)filterPredicate;
- (NSPredicate *)filterPredicate;
- (void)setClearsFilterPredicateOnInsertion:(BOOL)flag;
- (BOOL)clearsFilterPredicateOnInsertion;
- (NSArray *)arrangeObjects:(NSArray *)objects;
- (id)arrangedObjects;
- (void)setAvoidsEmptySelection:(BOOL)flag;
- (BOOL)avoidsEmptySelection;
- (void)setPreservesSelection:(BOOL)flag;
- (BOOL)preservesSelection;
- (void)setSelectsInsertedObjects:(BOOL)flag;
- (BOOL)selectsInsertedObjects;
- (void)setAlwaysUsesMultipleValuesMarker:(BOOL)flag;
- (BOOL)alwaysUsesMultipleValuesMarker;
- (BOOL)setSelectionIndexes:(NSIndexSet *)indexes;
- (NSIndexSet *)selectionIndexes;
- (BOOL)setSelectionIndex:(NSUInteger)index;
- (NSUInteger)selectionIndex;
- (BOOL)addSelectionIndexes:(NSIndexSet *)indexes;
- (BOOL)removeSelectionIndexes:(NSIndexSet *)indexes;
- (BOOL)setSelectedObjects:(NSArray *)objects;
- (NSArray *)selectedObjects;
- (BOOL)addSelectedObjects:(NSArray *)objects;
- (BOOL)removeSelectedObjects:(NSArray *)objects;
- (void)add:(id)sender;
- (void)remove:(id)sender;
- (void)insert:(id)sender;
- (BOOL)canInsert;
- (void)selectNext:(id)sender;
- (void)selectPrevious:(id)sender;
- (BOOL)canSelectNext;
- (BOOL)canSelectPrevious;
- (void)addObject:(id)object;
- (void)addObjects:(NSArray *)objects;
- (void)insertObject:(id)object atArrangedObjectIndex:(NSUInteger)index;
- (void)insertObjects:(NSArray *)objects atArrangedObjectIndexes:(NSIndexSet *)indexes;
- (void)removeObjectAtArrangedObjectIndex:(NSUInteger)index;
- (void)removeObjectsAtArrangedObjectIndexes:(NSIndexSet *)indexes;
- (void)removeObject:(id)object;
- (void)removeObjects:(NSArray *)objects;
@end

View File

@ -0,0 +1,296 @@
#import <Foundation/NSAttributedString.h>
#import <AppKit/NSFontManager.h>
#import <AppKit/NSText.h>
#import <AppKit/NSPasteboard.h>
#import <AppKit/AppKitDefines.h>
@class NSFileWrapper, NSURL, NSTextBlock, NSTextTable, NSTextList;
EXTERN_C NSString *NSFontAttributeName;
EXTERN_C NSString *NSParagraphStyleAttributeName;
EXTERN_C NSString *NSForegroundColorAttributeName;
EXTERN_C NSString *NSUnderlineStyleAttributeName;
EXTERN_C NSString *NSSuperscriptAttributeName;
EXTERN_C NSString *NSBackgroundColorAttributeName;
EXTERN_C NSString *NSAttachmentAttributeName;
EXTERN_C NSString *NSLigatureAttributeName;
EXTERN_C NSString *NSBaselineOffsetAttributeName;
EXTERN_C NSString *NSKernAttributeName;
EXTERN_C NSString *NSLinkAttributeName;
EXTERN_C NSString *NSStrokeWidthAttributeName;
EXTERN_C NSString *NSStrokeColorAttributeName;
EXTERN_C NSString *NSUnderlineColorAttributeName;
EXTERN_C NSString *NSStrikethroughStyleAttributeName;
EXTERN_C NSString *NSStrikethroughColorAttributeName;
EXTERN_C NSString *NSShadowAttributeName;
EXTERN_C NSString *NSObliquenessAttributeName;
EXTERN_C NSString *NSExpansionAttributeName;
EXTERN_C NSString *NSCursorAttributeName;
EXTERN_C NSString *NSToolTipAttributeName;
EXTERN_C NSString *NSCharacterShapeAttributeName;
EXTERN_C NSString *NSGlyphInfoAttributeName;
EXTERN_C NSString *NSWritingDirectionAttributeName;
EXTERN_C NSString *NSMarkedClauseSegmentAttributeName;
EXTERN_C NSString *NSVerticalGlyphFormAttributeName;
EXTERN_C NSString *NSTextAlternativesAttributeName;
enum {
NSUnderlineStyleNone = 0x00,
NSUnderlineStyleSingle = 0x01,
NSUnderlineStyleThick = 0x02,
NSUnderlineStyleDouble = 0x09
};
enum {
NSUnderlinePatternSolid = 0x0000,
NSUnderlinePatternDot = 0x0100,
NSUnderlinePatternDash = 0x0200,
NSUnderlinePatternDashDot = 0x0300,
NSUnderlinePatternDashDotDot = 0x0400
};
EXTERN_C NSUInteger NSUnderlineByWordMask;
EXTERN_C NSString *NSSpellingStateAttributeName;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
enum {
NSSpellingStateSpellingFlag = (1 << 0),
NSSpellingStateGrammarFlag = (1 << 1)
};
#endif
EXTERN_C NSString *NSPlainTextDocumentType;
EXTERN_C NSString *NSRTFTextDocumentType;
EXTERN_C NSString *NSRTFDTextDocumentType;
EXTERN_C NSString *NSMacSimpleTextDocumentType;
EXTERN_C NSString *NSHTMLTextDocumentType;
EXTERN_C NSString *NSDocFormatTextDocumentType;
EXTERN_C NSString *NSWordMLTextDocumentType;
EXTERN_C NSString *NSWebArchiveTextDocumentType;
EXTERN_C NSString *NSOfficeOpenXMLTextDocumentType;
EXTERN_C NSString *NSOpenDocumentTextDocumentType;
EXTERN_C NSString *NSTextLayoutSectionOrientation;
EXTERN_C NSString *NSTextLayoutSectionRange;
EXTERN_C NSString *NSPaperSizeDocumentAttribute ;
EXTERN_C NSString *NSLeftMarginDocumentAttribute ;
EXTERN_C NSString *NSRightMarginDocumentAttribute ;
EXTERN_C NSString *NSTopMarginDocumentAttribute ;
EXTERN_C NSString *NSBottomMarginDocumentAttribute;
EXTERN_C NSString *NSViewSizeDocumentAttribute ;
EXTERN_C NSString *NSViewZoomDocumentAttribute ;
EXTERN_C NSString *NSViewModeDocumentAttribute ;
EXTERN_C NSString *NSDocumentTypeDocumentAttribute;
EXTERN_C NSString *NSReadOnlyDocumentAttribute ;
EXTERN_C NSString *NSConvertedDocumentAttribute ;
EXTERN_C NSString *NSCocoaVersionDocumentAttribute;
EXTERN_C NSString *NSBackgroundColorDocumentAttribute ;
EXTERN_C NSString *NSHyphenationFactorDocumentAttribute ;
EXTERN_C NSString *NSDefaultTabIntervalDocumentAttribute ;
EXTERN_C NSString *NSCharacterEncodingDocumentAttribute ;
EXTERN_C NSString *NSFileTypeDocumentAttribute;
EXTERN_C NSString *NSUsesScreenFontsDocumentAttribute;
EXTERN_C NSString *NSTitleDocumentAttribute ;
EXTERN_C NSString *NSCompanyDocumentAttribute ;
EXTERN_C NSString *NSCopyrightDocumentAttribute ;
EXTERN_C NSString *NSSubjectDocumentAttribute ;
EXTERN_C NSString *NSAuthorDocumentAttribute ;
EXTERN_C NSString *NSKeywordsDocumentAttribute ;
EXTERN_C NSString *NSCommentDocumentAttribute ;
EXTERN_C NSString *NSEditorDocumentAttribute ;
EXTERN_C NSString *NSCreationTimeDocumentAttribute;
EXTERN_C NSString *NSModificationTimeDocumentAttribute;
EXTERN_C NSString *NSManagerDocumentAttribute;
EXTERN_C NSString *NSCategoryDocumentAttribute;
EXTERN_C NSString *NSTextLayoutSectionsAttribute;
EXTERN_C NSString *NSExcludedElementsDocumentAttribute ;
EXTERN_C NSString *NSTextEncodingNameDocumentAttribute ;
EXTERN_C NSString *NSPrefixSpacesDocumentAttribute ;
EXTERN_C NSString *NSDocumentTypeDocumentOption ;
EXTERN_C NSString *NSDefaultAttributesDocumentOption ;
EXTERN_C NSString *NSCharacterEncodingDocumentOption ;
EXTERN_C NSString *NSTextEncodingNameDocumentOption ;
EXTERN_C NSString *NSBaseURLDocumentOption ;
EXTERN_C NSString *NSTimeoutDocumentOption ;
EXTERN_C NSString *NSWebPreferencesDocumentOption ;
EXTERN_C NSString *NSWebResourceLoadDelegateDocumentOption;
EXTERN_C NSString *NSTextSizeMultiplierDocumentOption ;
EXTERN_C NSString *NSFileTypeDocumentOption;
@interface NSAttributedString (NSAttributedStringKitAdditions) <NSPasteboardReading, NSPasteboardWriting>
- (NSDictionary *)fontAttributesInRange:(NSRange)range;
- (NSDictionary *)rulerAttributesInRange:(NSRange)range;
- (BOOL)containsAttachments;
- (NSUInteger)lineBreakBeforeIndex:(NSUInteger)location withinRange:(NSRange)aRange;
- (NSUInteger)lineBreakByHyphenatingBeforeIndex:(NSUInteger)location withinRange:(NSRange)aRange;
- (NSRange)doubleClickAtIndex:(NSUInteger)location;
- (NSUInteger)nextWordFromIndex:(NSUInteger)location forward:(BOOL)isForward;
- (NSURL *)URLAtIndex:(NSUInteger)location effectiveRange:(NSRangePointer)effectiveRange;
+ (NSArray *)textTypes;
+ (NSArray *)textUnfilteredTypes;
- (NSRange)rangeOfTextBlock:(NSTextBlock *)block atIndex:(NSUInteger)location;
- (NSRange)rangeOfTextTable:(NSTextTable *)table atIndex:(NSUInteger)location;
- (NSRange)rangeOfTextList:(NSTextList *)list atIndex:(NSUInteger)location;
- (NSInteger)itemNumberInTextList:(NSTextList *)list atIndex:(NSUInteger)location;
- (id)initWithURL:(NSURL *)url options:(NSDictionary *)options documentAttributes:(NSDictionary **)dict error:(NSError **)error;
- (id)initWithData:(NSData *)data options:(NSDictionary *)options documentAttributes:(NSDictionary **)dict error:(NSError **)error;
- (id)initWithPath:(NSString *)path documentAttributes:(NSDictionary **)dict;
- (id)initWithURL:(NSURL *)url documentAttributes:(NSDictionary **)dict;
- (id)initWithRTF:(NSData *)data documentAttributes:(NSDictionary **)dict;
- (id)initWithRTFD:(NSData *)data documentAttributes:(NSDictionary **)dict;
- (id)initWithHTML:(NSData *)data documentAttributes:(NSDictionary **)dict;
- (id)initWithHTML:(NSData *)data baseURL:(NSURL *)base documentAttributes:(NSDictionary **)dict;
- (id)initWithDocFormat:(NSData *)data documentAttributes:(NSDictionary **)dict;
- (id)initWithHTML:(NSData *)data options:(NSDictionary *)options documentAttributes:(NSDictionary **)dict;
- (id)initWithRTFDFileWrapper:(NSFileWrapper *)wrapper documentAttributes:(NSDictionary **)dict;
- (NSData *)dataFromRange:(NSRange)range documentAttributes:(NSDictionary *)dict error:(NSError **)error;
- (NSFileWrapper *)fileWrapperFromRange:(NSRange)range documentAttributes:(NSDictionary *)dict error:(NSError **)error;
- (NSData *)RTFFromRange:(NSRange)range documentAttributes:(NSDictionary *)dict;
- (NSData *)RTFDFromRange:(NSRange)range documentAttributes:(NSDictionary *)dict;
- (NSFileWrapper *)RTFDFileWrapperFromRange:(NSRange)range documentAttributes:(NSDictionary *)dict;
- (NSData *)docFormatFromRange:(NSRange)range documentAttributes:(NSDictionary *)dict;
@end
@interface NSAttributedString(NSDeprecatedKitAdditions)
+ (NSArray *)textFileTypes;
+ (NSArray *)textPasteboardTypes;
+ (NSArray *)textUnfilteredFileTypes;
+ (NSArray *)textUnfilteredPasteboardTypes;
@end
@interface NSMutableAttributedString (NSMutableAttributedStringKitAdditions)
- (BOOL)readFromURL:(NSURL *)url options:(NSDictionary *)opts documentAttributes:(NSDictionary **)dict error:(NSError **)error;
- (BOOL)readFromData:(NSData *)data options:(NSDictionary *)opts documentAttributes:(NSDictionary **)dict error:(NSError **)error;
- (BOOL)readFromURL:(NSURL *)url options:(NSDictionary *)options documentAttributes:(NSDictionary **)dict;
- (BOOL)readFromData:(NSData *)data options:(NSDictionary *)options documentAttributes:(NSDictionary **)dict;
- (void)superscriptRange:(NSRange)range;
- (void)subscriptRange:(NSRange)range;
- (void)unscriptRange:(NSRange)range;
- (void)applyFontTraits:(NSFontTraitMask)traitMask range:(NSRange)range;
- (void)setAlignment:(NSTextAlignment)alignment range:(NSRange)range;
- (void)setBaseWritingDirection:(NSWritingDirection)writingDirection range:(NSRange)range;
- (void)fixAttributesInRange:(NSRange)range;
- (void)fixFontAttributeInRange:(NSRange)range;
- (void)fixParagraphStyleAttributeInRange:(NSRange)range;
- (void)fixAttachmentAttributeInRange:(NSRange)range;
@end
enum {
NSNoUnderlineStyle = 0,
NSSingleUnderlineStyle
};
EXTERN_C NSUInteger NSUnderlineStrikethroughMask;

197
src/AppKit/NSBezierPath.h Normal file
View File

@ -0,0 +1,197 @@
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <AppKit/NSFont.h>
@class NSAffineTransform;
enum {
NSButtLineCapStyle = 0,
NSRoundLineCapStyle = 1,
NSSquareLineCapStyle = 2
};
typedef NSUInteger NSLineCapStyle;
enum {
NSMiterLineJoinStyle = 0,
NSRoundLineJoinStyle = 1,
NSBevelLineJoinStyle = 2
};
typedef NSUInteger NSLineJoinStyle;
enum {
NSNonZeroWindingRule = 0,
NSEvenOddWindingRule = 1
};
typedef NSUInteger NSWindingRule;
enum {
NSMoveToBezierPathElement,
NSLineToBezierPathElement,
NSCurveToBezierPathElement,
NSClosePathBezierPathElement
};
typedef NSUInteger NSBezierPathElement;
@interface NSBezierPath : NSObject <NSCopying, NSCoding>
{
@private
NSInteger _elementCount;
NSInteger _elementMax;
struct PATHSEGMENT *_head;
NSInteger _lastSubpathIndex;
void *_extraSegments;
CGFloat _lineWidth;
NSRect _controlPointBounds;
CGFloat _miterLimit;
CGFloat _flatness;
CGFloat *_dashedLinePattern;
NSUInteger _dashedLineCount;
CGFloat _dashedLinePhase;
void *_path;
NSInteger _extraSegmentCount;
NSInteger _extraSegmentMax;
id _private[2];
struct {
unsigned int _flags:8;
unsigned int _pathState:2;
unsigned int _unused:22;
} _bpFlags;
}
+ (NSBezierPath *)bezierPath;
+ (NSBezierPath *)bezierPathWithRect:(NSRect)rect;
+ (NSBezierPath *)bezierPathWithOvalInRect:(NSRect)rect;
+ (NSBezierPath *)bezierPathWithRoundedRect:(NSRect)rect xRadius:(CGFloat)xRadius yRadius:(CGFloat)yRadius;
+ (void)fillRect:(NSRect)rect;
+ (void)strokeRect:(NSRect)rect;
+ (void)clipRect:(NSRect)rect;
+ (void)strokeLineFromPoint:(NSPoint)point1 toPoint:(NSPoint)point2;
+ (void)drawPackedGlyphs:(const char *)packedGlyphs atPoint:(NSPoint)point;
+ (void)setDefaultMiterLimit:(CGFloat)limit;
+ (CGFloat)defaultMiterLimit;
+ (void)setDefaultFlatness:(CGFloat)flatness;
+ (CGFloat)defaultFlatness;
+ (void)setDefaultWindingRule:(NSWindingRule)windingRule;
+ (NSWindingRule)defaultWindingRule;
+ (void)setDefaultLineCapStyle:(NSLineCapStyle)lineCapStyle;
+ (NSLineCapStyle)defaultLineCapStyle;
+ (void)setDefaultLineJoinStyle:(NSLineJoinStyle)lineJoinStyle;
+ (NSLineJoinStyle)defaultLineJoinStyle;
+ (void)setDefaultLineWidth:(CGFloat)lineWidth;
+ (CGFloat)defaultLineWidth;
- (void)moveToPoint:(NSPoint)point;
- (void)lineToPoint:(NSPoint)point;
- (void)curveToPoint:(NSPoint)endPoint
controlPoint1:(NSPoint)controlPoint1
controlPoint2:(NSPoint)controlPoint2;
- (void)closePath;
- (void)removeAllPoints;
- (void)relativeMoveToPoint:(NSPoint)point;
- (void)relativeLineToPoint:(NSPoint)point;
- (void)relativeCurveToPoint:(NSPoint)endPoint
controlPoint1:(NSPoint)controlPoint1
controlPoint2:(NSPoint)controlPoint2;
- (CGFloat)lineWidth;
- (void)setLineWidth:(CGFloat)lineWidth;
- (NSLineCapStyle)lineCapStyle;
- (void)setLineCapStyle:(NSLineCapStyle)lineCapStyle;
- (NSLineJoinStyle)lineJoinStyle;
- (void)setLineJoinStyle:(NSLineJoinStyle)lineJoinStyle;
- (NSWindingRule)windingRule;
- (void)setWindingRule:(NSWindingRule)windingRule;
- (CGFloat)miterLimit;
- (void)setMiterLimit:(CGFloat)miterLimit;
- (CGFloat)flatness;
- (void)setFlatness:(CGFloat)flatness;
- (void)getLineDash:(CGFloat *)pattern count:(NSInteger *)count phase:(CGFloat *)phase;
- (void)setLineDash:(const CGFloat *)pattern count:(NSInteger)count phase:(CGFloat)phase;
- (void)stroke;
- (void)fill;
- (void)addClip;
- (void)setClip;
- (NSBezierPath *)bezierPathByFlatteningPath;
- (NSBezierPath *)bezierPathByReversingPath;
- (void)transformUsingAffineTransform:(NSAffineTransform *)transform;
- (BOOL)isEmpty;
- (NSPoint)currentPoint;
- (NSRect)controlPointBounds;
- (NSRect)bounds;
- (NSInteger)elementCount;
- (NSBezierPathElement)elementAtIndex:(NSInteger)index
associatedPoints:(NSPointArray)points;
- (NSBezierPathElement)elementAtIndex:(NSInteger)index;
- (void)setAssociatedPoints:(NSPointArray)points atIndex:(NSInteger)index;
- (void)appendBezierPath:(NSBezierPath *)path;
- (void)appendBezierPathWithRect:(NSRect)rect;
- (void)appendBezierPathWithPoints:(NSPointArray)points count:(NSInteger)count;
- (void)appendBezierPathWithOvalInRect:(NSRect)rect;
- (void)appendBezierPathWithArcWithCenter:(NSPoint)center radius:(CGFloat)radius
startAngle:(CGFloat)startAngle
endAngle:(CGFloat)endAngle
clockwise:(BOOL)clockwise;
- (void)appendBezierPathWithArcWithCenter:(NSPoint)center radius:(CGFloat)radius
startAngle:(CGFloat)startAngle
endAngle:(CGFloat)endAngle;
- (void)appendBezierPathWithArcFromPoint:(NSPoint)point1
toPoint:(NSPoint)point2
radius:(CGFloat)radius;
- (void)appendBezierPathWithGlyph:(NSGlyph)glyph inFont:(NSFont *)font;
- (void)appendBezierPathWithGlyphs:(NSGlyph *)glyphs count:(NSInteger)count
inFont:(NSFont *)font;
- (void)appendBezierPathWithPackedGlyphs:(const char *)packedGlyphs;
- (void)appendBezierPathWithRoundedRect:(NSRect)rect xRadius:(CGFloat)xRadius yRadius:(CGFloat)yRadius;
- (BOOL)containsPoint:(NSPoint)point;
@end
@interface NSBezierPath (NSBezierPathDeprecated)
- (BOOL)cachesBezierPath;
- (void)setCachesBezierPath:(BOOL)flag;
@end

View File

@ -0,0 +1,154 @@
#import <AppKit/NSImageRep.h>
@class CIImage;
@class NSColor;
@class NSColorSpace;
enum {
NSTIFFCompressionNone = 1,
NSTIFFCompressionCCITTFAX3 = 3,
NSTIFFCompressionCCITTFAX4 = 4,
NSTIFFCompressionLZW = 5,
NSTIFFCompressionJPEG = 6,
NSTIFFCompressionNEXT = 32766,
NSTIFFCompressionPackBits = 32773,
NSTIFFCompressionOldJPEG = 32865
};
typedef NSUInteger NSTIFFCompression;
enum {
NSTIFFFileType,
NSBMPFileType,
NSGIFFileType,
NSJPEGFileType,
NSPNGFileType,
NSJPEG2000FileType
};
typedef NSUInteger NSBitmapImageFileType;
enum {
NSImageRepLoadStatusUnknownType = -1,
NSImageRepLoadStatusReadingHeader = -2,
NSImageRepLoadStatusWillNeedAllData = -3,
NSImageRepLoadStatusInvalidData = -4,
NSImageRepLoadStatusUnexpectedEOF = -5,
NSImageRepLoadStatusCompleted = -6
};
typedef NSInteger NSImageRepLoadStatus;
enum {
NSAlphaFirstBitmapFormat = 1 << 0,
NSAlphaNonpremultipliedBitmapFormat = 1 << 1,
NSFloatingPointSamplesBitmapFormat = 1 << 2
};
typedef NSUInteger NSBitmapFormat;
EXTERN_C NSString* NSImageCompressionMethod;
EXTERN_C NSString* NSImageCompressionFactor;
EXTERN_C NSString* NSImageDitherTransparency;
EXTERN_C NSString* NSImageRGBColorTable;
EXTERN_C NSString* NSImageInterlaced;
EXTERN_C NSString* NSImageColorSyncProfileData;
EXTERN_C NSString* NSImageFrameCount;
EXTERN_C NSString* NSImageCurrentFrame;
EXTERN_C NSString* NSImageCurrentFrameDuration;
EXTERN_C NSString* NSImageLoopCount ;
EXTERN_C NSString* NSImageGamma ;
EXTERN_C NSString* NSImageProgressive ;
EXTERN_C NSString* NSImageEXIFData ;
EXTERN_C NSString* NSImageFallbackBackgroundColor;
@interface NSBitmapImageRep : NSImageRep {
struct __bitmapRepFlags {
unsigned int bitsPerPixel:8;
unsigned int isPlanar:1;
unsigned int explicitPlanes:1;
unsigned int imageSourceIsIndexed:1;
unsigned int dataLoaded:1;
unsigned int colorModel:4;
unsigned int tierTwoInfoIsLoaded:1;
unsigned int respectO:1;
unsigned int compressionFactor:14;
unsigned int imageNumber:8;
unsigned int bitmapFormat:3;
unsigned int cgImageIsPrimary:1;
unsigned int compression:20;
} _moreRepFlags;
unsigned int _bytesPerRow;
volatile id _dataObj;
NSData *_tiffData;
id _properties;
}
- (id)initWithFocusedViewRect:(NSRect)rect;
- (id)initWithBitmapDataPlanes:(unsigned char **)planes pixelsWide:(NSInteger)width pixelsHigh:(NSInteger)height bitsPerSample:(NSInteger)bps samplesPerPixel:(NSInteger)spp hasAlpha:(BOOL)alpha isPlanar:(BOOL)isPlanar colorSpaceName:(NSString *)colorSpaceName bytesPerRow:(NSInteger)rBytes bitsPerPixel:(NSInteger)pBits;
- (id)initWithBitmapDataPlanes:(unsigned char **)planes pixelsWide:(NSInteger)width pixelsHigh:(NSInteger)height bitsPerSample:(NSInteger)bps samplesPerPixel:(NSInteger)spp hasAlpha:(BOOL)alpha isPlanar:(BOOL)isPlanar colorSpaceName:(NSString *)colorSpaceName bitmapFormat:(NSBitmapFormat)bitmapFormat bytesPerRow:(NSInteger)rBytes bitsPerPixel:(NSInteger)pBits;
- (id)initWithCGImage:(CGImageRef)cgImage;
- (id)initWithCIImage:(CIImage *)ciImage;
+ (NSArray *)imageRepsWithData:(NSData *)data;
+ (id)imageRepWithData:(NSData *)data;
- (id)initWithData:(NSData *)data;
- (unsigned char *)bitmapData ;
- (void)getBitmapDataPlanes:(unsigned char **)data;
- (BOOL)isPlanar;
- (NSInteger)samplesPerPixel;
- (NSInteger)bitsPerPixel;
- (NSInteger)bytesPerRow;
- (NSInteger)bytesPerPlane;
- (NSInteger)numberOfPlanes;
- (NSBitmapFormat)bitmapFormat;
- (void)getCompression:(NSTIFFCompression *)compression factor:(float *)factor;
- (void)setCompression:(NSTIFFCompression)compression factor:(float)factor;
- (NSData *)TIFFRepresentation;
- (NSData *)TIFFRepresentationUsingCompression:(NSTIFFCompression)comp factor:(float)factor;
+ (NSData *)TIFFRepresentationOfImageRepsInArray:(NSArray *)array;
+ (NSData *)TIFFRepresentationOfImageRepsInArray:(NSArray *)array usingCompression:(NSTIFFCompression)comp factor:(float)factor;
+ (void)getTIFFCompressionTypes:(const NSTIFFCompression **)list count:(NSInteger *)numTypes;
+ (NSString *)localizedNameForTIFFCompressionType:(NSTIFFCompression)compression;
- (BOOL)canBeCompressedUsing:(NSTIFFCompression)compression;
- (void)colorizeByMappingGray:(CGFloat)midPoint toColor:(NSColor *)midPointColor blackMapping:(NSColor *)shadowColor whiteMapping:(NSColor *)lightColor;
- (id)initForIncrementalLoad;
- (NSInteger)incrementalLoadFromData:(NSData*)data complete:(BOOL)complete;
- (void)setColor:(NSColor*)color atX:(NSInteger)x y:(NSInteger)y;
- (NSColor*)colorAtX:(NSInteger)x y:(NSInteger)y;
- (void)getPixel:(NSUInteger[])p atX:(NSInteger)x y:(NSInteger)y;
- (void)setPixel:(NSUInteger[])p atX:(NSInteger)x y:(NSInteger)y;
- (CGImageRef)CGImage;
- (NSColorSpace *)colorSpace;
- (NSBitmapImageRep *)bitmapImageRepByConvertingToColorSpace:(NSColorSpace *)targetSpace renderingIntent:(NSColorRenderingIntent)renderingIntent;
- (NSBitmapImageRep *)bitmapImageRepByRetaggingWithColorSpace:(NSColorSpace *)newSpace;
@end
@interface NSBitmapImageRep (NSBitmapImageFileTypeExtensions)
+ (NSData *)representationOfImageRepsInArray:(NSArray *)imageReps usingType:(NSBitmapImageFileType)storageType properties:(NSDictionary *)properties;
- (NSData *)representationUsingType:(NSBitmapImageFileType)storageType properties:(NSDictionary *)properties;
- (void)setProperty:(NSString *)property withValue:(id)value;
- (id)valueForProperty:(NSString *)property;
@end

98
src/AppKit/NSBox.h Normal file
View File

@ -0,0 +1,98 @@
#import <AppKit/NSView.h>
@class NSFont;
enum {
NSNoTitle = 0,
NSAboveTop = 1,
NSAtTop = 2,
NSBelowTop = 3,
NSAboveBottom = 4,
NSAtBottom = 5,
NSBelowBottom = 6
};
typedef NSUInteger NSTitlePosition;
enum {
NSBoxPrimary = 0,
NSBoxSecondary = 1,
NSBoxSeparator = 2,
NSBoxOldStyle = 3,
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
NSBoxCustom = 4
#endif
};
typedef NSUInteger NSBoxType;
@interface NSBox : NSView
{
id _titleCell;
id _contentView;
NSSize _offsets;
NSRect _borderRect;
NSRect _titleRect;
struct __bFlags {
NSBorderType borderType:2;
NSTitlePosition titlePosition:3;
unsigned int backgroundTransparent:1;
unsigned int orientation:2;
unsigned int needsTile:1;
unsigned int transparent:1;
unsigned int colorAltInterpretation:1;
unsigned int boxType:3;
unsigned int useSuperAddSubview:1;
unsigned int _RESERVED:17;
} _bFlags;
id _unused;
}
- (NSBorderType)borderType;
- (NSTitlePosition)titlePosition;
- (void)setBorderType:(NSBorderType)aType;
- (void)setBoxType:(NSBoxType)boxType;
- (NSBoxType)boxType;
- (void)setTitlePosition:(NSTitlePosition)aPosition;
- (NSString *)title;
- (void)setTitle:(NSString *)aString;
- (NSFont *)titleFont;
- (void)setTitleFont:(NSFont *)fontObj;
- (NSRect)borderRect;
- (NSRect)titleRect;
- (id)titleCell;
- (void)sizeToFit;
- (NSSize)contentViewMargins;
- (void)setContentViewMargins:(NSSize)offsetSize;
- (void)setFrameFromContentFrame:(NSRect)contentFrame;
- (id)contentView;
- (void)setContentView:(NSView *)aView;
- (BOOL)isTransparent;
- (void)setTransparent:(BOOL)flag;
@end
@interface NSBox (NSCustomBoxTypeProperties)
- (CGFloat)borderWidth;
- (void)setBorderWidth:(CGFloat)borderWidth;
- (CGFloat)cornerRadius;
- (void)setCornerRadius:(CGFloat)cornerRadius;
- (NSColor *)borderColor;
- (void)setBorderColor:(NSColor *)borderColor;
- (NSColor *)fillColor;
- (void)setFillColor:(NSColor *)fillColor;
@end
@interface NSBox(NSKeyboardUI)
- (void)setTitleWithMnemonic:(NSString *)stringWithAmpersand;
@end

587
src/AppKit/NSBrowser.h Normal file
View File

@ -0,0 +1,587 @@
#import <AppKit/NSControl.h>
#import <AppKit/NSDragging.h>
#import <AppKit/NSViewController.h>
#define NSAppKitVersionNumberWithContinuousScrollingBrowser 680.0
#define NSAppKitVersionNumberWithColumnResizingBrowser 685.0
@class NSMatrix, NSScroller, NSMutableArray, NSIndexSet;
@protocol NSBrowserDelegate;
typedef struct __Brflags {
#ifdef __BIG_ENDIAN__
unsigned int allowsMultipleSelection:1;
unsigned int allowsBranchSelection:1;
unsigned int reuseColumns:1;
unsigned int isTitled:1;
unsigned int titleFromPrevious:1;
unsigned int separateColumns:1;
unsigned int delegateImplementsWillDisplayCell:1;
unsigned int delegateSetsTitles:1;
unsigned int delegateSelectsCellsByString:1;
unsigned int delegateDoesNotCreateRowsInMatrix:1;
unsigned int delegateValidatesColumns:1;
unsigned int acceptArrowKeys:1;
unsigned int dontDrawTitles:1;
unsigned int sendActionOnArrowKeys:1;
unsigned int prohibitEmptySel:1;
unsigned int hasHorizontalScroller:1;
unsigned int time:1;
unsigned int allowsIncrementalSearching:1;
unsigned int delegateSelectsCellsByRow:1;
unsigned int disableCompositing:6;
unsigned int refusesFirstResponder:1;
unsigned int acceptsFirstMouse:1;
unsigned int actionNeedsToBeSent:1;
unsigned int usesSmallSizeTitleFont:1;
unsigned int usesSmallScrollers:1;
unsigned int prefersAllColumnUserResizing:1;
unsigned int firstVisibleCalculationDisabled:1;
#else
unsigned int firstVisibleCalculationDisabled:1;
unsigned int prefersAllColumnUserResizing:1;
unsigned int usesSmallScrollers:1;
unsigned int usesSmallSizeTitleFont:1;
unsigned int actionNeedsToBeSent:1;
unsigned int acceptsFirstMouse:1;
unsigned int refusesFirstResponder:1;
unsigned int disableCompositing:6;
unsigned int delegateSelectsCellsByRow:1;
unsigned int allowsIncrementalSearching:1;
unsigned int time:1;
unsigned int hasHorizontalScroller:1;
unsigned int prohibitEmptySel:1;
unsigned int sendActionOnArrowKeys:1;
unsigned int dontDrawTitles:1;
unsigned int acceptArrowKeys:1;
unsigned int delegateValidatesColumns:1;
unsigned int delegateDoesNotCreateRowsInMatrix:1;
unsigned int delegateSelectsCellsByString:1;
unsigned int delegateSetsTitles:1;
unsigned int delegateImplementsWillDisplayCell:1;
unsigned int separateColumns:1;
unsigned int titleFromPrevious:1;
unsigned int isTitled:1;
unsigned int reuseColumns:1;
unsigned int allowsBranchSelection:1;
unsigned int allowsMultipleSelection:1;
#endif
} _Brflags;
enum {
NSBrowserNoColumnResizing = 0,
NSBrowserAutoColumnResizing = 1,
NSBrowserUserColumnResizing = 2,
};
typedef NSUInteger NSBrowserColumnResizingType;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
enum {
NSBrowserDropOn,
NSBrowserDropAbove,
};
#endif
typedef NSUInteger NSBrowserDropOperation;
@interface NSBrowser : NSControl
{
id _target;
SEL _action;
id _delegate;
SEL _doubleAction;
Class _matrixClass;
id _cellPrototype;
NSSize _columnSize;
short _numberOfVisibleColumns;
short _minColumnWidth;
short _firstVisibleColumn;
short _maxVisibleColumns;
NSMutableArray *_titles;
NSString *_pathSeparator;
NSMutableArray *_columns;
id _brAuxiliaryStorage;
NSString *_firstColumnTitle;
NSScroller *_scroller;
_Brflags _brflags;
}
+ (Class)cellClass;
- (void)loadColumnZero;
- (BOOL)isLoaded;
- (void)setDoubleAction:(SEL)aSelector;
- (SEL)doubleAction;
- (void)setMatrixClass:(Class)factoryId;
- (Class)matrixClass;
- (void)setCellClass:(Class)factoryId;
- (void)setCellPrototype:(NSCell *)aCell;
- (id)cellPrototype;
- (void)setDelegate:(id <NSBrowserDelegate>)anObject;
- (id <NSBrowserDelegate>)delegate;
- (void)setReusesColumns:(BOOL)flag;
- (BOOL)reusesColumns;
- (void)setHasHorizontalScroller:(BOOL)flag;
- (BOOL)hasHorizontalScroller;
- (void)setAutohidesScroller:(BOOL)flag;
- (BOOL)autohidesScroller;
- (void)setSeparatesColumns:(BOOL)flag;
- (BOOL)separatesColumns;
- (void)setTitled:(BOOL)flag;
- (BOOL)isTitled;
- (void)setMinColumnWidth:(CGFloat)columnWidth;
- (CGFloat)minColumnWidth;
- (void)setMaxVisibleColumns:(NSInteger)columnCount;
- (NSInteger)maxVisibleColumns;
- (void)setAllowsMultipleSelection:(BOOL)flag;
- (BOOL)allowsMultipleSelection;
- (void)setAllowsBranchSelection:(BOOL)flag;
- (BOOL)allowsBranchSelection;
- (void)setAllowsEmptySelection:(BOOL)flag;
- (BOOL)allowsEmptySelection;
- (void)setTakesTitleFromPreviousColumn:(BOOL)flag;
- (BOOL)takesTitleFromPreviousColumn;
- (void)setSendsActionOnArrowKeys:(BOOL)flag;
- (BOOL)sendsActionOnArrowKeys;
- (id)itemAtIndexPath:(NSIndexPath *)indexPath;
- (id)itemAtRow:(NSInteger)row inColumn:(NSInteger)column;
- (NSIndexPath *)indexPathForColumn:(NSInteger)column;
- (BOOL)isLeafItem:(id)item;
- (void)reloadDataForRowIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column;
- (id)parentForItemsInColumn:(NSInteger)column;
- (void)scrollRowToVisible:(NSInteger)row inColumn:(NSInteger)column;
- (void)setTitle:(NSString *)aString ofColumn:(NSInteger)column;
- (NSString *)titleOfColumn:(NSInteger)column;
- (void)setPathSeparator:(NSString *)newString;
- (NSString *)pathSeparator;
- (BOOL)setPath:(NSString *)path;
- (NSString *)path;
- (NSString *)pathToColumn:(NSInteger)column;
- (NSInteger)clickedColumn;
- (NSInteger)clickedRow;
- (NSInteger)selectedColumn;
- (id)selectedCell;
- (id)selectedCellInColumn:(NSInteger)column;
- (NSArray *)selectedCells;
- (void)selectRow:(NSInteger)row inColumn:(NSInteger)column;
- (NSInteger)selectedRowInColumn:(NSInteger)column;
- (NSIndexPath *)selectionIndexPath;
- (void)setSelectionIndexPath:(NSIndexPath *)path;
- (NSArray *)selectionIndexPaths;
- (void)setSelectionIndexPaths:(NSArray *)paths;
- (void)selectRowIndexes:(NSIndexSet *)indexes inColumn:(NSInteger)column;
- (NSIndexSet *)selectedRowIndexesInColumn:(NSInteger)column;
- (void)reloadColumn:(NSInteger)column;
- (void)validateVisibleColumns;
- (void)scrollColumnsRightBy:(NSInteger)shiftAmount;
- (void)scrollColumnsLeftBy:(NSInteger)shiftAmount;
- (void)scrollColumnToVisible:(NSInteger)column;
- (NSInteger)lastColumn;
- (void)setLastColumn:(NSInteger)column;
- (void)addColumn;
- (NSInteger)numberOfVisibleColumns;
- (NSInteger)firstVisibleColumn;
- (NSInteger)lastVisibleColumn;
- (NSInteger)columnOfMatrix:(NSMatrix *)matrix;
- (NSMatrix *)matrixInColumn:(NSInteger)column;
- (id)loadedCellAtRow:(NSInteger)row column:(NSInteger)col;
- (void)selectAll:(id)sender;
- (void)tile;
- (void)doClick:(id)sender;
- (void)doDoubleClick:(id)sender;
- (BOOL)sendAction;
- (NSRect)titleFrameOfColumn:(NSInteger)column;
- (void)drawTitleOfColumn:(NSInteger)column inRect:(NSRect)aRect;
- (CGFloat)titleHeight;
- (NSRect)frameOfColumn:(NSInteger)column;
- (NSRect)frameOfInsideOfColumn:(NSInteger)column;
- (NSRect)frameOfRow:(NSInteger)row inColumn:(NSInteger)column;
- (BOOL)getRow:(NSInteger *)row column:(NSInteger *)column forPoint:(NSPoint)point;
- (CGFloat)columnWidthForColumnContentWidth:(CGFloat)columnContentWidth;
- (CGFloat)columnContentWidthForColumnWidth:(CGFloat)columnWidth;
- (void)setColumnResizingType:(NSBrowserColumnResizingType)columnResizingType;
- (NSBrowserColumnResizingType)columnResizingType;
- (void)setPrefersAllColumnUserResizing:(BOOL)prefersAllColumnResizing;
- (BOOL)prefersAllColumnUserResizing;
- (void)setWidth:(CGFloat)columnWidth ofColumn:(NSInteger)columnIndex;
- (CGFloat)widthOfColumn:(NSInteger)column;
- (void)setRowHeight:(CGFloat)height;
- (CGFloat)rowHeight;
- (void)noteHeightOfRowsWithIndexesChanged:(NSIndexSet *)indexSet inColumn:(NSInteger)columnIndex;
- (void)setDefaultColumnWidth:(CGFloat)columnWidth;
- (CGFloat)defaultColumnWidth;
- (void)setColumnsAutosaveName:(NSString *)name;
- (NSString *)columnsAutosaveName;
+ (void)removeSavedColumnsWithAutosaveName:(NSString *)name;
- (BOOL)canDragRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column withEvent:(NSEvent *)event;
- (NSImage *)draggingImageForRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column withEvent:(NSEvent *)event offset:(NSPointPointer)dragImageOffset;
- (void)setDraggingSourceOperationMask:(NSDragOperation)mask forLocal:(BOOL)isLocal;
- (BOOL)allowsTypeSelect;
- (void)setAllowsTypeSelect:(BOOL)value;
- (void)setBackgroundColor:(NSColor *)color;
- (NSColor *)backgroundColor;
- (void)editItemAtIndexPath:(NSIndexPath *)indexPath withEvent:(NSEvent *)theEvent select:(BOOL)select;
@end
EXTERN_C NSString *NSBrowserColumnConfigurationDidChangeNotification;
@protocol NSBrowserDelegate <NSObject>
@optional
- (NSInteger)browser:(NSBrowser *)sender numberOfRowsInColumn:(NSInteger)column;
- (void)browser:(NSBrowser *)sender createRowsForColumn:(NSInteger)column inMatrix:(NSMatrix *)matrix;
- (NSInteger)browser:(NSBrowser *)browser numberOfChildrenOfItem:(id)item;
- (id)browser:(NSBrowser *)browser child:(NSInteger)index ofItem:(id)item;
- (BOOL)browser:(NSBrowser *)browser isLeafItem:(id)item;
- (id)browser:(NSBrowser *)browser objectValueForItem:(id)item;
- (CGFloat)browser:(NSBrowser *)browser heightOfRow:(NSInteger)row inColumn:(NSInteger)columnIndex;
- (id)rootItemForBrowser:(NSBrowser *)browser;
- (void)browser:(NSBrowser *)browser setObjectValue:(id)object forItem:(id)item;
- (BOOL)browser:(NSBrowser *)browser shouldEditItem:(id)item;
- (void)browser:(NSBrowser *)sender willDisplayCell:(id)cell atRow:(NSInteger)row column:(NSInteger)column;
- (NSString *)browser:(NSBrowser *)sender titleOfColumn:(NSInteger)column;
- (BOOL)browser:(NSBrowser *)sender selectCellWithString:(NSString *)title inColumn:(NSInteger)column;
- (BOOL)browser:(NSBrowser *)sender selectRow:(NSInteger)row inColumn:(NSInteger)column;
- (BOOL)browser:(NSBrowser *)sender isColumnValid:(NSInteger)column;
- (void)browserWillScroll:(NSBrowser *)sender;
- (void)browserDidScroll:(NSBrowser *)sender;
- (CGFloat)browser:(NSBrowser *)browser shouldSizeColumn:(NSInteger)columnIndex forUserResize:(BOOL)forUserResize toWidth:(CGFloat)suggestedWidth;
- (CGFloat)browser:(NSBrowser *)browser sizeToFitWidthOfColumn:(NSInteger)columnIndex;
- (void)browserColumnConfigurationDidChange:(NSNotification *)notification;
- (BOOL)browser:(NSBrowser *)browser shouldShowCellExpansionForRow:(NSInteger)row column:(NSInteger)column;
- (BOOL)browser:(NSBrowser *)browser writeRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column toPasteboard:(NSPasteboard *)pasteboard;
- (NSArray *)browser:(NSBrowser *)browser namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination forDraggedRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column;
- (BOOL)browser:(NSBrowser *)browser canDragRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column withEvent:(NSEvent *)event;
- (NSImage *)browser:(NSBrowser *)browser draggingImageForRowsWithIndexes:(NSIndexSet *)rowIndexes inColumn:(NSInteger)column withEvent:(NSEvent *)event offset:(NSPointPointer)dragImageOffset;
- (NSDragOperation)browser:(NSBrowser *)browser validateDrop:(id <NSDraggingInfo>)info proposedRow:(NSInteger *)row column:(NSInteger *)column dropOperation:(NSBrowserDropOperation *)dropOperation;
- (BOOL)browser:(NSBrowser *)browser acceptDrop:(id <NSDraggingInfo>)info atRow:(NSInteger)row column:(NSInteger)column dropOperation:(NSBrowserDropOperation)dropOperation;
- (NSString *)browser:(NSBrowser *)browser typeSelectStringForRow:(NSInteger)row inColumn:(NSInteger)column;
- (BOOL)browser:(NSBrowser *)browser shouldTypeSelectForEvent:(NSEvent *)event withCurrentSearchString:(NSString *)searchString;
- (NSInteger)browser:(NSBrowser *)browser nextTypeSelectMatchFromRow:(NSInteger)startRow toRow:(NSInteger)endRow inColumn:(NSInteger)column forString:(NSString *)searchString;
- (NSViewController *)browser:(NSBrowser *)browser previewViewControllerForLeafItem:(id)item;
- (NSViewController *)browser:(NSBrowser *)browser headerViewControllerForItem:(id)item;
- (void)browser:(NSBrowser *)browser didChangeLastColumn:(NSInteger)oldLastColumn toColumn:(NSInteger)column;
- (NSIndexSet *)browser:(NSBrowser *)browser selectionIndexesForProposedSelection:(NSIndexSet *)proposedSelectionIndexes inColumn:(NSInteger)column;
@end
@interface NSBrowser(NSDeprecated)
- (void)setAcceptsArrowKeys:(BOOL)flag;
- (BOOL)acceptsArrowKeys;
- (void)displayColumn:(NSInteger)column;
- (void)displayAllColumns;
- (void)scrollViaScroller:(NSScroller *)sender;
- (void)updateScroller;
@end

View File

@ -0,0 +1,23 @@
#import <AppKit/NSCell.h>
@class NSImage;
@interface NSBrowserCell : NSCell
+ (NSImage *)branchImage;
+ (NSImage *)highlightedBranchImage;
- (NSColor *)highlightColorInView:(NSView *)controlView;
- (BOOL)isLeaf;
- (void)setLeaf:(BOOL)flag;
- (BOOL)isLoaded;
- (void)setLoaded:(BOOL)flag;
- (void)reset;
- (void)set;
- (void)setImage:(NSImage *)image;
- (NSImage *)image;
- (void)setAlternateImage:(NSImage *)newAltImage;
- (NSImage *)alternateImage;
@end

72
src/AppKit/NSButton.h Normal file
View File

@ -0,0 +1,72 @@
#import <AppKit/NSControl.h>
#import <AppKit/NSButtonCell.h>
#import <AppKit/NSUserInterfaceValidation.h>
@class NSSound;
@interface NSButton : NSControl <NSUserInterfaceValidations>
- (NSString *)title;
- (void)setTitle:(NSString *)aString;
- (NSString *)alternateTitle;
- (void)setAlternateTitle:(NSString *)aString;
- (NSImage *)image;
- (void)setImage:(NSImage *)image;
- (NSImage *)alternateImage;
- (void)setAlternateImage:(NSImage *)image;
- (NSCellImagePosition)imagePosition;
- (void)setImagePosition:(NSCellImagePosition)aPosition;
- (void)setButtonType:(NSButtonType)aType;
- (NSInteger)state;
- (void)setState:(NSInteger)value;
- (BOOL)isBordered;
- (void)setBordered:(BOOL)flag;
- (BOOL)isTransparent;
- (void)setTransparent:(BOOL)flag;
- (void)setPeriodicDelay:(float)delay interval:(float)interval;
- (void)getPeriodicDelay:(float *)delay interval:(float *)interval;
- (NSString *)keyEquivalent;
- (void)setKeyEquivalent:(NSString *)charCode;
- (NSUInteger)keyEquivalentModifierMask;
- (void)setKeyEquivalentModifierMask:(NSUInteger)mask;
- (void)highlight:(BOOL)flag;
- (BOOL)performKeyEquivalent:(NSEvent *)key;
@end
@interface NSButton(NSButtonAttributedStringMethods)
- (NSAttributedString *)attributedTitle;
- (void)setAttributedTitle:(NSAttributedString *)aString;
- (NSAttributedString *)attributedAlternateTitle;
- (void)setAttributedAlternateTitle:(NSAttributedString *)obj;
@end
@interface NSButton(NSButtonBezelStyles)
- (void) setBezelStyle:(NSBezelStyle)bezelStyle;
- (NSBezelStyle)bezelStyle;
@end
@interface NSButton(NSButtonMixedState)
- (void)setAllowsMixedState:(BOOL)flag;
- (BOOL)allowsMixedState;
- (void)setNextState;
@end
@interface NSButton(NSButtonBorder)
- (void) setShowsBorderOnlyWhileMouseInside:(BOOL)show;
- (BOOL) showsBorderOnlyWhileMouseInside;
@end
@interface NSButton (NSButtonSoundExtensions)
- (void)setSound:(NSSound *)aSound;
- (NSSound *)sound;
@end
@interface NSButton(NSKeyboardUI)
- (void)setTitleWithMnemonic:(NSString *)stringWithAmpersand;
@end

245
src/AppKit/NSButtonCell.h Normal file
View File

@ -0,0 +1,245 @@
#import <AppKit/NSActionCell.h>
@class NSAttributedString, NSFont, NSImage, NSSound;
enum {
NSMomentaryLightButton = 0,
NSPushOnPushOffButton = 1,
NSToggleButton = 2,
NSSwitchButton = 3,
NSRadioButton = 4,
NSMomentaryChangeButton = 5,
NSOnOffButton = 6,
NSMomentaryPushInButton = 7,
NSMomentaryPushButton = 0,
NSMomentaryLight = 7
};
typedef NSUInteger NSButtonType;
enum {
NSRoundedBezelStyle = 1,
NSRegularSquareBezelStyle = 2,
NSThickSquareBezelStyle = 3,
NSThickerSquareBezelStyle = 4,
NSDisclosureBezelStyle = 5,
NSShadowlessSquareBezelStyle = 6,
NSCircularBezelStyle = 7,
NSTexturedSquareBezelStyle = 8,
NSHelpButtonBezelStyle = 9,
NSSmallSquareBezelStyle = 10,
NSTexturedRoundedBezelStyle = 11,
NSRoundRectBezelStyle = 12,
NSRecessedBezelStyle = 13,
NSRoundedDisclosureBezelStyle = 14,
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
NSInlineBezelStyle = 15,
#endif
NSSmallIconButtonBezelStyle = 2
};
typedef NSUInteger NSBezelStyle;
typedef struct __BCFlags {
#ifdef __BIG_ENDIAN__
unsigned int pushIn:1;
unsigned int changeContents:1;
unsigned int changeBackground:1;
unsigned int changeGray:1;
unsigned int lightByContents:1;
unsigned int lightByBackground:1;
unsigned int lightByGray:1;
unsigned int drawing:1;
unsigned int bordered:1;
unsigned int imageOverlaps:1;
unsigned int horizontal:1;
unsigned int bottomOrLeft:1;
unsigned int imageAndText:1;
unsigned int imageSizeDiff:1;
unsigned int hasKeyEquivalentInsteadOfImage:1;
unsigned int inIntermediateDisclosure:1;
unsigned int transparent:1;
unsigned int inset:2;
unsigned int doesNotDimImage:1;
unsigned int suppressAXValueChangeNote:1;
unsigned int isDrawingDisclosure:1;
unsigned int hasTitleTextField:1;
unsigned int useButtonImageSource:1;
unsigned int isDrawingFocus:1;
unsigned int __reserved:7;
#else
unsigned int __reserved:7;
unsigned int isDrawingFocus:1;
unsigned int useButtonImageSource:1;
unsigned int hasTitleTextField:1;
unsigned int isDrawingDisclosure:1;
unsigned int suppressAXValueChangeNote:1;
unsigned int doesNotDimImage:1;
unsigned int inset:2;
unsigned int transparent:1;
unsigned int inIntermediateDisclosure:1;
unsigned int hasKeyEquivalentInsteadOfImage:1;
unsigned int imageSizeDiff:1;
unsigned int imageAndText:1;
unsigned int bottomOrLeft:1;
unsigned int horizontal:1;
unsigned int imageOverlaps:1;
unsigned int bordered:1;
unsigned int drawing:1;
unsigned int lightByGray:1;
unsigned int lightByBackground:1;
unsigned int lightByContents:1;
unsigned int changeGray:1;
unsigned int changeBackground:1;
unsigned int changeContents:1;
unsigned int pushIn:1;
#endif
} _BCFlags;
typedef struct __BCFlags2 {
#ifdef __BIG_ENDIAN__
unsigned int keyEquivalentModifierMask:24;
unsigned int imageScaling:2;
unsigned int bezelStyle2:1;
unsigned int mouseInside:1;
unsigned int showsBorderOnlyWhileMouseInside:1;
unsigned int bezelStyle:3;
#else
unsigned int bezelStyle:3;
unsigned int showsBorderOnlyWhileMouseInside:1;
unsigned int mouseInside:1;
unsigned int bezelStyle2:1;
unsigned int imageScaling:2;
unsigned int keyEquivalentModifierMask:24;
#endif
} _BCFlags2;
@interface NSButtonCell : NSActionCell
{
NSString *_altContents;
id _sound;
NSString *_keyEquivalent;
_BCFlags2 _bcFlags2;
unsigned short _periodicDelay;
unsigned short _periodicInterval;
_BCFlags _bcFlags;
NSImage *_normalImage;
id _alternateImageOrKeyEquivalentFont;
}
- (NSString *)title;
- (void)setTitle:(NSString *)aString;
- (NSString *)alternateTitle;
- (void)setAlternateTitle:(NSString *)aString;
- (NSImage *)alternateImage;
- (void)setAlternateImage:(NSImage *)image;
- (NSCellImagePosition)imagePosition;
- (void)setImagePosition:(NSCellImagePosition)aPosition;
- (NSImageScaling)imageScaling;
- (void)setImageScaling:(NSImageScaling)scaling;
- (NSInteger)highlightsBy;
- (void)setHighlightsBy:(NSInteger)aType;
- (NSInteger)showsStateBy;
- (void)setShowsStateBy:(NSInteger)aType;
- (void)setButtonType:(NSButtonType)aType;
- (BOOL)isOpaque;
- (void)setFont:(NSFont *)fontObj;
- (BOOL)isTransparent;
- (void)setTransparent:(BOOL)flag;
- (void)setPeriodicDelay:(float)delay interval:(float)interval;
- (void)getPeriodicDelay:(float *)delay interval:(float *)interval;
- (NSString *)keyEquivalent;
- (void)setKeyEquivalent:(NSString *)aKeyEquivalent;
- (NSUInteger)keyEquivalentModifierMask;
- (void)setKeyEquivalentModifierMask:(NSUInteger)mask;
- (NSFont *)keyEquivalentFont;
- (void)setKeyEquivalentFont:(NSFont *)fontObj;
- (void)setKeyEquivalentFont:(NSString *)fontName size:(CGFloat)fontSize;
- (void)performClick:(id)sender;
- (void)drawImage:(NSImage*)image withFrame:(NSRect)frame inView:(NSView*)controlView;
- (NSRect)drawTitle:(NSAttributedString*)title withFrame:(NSRect)frame inView:(NSView*)controlView;
- (void)drawBezelWithFrame:(NSRect)frame inView:(NSView*)controlView;
@end
enum {
NSGradientNone = 0,
NSGradientConcaveWeak = 1,
NSGradientConcaveStrong = 2,
NSGradientConvexWeak = 3,
NSGradientConvexStrong = 4
};
typedef NSUInteger NSGradientType;
@interface NSButtonCell(NSButtonCellExtensions)
- (NSGradientType)gradientType;
- (void)setGradientType:(NSGradientType)type;
- (void)setImageDimsWhenDisabled:(BOOL)flag;
- (BOOL)imageDimsWhenDisabled;
- (void)setShowsBorderOnlyWhileMouseInside:(BOOL)show;
- (BOOL)showsBorderOnlyWhileMouseInside;
- (void)mouseEntered:(NSEvent*)event;
- (void)mouseExited:(NSEvent*)event;
- (NSColor *)backgroundColor;
- (void)setBackgroundColor:(NSColor *)color;
@end
@interface NSButtonCell(NSButtonCellAttributedStringMethods)
- (NSAttributedString *)attributedTitle;
- (void)setAttributedTitle:(NSAttributedString *)obj;
- (NSAttributedString *)attributedAlternateTitle;
- (void)setAttributedAlternateTitle:(NSAttributedString *)obj;
@end
@interface NSButtonCell(NSButtonCellBezelStyles)
- (void)setBezelStyle:(NSBezelStyle)bezelStyle;
- (NSBezelStyle)bezelStyle;
@end
@interface NSButtonCell (NSButtonCellSoundExtensions)
- (void)setSound:(NSSound *)aSound;
- (NSSound *)sound;
@end
@interface NSButtonCell(NSKeyboardUI)
- (void)setTitleWithMnemonic:(NSString *)stringWithAmpersand;
- (void)setAlternateTitleWithMnemonic:(NSString *)stringWithAmpersand;
- (void)setAlternateMnemonicLocation:(NSUInteger)location;
- (NSUInteger)alternateMnemonicLocation;
- (NSString *)alternateMnemonic;
@end

22
src/AppKit/NSCIImageRep.h Normal file
View File

@ -0,0 +1,22 @@
#import <AppKit/NSImageRep.h>
#import <AppKit/NSGraphics.h>
@class CIImage;
@class NSBitmapImageRep;
@interface NSCIImageRep : NSImageRep
{
CIImage *_ciImage;
}
+ (id)imageRepWithCIImage:(CIImage *)image;
- (id)initWithCIImage:(CIImage *)image;
- (CIImage *)CIImage;
@end
@interface CIImage (NSAppKitAdditions)
- (id)initWithBitmapImageRep:(NSBitmapImageRep *)bitmapImageRep;
- (void)drawInRect:(NSRect)rect fromRect:(NSRect)fromRect operation:(NSCompositingOperation)op fraction:(CGFloat)delta;
- (void)drawAtPoint:(NSPoint)point fromRect:(NSRect)fromRect operation:(NSCompositingOperation)op fraction:(CGFloat)delta;
@end

View File

@ -0,0 +1,23 @@
#import <AppKit/NSImageRep.h>
#import <AppKit/NSGraphics.h>
@class NSWindow;
@interface NSCachedImageRep : NSImageRep {
NSPoint _origin;
NSWindow *_window;
__strong void *_cache;
}
- (id)initWithWindow:(NSWindow *)win rect:(NSRect)rect;
- (id)initWithSize:(NSSize)size depth:(NSWindowDepth)depth separate:(BOOL)flag alpha:(BOOL)alpha;
- (NSWindow *)window;
- (NSRect)rect;
@end

437
src/AppKit/NSCell.h Normal file
View File

@ -0,0 +1,437 @@
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <AppKit/NSText.h>
#import <AppKit/NSParagraphStyle.h>
#import <AppKit/NSApplication.h>
#import <AppKit/NSUserInterfaceItemIdentification.h>
@class NSAttributedString, NSEvent, NSFont, NSFormatter, NSImage, NSMenu, NSText, NSView, NSTextView;
enum {
NSAnyType = 0,
NSIntType = 1,
NSPositiveIntType = 2,
NSFloatType = 3,
NSPositiveFloatType = 4,
NSDoubleType = 6,
NSPositiveDoubleType = 7
};
enum {
NSNullCellType = 0,
NSTextCellType = 1,
NSImageCellType = 2
};
typedef NSUInteger NSCellType;
enum {
NSCellDisabled = 0,
NSCellState = 1,
NSPushInCell = 2,
NSCellEditable = 3,
NSChangeGrayCell = 4,
NSCellHighlighted = 5,
NSCellLightsByContents = 6,
NSCellLightsByGray = 7,
NSChangeBackgroundCell = 8,
NSCellLightsByBackground = 9,
NSCellIsBordered = 10,
NSCellHasOverlappingImage = 11,
NSCellHasImageHorizontal = 12,
NSCellHasImageOnLeftOrBottom = 13,
NSCellChangesContents = 14,
NSCellIsInsetButton = 15,
NSCellAllowsMixedState = 16
};
typedef NSUInteger NSCellAttribute;
enum {
NSNoImage = 0,
NSImageOnly = 1,
NSImageLeft = 2,
NSImageRight = 3,
NSImageBelow = 4,
NSImageAbove = 5,
NSImageOverlaps = 6
};
typedef NSUInteger NSCellImagePosition;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
enum {
NSImageScaleProportionallyDown = 0,
NSImageScaleAxesIndependently,
NSImageScaleNone,
NSImageScaleProportionallyUpOrDown
};
#endif
typedef NSUInteger NSImageScaling;
enum {
NSMixedState = -1,
NSOffState = 0,
NSOnState = 1
};
typedef NSInteger NSCellStateValue;
enum {
NSNoCellMask = 0,
NSContentsCellMask = 1,
NSPushInCellMask = 2,
NSChangeGrayCellMask = 4,
NSChangeBackgroundCellMask = 8
};
enum {
NSDefaultControlTint = 0,
NSBlueControlTint = 1,
NSGraphiteControlTint = 6,
NSClearControlTint = 7
};
typedef NSUInteger NSControlTint;
enum {
NSRegularControlSize,
NSSmallControlSize,
NSMiniControlSize
};
typedef NSUInteger NSControlSize;
typedef struct __CFlags {
unsigned int state:1;
unsigned int highlighted:1;
unsigned int disabled:1;
unsigned int editable:1;
NSCellType type:2;
unsigned int vCentered:1;
unsigned int hCentered:1;
unsigned int bordered:1;
unsigned int bezeled:1;
unsigned int selectable:1;
unsigned int scrollable:1;
unsigned int continuous:1;
unsigned int actOnMouseDown:1;
unsigned int isLeaf:1;
unsigned int invalidObjectValue:1;
unsigned int invalidFont:1;
NSLineBreakMode lineBreakMode:3;
unsigned int cellReserved1:2;
unsigned int singleLineMode:1;
unsigned int actOnMouseDragged:1;
unsigned int isLoaded:1;
unsigned int truncateLastLine:1;
unsigned int dontActOnMouseUp:1;
unsigned int isWhite:1;
unsigned int useUserKeyEquivalent:1;
unsigned int showsFirstResponder:1;
unsigned int focusRingType:2;
unsigned int wasSelectable:1;
unsigned int hasInvalidObject:1;
unsigned int allowsEditingTextAttributes:1;
unsigned int importsGraphics:1;
NSTextAlignment alignment:3;
unsigned int layoutDirectionRTL:1;
unsigned int backgroundStyle:3;
unsigned int cellReserved2:4;
unsigned int refusesFirstResponder:1;
unsigned int needsHighlightedText:1;
unsigned int dontAllowsUndo:1;
unsigned int currentlyEditing:1;
unsigned int allowsMixedState:1;
unsigned int inMixedState:1;
unsigned int sendsActionOnEndEditing:1;
unsigned int inSendAction:1;
unsigned int menuWasSet:1;
unsigned int controlTint:3;
unsigned int controlSize:2;
unsigned int branchImageDisabled:1;
unsigned int drawingInRevealover:1;
unsigned int needsHighlightedTextHint:1;
} _CFlags;
@interface NSCell : NSObject <NSCopying, NSCoding, NSUserInterfaceItemIdentification>
{
id _contents;
_CFlags _cFlags;
@private
id _support;
}
+ (BOOL)prefersTrackingUntilMouseUp;
- (id)initTextCell:(NSString *)aString;
- (id)initImageCell:(NSImage *)image;
- (NSView *)controlView;
- (void)setControlView:(NSView*)view;
- (NSCellType)type;
- (void)setType:(NSCellType)aType;
- (NSInteger)state;
- (void)setState:(NSInteger)value;
- (id)target;
- (void)setTarget:(id)anObject;
- (SEL)action;
- (void)setAction:(SEL)aSelector;
- (NSInteger)tag;
- (void)setTag:(NSInteger)anInt;
- (NSString*)title;
- (void)setTitle:(NSString*)aString;
- (BOOL)isOpaque;
- (BOOL)isEnabled;
- (void)setEnabled:(BOOL)flag;
- (NSInteger)sendActionOn:(NSInteger)mask;
- (BOOL)isContinuous;
- (void)setContinuous:(BOOL)flag;
- (BOOL)isEditable;
- (void)setEditable:(BOOL)flag;
- (BOOL)isSelectable;
- (void)setSelectable:(BOOL)flag;
- (BOOL)isBordered;
- (void)setBordered:(BOOL)flag;
- (BOOL)isBezeled;
- (void)setBezeled:(BOOL)flag;
- (BOOL)isScrollable;
- (void)setScrollable:(BOOL)flag;
- (BOOL)isHighlighted;
- (void)setHighlighted:(BOOL)flag;
- (NSTextAlignment)alignment;
- (void)setAlignment:(NSTextAlignment)mode;
- (BOOL)wraps;
- (void)setWraps:(BOOL)flag;
- (NSFont *)font;
- (void)setFont:(NSFont *)fontObj;
- (NSString *)keyEquivalent;
- (void)setFormatter:(NSFormatter *)newFormatter;
- (id)formatter;
- (id)objectValue;
- (void)setObjectValue:(id <NSCopying>)obj;
- (BOOL)hasValidObjectValue;
- (NSString *)stringValue;
- (void)setStringValue:(NSString *)aString;
- (NSComparisonResult)compare:(id)otherCell;
- (int)intValue;
- (void)setIntValue:(int)anInt;
- (float)floatValue;
- (void)setFloatValue:(float)aFloat;
- (double)doubleValue;
- (void)setDoubleValue:(double)aDouble;
- (void)takeIntValueFrom:(id)sender;
- (void)takeFloatValueFrom:(id)sender;
- (void)takeDoubleValueFrom:(id)sender;
- (void)takeStringValueFrom:(id)sender;
- (void)takeObjectValueFrom:(id)sender;
- (NSImage *)image;
- (void)setImage:(NSImage *)image;
- (void)setControlTint:(NSControlTint)controlTint;
- (NSControlTint)controlTint;
- (void)setControlSize:(NSControlSize)size;
- (NSControlSize)controlSize;
- (id)representedObject;
- (void)setRepresentedObject:(id)anObject;
- (NSInteger)cellAttribute:(NSCellAttribute)aParameter;
- (void)setCellAttribute:(NSCellAttribute)aParameter to:(NSInteger)value;
- (NSRect)imageRectForBounds:(NSRect)theRect;
- (NSRect)titleRectForBounds:(NSRect)theRect;
- (NSRect)drawingRectForBounds:(NSRect)theRect;
- (NSSize)cellSize;
- (NSSize)cellSizeForBounds:(NSRect)aRect;
- (NSColor *)highlightColorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
- (void)calcDrawInfo:(NSRect)aRect;
- (NSText *)setUpFieldEditorAttributes:(NSText *)textObj;
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
- (void)highlight:(BOOL)flag withFrame:(NSRect)cellFrame inView:(NSView *)controlView;
- (NSInteger)mouseDownFlags;
- (void)getPeriodicDelay:(float *)delay interval:(float *)interval;
- (BOOL)startTrackingAt:(NSPoint)startPoint inView:(NSView *)controlView;
- (BOOL)continueTracking:(NSPoint)lastPoint at:(NSPoint)currentPoint inView:(NSView *)controlView;
- (void)stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint inView:(NSView *)controlView mouseIsUp:(BOOL)flag;
- (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(NSView *)controlView untilMouseUp:(BOOL)flag;
- (void)editWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject event:(NSEvent *)theEvent;
- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObj delegate:(id)anObject start:(NSInteger)selStart length:(NSInteger)selLength;
- (void)endEditing:(NSText *)textObj;
- (void)resetCursorRect:(NSRect)cellFrame inView:(NSView *)controlView;
- (void)setMenu:(NSMenu *)aMenu;
- (NSMenu *)menu;
- (NSMenu *)menuForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)view;
+ (NSMenu *)defaultMenu;
- (void)setSendsActionOnEndEditing:(BOOL)flag;
- (BOOL)sendsActionOnEndEditing;
- (NSWritingDirection)baseWritingDirection;
- (void)setBaseWritingDirection:(NSWritingDirection)writingDirection;
- (void)setLineBreakMode:(NSLineBreakMode)mode;
- (NSLineBreakMode)lineBreakMode;
- (void)setAllowsUndo:(BOOL)allowsUndo;
- (BOOL)allowsUndo;
- (NSInteger)integerValue;
- (void)setIntegerValue:(NSInteger)anInteger;
- (void)takeIntegerValueFrom:(id)sender;
- (BOOL)truncatesLastVisibleLine;
- (void)setTruncatesLastVisibleLine:(BOOL)flag;
- (NSUserInterfaceLayoutDirection)userInterfaceLayoutDirection;
- (void)setUserInterfaceLayoutDirection:(NSUserInterfaceLayoutDirection)layoutDirection;
- (NSTextView *)fieldEditorForView:(NSView *)aControlView;
- (BOOL)usesSingleLineMode;
- (void)setUsesSingleLineMode:(BOOL)flag;
- (NSArray *)draggingImageComponentsWithFrame:(NSRect)frame inView:(NSView *)view;
@end
@interface NSCell(NSKeyboardUI)
- (void)setRefusesFirstResponder:(BOOL)flag;
- (BOOL)refusesFirstResponder;
- (BOOL)acceptsFirstResponder;
- (void)setShowsFirstResponder:(BOOL)showFR;
- (BOOL)showsFirstResponder;
- (void)performClick:(id)sender;
- (void)setFocusRingType:(NSFocusRingType)focusRingType;
- (NSFocusRingType)focusRingType;
+ (NSFocusRingType)defaultFocusRingType;
- (void)drawFocusRingMaskWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
- (NSRect)focusRingMaskBoundsForFrame:(NSRect)cellFrame inView:(NSView *)controlView;
- (BOOL)wantsNotificationForMarkedText;
@end
@interface NSCell(NSCellAttributedStringMethods)
- (NSAttributedString *)attributedStringValue;
- (void)setAttributedStringValue:(NSAttributedString *)obj;
- (BOOL)allowsEditingTextAttributes;
- (void)setAllowsEditingTextAttributes:(BOOL)flag;
- (BOOL)importsGraphics;
- (void)setImportsGraphics:(BOOL)flag;
@end
@interface NSCell(NSCellMixedState)
- (void)setAllowsMixedState:(BOOL)flag;
- (BOOL)allowsMixedState;
- (NSInteger)nextState;
- (void)setNextState;
@end
EXTERN_C NSString *NSControlTintDidChangeNotification;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
enum {
NSCellHitNone = 0,
NSCellHitContentArea = 1 << 0,
NSCellHitEditableTextArea = 1 << 1,
NSCellHitTrackableArea = 1 << 2,
};
#endif
@interface NSCell(NSCellHitTest)
- (NSUInteger)hitTestForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView;
@end
@interface NSCell(NSCellExpansion)
- (NSRect)expansionFrameWithFrame:(NSRect)cellFrame inView:(NSView *)view;
- (void)drawWithExpansionFrame:(NSRect)cellFrame inView:(NSView *)view;
@end
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
enum {
NSBackgroundStyleLight = 0,
NSBackgroundStyleDark,
NSBackgroundStyleRaised,
NSBackgroundStyleLowered
};
#endif
typedef NSInteger NSBackgroundStyle;
@interface NSCell (NSCellBackgroundStyle)
- (NSBackgroundStyle)backgroundStyle;
- (void)setBackgroundStyle:(NSBackgroundStyle)style;
- (NSBackgroundStyle)interiorBackgroundStyle;
@end
@interface NSCell (NSDeprecated)
enum {
NSScaleProportionally = 0,
NSScaleToFit,
NSScaleNone
};
- (NSInteger)entryType;
- (void)setEntryType:(NSInteger)aType;
- (BOOL)isEntryAcceptable:(NSString *)aString;
- (void)setFloatingPointFormat:(BOOL)autoRange left:(NSUInteger)leftDigits right:(NSUInteger)rightDigits;
- (void)setMnemonicLocation:(NSUInteger)location;
- (NSUInteger)mnemonicLocation;
- (NSString *)mnemonic;
- (void)setTitleWithMnemonic:(NSString *)stringWithAmpersand;
@end
EXTERN_C void NSDrawThreePartImage(NSRect frame, NSImage *startCap, NSImage *centerFill, NSImage *endCap, BOOL vertical, NSCompositingOperation op, CGFloat alphaFraction, BOOL flipped);
EXTERN_C void NSDrawNinePartImage(NSRect frame, NSImage *topLeftCorner, NSImage *topEdgeFill, NSImage *topRightCorner, NSImage *leftEdgeFill, NSImage *centerFill, NSImage *rightEdgeFill, NSImage *bottomLeftCorner, NSImage *bottomEdgeFill, NSImage *bottomRightCorner, NSCompositingOperation op, CGFloat alphaFraction, BOOL flipped);

64
src/AppKit/NSClipView.h Normal file
View File

@ -0,0 +1,64 @@
#import <AppKit/NSView.h>
@class NSColor, NSNotification;
@interface NSClipView : NSView
{
NSColor *_backgroundColor;
NSView *_docView;
NSRect _docRect;
NSRect _oldDocFrame;
NSCursor *_cursor;
id _scrollAnimationHelper;
struct __cvFlags {
unsigned int isFlipped:1;
unsigned int onlyUncovered:1;
unsigned int reflectScroll:1;
unsigned int usedByCell:1;
unsigned int scrollClipTo:1;
unsigned int noCopyOnScroll:1;
unsigned int drawsBackground:1;
unsigned int scrollInProgress:1;
unsigned int skipRemoveSuperviewCheck:1;
unsigned int animateCurrentScroll:1;
unsigned int canAnimateScrolls:1;
unsigned int nextScrollRelativeToCurrentPosition:1;
unsigned int viewBoundsChangedOverridden:1;
unsigned int viewFrameChangedOverridden:1;
unsigned int documentViewAlignment:4;
unsigned int redrawnWhileScrolling:1;
unsigned int dontConstrainScroll:1;
unsigned int lastAtEdgesState:4;
unsigned int showOverlayScrollersForScrollStep:1;
unsigned int scrollerKnobFlashSpecifier:2;
unsigned int drawsContentShadow:1;
unsigned int dontConstrainBoundsChange:1;
unsigned int RESERVED:3;
} _cvFlags;
}
- (void)setBackgroundColor:(NSColor *)color;
- (NSColor *)backgroundColor;
- (void)setDrawsBackground:(BOOL)flag;
- (BOOL)drawsBackground;
- (void)setDocumentView:(NSView *)aView;
- (id)documentView;
- (NSRect)documentRect;
- (void)setDocumentCursor:(NSCursor *)anObj;
- (NSCursor *)documentCursor;
- (NSRect)documentVisibleRect;
- (void)viewFrameChanged:(NSNotification *)notification;
- (void)viewBoundsChanged:(NSNotification *)notification;
- (void)setCopiesOnScroll:(BOOL)flag;
- (BOOL)copiesOnScroll;
- (BOOL)autoscroll:(NSEvent *)theEvent;
- (NSPoint)constrainScrollPoint:(NSPoint)newOrigin;
- (void)scrollToPoint:(NSPoint)newOrigin;
@end
@interface NSView(NSClipViewSuperview)
- (void)reflectScrolledClipView:(NSClipView *)aClipView;
- (void)scrollClipView:(NSClipView *)aClipView toPoint:(NSPoint)aPoint;
@end

View File

@ -0,0 +1,211 @@
#import <AppKit/NSView.h>
#import <AppKit/NSViewController.h>
#import <AppKit/NSDragging.h>
@class NSCollectionView, NSImageView, NSIndexSet, NSMutableIndexSet, NSNib, NSTextField;
@protocol NSCollectionViewDelegate;
typedef NSInteger NSCollectionViewDropOperation;
@interface NSCollectionViewItem : NSViewController <NSCopying> {
@private
NSCollectionView *_collectionView;
struct {
unsigned int isSelected:1;
unsigned int suppressSelectionChangedNotification:1;
unsigned int connectionsCopied:1;
unsigned int reserved:29;
} _cviFlags;
NSData *_cachedArchive;
void *_reserved2;
}
@property (readonly) NSCollectionView *collectionView;
@property (getter=isSelected) BOOL selected;
@property (assign) IBOutlet NSImageView *imageView;
@property (assign) IBOutlet NSTextField *textField;
@property (readonly) NSArray *draggingImageComponents;
@end
@interface NSCollectionView : NSView <NSDraggingSource, NSDraggingDestination> {
@private
NSArray *_content;
NSMutableIndexSet *_selectionIndexes;
NSCollectionViewItem *_itemPrototype;
NSSize _minItemSize;
NSSize _maxItemSize;
NSUInteger _maxGridRows;
NSUInteger _maxGridColumns;
NSArray *_backgroundColors;
NSMutableArray *_displayedItems;
NSTimeInterval _animationDuration;
struct {
unsigned int isFirstResponder:1;
unsigned int invalidateItemViews:1;
unsigned int selectable:1;
unsigned int allowsMultipleSelection:1;
unsigned int avoidsEmptySelection:1;
unsigned int superviewIsClipView:1;
unsigned int needsUpdateGrid:1;
unsigned int needsUpdateBackground:1;
unsigned int gridSettingsNeedUpdate:1;
unsigned int guardSetFrameSize:1;
unsigned int canDisplayItems:1;
unsigned int animateForDrag:1;
unsigned int unarchiving:1;
unsigned int reserved:19;
} _cvFlags;
id _delegate;
NSMutableArray *_backgroundLayers;
NSSize _storedFrameSize;
NSNib *_cachedNib;
BOOL *_animTimerCancel;
NSArray *_removedItems;
NSArray *_addedItems;
NSIndexSet *_addedItemIndexes;
BOOL *_resizeTimerCancel;
NSIndexSet *_draggedIndexes;
NSDragOperation _draggingSourceOperationMaskForLocal;
NSDragOperation _draggingSourceOperationMaskForNonLocal;
NSInteger _currentDropIndex;
NSInteger _currentDropSpaceIndex;
NSInteger _shiftRow;
NSDragOperation _currentDragOperation;
NSCollectionViewDropOperation _currentDropOperation;
id _draggingInfo;
BOOL *_dragTimerCancel;
id _private;
void *_reserved[13];
}
- (void)setDelegate:(id <NSCollectionViewDelegate>)aDelegate;
- (id <NSCollectionViewDelegate>)delegate;
- (BOOL)isFirstResponder;
- (void)setContent:(NSArray *)content;
- (NSArray *)content;
- (void)setSelectable:(BOOL)flag;
- (BOOL)isSelectable;
- (void)setAllowsMultipleSelection:(BOOL)flag;
- (BOOL)allowsMultipleSelection;
- (void)setSelectionIndexes:(NSIndexSet *)indexes;
- (NSIndexSet *)selectionIndexes;
- (NSCollectionViewItem *)newItemForRepresentedObject:(id)object;
- (void)setItemPrototype:(NSCollectionViewItem *)prototype;
- (NSCollectionViewItem *)itemPrototype;
- (void)setMaxNumberOfRows:(NSUInteger)number;
- (NSUInteger)maxNumberOfRows;
- (void)setMaxNumberOfColumns:(NSUInteger)number;
- (NSUInteger)maxNumberOfColumns;
- (void)setMinItemSize:(NSSize)size;
- (NSSize)minItemSize;
- (void)setMaxItemSize:(NSSize)size;
- (NSSize)maxItemSize;
- (void)setBackgroundColors:(NSArray *)colors;
- (NSArray *)backgroundColors;
- (NSCollectionViewItem *)itemAtIndex:(NSUInteger)index;
- (NSRect)frameForItemAtIndex:(NSUInteger)index;
- (NSRect)frameForItemAtIndex:(NSUInteger)index withNumberOfItems:(NSUInteger)numberOfItems;
- (void)setDraggingSourceOperationMask:(NSDragOperation)dragOperationMask forLocal:(BOOL)localDestination;
- (NSImage *)draggingImageForItemsAtIndexes:(NSIndexSet *)indexes withEvent:(NSEvent *)event offset:(NSPointPointer)dragImageOffset;
@end
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
enum {
NSCollectionViewDropOn = 0,
NSCollectionViewDropBefore = 1,
};
#endif
@protocol NSCollectionViewDelegate <NSObject>
@optional
- (BOOL)collectionView:(NSCollectionView *)collectionView canDragItemsAtIndexes:(NSIndexSet *)indexes withEvent:(NSEvent *)event;
- (BOOL)collectionView:(NSCollectionView *)collectionView writeItemsAtIndexes:(NSIndexSet *)indexes toPasteboard:(NSPasteboard *)pasteboard;
- (NSArray *)collectionView:(NSCollectionView *)collectionView namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropURL forDraggedItemsAtIndexes:(NSIndexSet *)indexes;
- (NSImage *)collectionView:(NSCollectionView *)collectionView draggingImageForItemsAtIndexes:(NSIndexSet *)indexes withEvent:(NSEvent *)event offset:(NSPointPointer)dragImageOffset;
- (NSDragOperation)collectionView:(NSCollectionView *)collectionView validateDrop:(id <NSDraggingInfo>)draggingInfo proposedIndex:(NSInteger *)proposedDropIndex dropOperation:(NSCollectionViewDropOperation *)proposedDropOperation;
- (BOOL)collectionView:(NSCollectionView *)collectionView acceptDrop:(id <NSDraggingInfo>)draggingInfo index:(NSInteger)index dropOperation:(NSCollectionViewDropOperation)dropOperation;
- (id <NSPasteboardWriting>)collectionView:(NSCollectionView *)collectionView pasteboardWriterForItemAtIndex:(NSUInteger)index;
- (void)collectionView:(NSCollectionView *)collectionView draggingSession:(NSDraggingSession *)session willBeginAtPoint:(NSPoint)screenPoint forItemsAtIndexes:(NSIndexSet *)indexes;
- (void)collectionView:(NSCollectionView *)collectionView draggingSession:(NSDraggingSession *)session endedAtPoint:(NSPoint)screenPoint dragOperation:(NSDragOperation)operation;
- (void)collectionView:(NSCollectionView *)collectionView updateDraggingItemsForDrag:(id <NSDraggingInfo>)draggingInfo;
@end

256
src/AppKit/NSColor.h Normal file
View File

@ -0,0 +1,256 @@
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSCell.h>
#import <AppKit/NSPasteboard.h>
@class NSDictionary, NSImage, NSColorSpace;
@class CIColor;
typedef void* CGColorRef;
typedef void* CGColorSpaceRef;
#define NSAppKitVersionNumberWithPatternColorLeakFix 641.0
@interface NSColor : NSObject <NSCopying, NSCoding, NSPasteboardReading, NSPasteboardWriting>
+ (NSColor *)colorWithCalibratedWhite:(CGFloat)white alpha:(CGFloat)alpha;
+ (NSColor *)colorWithCalibratedHue:(CGFloat)hue saturation:(CGFloat)saturation brightness:(CGFloat)brightness alpha:(CGFloat)alpha;
+ (NSColor *)colorWithCalibratedRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha;
+ (NSColor *)colorWithDeviceWhite:(CGFloat)white alpha:(CGFloat)alpha;
+ (NSColor *)colorWithDeviceHue:(CGFloat)hue saturation:(CGFloat)saturation brightness:(CGFloat)brightness alpha:(CGFloat)alpha;
+ (NSColor *)colorWithDeviceRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha;
+ (NSColor *)colorWithDeviceCyan:(CGFloat)cyan magenta:(CGFloat)magenta yellow:(CGFloat)yellow black:(CGFloat)black alpha:(CGFloat)alpha;
+ (NSColor *)colorWithCatalogName:(NSString *)listName colorName:(NSString *)colorName;
+ (NSColor *)colorWithColorSpace:(NSColorSpace *)space components:(const CGFloat *)components count:(NSInteger)numberOfComponents;
+ (NSColor *)colorWithGenericGamma22White:(CGFloat)white alpha:(CGFloat)alpha;
+ (NSColor *)colorWithSRGBRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha;
+ (NSColor *)blackColor;
+ (NSColor *)darkGrayColor;
+ (NSColor *)lightGrayColor;
+ (NSColor *)whiteColor;
+ (NSColor *)grayColor;
+ (NSColor *)redColor;
+ (NSColor *)greenColor;
+ (NSColor *)blueColor;
+ (NSColor *)cyanColor;
+ (NSColor *)yellowColor;
+ (NSColor *)magentaColor;
+ (NSColor *)orangeColor;
+ (NSColor *)purpleColor;
+ (NSColor *)brownColor;
+ (NSColor *)clearColor;
+ (NSColor *)controlShadowColor;
+ (NSColor *)controlDarkShadowColor;
+ (NSColor *)controlColor;
+ (NSColor *)controlHighlightColor;
+ (NSColor *)controlLightHighlightColor;
+ (NSColor *)controlTextColor;
+ (NSColor *)controlBackgroundColor;
+ (NSColor *)selectedControlColor;
+ (NSColor *)secondarySelectedControlColor;
+ (NSColor *)selectedControlTextColor;
+ (NSColor *)disabledControlTextColor;
+ (NSColor *)textColor;
+ (NSColor *)textBackgroundColor;
+ (NSColor *)selectedTextColor;
+ (NSColor *)selectedTextBackgroundColor;
+ (NSColor *)gridColor;
+ (NSColor *)keyboardFocusIndicatorColor;
+ (NSColor *)windowBackgroundColor;
+ (NSColor *)underPageBackgroundColor;
+ (NSColor *)scrollBarColor;
+ (NSColor *)knobColor;
+ (NSColor *)selectedKnobColor;
+ (NSColor *)windowFrameColor;
+ (NSColor *)windowFrameTextColor;
+ (NSColor *)selectedMenuItemColor;
+ (NSColor *)selectedMenuItemTextColor;
+ (NSColor *)highlightColor;
+ (NSColor *)shadowColor;
+ (NSColor *)headerColor;
+ (NSColor *)headerTextColor;
+ (NSColor *)alternateSelectedControlColor;
+ (NSColor *)alternateSelectedControlTextColor;
+ (NSArray *)controlAlternatingRowBackgroundColors;
- (NSColor *)highlightWithLevel:(CGFloat)val;
- (NSColor *)shadowWithLevel:(CGFloat)val;
+ (NSColor *)colorForControlTint:(NSControlTint)controlTint;
+ (NSControlTint) currentControlTint;
- (void)set;
- (void)setFill;
- (void)setStroke;
- (NSString *)colorSpaceName;
- (NSColor *)colorUsingColorSpaceName:(NSString *)colorSpace;
- (NSColor *)colorUsingColorSpaceName:(NSString *)colorSpace device:(NSDictionary *)deviceDescription;
- (NSColor *)colorUsingColorSpace:(NSColorSpace *)space;
- (NSColor *)blendedColorWithFraction:(CGFloat)fraction ofColor:(NSColor *)color;
- (NSColor *)colorWithAlphaComponent:(CGFloat)alpha;
- (NSString *)catalogNameComponent;
- (NSString *)colorNameComponent;
- (NSString *)localizedCatalogNameComponent;
- (NSString *)localizedColorNameComponent;
- (CGFloat)redComponent;
- (CGFloat)greenComponent;
- (CGFloat)blueComponent;
- (void)getRed:(CGFloat *)red green:(CGFloat *)green blue:(CGFloat *)blue alpha:(CGFloat *)alpha;
- (CGFloat)hueComponent;
- (CGFloat)saturationComponent;
- (CGFloat)brightnessComponent;
- (void)getHue:(CGFloat *)hue saturation:(CGFloat *)saturation brightness:(CGFloat *)brightness alpha:(CGFloat *)alpha;
- (CGFloat)whiteComponent;
- (void)getWhite:(CGFloat *)white alpha:(CGFloat *)alpha;
- (CGFloat)cyanComponent;
- (CGFloat)magentaComponent;
- (CGFloat)yellowComponent;
- (CGFloat)blackComponent;
- (void)getCyan:(CGFloat *)cyan magenta:(CGFloat *)magenta yellow:(CGFloat *)yellow black:(CGFloat *)black alpha:(CGFloat *)alpha;
- (NSColorSpace *)colorSpace;
- (NSInteger)numberOfComponents;
- (void)getComponents:(CGFloat *)components;
- (CGFloat)alphaComponent;
+ (NSColor *)colorFromPasteboard:(NSPasteboard *)pasteBoard;
- (void)writeToPasteboard:(NSPasteboard *)pasteBoard;
+ (NSColor *)colorWithPatternImage:(NSImage*)image;
- (NSImage *)patternImage;
- (void)drawSwatchInRect:(NSRect)rect;
+ (NSColor *)colorWithCGColor:(CGColorRef)cgColor;
- (CGColorRef)CGColor;
+ (void)setIgnoresAlpha:(BOOL)flag;
+ (BOOL)ignoresAlpha;
@end
#if 0
@interface NSColor (NSQuartzCoreAdditions)
+ (NSColor *)colorWithCIColor:(CIColor *)color;
@end
@interface CIColor (NSAppKitAdditions)
- (id)initWithColor:(NSColor *)color;
@end
#endif
@interface NSCoder(NSAppKitColorExtensions)
- (NSColor *)decodeNXColor;
@end
EXTERN_C NSString *NSSystemColorsDidChangeNotification;

84
src/AppKit/NSColorList.h Normal file
View File

@ -0,0 +1,84 @@
#import <Foundation/NSObject.h>
#import <AppKit/AppKitDefines.h>
#import <CoreFoundation/CFDictionary.h>
@class NSArray, NSMutableArray, NSColor, NSBundle;
@interface NSColorList : NSObject <NSCoding> {
NSMutableArray *_keyArray;
NSMutableArray *_colorArray;
CFMutableDictionaryRef _keyToIndexTable;
NSString *_name;
NSString *_printerType;
NSString *_fileName;
struct _colorListFlags {
unsigned int colorsLoaded:1;
unsigned int editable:1;
unsigned int hasDeviceSpecificLists:1;
unsigned int dirty:1;
unsigned int hasFrozen:1;
unsigned int notificationsDisabled:1;
unsigned int hasAttemptedLoadingBundleForDirectory:1;
unsigned int isProfileBased:1;
unsigned int :24;
#if __LP64__
unsigned int :32;
#endif
} _flags;
id _clAuxiliaryStorage;
}
+ (NSArray *)availableColorLists;
+ (NSColorList *)colorListNamed:(NSString *)name;
- (id)initWithName:(NSString *)name;
- (id)initWithName:(NSString *)name fromFile:(NSString *)path;
- (NSString *)name;
- (void)setColor:(NSColor *)color forKey:(NSString *)key;
- (void)insertColor:(NSColor *)color key:(NSString *)key atIndex:(NSUInteger)loc;
- (void)removeColorWithKey:(NSString *)key;
- (NSColor *)colorWithKey:(NSString *)key;
- (NSArray *)allKeys;
- (BOOL)isEditable;
- (BOOL)writeToFile:(NSString *)path;
- (void)removeFile;
@end
EXTERN_C NSString *NSColorListDidChangeNotification;

105
src/AppKit/NSColorPanel.h Normal file
View File

@ -0,0 +1,105 @@
#import <AppKit/NSPanel.h>
#import <AppKit/NSApplication.h>
@class NSColorList, NSMutableArray;
typedef NSInteger NSColorPanelMode;
enum {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
NSNoModeColorPanel = -1,
#endif
NSGrayModeColorPanel = 0,
NSRGBModeColorPanel = 1,
NSCMYKModeColorPanel = 2,
NSHSBModeColorPanel = 3,
NSCustomPaletteModeColorPanel = 4,
NSColorListModeColorPanel = 5,
NSWheelModeColorPanel = 6,
NSCrayonModeColorPanel = 7
};
enum {
NSColorPanelGrayModeMask = 0x00000001,
NSColorPanelRGBModeMask = 0x00000002,
NSColorPanelCMYKModeMask = 0x00000004,
NSColorPanelHSBModeMask = 0x00000008,
NSColorPanelCustomPaletteModeMask = 0x00000010,
NSColorPanelColorListModeMask = 0x00000020,
NSColorPanelWheelModeMask = 0x00000040,
NSColorPanelCrayonModeMask = 0x00000080,
NSColorPanelAllModesMask = 0x0000ffff
};
@interface NSColorPanel : NSPanel
{
id _colorSwatch;
id _reserved1;
id _colorWell;
NSMutableArray *_pickersWithLoadedViews;
id _magnifyButton;
id _middleView;
id _opacitySlider;
id _opacityText;
id _opacityView;
id _modalButtons;
id _pickerView;
id _customViewsList;
id _customPickerList;
id _currViewObject;
id _boxAboveSwatch;
id _target;
id _accessoryView;
SEL _action;
NSSize _minColorPanelSize;
NSSize _maxColorPanelSize;
NSSize _reserved2;
NSSize _reserved3;
id _resizeDimple;
BOOL _reserved5;
BOOL _reserved6;
BOOL _handlingOpacityMoveAction;
BOOL _ignoreConstraints;
BOOL _continuous;
BOOL _allowColorSetting;
BOOL _stillInitializing;
id _opacityTextController;
}
+ (NSColorPanel *)sharedColorPanel;
+ (BOOL)sharedColorPanelExists;
+ (BOOL)dragColor:(NSColor *)color withEvent:(NSEvent *)theEvent fromView:(NSView *)sourceView;
+ (void)setPickerMask:(NSUInteger)mask;
+ (void)setPickerMode:(NSColorPanelMode)mode;
- (void)setAccessoryView:(NSView *)aView;
- (NSView *)accessoryView;
- (void)setContinuous:(BOOL)flag;
- (BOOL)isContinuous;
- (void)setShowsAlpha:(BOOL)flag;
- (BOOL)showsAlpha;
- (void)setMode:(NSColorPanelMode)mode;
- (NSColorPanelMode)mode;
- (void)setColor:(NSColor *)color;
- (NSColor *)color;
- (CGFloat)alpha;
- (void)setAction:(SEL)aSelector;
- (void)setTarget:(id)anObject;
- (void)attachColorList:(NSColorList *)colorList;
- (void)detachColorList:(NSColorList *)colorList;
@end
@interface NSApplication(NSColorPanel)
- (void)orderFrontColorPanel:(id)sender;
@end
@interface NSObject(NSColorPanelResponderMethod)
- (void)changeColor:(id)sender;
@end
EXTERN_C NSString *NSColorPanelColorDidChangeNotification;

View File

@ -0,0 +1,22 @@
#import <AppKit/NSColorPicking.h>
@interface NSColorPicker : NSObject <NSColorPickingDefault>
{
id _imageObject;
NSColorPanel *_colorPanel;
NSString *_buttonToolTip;
}
- (id)initWithPickerMask:(NSUInteger)mask colorPanel:(NSColorPanel *)owningColorPanel;
- (NSColorPanel *)colorPanel;
- (NSImage *)provideNewButtonImage;
- (void)insertNewButtonImage:(NSImage *)newButtonImage in:(NSButtonCell *)buttonCell;
- (void)viewSizeChanged:(id)sender;
- (void)attachColorList:(NSColorList *)colorList;
- (void)detachColorList:(NSColorList *)colorList;
- (void)setMode:(NSColorPanelMode)mode;
- (NSString *)buttonToolTip;
- (NSSize)minContentSize;
@end

View File

@ -0,0 +1,50 @@
#import <Foundation/NSObject.h>
#import <AppKit/NSColorPanel.h>
@class NSButtonCell, NSColor, NSColorPanel, NSColorList, NSImage, NSView;
@protocol NSColorPickingDefault
- (id)initWithPickerMask:(NSUInteger)mask colorPanel:(NSColorPanel *)owningColorPanel;
- (NSImage *)provideNewButtonImage;
- (void)insertNewButtonImage:(NSImage *)newButtonImage in:(NSButtonCell *)buttonCell;
- (void)viewSizeChanged:(id)sender;
- (void)alphaControlAddedOrRemoved:(id)sender;
- (void)attachColorList:(NSColorList *)colorList;
- (void)detachColorList:(NSColorList *)colorList;
- (void)setMode:(NSColorPanelMode)mode;
- (NSString *)buttonToolTip;
- (NSSize)minContentSize;
@end
@protocol NSColorPickingCustom <NSColorPickingDefault>
- (BOOL)supportsMode:(NSColorPanelMode)mode;
- (NSColorPanelMode)currentMode;
- (NSView *)provideNewView:(BOOL)initialRequest;
- (void)setColor:(NSColor *)newColor;
@end

72
src/AppKit/NSColorSpace.h Normal file
View File

@ -0,0 +1,72 @@
#import <Foundation/NSObject.h>
#import <AppKit/AppKitDefines.h>
@class NSData, NSArray;
enum {
NSUnknownColorSpaceModel = -1,
NSGrayColorSpaceModel,
NSRGBColorSpaceModel,
NSCMYKColorSpaceModel,
NSLABColorSpaceModel,
NSDeviceNColorSpaceModel,
NSIndexedColorSpaceModel,
NSPatternColorSpaceModel
};
typedef NSInteger NSColorSpaceModel;
@interface NSColorSpace : NSObject <NSCoding> {
id _profile;
struct {
unsigned int colorSpaceID:8;
unsigned int storageType:3;
unsigned int replacedDuringUnarchiving:1;
unsigned int :20;
#if __LP64__
unsigned int :32;
#endif
} _flags;
void *__cgColorSpace;
void *__cgColorTransform;
void *_reserved[4];
}
- (id)initWithICCProfileData:(NSData *)iccData;
- (NSData *)ICCProfileData;
- (id)initWithColorSyncProfile:(void * )prof;
- (void * )colorSyncProfile ;
- (id)initWithCGColorSpace:(CGColorSpaceRef)cgColorSpace;
- (CGColorSpaceRef)CGColorSpace;
- (NSInteger)numberOfColorComponents;
- (NSColorSpaceModel)colorSpaceModel;
- (NSString *)localizedName;
+ (NSColorSpace *)genericRGBColorSpace;
+ (NSColorSpace *)genericGrayColorSpace;
+ (NSColorSpace *)genericCMYKColorSpace;
+ (NSColorSpace *)deviceRGBColorSpace;
+ (NSColorSpace *)deviceGrayColorSpace;
+ (NSColorSpace *)deviceCMYKColorSpace;
+ (NSColorSpace *)sRGBColorSpace;
+ (NSColorSpace *)genericGamma22GrayColorSpace;
+ (NSColorSpace *)adobeRGB1998ColorSpace;
+ (NSArray *)availableColorSpacesWithModel:(NSColorSpaceModel)model;
@end

32
src/AppKit/NSColorWell.h Normal file
View File

@ -0,0 +1,32 @@
#import <AppKit/NSControl.h>
@interface NSColorWell : NSControl
{
NSColor *_color;
id _target;
SEL _action;
struct __cwFlags {
unsigned int isActive:1;
unsigned int isBordered:1;
unsigned int cantDraw:1;
unsigned int isNotContinuous:1;
unsigned int refusesFR:1;
unsigned int reservedColorWell:27;
} _cwFlags;
}
- (void)deactivate;
- (void)activate:(BOOL)exclusive;
- (BOOL)isActive;
- (void)drawWellInside:(NSRect)insideRect;
- (BOOL)isBordered;
- (void)setBordered:(BOOL)flag;
- (void)takeColorFrom:(id)sender;
- (void)setColor:(NSColor *)color;
- (NSColor *)color;
@end

85
src/AppKit/NSComboBox.h Normal file
View File

@ -0,0 +1,85 @@
#import <AppKit/NSTextField.h>
EXTERN_C NSString *NSComboBoxWillPopUpNotification;
EXTERN_C NSString *NSComboBoxWillDismissNotification;
EXTERN_C NSString *NSComboBoxSelectionDidChangeNotification;
EXTERN_C NSString *NSComboBoxSelectionIsChangingNotification;
@protocol NSComboBoxDelegate, NSComboBoxDataSource;
@interface NSComboBox : NSTextField {
id _dataSource;
}
- (BOOL)hasVerticalScroller;
- (void)setHasVerticalScroller:(BOOL)flag;
- (NSSize)intercellSpacing;
- (void)setIntercellSpacing:(NSSize)aSize;
- (CGFloat)itemHeight;
- (void)setItemHeight:(CGFloat)itemHeight;
- (NSInteger)numberOfVisibleItems;
- (void)setNumberOfVisibleItems:(NSInteger)visibleItems;
- (void)setButtonBordered:(BOOL)flag;
- (BOOL)isButtonBordered;
- (void)reloadData;
- (void)noteNumberOfItemsChanged;
- (void)setUsesDataSource:(BOOL)flag;
- (BOOL)usesDataSource;
- (void)scrollItemAtIndexToTop:(NSInteger)index;
- (void)scrollItemAtIndexToVisible:(NSInteger)index;
- (void)selectItemAtIndex:(NSInteger)index;
- (void)deselectItemAtIndex:(NSInteger)index;
- (NSInteger)indexOfSelectedItem;
- (NSInteger)numberOfItems;
- (BOOL)completes;
- (void)setCompletes:(BOOL)completes;
- (id <NSComboBoxDelegate>)delegate;
- (void)setDelegate:(id <NSComboBoxDelegate>)anObject;
- (id <NSComboBoxDataSource>)dataSource;
- (void)setDataSource:(id <NSComboBoxDataSource>)aSource;
- (void)addItemWithObjectValue:(id)object;
- (void)addItemsWithObjectValues:(NSArray *)objects;
- (void)insertItemWithObjectValue:(id)object atIndex:(NSInteger)index;
- (void)removeItemWithObjectValue:(id)object;
- (void)removeItemAtIndex:(NSInteger)index;
- (void)removeAllItems;
- (void)selectItemWithObjectValue:(id)object;
- (id)itemObjectValueAtIndex:(NSInteger)index;
- (id)objectValueOfSelectedItem;
- (NSInteger)indexOfItemWithObjectValue:(id)object;
- (NSArray *)objectValues;
@end
@protocol NSComboBoxDataSource <NSObject>
@optional
- (NSInteger)numberOfItemsInComboBox:(NSComboBox *)aComboBox;
- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)index;
- (NSUInteger)comboBox:(NSComboBox *)aComboBox indexOfItemWithStringValue:(NSString *)string;
- (NSString *)comboBox:(NSComboBox *)aComboBox completedString:(NSString *)string;
@end
@protocol NSComboBoxDelegate <NSTextFieldDelegate>
@optional
- (void)comboBoxWillPopUp:(NSNotification *)notification;
- (void)comboBoxWillDismiss:(NSNotification *)notification;
- (void)comboBoxSelectionDidChange:(NSNotification *)notification;
- (void)comboBoxSelectionIsChanging:(NSNotification *)notification;
@end

View File

@ -0,0 +1,87 @@
#import <AppKit/NSTextFieldCell.h>
@class NSButtonCell, NSTableView, NSMutableArray;
@protocol NSComboBoxCellDataSource;
@interface NSComboBoxCell : NSTextFieldCell {
id _delegate;
id _dataSource;
struct __cbcFlags {
unsigned int usesDataSource:1;
unsigned int completes:1;
unsigned int buttonBordered:1;
unsigned int popUpIsUp:1;
unsigned int filteringEvents:1;
unsigned int drawing:1;
unsigned int synchronizingSelection:1;
unsigned int reserved:9;
unsigned int visibleItems:16;
} _cbcFlags;
NSButtonCell *_buttonCell;
NSTableView *_tableView;
NSScrollView *_scrollView;
NSWindow *_popUp;
NSMutableArray *_popUpList;
__strong NSRect *_cellFrame;
void *_reserved;
}
- (BOOL)hasVerticalScroller;
- (void)setHasVerticalScroller:(BOOL)flag;
- (NSSize)intercellSpacing;
- (void)setIntercellSpacing:(NSSize)aSize;
- (CGFloat)itemHeight;
- (void)setItemHeight:(CGFloat)itemHeight;
- (NSInteger)numberOfVisibleItems;
- (void)setNumberOfVisibleItems:(NSInteger)visibleItems;
- (void)setButtonBordered:(BOOL)flag;
- (BOOL)isButtonBordered;
- (void)reloadData;
- (void)noteNumberOfItemsChanged;
- (void)setUsesDataSource:(BOOL)flag;
- (BOOL)usesDataSource;
- (void)scrollItemAtIndexToTop:(NSInteger)index;
- (void)scrollItemAtIndexToVisible:(NSInteger)index;
- (void)selectItemAtIndex:(NSInteger)index;
- (void)deselectItemAtIndex:(NSInteger)index;
- (NSInteger)indexOfSelectedItem;
- (NSInteger)numberOfItems;
- (BOOL)completes;
- (void)setCompletes:(BOOL)completes;
- (NSString *)completedString:(NSString *)string;
- (id <NSComboBoxCellDataSource>)dataSource;
- (void)setDataSource:(id <NSComboBoxCellDataSource>)aSource;
- (void)addItemWithObjectValue:(id)object;
- (void)addItemsWithObjectValues:(NSArray *)objects;
- (void)insertItemWithObjectValue:(id)object atIndex:(NSInteger)index;
- (void)removeItemWithObjectValue:(id)object;
- (void)removeItemAtIndex:(NSInteger)index;
- (void)removeAllItems;
- (void)selectItemWithObjectValue:(id)object;
- (id)itemObjectValueAtIndex:(NSInteger)index;
- (id)objectValueOfSelectedItem;
- (NSInteger)indexOfItemWithObjectValue:(id)object;
- (NSArray *)objectValues;
@end
@protocol NSComboBoxCellDataSource <NSObject>
@optional
- (NSInteger)numberOfItemsInComboBoxCell:(NSComboBoxCell *)comboBoxCell;
- (id)comboBoxCell:(NSComboBoxCell *)aComboBoxCell objectValueForItemAtIndex:(NSInteger)index;
- (NSUInteger)comboBoxCell:(NSComboBoxCell *)aComboBoxCell indexOfItemWithStringValue:(NSString *)string;
- (NSString *)comboBoxCell:(NSComboBoxCell *)aComboBoxCell completedString:(NSString *)uncompletedString;
@end

144
src/AppKit/NSControl.h Normal file
View File

@ -0,0 +1,144 @@
#import <AppKit/NSView.h>
#import <AppKit/NSText.h>
@class NSCell, NSFont, NSTextView, NSNotification, NSAttributedString, NSFormatter;
@interface NSControl : NSView
{
NSInteger _tag;
id _cell;
struct __conFlags {
unsigned int enabled:1;
unsigned int ignoreMultiClick:1;
unsigned int calcSize:1;
unsigned int drawingAncestor:1;
unsigned int ibReserved:1;
unsigned int updateCellFocus:1;
unsigned int allowsLogicalLayoutDirection:1;
unsigned int asmlwidth:1;
unsigned int hsmlwidth:1;
unsigned int dontValidate:1;
unsigned int reserved:22;
} _conFlags;
}
+ (void)setCellClass:(Class)factoryId;
+ (Class)cellClass;
- (id)initWithFrame:(NSRect)frameRect;
- (void)sizeToFit;
- (void)calcSize;
- (id)cell;
- (void)setCell:(NSCell *)aCell;
- (id)selectedCell;
- (id)target;
- (void)setTarget:(id)anObject;
- (SEL)action;
- (void)setAction:(SEL)aSelector;
- (NSInteger)tag;
- (void)setTag:(NSInteger)anInt;
- (NSInteger)selectedTag;
- (void)setIgnoresMultiClick:(BOOL)flag;
- (BOOL)ignoresMultiClick;
- (NSInteger)sendActionOn:(NSInteger)mask;
- (BOOL)isContinuous;
- (void)setContinuous:(BOOL)flag;
- (BOOL)isEnabled;
- (void)setEnabled:(BOOL)flag;
- (NSTextAlignment)alignment;
- (void)setAlignment:(NSTextAlignment)mode;
- (NSFont *)font;
- (void)setFont:(NSFont *)fontObj;
- (void)setFormatter:(NSFormatter *)newFormatter;
- (id)formatter;
- (void)setObjectValue:(id<NSCopying>)obj;
- (void)setStringValue:(NSString *)aString;
- (void)setIntValue:(int)anInt;
- (void)setFloatValue:(float)aFloat;
- (void)setDoubleValue:(double)aDouble;
- (id)objectValue;
- (NSString *)stringValue;
- (int)intValue;
- (float)floatValue;
- (double)doubleValue;
- (void)setNeedsDisplay;
- (void)updateCell:(NSCell *)aCell;
- (void)updateCellInside:(NSCell *)aCell;
- (void)drawCellInside:(NSCell *)aCell;
- (void)drawCell:(NSCell *)aCell;
- (void)selectCell:(NSCell *)aCell;
- (BOOL)sendAction:(SEL)theAction to:(id)theTarget;
- (void)takeIntValueFrom:(id)sender;
- (void)takeFloatValueFrom:(id)sender;
- (void)takeDoubleValueFrom:(id)sender;
- (void)takeStringValueFrom:(id)sender;
- (void)takeObjectValueFrom:(id)sender;
- (NSText *)currentEditor;
- (BOOL)abortEditing;
- (void)validateEditing;
- (void)mouseDown:(NSEvent *)theEvent;
- (NSWritingDirection)baseWritingDirection;
- (void)setBaseWritingDirection:(NSWritingDirection)writingDirection;
- (NSInteger)integerValue;
- (void)setIntegerValue:(NSInteger)anInteger;
- (void)takeIntegerValueFrom:(id)sender;
- (BOOL)allowsExpansionToolTips;
- (void)setAllowsExpansionToolTips:(BOOL)value;
@end
@interface NSControl(NSKeyboardUI)
- (void)performClick:sender;
- (void)setRefusesFirstResponder:(BOOL)flag;
- (BOOL)refusesFirstResponder;
@end
@interface NSObject(NSControlSubclassNotifications)
- (void)controlTextDidBeginEditing:(NSNotification *)obj;
- (void)controlTextDidEndEditing:(NSNotification *)obj;
- (void)controlTextDidChange:(NSNotification *)obj;
@end
@protocol NSControlTextEditingDelegate <NSObject>
@optional
- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor;
- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor;
- (BOOL)control:(NSControl *)control didFailToFormatString:(NSString *)string errorDescription:(NSString *)error;
- (void)control:(NSControl *)control didFailToValidatePartialString:(NSString *)string errorDescription:(NSString *)error;
- (BOOL)control:(NSControl *)control isValidObject:(id)obj;
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector;
- (NSArray *)control:(NSControl *)control textView:(NSTextView *)textView completions:(NSArray *)words forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(NSInteger *)index;
@end
EXTERN_C NSString *NSControlTextDidBeginEditingNotification;
EXTERN_C NSString *NSControlTextDidEndEditingNotification;
EXTERN_C NSString *NSControlTextDidChangeNotification;
@interface NSControl(NSControlAttributedStringMethods)
- (NSAttributedString *)attributedStringValue;
- (void)setAttributedStringValue:(NSAttributedString *)obj;
@end
@interface NSControl (NSDeprecated)
- (void)setFloatingPointFormat:(BOOL)autoRange left:(NSUInteger)leftDigits right:(NSUInteger)rightDigits;
@end

39
src/AppKit/NSController.h Normal file
View File

@ -0,0 +1,39 @@
#import <AppKit/NSKeyValueBinding.h>
#import <CoreFoundation/CoreFoundation.h>
@class NSMutableArray, NSMutableDictionary, NSMutableSet;
@interface NSController : NSObject <NSCoding> {
@private
void *_reserved;
void *_reserved2;
int _specialPurposeType;
id _bindingAdaptor;
NSMutableArray *_editors;
NSMutableArray *_declaredKeys;
NSMutableDictionary *_dependentKeyToModelKeyTable;
NSMutableDictionary *_modelKeyToDependentKeyTable;
NSMutableArray *_modelKeysToRefreshEachTime;
struct __bindingsControllerFlags {
unsigned int _alwaysPresentsApplicationModalAlerts:1;
unsigned int _refreshesAllModelKeys:1;
unsigned int _multipleObservedModelObjects:1;
unsigned int _isEditing:1;
unsigned int _reservedController:28;
} _bindingsControllerFlags;
NSMutableDictionary *_reservedOther;
@protected
id _modelObservingTracker;
id _expectedObservingInfo;
id _singleValueAccessor;
}
- (void)objectDidBeginEditing:(id)editor;
- (void)objectDidEndEditing:(id)editor;
- (void)discardEditing;
- (BOOL)commitEditing;
- (void)commitEditingWithDelegate:(id)delegate didCommitSelector:(SEL)didCommitSelector contextInfo:(void *)contextInfo;
- (BOOL)isEditing;
@end

71
src/AppKit/NSCursor.h Normal file
View File

@ -0,0 +1,71 @@
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
@class NSColor, NSEvent, NSImage;
#define NSAppKitVersionNumberWithCursorSizeSupport 682.0
@interface NSCursor : NSObject <NSCoding> {
NSPoint _hotSpot;
struct _cursorFlags {
unsigned int onMouseExited:1;
unsigned int onMouseEntered:1;
unsigned int cursorType:8;
unsigned int :22;
} _flags;
id _image;
}
+ (NSCursor *)currentCursor;
+ (NSCursor *)currentSystemCursor;
+ (NSCursor *)arrowCursor;
+ (NSCursor *)IBeamCursor;
+ (NSCursor *)pointingHandCursor;
+ (NSCursor *)closedHandCursor;
+ (NSCursor *)openHandCursor;
+ (NSCursor *)resizeLeftCursor;
+ (NSCursor *)resizeRightCursor;
+ (NSCursor *)resizeLeftRightCursor;
+ (NSCursor *)resizeUpCursor;
+ (NSCursor *)resizeDownCursor;
+ (NSCursor *)resizeUpDownCursor;
+ (NSCursor *)crosshairCursor;
+ (NSCursor *)disappearingItemCursor;
+ (NSCursor *)operationNotAllowedCursor;
+ (NSCursor *)dragLinkCursor;
+ (NSCursor *)dragCopyCursor;
+ (NSCursor *)contextualMenuCursor;
+ (NSCursor *)IBeamCursorForVerticalLayout;
- (id)initWithImage:(NSImage *)newImage hotSpot:(NSPoint)aPoint;
- (id)initWithImage:(NSImage *)newImage foregroundColorHint:(NSColor *)fg backgroundColorHint:(NSColor *)bg hotSpot:(NSPoint)hotSpot;
+ (void)hide;
+ (void)unhide;
+ (void)setHiddenUntilMouseMoves:(BOOL)flag;
+ (void)pop;
- (NSImage *)image;
- (NSPoint)hotSpot;
- (void)push;
- (void)pop;
- (void)set;
- (void)setOnMouseExited:(BOOL)flag;
- (void)setOnMouseEntered:(BOOL)flag;
- (BOOL)isSetOnMouseExited;
- (BOOL)isSetOnMouseEntered;
- (void)mouseEntered:(NSEvent *)theEvent;
- (void)mouseExited:(NSEvent *)theEvent;
@end

View File

@ -0,0 +1,17 @@
#import <AppKit/NSImageRep.h>
@interface NSCustomImageRep : NSImageRep {
SEL _drawMethod;
id _drawObject;
unsigned int _reserved;
}
- (id)initWithSize:(NSSize)size flipped:(BOOL)drawingHandlerShouldBeCalledWithFlippedContext drawingHandler:(BOOL (^)(NSRect dstRect))drawingHandler;
- (BOOL (^)(NSRect dstRect))drawingHandler;
- (id)initWithDrawSelector:(SEL)aMethod delegate:(id)anObject;
- (SEL)drawSelector;
- (id)delegate;
@end

71
src/AppKit/NSDatePicker.h Normal file
View File

@ -0,0 +1,71 @@
#import <AppKit/NSControl.h>
#import <AppKit/NSDatePickerCell.h>
@class NSCalendar, NSLocale, NSTimeZone;
@interface NSDatePicker : NSControl
{
}
- (NSDatePickerStyle)datePickerStyle;
- (void)setDatePickerStyle:(NSDatePickerStyle)newStyle;
- (BOOL)isBezeled;
- (void)setBezeled:(BOOL)flag;
- (BOOL)isBordered;
- (void)setBordered:(BOOL)flag;
- (BOOL)drawsBackground;
- (void)setDrawsBackground:(BOOL)flag;
- (NSColor *)backgroundColor;
- (void)setBackgroundColor:(NSColor *)color;
- (NSColor *)textColor;
- (void)setTextColor:(NSColor *)color;
- (NSDatePickerMode)datePickerMode;
- (void)setDatePickerMode:(NSDatePickerMode)newMode;
- (NSDatePickerElementFlags)datePickerElements;
- (void)setDatePickerElements:(NSDatePickerElementFlags)elementFlags;
- (NSCalendar *)calendar;
- (void)setCalendar:(NSCalendar *)newCalendar;
- (NSLocale *)locale;
- (void)setLocale:(NSLocale *)newLocale;
- (NSTimeZone *)timeZone;
- (void)setTimeZone:(NSTimeZone *)newTimeZone;
- (NSDate *)dateValue;
- (void)setDateValue:(NSDate *)newStartDate;
- (NSTimeInterval)timeInterval;
- (void)setTimeInterval:(NSTimeInterval)newTimeInterval;
- (NSDate *)minDate;
- (void)setMinDate:(NSDate *)date;
- (NSDate *)maxDate;
- (void)setMaxDate:(NSDate *)date;
- (id <NSDatePickerCellDelegate>)delegate;
- (void)setDelegate:(id <NSDatePickerCellDelegate>)anObject;
@end

View File

@ -0,0 +1,124 @@
#import <Foundation/NSDate.h>
#import <AppKit/NSActionCell.h>
enum {
NSTextFieldAndStepperDatePickerStyle = 0,
NSClockAndCalendarDatePickerStyle = 1,
NSTextFieldDatePickerStyle = 2
};
typedef NSUInteger NSDatePickerStyle;
enum {
NSSingleDateMode = 0,
NSRangeDateMode = 1
};
typedef NSUInteger NSDatePickerMode;
typedef NSUInteger NSDatePickerElementFlags;
enum {
NSHourMinuteDatePickerElementFlag = 0x000c,
NSHourMinuteSecondDatePickerElementFlag = 0x000e,
NSTimeZoneDatePickerElementFlag = 0x0010,
NSYearMonthDatePickerElementFlag = 0x00c0,
NSYearMonthDayDatePickerElementFlag = 0x00e0,
NSEraDatePickerElementFlag = 0x0100,
};
@class NSCalendar, NSLocale, NSTimeZone;
@protocol NSDatePickerCellDelegate;
@interface NSDatePickerCell : NSActionCell
{
@private
NSTimeInterval _timeInterval;
NSDate *_minDate;
NSDate *_maxDate;
struct __dateCellFlags {
unsigned int elements:16;
unsigned int controlStyle:3;
unsigned int controlMode:2;
unsigned int trackingHand:2;
unsigned int reserved2:4;
unsigned int drawsBackground:1;
unsigned int digitsEntered:2;
unsigned int forcesLeadingZeroes:1;
unsigned int wrapsDateComponentArithmetic:1;
} _dcFlags;
id _delegate;
NSCalendar *_calendar;
NSLocale *_locale;
NSTimeZone *_timeZone;
NSColor *_backgroundColor;
NSColor *_textColor;
int _indexOfSelectedSubfield;
int _reserved0;
id _reserved1;
id _reserved2;
id _reserved3;
id _reserved4;
}
- (NSDatePickerStyle)datePickerStyle;
- (void)setDatePickerStyle:(NSDatePickerStyle)newStyle;
- (BOOL)drawsBackground;
- (void)setDrawsBackground:(BOOL)flag;
- (NSColor *)backgroundColor;
- (void)setBackgroundColor:(NSColor *)color;
- (NSColor *)textColor;
- (void)setTextColor:(NSColor *)color;
- (NSDatePickerMode)datePickerMode;
- (void)setDatePickerMode:(NSDatePickerMode)newMode;
- (NSDatePickerElementFlags)datePickerElements;
- (void)setDatePickerElements:(NSDatePickerElementFlags)elementFlags;
- (NSCalendar *)calendar;
- (void)setCalendar:(NSCalendar *)newCalendar;
- (NSLocale *)locale;
- (void)setLocale:(NSLocale *)newLocale;
- (NSTimeZone *)timeZone;
- (void)setTimeZone:(NSTimeZone *)newTimeZone;
- (NSDate *)dateValue;
- (void)setDateValue:(NSDate *)newStartDate;
- (NSTimeInterval)timeInterval;
- (void)setTimeInterval:(NSTimeInterval)newTimeInterval;
- (NSDate *)minDate;
- (void)setMinDate:(NSDate *)date;
- (NSDate *)maxDate;
- (void)setMaxDate:(NSDate *)date;
- (id <NSDatePickerCellDelegate>)delegate;
- (void)setDelegate:(id <NSDatePickerCellDelegate>)anObject;
@end
@protocol NSDatePickerCellDelegate <NSObject>
@optional
- (void)datePickerCell:(NSDatePickerCell *)aDatePickerCell validateProposedDateValue:(NSDate **)proposedDateValue timeInterval:(NSTimeInterval *)proposedTimeInterval;
@end

View File

@ -0,0 +1,64 @@
#import <AppKit/NSArrayController.h>
@class NSDictionary;
@interface NSObject (NSDictionaryControllerKeyValuePair)
- (void)setLocalizedKey:(NSString *)localizedKey;
- (NSString *)localizedKey;
- (void)setKey:(NSString *)key;
- (NSString *)key;
- (void)setValue:(id)value;
- (id)value;
- (BOOL)isExplicitlyIncluded;
@end
@interface NSDictionaryController : NSArrayController {
@private
void *_reserved5;
void *_reserved6;
void *_reserved7;
id _contentDictionary;
NSString *_initialKey;
id _initialValue;
NSUInteger _minimumInsertionKeyIndex;
NSString *_localizedKeyStringsFileName;
NSDictionary *_localizedKeyForKeyDictionary;
NSDictionary *_keyForLocalizedKeyDictionary;
NSArray *_includedKeys;
NSArray *_excludedKeys;
struct __dictionaryControllerFlags {
unsigned int _deepCopiesValues:1;
unsigned int _suppressBuildingDictionary:1;
unsigned int _reservedDictionaryController:30;
} _dictionaryControllerFlags;
}
- (id)newObject;
- (void)setInitialKey:(NSString *)key;
- (NSString *)initialKey;
- (void)setInitialValue:(id)value;
- (id)initialValue;
- (void)setIncludedKeys:(NSArray *)keys;
- (NSArray *)includedKeys;
- (void)setExcludedKeys:(NSArray *)keys;
- (NSArray *)excludedKeys;
- (void)setLocalizedKeyDictionary:(NSDictionary *)dictionary;
- (NSDictionary *)localizedKeyDictionary;
- (void)setLocalizedKeyTable:(NSString *)stringsFileName;
- (NSString *)localizedKeyTable;
@end

72
src/AppKit/NSDockTile.h Normal file
View File

@ -0,0 +1,72 @@
#import <Foundation/NSGeometry.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSString.h>
#define NSAppKitVersionNumberWithDockTilePlugInSupport 1001.0
@class NSView;
@interface NSDockTile : NSObject {
@private;
id _owner;
void *_dockContextRef;
NSView *_contentView;
NSView *_frameView;
NSView *_backstopView;
NSString *_badgeLabel;
struct {
unsigned int showsAppBadge:1;
unsigned int reserved:31;
} _dFlags;
NSSize _dockTileSize;
id _miniViewController;
id reserved[4];
}
- (NSSize)size;
- (void)setContentView:(NSView *)view;
- (NSView *)contentView;
- (void)display;
- (void)setShowsApplicationBadge:(BOOL)flag;
- (BOOL)showsApplicationBadge;
- (void)setBadgeLabel:(NSString *)string;
- (NSString *)badgeLabel;
- (id)owner;
@end
@class NSMenu;
@protocol NSDockTilePlugIn <NSObject>
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
@required
- (void)setDockTile:(NSDockTile*)dockTile;
@optional
- (NSMenu*)dockMenu;
#endif
@end

722
src/AppKit/NSDocument.h Normal file
View File

@ -0,0 +1,722 @@
#import <AppKit/NSNibDeclarations.h>
#import <AppKit/NSUserInterfaceValidation.h>
//#import <Foundation/NSFilePresenter.h>
@protocol NSFilePresenter;
@class NSArray, NSData, NSDate, NSDictionary, NSError, NSFileWrapper, NSMenuItem, NSPageLayout, NSPrintInfo, NSPrintOperation, NSSavePanel, NSUndoManager, NSURL, NSView, NSWindow, NSWindowController;
enum {
NSChangeDone = 0,
NSChangeUndone = 1,
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
NSChangeRedone = 5,
#endif
NSChangeCleared = 2,
NSChangeReadOtherContents = 3,
NSChangeAutosaved = 4,
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
NSChangeDiscardable = 256
#endif
};
typedef NSUInteger NSDocumentChangeType;
enum {
NSSaveOperation = 0,
NSSaveAsOperation = 1,
NSSaveToOperation = 2,
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
NSAutosaveInPlaceOperation = 4,
#endif
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
NSAutosaveElsewhereOperation = 3,
#endif
NSAutosaveAsOperation,
NSAutosaveOperation = 3
};
typedef NSUInteger NSSaveOperationType;
@interface NSDocument : NSObject<NSFilePresenter, NSUserInterfaceValidations> {
@private
NSWindow *_window;
id _windowControllers;
NSURL *_fileURL;
NSString *_fileType;
NSPrintInfo *_printInfo;
long _documentReserved;
NSView *savePanelAccessory;
id _displayName;
id _privateData;
NSUndoManager *_undoManager;
struct __docFlags {
unsigned int inClose:1;
unsigned int hasUndoManager:1;
unsigned int unused:1;
unsigned int reconciledToFileName:1;
unsigned int checkingDisplayName:1;
unsigned int hasInvalidRestorableState:1;
unsigned int hasEverHadInvalidRestorableState:1;
unsigned int RESERVED:25;
} _docFlags;
NSString *_savePanelSaveType;
}
- (id)init;
- (id)initWithType:(NSString *)typeName error:(NSError **)outError;
+ (BOOL)canConcurrentlyReadDocumentsOfType:(NSString *)typeName;
- (id)initWithContentsOfURL:(NSURL *)url ofType:(NSString *)typeName error:(NSError **)outError;
- (id)initForURL:(NSURL *)urlOrNil withContentsOfURL:(NSURL *)contentsURL ofType:(NSString *)typeName error:(NSError **)outError;
- (void)setFileType:(NSString *)typeName;
- (NSString *)fileType;
- (void)setFileURL:(NSURL *)url;
- (NSURL *)fileURL;
- (void)setFileModificationDate:(NSDate *)modificationDate;
- (NSDate *)fileModificationDate;
- (void)setDraft:(BOOL)flag;
- (BOOL)isDraft;
#if NS_BLOCKS_AVAILABLE
- (void)performActivityWithSynchronousWaiting:(BOOL)waitSynchronously usingBlock:(void (^)(void (^activityCompletionHandler)(void)))block;
- (void)continueActivityUsingBlock:(void (^)(void))block;
- (void)continueAsynchronousWorkOnMainThreadUsingBlock:(void (^)(void))block;
- (void)performSynchronousFileAccessUsingBlock:(void (^)(void))block;
- (void)performAsynchronousFileAccessUsingBlock:(void (^)(void (^fileAccessCompletionHandler)(void)))block;
#endif
- (IBAction)revertDocumentToSaved:(id)sender;
- (BOOL)revertToContentsOfURL:(NSURL *)url ofType:(NSString *)typeName error:(NSError **)outError;
- (BOOL)readFromURL:(NSURL *)url ofType:(NSString *)typeName error:(NSError **)outError;
- (BOOL)readFromFileWrapper:(NSFileWrapper *)fileWrapper ofType:(NSString *)typeName error:(NSError **)outError;
- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError;
- (BOOL)isEntireFileLoaded;
- (BOOL)writeToURL:(NSURL *)url ofType:(NSString *)typeName error:(NSError **)outError;
- (NSFileWrapper *)fileWrapperOfType:(NSString *)typeName error:(NSError **)outError;
- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError;
- (void)unblockUserInteraction;
- (BOOL)autosavingIsImplicitlyCancellable;
- (BOOL)writeSafelyToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation error:(NSError **)outError;
- (BOOL)writeToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation originalContentsURL:(NSURL *)absoluteOriginalContentsURL error:(NSError **)outError;
- (NSDictionary *)fileAttributesToWriteToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation originalContentsURL:(NSURL *)absoluteOriginalContentsURL error:(NSError **)outError;
- (BOOL)keepBackupFile;
- (NSURL *)backupFileURL;
- (IBAction)saveDocument:(id)sender;
- (IBAction)saveDocumentAs:(id)sender;
- (IBAction)saveDocumentTo:(id)sender;
- (void)saveDocumentWithDelegate:(id)delegate didSaveSelector:(SEL)didSaveSelector contextInfo:(void *)contextInfo;
- (void)runModalSavePanelForSaveOperation:(NSSaveOperationType)saveOperation delegate:(id)delegate didSaveSelector:(SEL)didSaveSelector contextInfo:(void *)contextInfo;
- (BOOL)shouldRunSavePanelWithAccessoryView;
- (BOOL)prepareSavePanel:(NSSavePanel *)savePanel;
- (BOOL)fileNameExtensionWasHiddenInLastRunSavePanel;
- (NSString *)fileTypeFromLastRunSavePanel;
- (void)saveToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation delegate:(id)delegate didSaveSelector:(SEL)didSaveSelector contextInfo:(void *)contextInfo;
#if NS_BLOCKS_AVAILABLE
- (void)saveToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation completionHandler:(void (^)(NSError *errorOrNil))completionHandler;
#endif
- (BOOL)canAsynchronouslyWriteToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation;
- (BOOL)checkAutosavingSafetyAndReturnError:(NSError **)outError;
- (void)scheduleAutosaving;
- (BOOL)hasUnautosavedChanges;
- (void)autosaveDocumentWithDelegate:(id)delegate didAutosaveSelector:(SEL)didAutosaveSelector contextInfo:(void *)contextInfo;
#if NS_BLOCKS_AVAILABLE
- (void)autosaveWithImplicitCancellability:(BOOL)autosavingIsImplicitlyCancellable completionHandler:(void (^)(NSError *errorOrNil))completionHandler;
#endif
+ (BOOL)autosavesInPlace;
+ (BOOL)preservesVersions;
- (IBAction)browseDocumentVersions:(id)sender;
+ (BOOL)autosavesDrafts;
- (NSString *)autosavingFileType;
- (void)setAutosavedContentsFileURL:(NSURL *)url;
- (NSURL *)autosavedContentsFileURL;
- (void)canCloseDocumentWithDelegate:(id)delegate shouldCloseSelector:(SEL)shouldCloseSelector contextInfo:(void *)contextInfo;
- (void)close;
- (IBAction)duplicateDocument:(id)sender;
- (void)duplicateDocumentWithDelegate:(id)delegate didDuplicateSelector:(SEL)didDuplicateSelector contextInfo:(void *)contextInfo;
- (NSDocument *)duplicateAndReturnError:(NSError **)outError;
- (IBAction)renameDocument:(id)sender;
- (IBAction)moveDocumentToUbiquityContainer:(id)sender;
- (IBAction)moveDocument:(id)sender;
- (void)moveDocumentWithCompletionHandler:(void (^)(BOOL didMove))completionHandler;
- (void)moveToURL:(NSURL *)url completionHandler:(void (^)(NSError *))completionHandler;
- (IBAction)lockDocument:(id)sender;
- (IBAction)unlockDocument:(id)sender;
- (void)lockDocumentWithCompletionHandler:(void (^)(BOOL didLock))completionHandler;
- (void)lockWithCompletionHandler:(void (^)(NSError *))completionHandler;
- (void)unlockDocumentWithCompletionHandler:(void (^)(BOOL didUnlock))completionHandler;
- (void)unlockWithCompletionHandler:(void (^)(NSError *))completionHandler;
- (BOOL)isLocked;
- (IBAction)runPageLayout:(id)sender;
- (void)runModalPageLayoutWithPrintInfo:(NSPrintInfo *)printInfo delegate:(id)delegate didRunSelector:(SEL)didRunSelector contextInfo:(void *)contextInfo;
- (BOOL)preparePageLayout:(NSPageLayout *)pageLayout;
- (BOOL)shouldChangePrintInfo:(NSPrintInfo *)newPrintInfo;
- (void)setPrintInfo:(NSPrintInfo *)printInfo;
- (NSPrintInfo *)printInfo;
- (IBAction)printDocument:(id)sender;
- (void)printDocumentWithSettings:(NSDictionary *)printSettings showPrintPanel:(BOOL)showPrintPanel delegate:(id)delegate didPrintSelector:(SEL)didPrintSelector contextInfo:(void *)contextInfo;
- (NSPrintOperation *)printOperationWithSettings:(NSDictionary *)printSettings error:(NSError **)outError;
- (void)runModalPrintOperation:(NSPrintOperation *)printOperation delegate:(id)delegate didRunSelector:(SEL)didRunSelector contextInfo:(void *)contextInfo;
- (BOOL)isDocumentEdited;
- (BOOL)isInViewingMode;
- (void)updateChangeCount:(NSDocumentChangeType)change;
- (id)changeCountTokenForSaveOperation:(NSSaveOperationType)saveOperation;
- (void)updateChangeCountWithToken:(id)changeCountToken forSaveOperation:(NSSaveOperationType)saveOperation;
- (void)setUndoManager:(NSUndoManager *)undoManager;
- (NSUndoManager *)undoManager;
- (void)setHasUndoManager:(BOOL)hasUndoManager;
- (BOOL)hasUndoManager;
- (void)presentError:(NSError *)error modalForWindow:(NSWindow *)window delegate:(id)delegate didPresentSelector:(SEL)didPresentSelector contextInfo:(void *)contextInfo;
- (BOOL)presentError:(NSError *)error;
- (NSError *)willPresentError:(NSError *)error;
- (void)willNotPresentError:(NSError *)error;
- (void)makeWindowControllers;
- (NSString *)windowNibName;
- (void)windowControllerWillLoadNib:(NSWindowController *)windowController;
- (void)windowControllerDidLoadNib:(NSWindowController *)windowController;
- (void)setWindow:(NSWindow *)window;
- (void)addWindowController:(NSWindowController *)windowController;
- (void)removeWindowController:(NSWindowController *)windowController;
- (void)showWindows;
- (NSArray *)windowControllers;
- (void)shouldCloseWindowController:(NSWindowController *)windowController delegate:(id)delegate shouldCloseSelector:(SEL)shouldCloseSelector contextInfo:(void *)contextInfo;
- (void)setDisplayName:(NSString *)displayNameOrNil;
- (NSString *)displayName;
- (NSString *)defaultDraftName;
- (NSWindow *)windowForSheet;
+ (NSArray *)readableTypes;
+ (NSArray *)writableTypes;
+ (BOOL)isNativeType:(NSString *)type;
- (NSArray *)writableTypesForSaveOperation:(NSSaveOperationType)saveOperation;
- (NSString *)fileNameExtensionForType:(NSString *)typeName saveOperation:(NSSaveOperationType)saveOperation;
- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)anItem;
+ (BOOL)usesUbiquitousStorage;
@end
@interface NSDocument(NSDeprecated)
- (BOOL)saveToURL:(NSURL *)url ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation error:(NSError **)outError;
- (NSData *)dataRepresentationOfType:(NSString *)type;
- (NSDictionary *)fileAttributesToWriteToFile:(NSString *)fullDocumentPath ofType:(NSString *)documentTypeName saveOperation:(NSSaveOperationType)saveOperationType;
- (NSString *)fileName;
- (NSFileWrapper *)fileWrapperRepresentationOfType:(NSString *)type;
- (id)initWithContentsOfFile:(NSString *)absolutePath ofType:(NSString *)typeName;
- (id)initWithContentsOfURL:(NSURL *)url ofType:(NSString *)typeName;
- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)type;
- (BOOL)loadFileWrapperRepresentation:(NSFileWrapper *)wrapper ofType:(NSString *)type;
- (void)printShowingPrintPanel:(BOOL)flag;
- (BOOL)readFromFile:(NSString *)fileName ofType:(NSString *)type;
- (BOOL)readFromURL:(NSURL *)url ofType:(NSString *)type;
- (BOOL)revertToSavedFromFile:(NSString *)fileName ofType:(NSString *)type;
- (BOOL)revertToSavedFromURL:(NSURL *)url ofType:(NSString *)type;
- (NSInteger)runModalPageLayoutWithPrintInfo:(NSPrintInfo *)printInfo;
- (void)saveToFile:(NSString *)fileName saveOperation:(NSSaveOperationType)saveOperation delegate:(id)delegate didSaveSelector:(SEL)didSaveSelector contextInfo:(void *)contextInfo;
- (void)setFileName:(NSString *)fileName;
- (BOOL)writeToFile:(NSString *)fileName ofType:(NSString *)type;
- (BOOL)writeToFile:(NSString *)fullDocumentPath ofType:(NSString *)documentTypeName originalFile:(NSString *)fullOriginalDocumentPath saveOperation:(NSSaveOperationType)saveOperationType;
- (BOOL)writeToURL:(NSURL *)url ofType:(NSString *)type;
- (BOOL)writeWithBackupToFile:(NSString *)fullDocumentPath ofType:(NSString *)documentTypeName saveOperation:(NSSaveOperationType)saveOperationType;
@end

View File

@ -0,0 +1,245 @@
#import <AppKit/NSNibDeclarations.h>
#import <AppKit/NSUserInterfaceValidation.h>
#import <Foundation/NSDate.h>
@class NSArray, NSDocument, NSError, NSMenuItem, NSMutableDictionary, NSOpenPanel, NSURL, NSWindow;
@interface NSDocumentController : NSObject<NSCoding, NSUserInterfaceValidations> {
@private
id _documents;
id _moreVars;
NSArray *_cachedTypeDescriptions;
NSMutableDictionary *_recents;
int _recentsLimit;
}
+ (id)sharedDocumentController;
- (id)init;
- (NSArray *)documents;
- (id)currentDocument;
- (NSString *)currentDirectory;
- (id)documentForURL:(NSURL *)url;
- (id)documentForWindow:(NSWindow *)window;
- (void)addDocument:(NSDocument *)document;
- (void)removeDocument:(NSDocument *)document;
- (IBAction)newDocument:(id)sender;
- (id)openUntitledDocumentAndDisplay:(BOOL)displayDocument error:(NSError **)outError;
- (id)makeUntitledDocumentOfType:(NSString *)typeName error:(NSError **)outError;
- (IBAction)openDocument:(id)sender;
- (NSArray *)URLsFromRunningOpenPanel;
- (NSInteger)runModalOpenPanel:(NSOpenPanel *)openPanel forTypes:(NSArray *)types;
- (void)beginOpenPanelWithCompletionHandler:(void (^)(NSArray *))completionHandler;
- (void)beginOpenPanel:(NSOpenPanel *)openPanel forTypes:(NSArray *)inTypes completionHandler:(void (^)(NSInteger result))completionHandler;
#if NS_BLOCKS_AVAILABLE
- (void)openDocumentWithContentsOfURL:(NSURL *)url display:(BOOL)displayDocument completionHandler:(void (^)(NSDocument *document, BOOL documentWasAlreadyOpen, NSError *error))completionHandler;
#endif
- (id)makeDocumentWithContentsOfURL:(NSURL *)url ofType:(NSString *)typeName error:(NSError **)outError;
#if NS_BLOCKS_AVAILABLE
- (void)reopenDocumentForURL:(NSURL *)urlOrNil withContentsOfURL:(NSURL *)contentsURL display:(BOOL)displayDocument completionHandler:(void (^)(NSDocument *document, BOOL documentWasAlreadyOpen, NSError *error))completionHandler;
#endif
- (id)makeDocumentForURL:(NSURL *)urlOrNil withContentsOfURL:(NSURL *)contentsURL ofType:(NSString *)typeName error:(NSError **)outError;
- (void)setAutosavingDelay:(NSTimeInterval)autosavingDelay;
- (NSTimeInterval)autosavingDelay;
- (IBAction)saveAllDocuments:(id)sender;
- (BOOL)hasEditedDocuments;
- (void)reviewUnsavedDocumentsWithAlertTitle:(NSString *)title cancellable:(BOOL)cancellable delegate:(id)delegate didReviewAllSelector:(SEL)didReviewAllSelector contextInfo:(void *)contextInfo;
- (void)closeAllDocumentsWithDelegate:(id)delegate didCloseAllSelector:(SEL)didCloseAllSelector contextInfo:(void *)contextInfo;
- (NSDocument *)duplicateDocumentWithContentsOfURL:(NSURL *)url copying:(BOOL)duplicateByCopying displayName:(NSString *)displayNameOrNil error:(NSError **)outError;
- (void)presentError:(NSError *)error modalForWindow:(NSWindow *)window delegate:(id)delegate didPresentSelector:(SEL)didPresentSelector contextInfo:(void *)contextInfo;
- (BOOL)presentError:(NSError *)error;
- (NSError *)willPresentError:(NSError *)error;
- (NSUInteger)maximumRecentDocumentCount;
- (IBAction)clearRecentDocuments:(id)sender;
- (void)noteNewRecentDocument:(NSDocument *)document;
- (void)noteNewRecentDocumentURL:(NSURL *)url;
- (NSArray *)recentDocumentURLs;
- (NSString *)defaultType;
- (NSString *)typeForContentsOfURL:(NSURL *)url error:(NSError **)outError;
- (NSArray *)documentClassNames;
- (Class)documentClassForType:(NSString *)typeName;
- (NSString *)displayNameForType:(NSString *)typeName;
- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)anItem;
@end
@interface NSDocumentController(NSDeprecated)
- (id)openDocumentWithContentsOfURL:(NSURL *)url display:(BOOL)displayDocument error:(NSError **)outError;
- (BOOL)reopenDocumentForURL:(NSURL *)url withContentsOfURL:(NSURL *)contentsURL error:(NSError **)outError;
- (NSArray *)fileExtensionsFromType:(NSString *)typeName;
- (NSString *)typeFromFileExtension:(NSString *)fileNameExtensionOrHFSFileType;
- (id)documentForFileName:(NSString *)fileName;
- (NSArray *)fileNamesFromRunningOpenPanel;
- (id)makeDocumentWithContentsOfFile:(NSString *)fileName ofType:(NSString *)type;
- (id)makeDocumentWithContentsOfURL:(NSURL *)url ofType:(NSString *)type;
- (id)makeUntitledDocumentOfType:(NSString *)type;
- (id)openDocumentWithContentsOfFile:(NSString *)fileName display:(BOOL)display;
- (id)openDocumentWithContentsOfURL:(NSURL *)url display:(BOOL)display;
- (id)openUntitledDocumentOfType:(NSString*)type display:(BOOL)display;
- (void)setShouldCreateUI:(BOOL)flag;
- (BOOL)shouldCreateUI;
@end

View File

@ -0,0 +1,19 @@
#import <AppKit/NSDocument.h>
@class NSCloseCommand;
@class NSScriptCommand;
@class NSScriptObjectSpecifier;
@class NSString;
@interface NSDocument (NSScripting)
- (NSString *)lastComponentOfFileName;
- (void)setLastComponentOfFileName:(NSString *)str;
- (id)handleSaveScriptCommand:(NSScriptCommand *)command;
- (id)handleCloseScriptCommand:(NSCloseCommand *)command;
- (id)handlePrintScriptCommand:(NSScriptCommand *)command;
- (NSScriptObjectSpecifier *)objectSpecifier;
@end

152
src/AppKit/NSDragging.h Normal file
View File

@ -0,0 +1,152 @@
#import <Foundation/NSObjCRuntime.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <limits.h>
@class NSDraggingItem, NSDraggingSession, NSImage, NSPasteboard, NSView, NSWindow;
@class NSURL, NSArray, NSDictionary;
@protocol NSPasteboardWriting;
typedef NSUInteger NSDragOperation;
enum {
NSDragOperationNone = 0,
NSDragOperationCopy = 1,
NSDragOperationLink = 2,
NSDragOperationGeneric = 4,
NSDragOperationPrivate = 8,
NSDragOperationAll_Obsolete = 15,
NSDragOperationMove = 16,
NSDragOperationDelete = 32,
NSDragOperationEvery = NSUIntegerMax
};
#define NSDragOperationAll NSDragOperationAll_Obsolete
#if MAC_OS_X_VERSION_10_7 <= MAC_OS_X_VERSION_MAX_ALLOWED
enum {
NSDraggingFormationDefault = 0,
NSDraggingFormationNone,
NSDraggingFormationPile,
NSDraggingFormationList,
NSDraggingFormationStack
};
#endif
typedef NSInteger NSDraggingFormation;
#if MAC_OS_X_VERSION_10_7 <= MAC_OS_X_VERSION_MAX_ALLOWED
enum {
NSDraggingContextOutsideApplication = 0,
NSDraggingContextWithinApplication
};
#endif
typedef NSInteger NSDraggingContext;
#if MAC_OS_X_VERSION_10_7 <= MAC_OS_X_VERSION_MAX_ALLOWED
enum {
NSDraggingItemEnumerationConcurrent = NSEnumerationConcurrent,
NSDraggingItemEnumerationClearNonenumeratedImages = (1UL << 16),
};
#endif
typedef NSUInteger NSDraggingItemEnumerationOptions;
@protocol NSDraggingInfo <NSObject>
@required
- (NSWindow *)draggingDestinationWindow;
- (NSDragOperation)draggingSourceOperationMask;
- (NSPoint)draggingLocation;
- (NSPoint)draggedImageLocation;
- (NSImage *)draggedImage;
- (NSPasteboard *)draggingPasteboard;
- (id)draggingSource;
- (NSInteger)draggingSequenceNumber;
- (void)slideDraggedImageTo:(NSPoint)screenPoint;
- (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination;
@property NSDraggingFormation draggingFormation;
@property BOOL animatesToDestination;
@property NSInteger numberOfValidItemsForDrop;
#if NS_BLOCKS_AVAILABLE
- (void)enumerateDraggingItemsWithOptions:(NSDraggingItemEnumerationOptions)enumOpts forView:(NSView *)view classes:(NSArray *)classArray searchOptions:(NSDictionary *)searchOptions usingBlock:(void (^)(NSDraggingItem *draggingItem, NSInteger idx, BOOL *stop))block;
#endif
@end
@protocol NSDraggingDestination <NSObject>
@optional
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender;
- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender;
- (void)draggingExited:(id <NSDraggingInfo>)sender;
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender;
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
- (void)concludeDragOperation:(id <NSDraggingInfo>)sender;
- (void)draggingEnded:(id <NSDraggingInfo>)sender;
- (BOOL)wantsPeriodicDraggingUpdates;
- (void)updateDraggingItemsForDrag:(id <NSDraggingInfo>)sender;
@end
@protocol NSDraggingSource <NSObject>
@required
- (NSDragOperation)draggingSession:(NSDraggingSession *)session sourceOperationMaskForDraggingContext:(NSDraggingContext)context;
@optional
- (void)draggingSession:(NSDraggingSession *)session willBeginAtPoint:(NSPoint)screenPoint;
- (void)draggingSession:(NSDraggingSession *)session movedToPoint:(NSPoint)screenPoint;
- (void)draggingSession:(NSDraggingSession *)session endedAtPoint:(NSPoint)screenPoint operation:(NSDragOperation)operation;
- (BOOL)ignoreModifierKeysForDraggingSession:(NSDraggingSession *)session;
@end
@interface NSObject(NSDraggingSourceDeprecated)
- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)flag;
- (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination;
- (void)draggedImage:(NSImage *)image beganAt:(NSPoint)screenPoint;
- (void)draggedImage:(NSImage *)image endedAt:(NSPoint)screenPoint operation:(NSDragOperation)operation;
- (void)draggedImage:(NSImage *)image movedTo:(NSPoint)screenPoint;
- (BOOL)ignoreModifierKeysWhileDragging;
- (void)draggedImage:(NSImage *)image endedAt:(NSPoint)screenPoint deposited:(BOOL)flag;
- (void)draggedImage:(NSImage *)image endedAt:(NSPoint)screenPoint deposited:(BOOL)flag;
@end

View File

@ -0,0 +1,76 @@
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <AppKit/AppKitDefines.h>
@class NSArray, NSString;
@protocol NSPasteboardWriting;
EXTERN_C NSString * const NSDraggingImageComponentIconKey;
EXTERN_C NSString * const NSDraggingImageComponentLabelKey;
@interface NSDraggingImageComponent : NSObject {
@private
NSString *_key;
id _contents;
NSRect _frame;
}
+ (id)draggingImageComponentWithKey:(NSString *)key;
- (id)initWithKey:(NSString *)key;
@property(copy) NSString *key;
@property(retain) id contents;
@property NSRect frame;
@end
@interface NSDraggingItem : NSObject {
@private
id _item;
NSRect _frame;
NSArray *_components;
NSArray *(^_componentsProvider)(void);
NSInteger _reserved1;
NSInteger _reserved2;
}
- (id)initWithPasteboardWriter:(id <NSPasteboardWriting>) pasteboardWriter;
@property(retain, readonly) id item;
@property NSRect draggingFrame;
#if NS_BLOCKS_AVAILABLE
@property(copy) NSArray*(^imageComponentsProvider)(void);
#endif
- (void)setDraggingFrame:(NSRect)frame contents:(id)contents;
@property(copy, readonly) NSArray *imageComponents;
@end

View File

@ -0,0 +1,61 @@
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <AppKit/NSDragging.h>
@class NSPasteboard, NSImage, NSDraggingItem;
@protocol NSDraggingSource, NSPasteboardWriting;
@interface NSDraggingSession : NSObject {
@private
void *_private;
NSPoint _dragLocation;
NSPoint _offset;
id<NSDraggingSource> _source;
id _alternateDragSource;
id<NSDraggingSource> _filePromiseDragSource;
NSPasteboard *_pboard;
NSImage *_compositeImageCache;
NSInteger _leaderIndex;
BOOL _animatesOnCancelOrFail;
BOOL _reservedBOOL1;
BOOL _reservedBOOL2;
BOOL _reservedBOOL3;
BOOL _reservedBOOL4;
BOOL _reservedBOOL5;
BOOL _reservedBOOL6;
BOOL _reservedBOOL7;
NSInteger _reservedInteger1;
NSInteger _reservedInteger2;
}
@property NSDraggingFormation draggingFormation;
@property BOOL animatesToStartingPositionsOnCancelOrFail;
@property NSInteger draggingLeaderIndex;
@property(readonly) NSPasteboard *draggingPasteboard;
@property(readonly) NSInteger draggingSequenceNumber;
@property(readonly) NSPoint draggingLocation;
#if NS_BLOCKS_AVAILABLE
- (void)enumerateDraggingItemsWithOptions:(NSDraggingItemEnumerationOptions)enumOpts forView:(NSView *)view classes:(NSArray *)classArray searchOptions:(NSDictionary *)searchOptions usingBlock:(void (^)(NSDraggingItem *draggingItem, NSInteger idx, BOOL *stop))block;
#endif
@end

110
src/AppKit/NSDrawer.h Normal file
View File

@ -0,0 +1,110 @@
#import <CoreFoundation/CFDate.h>
#import <CoreFoundation/CFRunLoop.h>
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSResponder.h>
#import <AppKit/NSWindow.h>
@class NSArray;
@class NSLock;
@class NSView;
@class NSWindow;
@class NSNotification;
@protocol NSDrawerDelegate;
enum {
NSDrawerClosedState = 0,
NSDrawerOpeningState = 1,
NSDrawerOpenState = 2,
NSDrawerClosingState = 3
};
typedef NSUInteger NSDrawerState;
@interface NSDrawer : NSResponder
{
NSDrawerState _drawerState;
NSDrawerState _drawerNextState;
NSRectEdge _drawerEdge;
NSRectEdge _drawerNextEdge;
NSRectEdge _drawerPreferredEdge;
float _drawerPercent;
float _drawerPercentSaved;
CGFloat _drawerLeadingOffset;
CGFloat _drawerTrailingOffset;
NSLock *_drawerLock;
NSWindow *_drawerWindow;
NSWindow *_drawerParentWindow;
NSWindow *_drawerNextParentWindow;
NSString *_drawerSaveName;
CFAbsoluteTime _drawerStartTime;
CFTimeInterval _drawerTotalTime;
CFRunLoopRef _drawerLoop;
__strong CFRunLoopTimerRef _drawerTimer;
id _drawerDelegate;
unsigned int _drawerFlags;
__strong CFRunLoopObserverRef _drawerObserver;
}
- (id)initWithContentSize:(NSSize)contentSize preferredEdge:(NSRectEdge)edge;
- (void)setParentWindow:(NSWindow *)parent;
- (NSWindow *)parentWindow;
- (void)setContentView:(NSView *)aView;
- (NSView *)contentView;
- (void)setPreferredEdge:(NSRectEdge)edge;
- (NSRectEdge)preferredEdge;
- (void)setDelegate:(id <NSDrawerDelegate>)anObject;
- (id <NSDrawerDelegate>)delegate;
- (void)open;
- (void)openOnEdge:(NSRectEdge)edge;
- (void)close;
- (void)open:(id)sender;
- (void)close:(id)sender;
- (void)toggle:(id)sender;
- (NSInteger)state;
- (NSRectEdge)edge;
- (void)setContentSize:(NSSize)size;
- (NSSize)contentSize;
- (void)setMinContentSize:(NSSize)size;
- (NSSize)minContentSize;
- (void)setMaxContentSize:(NSSize)size;
- (NSSize)maxContentSize;
- (void)setLeadingOffset:(CGFloat)offset;
- (CGFloat)leadingOffset;
- (void)setTrailingOffset:(CGFloat)offset;
- (CGFloat)trailingOffset;
@end
@interface NSWindow(Drawers)
- (NSArray *)drawers;
@end
@protocol NSDrawerDelegate <NSObject>
@optional
- (BOOL)drawerShouldOpen:(NSDrawer *)sender;
- (BOOL)drawerShouldClose:(NSDrawer *)sender;
- (NSSize)drawerWillResizeContents:(NSDrawer *)sender toSize:(NSSize)contentSize;
- (void)drawerWillOpen:(NSNotification *)notification;
- (void)drawerDidOpen:(NSNotification *)notification;
- (void)drawerWillClose:(NSNotification *)notification;
- (void)drawerDidClose:(NSNotification *)notification;
@end
EXTERN_C NSString *NSDrawerWillOpenNotification;
EXTERN_C NSString *NSDrawerDidOpenNotification;
EXTERN_C NSString *NSDrawerWillCloseNotification;
EXTERN_C NSString *NSDrawerDidCloseNotification;

View File

@ -0,0 +1,21 @@
#import <AppKit/NSImageRep.h>
@class NSPDFImageRep;
@interface NSEPSImageRep : NSImageRep {
NSPoint _bBoxOrigin;
NSData *_epsData;
NSPDFImageRep* _pdfImageRep;
}
+ (id)imageRepWithData:(NSData *)epsData;
- (id)initWithData:(NSData *)epsData;
- (void)prepareGState;
- (NSData *)EPSRepresentation;
- (NSRect)boundingBox;
@end

42
src/AppKit/NSErrors.h Normal file
View File

@ -0,0 +1,42 @@
#import <AppKit/AppKitDefines.h>
@class NSString;
EXTERN_C NSString *NSTextLineTooLongException;
EXTERN_C NSString *NSTextNoSelectionException;
EXTERN_C NSString *NSWordTablesWriteException;
EXTERN_C NSString *NSWordTablesReadException;
EXTERN_C NSString *NSTextReadException;
EXTERN_C NSString *NSTextWriteException;
EXTERN_C NSString *NSPasteboardCommunicationException;
EXTERN_C NSString *NSPrintingCommunicationException;
EXTERN_C NSString *NSAbortModalException;
EXTERN_C NSString *NSAbortPrintingException;
EXTERN_C NSString *NSIllegalSelectorException;
EXTERN_C NSString *NSAppKitVirtualMemoryException;
EXTERN_C NSString *NSBadRTFDirectiveException;
EXTERN_C NSString *NSBadRTFFontTableException;
EXTERN_C NSString *NSBadRTFStyleSheetException;
EXTERN_C NSString *NSTypedStreamVersionException;
EXTERN_C NSString *NSTIFFException;
EXTERN_C NSString *NSPrintPackageException;
EXTERN_C NSString *NSBadRTFColorTableException;
EXTERN_C NSString *NSDraggingException;
EXTERN_C NSString *NSColorListIOException;
EXTERN_C NSString *NSColorListNotEditableException;
EXTERN_C NSString *NSBadBitmapParametersException;
EXTERN_C NSString *NSWindowServerCommunicationException;
EXTERN_C NSString *NSFontUnavailableException;
EXTERN_C NSString *NSPPDIncludeNotFoundException;
EXTERN_C NSString *NSPPDParseException;
EXTERN_C NSString *NSPPDIncludeStackOverflowException;
EXTERN_C NSString *NSPPDIncludeStackUnderflowException;
EXTERN_C NSString *NSRTFPropertyStackOverflowException;
EXTERN_C NSString *NSAppKitIgnoredException;
EXTERN_C NSString *NSBadComparisonException;
EXTERN_C NSString *NSImageCacheException;
EXTERN_C NSString *NSNibLoadingException;
EXTERN_C NSString *NSBrowserIllegalDelegateException;
EXTERN_C NSString *NSAccessibilityException;

View File

@ -153,4 +153,12 @@ enum {
}; };
inline NSUInteger NSEventMaskFromType(NSEventType type) { return (1 << type); }; inline NSUInteger NSEventMaskFromType(NSEventType type) { return (1 << type); };
enum {
NSEventGestureAxisNone = 0,
NSEventGestureAxisHorizontal,
NSEventGestureAxisVertical
};
typedef NSInteger NSEventGestureAxis;
#endif #endif

232
src/AppKit/NSFont.h Normal file
View File

@ -0,0 +1,232 @@
#import <Foundation/NSObject.h>
#import <Foundation/NSString.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSCell.h>
@class NSFontDescriptor, NSAffineTransform, NSGraphicsContext;
typedef unsigned int NSGlyph;
enum {
NSControlGlyph = 0x00FFFFFF,
NSNullGlyph = 0x0
};
EXTERN_C const CGFloat *NSFontIdentityMatrix;
enum {
NSNativeShortGlyphPacking = 5
};
typedef NSUInteger NSMultibyteGlyphPacking;
enum {
NSFontDefaultRenderingMode = 0,
NSFontAntialiasedRenderingMode = 1,
NSFontIntegerAdvancementsRenderingMode = 2,
NSFontAntialiasedIntegerAdvancementsRenderingMode = 3
};
typedef NSUInteger NSFontRenderingMode;
@interface NSFont : NSObject <NSCopying, NSCoding> {
NSString *_name;
CGFloat _size;
NSInteger _retainCount;
struct __fFlags {
unsigned int _isScreenFont:1;
unsigned int _systemFontType:8;
unsigned int _reserved1:4;
unsigned int _matrixIsIdentity:1;
unsigned int _renderingMode:3;
unsigned int _inInstanceCache:1;
unsigned int _reserved2:14;
} _fFlags;
id _private;
}
+ (NSFont *)fontWithName:(NSString *)fontName size:(CGFloat)fontSize;
+ (NSFont *)fontWithName:(NSString *)fontName matrix:(const CGFloat *)fontMatrix;
+ (NSFont *)fontWithDescriptor:(NSFontDescriptor *)fontDescriptor size:(CGFloat)fontSize;
+ (NSFont *)fontWithDescriptor:(NSFontDescriptor *)fontDescriptor textTransform:(NSAffineTransform *)textTransform;
+ (NSFont *)userFontOfSize:(CGFloat)fontSize;
+ (NSFont *)userFixedPitchFontOfSize:(CGFloat)fontSize;
+ (void)setUserFont:(NSFont *)aFont;
+ (void)setUserFixedPitchFont:(NSFont *)aFont;
+ (NSFont *)systemFontOfSize:(CGFloat)fontSize;
+ (NSFont *)boldSystemFontOfSize:(CGFloat)fontSize;
+ (NSFont *)labelFontOfSize:(CGFloat)fontSize;
+ (NSFont *)titleBarFontOfSize:(CGFloat)fontSize;
+ (NSFont *)menuFontOfSize:(CGFloat)fontSize;
+ (NSFont *)menuBarFontOfSize:(CGFloat)fontSize;
+ (NSFont *)messageFontOfSize:(CGFloat)fontSize;
+ (NSFont *)paletteFontOfSize:(CGFloat)fontSize;
+ (NSFont *)toolTipsFontOfSize:(CGFloat)fontSize;
+ (NSFont *)controlContentFontOfSize:(CGFloat)fontSize;
+ (CGFloat)systemFontSize;
+ (CGFloat)smallSystemFontSize;
+ (CGFloat)labelFontSize;
+ (CGFloat)systemFontSizeForControlSize:(NSControlSize)controlSize;
- (NSString *)fontName;
- (CGFloat)pointSize;
- (const CGFloat *)matrix ;
- (NSString *)familyName;
- (NSString *)displayName;
- (NSFontDescriptor *)fontDescriptor;
- (NSAffineTransform *)textTransform;
- (NSUInteger)numberOfGlyphs;
- (NSStringEncoding)mostCompatibleStringEncoding;
- (NSGlyph)glyphWithName:(NSString *)aName;
- (NSCharacterSet *)coveredCharacterSet;
- (NSRect)boundingRectForFont;
- (NSSize)maximumAdvancement;
- (CGFloat)ascender;
- (CGFloat)descender;
- (CGFloat)leading;
- (CGFloat)underlinePosition;
- (CGFloat)underlineThickness;
- (CGFloat)italicAngle;
- (CGFloat)capHeight;
- (CGFloat)xHeight;
- (BOOL)isFixedPitch;
- (NSRect)boundingRectForGlyph:(NSGlyph)aGlyph;
- (NSSize)advancementForGlyph:(NSGlyph)ag;
- (void)getBoundingRects:(NSRectArray)bounds forGlyphs:(const NSGlyph *)glyphs count:(NSUInteger)glyphCount;
- (void)getAdvancements:(NSSizeArray)advancements forGlyphs:(const NSGlyph *)glyphs count:(NSUInteger)glyphCount;
- (void)getAdvancements:(NSSizeArray)advancements forPackedGlyphs:(const void *)packedGlyphs length:(NSUInteger)length;
- (void)set;
- (void)setInContext:(NSGraphicsContext *)graphicsContext;
- (NSFont *)printerFont;
- (NSFont *)screenFont;
- (NSFont *)screenFontWithRenderingMode:(NSFontRenderingMode)renderingMode;
- (NSFontRenderingMode)renderingMode;
- (NSFont *)verticalFont;
- (BOOL)isVertical;
@end
EXTERN_C NSInteger NSConvertGlyphsToPackedGlyphs(NSGlyph *glBuf, NSInteger count, NSMultibyteGlyphPacking packing, char *packedGlyphs);
EXTERN_C NSString *NSAntialiasThresholdChangedNotification;
EXTERN_C NSString *NSFontSetChangedNotification;
#if !__LP64__
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
enum {
NSOneByteGlyphPacking,
NSJapaneseEUCGlyphPacking,
NSAsciiWithDoubleByteEUCGlyphPacking,
NSTwoByteGlyphPacking,
NSFourByteGlyphPacking,
};
enum _NSGlyphRelation {
NSGlyphBelow = 1,
NSGlyphAbove = 2
};
#endif
typedef NSUInteger NSGlyphRelation;
@interface NSFont (NSFontDeprecated)
+ (void)useFont:(NSString *)fontName;
- (CGFloat)widthOfString:(NSString *)string;
- (BOOL)isBaseFont;
- (NSDictionary *)afmDictionary;
- (BOOL)glyphIsEncoded:(NSGlyph)aGlyph;
- (CGFloat)defaultLineHeightForFont;
+ (NSArray *)preferredFontNames;
+ (void)setPreferredFontNames:(NSArray *)fontNameArray;
- (NSString *)encodingScheme;
- (NSMultibyteGlyphPacking) glyphPacking;
- (NSPoint)positionOfGlyph:(NSGlyph)curGlyph precededByGlyph:(NSGlyph)prevGlyph isNominal:(BOOL *)nominal;
- (NSInteger)positionsForCompositeSequence:(NSGlyph *)someGlyphs numberOfGlyphs:(NSInteger)numGlyphs pointArray:(NSPointArray)points;
- (NSPoint)positionOfGlyph:(NSGlyph)curGlyph struckOverGlyph:(NSGlyph)prevGlyph metricsExist:(BOOL *)exist;
- (NSPoint)positionOfGlyph:(NSGlyph)aGlyph struckOverRect:(NSRect)aRect metricsExist:(BOOL *)exist;
- (NSPoint)positionOfGlyph:(NSGlyph)aGlyph forCharacter:(unichar)aChar struckOverRect:(NSRect)aRect;
- (NSPoint)positionOfGlyph:(NSGlyph)thisGlyph withRelation:(NSGlyphRelation)rel toBaseGlyph:(NSGlyph)baseGlyph totalAdvancement:(NSSizePointer)adv metricsExist:(BOOL *)exist;
@end
EXTERN_C NSString *NSAFMFamilyName;
EXTERN_C NSString *NSAFMFontName;
EXTERN_C NSString *NSAFMFormatVersion;
EXTERN_C NSString *NSAFMFullName;
EXTERN_C NSString *NSAFMNotice;
EXTERN_C NSString *NSAFMVersion;
EXTERN_C NSString *NSAFMWeight;
EXTERN_C NSString *NSAFMEncodingScheme;
EXTERN_C NSString *NSAFMCharacterSet;
EXTERN_C NSString *NSAFMCapHeight;
EXTERN_C NSString *NSAFMXHeight;
EXTERN_C NSString *NSAFMAscender;
EXTERN_C NSString *NSAFMDescender;
EXTERN_C NSString *NSAFMUnderlinePosition;
EXTERN_C NSString *NSAFMUnderlineThickness;
EXTERN_C NSString *NSAFMItalicAngle;
EXTERN_C NSString *NSAFMMappingScheme;
#endif

View File

@ -0,0 +1,143 @@
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSError.h>
#import <Foundation/NSLocale.h>
#import <Foundation/NSString.h>
#import <AppKit/AppKitDefines.h>
@class NSFontDescriptor;
enum {
NSFontCollectionVisibilityProcess = (1UL << 0),
NSFontCollectionVisibilityUser = (1UL << 1),
NSFontCollectionVisibilityComputer = (1UL << 2)
};
typedef NSUInteger NSFontCollectionVisibility;
@interface NSFontCollection : NSObject <NSCopying, NSMutableCopying, NSCoding>
+ (id)fontCollectionWithDescriptors:(NSArray *)queryDescriptors;
+ (id)fontCollectionWithAllAvailableDescriptors;
+ (id)fontCollectionWithLocale:(NSLocale *)locale;
+ (BOOL)showFontCollection:(NSFontCollection *)collection withName:(NSString *)name visibility:(NSFontCollectionVisibility)visibility error:(NSError **)error;
+ (BOOL)hideFontCollectionWithName:(NSString *)name visibility:(NSFontCollectionVisibility)visibility error:(NSError **)error;
+ (BOOL)renameFontCollectionWithName:(NSString *)name visibility:(NSFontCollectionVisibility)visibility toName:(NSString *)name error:(NSError **)error;
+ (NSArray *)allFontCollectionNames;
+ (id)fontCollectionWithName:(NSString *)name;
+ (id)fontCollectionWithName:(NSString *)name visibility:(NSFontCollectionVisibility)visibility;
- (NSArray *)queryDescriptors;
- (NSArray *)exclusionDescriptors;
- (NSArray *)matchingDescriptors;
- (NSArray *)matchingDescriptorsWithOptions:(NSDictionary *)options;
- (NSArray *)matchingDescriptorsForFamily:(NSString *)family;
- (NSArray *)matchingDescriptorsForFamily:(NSString *)family options:(NSDictionary *)options;
@end
@interface NSMutableFontCollection : NSFontCollection
- (void)setQueryDescriptors:(NSArray *)descriptors;
- (void)setExclusionDescriptors:(NSArray *)descriptors;
- (void)addQueryForDescriptors:(NSArray *)descriptors;
- (void)removeQueryForDescriptors:(NSArray *)descriptors;
@end
EXTERN_C NSString * const NSFontCollectionIncludeDisabledFontsOption;
EXTERN_C NSString * const NSFontCollectionRemoveDuplicatesOption;
EXTERN_C NSString * const NSFontCollectionDisallowAutoActivationOption;
EXTERN_C NSString * const NSFontCollectionDidChangeNotification;
EXTERN_C NSString * const NSFontCollectionActionKey;
EXTERN_C NSString * const NSFontCollectionNameKey;
EXTERN_C NSString * const NSFontCollectionOldNameKey;
EXTERN_C NSString * const NSFontCollectionVisibilityKey;
EXTERN_C NSString * const NSFontCollectionWasShown;
EXTERN_C NSString * const NSFontCollectionWasHidden;
EXTERN_C NSString * const NSFontCollectionWasRenamed;
EXTERN_C NSString * const NSFontCollectionAllFonts;
EXTERN_C NSString * const NSFontCollectionUser;
EXTERN_C NSString * const NSFontCollectionFavorites;
EXTERN_C NSString * const NSFontCollectionRecentlyUsed;

View File

@ -0,0 +1,150 @@
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <AppKit/AppKitDefines.h>
typedef uint32_t NSFontSymbolicTraits;
enum {
NSFontUnknownClass = 0 << 28,
NSFontOldStyleSerifsClass = 1 << 28,
NSFontTransitionalSerifsClass = 2 << 28,
NSFontModernSerifsClass = 3 << 28,
NSFontClarendonSerifsClass = 4 << 28,
NSFontSlabSerifsClass = 5 << 28,
NSFontFreeformSerifsClass = 7 << 28,
NSFontSansSerifClass = 8 << 28,
NSFontOrnamentalsClass = 9 << 28,
NSFontScriptsClass = 10 << 28,
NSFontSymbolicClass = 12 << 28
};
typedef uint32_t NSFontFamilyClass;
enum {
NSFontFamilyClassMask = 0xF0000000
};
enum {
NSFontItalicTrait = (1 << 0),
NSFontBoldTrait = (1 << 1),
NSFontExpandedTrait = (1 << 5),
NSFontCondensedTrait = (1 << 6),
NSFontMonoSpaceTrait = (1 << 10),
NSFontVerticalTrait = (1 << 11),
NSFontUIOptimizedTrait = (1 << 12)
};
@class NSMutableDictionary, NSDictionary, NSArray, NSSet, NSAffineTransform;
@interface NSFontDescriptor: NSObject <NSCopying, NSCoding> {
NSMutableDictionary *_attributes;
id _reserved1;
id _reserved2;
id _reserved3;
id _reserved4;
id _reserved5;
}
- (NSString *)postscriptName;
- (CGFloat)pointSize;
- (NSAffineTransform *)matrix;
- (NSFontSymbolicTraits)symbolicTraits;
- (id)objectForKey:(NSString *)anAttribute;
- (NSDictionary *)fontAttributes;
+ (NSFontDescriptor *)fontDescriptorWithFontAttributes:(NSDictionary *)attributes;
+ (NSFontDescriptor *)fontDescriptorWithName:(NSString *)fontName size:(CGFloat)size;
+ (NSFontDescriptor *)fontDescriptorWithName:(NSString *)fontName matrix:(NSAffineTransform *)matrix;
- (id)initWithFontAttributes:(NSDictionary *)attributes;
- (NSArray *)matchingFontDescriptorsWithMandatoryKeys:(NSSet *)mandatoryKeys;
- (NSFontDescriptor *)matchingFontDescriptorWithMandatoryKeys:(NSSet *)mandatoryKeys;
- (NSFontDescriptor *)fontDescriptorByAddingAttributes:(NSDictionary *)attributes;
- (NSFontDescriptor *)fontDescriptorWithSymbolicTraits:(NSFontSymbolicTraits)symbolicTraits;
- (NSFontDescriptor *)fontDescriptorWithSize:(CGFloat)newPointSize;
- (NSFontDescriptor *)fontDescriptorWithMatrix:(NSAffineTransform *)matrix;
- (NSFontDescriptor *)fontDescriptorWithFace:(NSString *)newFace;
- (NSFontDescriptor *)fontDescriptorWithFamily:(NSString *)newFamily;
@end
EXTERN_C NSString *NSFontFamilyAttribute;
EXTERN_C NSString *NSFontNameAttribute;
EXTERN_C NSString *NSFontFaceAttribute;
EXTERN_C NSString *NSFontSizeAttribute;
EXTERN_C NSString *NSFontVisibleNameAttribute;
EXTERN_C NSString *NSFontMatrixAttribute ;
EXTERN_C NSString *NSFontVariationAttribute ;
EXTERN_C NSString *NSFontCharacterSetAttribute ;
EXTERN_C NSString *NSFontCascadeListAttribute ;
EXTERN_C NSString *NSFontTraitsAttribute ;
EXTERN_C NSString *NSFontFixedAdvanceAttribute ;
EXTERN_C NSString *NSFontFeatureSettingsAttribute;
EXTERN_C NSString *NSFontColorAttribute;
EXTERN_C NSString *NSFontSymbolicTrait;
EXTERN_C NSString *NSFontWeightTrait;
EXTERN_C NSString *NSFontWidthTrait;
EXTERN_C NSString *NSFontSlantTrait;
EXTERN_C NSString *NSFontVariationAxisIdentifierKey;
EXTERN_C NSString *NSFontVariationAxisMinimumValueKey;
EXTERN_C NSString *NSFontVariationAxisMaximumValueKey;
EXTERN_C NSString *NSFontVariationAxisDefaultValueKey;
EXTERN_C NSString *NSFontVariationAxisNameKey;
EXTERN_C NSString *NSFontFeatureTypeIdentifierKey;
EXTERN_C NSString *NSFontFeatureSelectorIdentifierKey;

159
src/AppKit/NSFontManager.h Normal file
View File

@ -0,0 +1,159 @@
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
@class NSArray, NSDictionary, NSFont, NSFontPanel, NSMenu, NSFontDescriptor;
typedef NSUInteger NSFontTraitMask;
enum {
NSItalicFontMask = 0x00000001,
NSBoldFontMask = 0x00000002,
NSUnboldFontMask = 0x00000004,
NSNonStandardCharacterSetFontMask = 0x00000008,
NSNarrowFontMask = 0x00000010,
NSExpandedFontMask = 0x00000020,
NSCondensedFontMask = 0x00000040,
NSSmallCapsFontMask = 0x00000080,
NSPosterFontMask = 0x00000100,
NSCompressedFontMask = 0x00000200,
NSFixedPitchFontMask = 0x00000400,
NSUnitalicFontMask = 0x01000000
};
enum {
NSFontCollectionApplicationOnlyMask = 1 << 0
};
enum {
NSNoFontChangeAction = 0,
NSViaPanelFontAction = 1,
NSAddTraitFontAction = 2,
NSSizeUpFontAction = 3,
NSSizeDownFontAction = 4,
NSHeavierFontAction = 5,
NSLighterFontAction = 6,
NSRemoveTraitFontAction = 7
};
typedef NSUInteger NSFontAction;
@interface NSFontManager : NSObject
{
@private
NSFontPanel * _panel;
unsigned int _fmReserved1;
SEL _action;
id _actionOrigin;
id _target;
NSFont *_selFont;
struct _fmFlags {
unsigned int multipleFont:1;
unsigned int disabled:1;
unsigned int senderTagMode:2;
unsigned int _RESERVED:12;
} _fmFlags;
unsigned short _fmReserved3;
id _delegate;
id _collections;
id _hiddenCollections;
NSUInteger _fmReserved4;
}
+ (void)setFontPanelFactory:(Class)factoryId;
+ (void)setFontManagerFactory:(Class)factoryId;
+ (NSFontManager *)sharedFontManager;
- (BOOL)isMultiple;
- (NSFont *)selectedFont;
- (void)setSelectedFont:(NSFont *)fontObj isMultiple:(BOOL)flag;
- (void)setFontMenu:(NSMenu *)newMenu;
- (NSMenu *)fontMenu:(BOOL)create;
- (NSFontPanel *)fontPanel:(BOOL)create;
- (NSFont *)fontWithFamily:(NSString *)family traits:(NSFontTraitMask)traits weight:(NSInteger)weight size:(CGFloat)size;
- (NSFontTraitMask)traitsOfFont:(NSFont *)fontObj;
- (NSInteger)weightOfFont:(NSFont *)fontObj;
- (NSArray *)availableFonts;
- (NSArray *)availableFontFamilies;
- (NSArray *)availableMembersOfFontFamily:(NSString *)fam;
- (NSFont *)convertFont:(NSFont *)fontObj;
- (NSFont *)convertFont:(NSFont *)fontObj toSize:(CGFloat)size;
- (NSFont *)convertFont:(NSFont *)fontObj toFace:(NSString *)typeface;
- (NSFont *)convertFont:(NSFont *)fontObj toFamily:(NSString *)family;
- (NSFont *)convertFont:(NSFont *)fontObj toHaveTrait:(NSFontTraitMask)trait;
- (NSFont *)convertFont:(NSFont *)fontObj toNotHaveTrait:(NSFontTraitMask)trait;
- (NSFont *)convertWeight:(BOOL)upFlag ofFont:(NSFont *)fontObj;
- (BOOL)isEnabled;
- (void)setEnabled:(BOOL)flag;
- (SEL)action;
- (void)setAction:(SEL)aSelector;
- (BOOL)sendAction;
- (void)setDelegate:(id)anObject;
- (id)delegate;
- (NSString *) localizedNameForFamily:(NSString *)family face:(NSString *)faceKey;
- (void)setSelectedAttributes:(NSDictionary *)attributes isMultiple:(BOOL)flag;
- (NSDictionary *)convertAttributes:(NSDictionary *)attributes;
- (NSArray *)availableFontNamesMatchingFontDescriptor:(NSFontDescriptor *)descriptor;
- (NSArray *)collectionNames;
- (NSArray *)fontDescriptorsInCollection:(NSString *)collectionNames;
- (BOOL)addCollection:(NSString *)collectionName options:(NSInteger)collectionOptions;
- (BOOL)removeCollection:(NSString *)collectionName;
- (void)addFontDescriptors:(NSArray *)descriptors toCollection:(NSString *)collectionName;
- (void)removeFontDescriptor:(NSFontDescriptor *)descriptor fromCollection:(NSString *)collection;
- (NSFontAction)currentFontAction;
- (NSFontTraitMask)convertFontTraits:(NSFontTraitMask)traits;
- (void)setTarget:(id)aTarget;
- (id)target;
@end
@interface NSFontManager(NSFontManagerMenuActionMethods)
- (BOOL)fontNamed:(NSString *)fName hasTraits:(NSFontTraitMask)someTraits;
- (NSArray *)availableFontNamesWithTraits:(NSFontTraitMask)someTraits;
- (void)addFontTrait:(id)sender;
- (void)removeFontTrait:(id)sender;
- (void)modifyFontViaPanel:(id)sender;
- (void)modifyFont:(id)sender;
- (void)orderFrontFontPanel:(id)sender;
- (void)orderFrontStylesPanel:(id)sender;
@end
@interface NSObject(NSFontManagerDelegate)
- (BOOL)fontManager:(id)sender willIncludeFont:(NSString *)fontName;
@end
@interface NSObject(NSFontManagerResponderMethod)
- (void)changeFont:(id)sender;
@end

129
src/AppKit/NSFontPanel.h Normal file
View File

@ -0,0 +1,129 @@
#import <AppKit/NSPanel.h>
@class NSFontPanel, NSMutableDictionary, NSFontManager, NSMutableArray, NSTableView, NSFontDescriptor, NSFont;
@interface NSObject (NSFontPanelValidationAdditions)
- (NSUInteger) validModesForFontPanel: (NSFontPanel *) fontPanel;
@end
@interface NSFontPanel : NSPanel {
NSFontManager *_manager;
NSArray *_collectionNames;
id _selection;
void *_carbonNotification;
id _targetObject;
id _familyList;
id _faceList;
id _sizeList;
id _mainCollectionList;
id _sizeField;
id _sizeSlider;
id _sizeSliderBox;
id _preview;
id _previewCaption;
id _mainSplitView;
id _mmCollectionList;
id _mmFamilyList;
id _mmFaceList;
id _mmSizeList;
id _extrasPopup;
id _searchField;
id _fixedListButton;
id _sliderButton;
id _accessoryView;
struct __fpFlags {
unsigned int setFontChange:1;
unsigned int setFontAttributeChange:1;
unsigned int _delRespFamily:1;
unsigned int _delRespFace:1;
unsigned int _delRespSize:1;
unsigned int _delRespColl:1;
unsigned int _collectionDisabled:1;
unsigned int _sizeDisabled:1;
unsigned int _faceDisabled:1;
unsigned int showEffects:1;
unsigned int _uiMode:8;
unsigned int _reserved:14;
} _fpFlags;
id _regularModeBox;
id _miniModeBox;
id _modeBoxSuperview;
id _collectionLabel;
id _sizeLabel;
id _faceLabel;
id _familyLabel;
id _sizeStyleButton;
id _newSizeField;
id _editSizeList;
id _editSizeListBox;
id _editSizeSliderBox;
id _editSizeSliderMaxField;
id _editSizeSliderMinField;
id _sizeEditWindow;
id _availableSizes;
id _addCollectionButton;
id _removeCollectionButton;
CGFloat _fontPanelPreviewHeight;
id _typographyPanel;
id _actionButton;
id _fontEffectsBox;
int _sizeStyle;
#if !__LP64__
id _fpUnused[72];
#endif
}
+ (NSFontPanel *)sharedFontPanel;
+ (BOOL)sharedFontPanelExists;
- (NSView *)accessoryView;
- (void)setAccessoryView:(NSView *)aView;
- (void)setPanelFont:(NSFont *)fontObj isMultiple:(BOOL)flag;
- (NSFont *)panelConvertFont:(NSFont *)fontObj;
- (BOOL)worksWhenModal;
- (BOOL)isEnabled;
- (void)setEnabled:(BOOL)flag;
- (void) reloadDefaultFontFamilies;
@end
enum {
NSFPPreviewButton = 131,
NSFPRevertButton = 130,
NSFPSetButton = 132,
NSFPPreviewField = 128,
NSFPSizeField = 129,
NSFPSizeTitle = 133,
NSFPCurrentField = 134
};
enum {
NSFontPanelFaceModeMask = 1 << 0,
NSFontPanelSizeModeMask = 1 << 1,
NSFontPanelCollectionModeMask = 1 << 2,
NSFontPanelUnderlineEffectModeMask = 1<<8,
NSFontPanelStrikethroughEffectModeMask = 1<<9,
NSFontPanelTextColorEffectModeMask = 1<< 10,
NSFontPanelDocumentColorEffectModeMask = 1<<11,
NSFontPanelShadowEffectModeMask = 1<<12,
NSFontPanelAllEffectsModeMask = 0XFFF00,
NSFontPanelStandardModesMask = 0xFFFF,
NSFontPanelAllModesMask = 0xFFFFFFFF
};

36
src/AppKit/NSForm.h Normal file
View File

@ -0,0 +1,36 @@
#import <AppKit/NSMatrix.h>
@class NSFormCell;
@interface NSForm : NSMatrix
- (NSInteger)indexOfSelectedItem;
- (void)setEntryWidth:(CGFloat)width;
- (void)setInterlineSpacing:(CGFloat)spacing;
- (void)setBordered:(BOOL)flag;
- (void)setBezeled:(BOOL)flag;
- (void)setTitleAlignment:(NSTextAlignment)mode;
- (void)setTextAlignment:(NSTextAlignment)mode;
- (void)setTitleFont:(NSFont *)fontObj;
- (void)setTextFont:(NSFont *)fontObj;
- (id)cellAtIndex:(NSInteger)index;
- (void)drawCellAtIndex:(NSInteger)index;
- (NSFormCell *)addEntry:(NSString *)title;
- (NSFormCell *)insertEntry:(NSString *)title atIndex:(NSInteger)index;
- (void)removeEntryAtIndex:(NSInteger)index;
- (NSInteger)indexOfCellWithTag:(NSInteger)aTag;
- (void)selectTextAtIndex:(NSInteger)index;
- (void)setFrameSize:(NSSize)newSize;
- (void)setTitleBaseWritingDirection:(NSWritingDirection)writingDirection;
- (void)setTextBaseWritingDirection:(NSWritingDirection)writingDirection;
- (void)setPreferredTextFieldWidth:(CGFloat)preferredWidth;
- (CGFloat)preferredTextFieldWidth;
@end

50
src/AppKit/NSFormCell.h Normal file
View File

@ -0,0 +1,50 @@
#import <AppKit/NSActionCell.h>
@interface NSFormCell : NSActionCell
{
CGFloat _titleWidth;
id _titleCell;
CGFloat _titleEndPoint;
#if __LP64__
CGFloat _preferredTextFieldWidth;
#endif
}
- (id)initTextCell:(NSString *)aString;
- (CGFloat)titleWidth:(NSSize)aSize;
- (CGFloat)titleWidth;
- (void)setTitleWidth:(CGFloat)width;
- (NSString *)title;
- (void)setTitle:(NSString *)aString;
- (NSFont *)titleFont;
- (void)setTitleFont:(NSFont *)fontObj;
- (NSTextAlignment)titleAlignment;
- (void)setTitleAlignment:(NSTextAlignment)mode;
- (BOOL)isOpaque;
- (void)setPreferredTextFieldWidth:(CGFloat)preferredWidth;
- (CGFloat)preferredTextFieldWidth;
- (void)setPlaceholderString:(NSString*)string;
- (NSString*)placeholderString;
- (void)setPlaceholderAttributedString:(NSAttributedString*)string;
- (NSAttributedString*)placeholderAttributedString;
- (NSWritingDirection)titleBaseWritingDirection;
- (void)setTitleBaseWritingDirection:(NSWritingDirection)writingDirection;
- (void)setPreferredTextFieldWidth:(CGFloat)width;
- (CGFloat)preferredTextFieldWidth;
@end
@interface NSFormCell(NSKeyboardUI)
- (void)setTitleWithMnemonic:(NSString *)stringWithAmpersand;
@end
@interface NSFormCell(NSFormCellAttributedStringMethods)
- (NSAttributedString *)attributedTitle;
- (void)setAttributedTitle:(NSAttributedString *)obj;
@end

View File

@ -0,0 +1,25 @@
#import <Foundation/NSAttributedString.h>
#import <AppKit/NSFont.h>
enum {
NSShowControlGlyphs = (1 << 0),
NSShowInvisibleGlyphs = (1 << 1),
NSWantsBidiLevels = (1 << 2)
};
@protocol NSGlyphStorage
- (void)insertGlyphs:(const NSGlyph *)glyphs length:(NSUInteger)length forStartingGlyphAtIndex:(NSUInteger)glyphIndex characterIndex:(NSUInteger)charIndex;
- (void)setIntAttribute:(NSInteger)attributeTag value:(NSInteger)val forGlyphAtIndex:(NSUInteger)glyphIndex;
- (NSAttributedString *)attributedString;
- (NSUInteger)layoutOptions;
@end
@interface NSGlyphGenerator : NSObject
- (void)generateGlyphsForGlyphStorage:(id <NSGlyphStorage>)glyphStorage desiredNumberOfCharacters:(NSUInteger)nChars glyphIndex:(NSUInteger *)glyphIndex characterIndex:(NSUInteger *)charIndex;
+ (id) sharedGlyphGenerator;
@end

35
src/AppKit/NSGlyphInfo.h Normal file
View File

@ -0,0 +1,35 @@
#import <Foundation/NSString.h>
#import <AppKit/NSFont.h>
enum {
NSIdentityMappingCharacterCollection = 0,
NSAdobeCNS1CharacterCollection = 1,
NSAdobeGB1CharacterCollection = 2,
NSAdobeJapan1CharacterCollection = 3,
NSAdobeJapan2CharacterCollection = 4,
NSAdobeKorea1CharacterCollection = 5,
};
typedef NSUInteger NSCharacterCollection;
@interface NSGlyphInfo : NSObject <NSCopying, NSCoding> {
NSString *_baseString;
}
+ (NSGlyphInfo *)glyphInfoWithGlyphName:(NSString *)glyphName forFont:(NSFont *)font baseString:(NSString *)theString;
+ (NSGlyphInfo *)glyphInfoWithGlyph:(NSGlyph)glyph forFont:(NSFont *)font baseString:(NSString *)theString;
+ (NSGlyphInfo *)glyphInfoWithCharacterIdentifier:(NSUInteger)cid collection:(NSCharacterCollection)characterCollection baseString:(NSString *)theString;
- (NSString *)glyphName;
- (NSUInteger)characterIdentifier;
- (NSCharacterCollection)characterCollection;
@end

96
src/AppKit/NSGradient.h Normal file
View File

@ -0,0 +1,96 @@
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
@class NSArray, NSBezierPath, NSColor, NSColorSpace;
typedef NSUInteger NSGradientDrawingOptions;
enum {
NSGradientDrawsBeforeStartingLocation = (1 << 0),
NSGradientDrawsAfterEndingLocation = (1 << 1),
};
@interface NSGradient : NSObject <NSCopying, NSCoding> {
@private
NSArray *_colorArray;
NSColorSpace *_colorSpace;
__strong void *_functionRef;
void *_componentArray;
void *_reserved1;
void *_reserved2;
void *_reserved3;
}
- (id)initWithStartingColor:(NSColor *)startingColor endingColor:(NSColor *)endingColor;
- (id)initWithColors:(NSArray *)colorArray;
- (id)initWithColorsAndLocations:(NSColor *)firstColor, ... NS_REQUIRES_NIL_TERMINATION;
- (id)initWithColors:(NSArray *)colorArray atLocations:(const CGFloat *)locations colorSpace:(NSColorSpace *)colorSpace;
- (void)drawFromPoint:(NSPoint)startingPoint toPoint:(NSPoint)endingPoint options:(NSGradientDrawingOptions)options;
- (void)drawInRect:(NSRect)rect angle:(CGFloat)angle;
- (void)drawInBezierPath:(NSBezierPath *)path angle:(CGFloat)angle;
- (void)drawFromCenter:(NSPoint)startCenter radius:(CGFloat)startRadius toCenter:(NSPoint)endCenter radius:(CGFloat)endRadius options:(NSGradientDrawingOptions)options;
- (void)drawInRect:(NSRect)rect relativeCenterPosition:(NSPoint)relativeCenterPosition;
- (void)drawInBezierPath:(NSBezierPath *)path relativeCenterPosition:(NSPoint)relativeCenterPosition;
- (NSColorSpace *)colorSpace;
- (NSInteger)numberOfColorStops;
- (void)getColor:(NSColor **)color location:(CGFloat *)location atIndex:(NSInteger)index;
- (NSColor *)interpolatedColorAtLocation:(CGFloat)location;
@end

178
src/AppKit/NSGraphics.h Normal file
View File

@ -0,0 +1,178 @@
#import <Foundation/NSGeometry.h>
#import <AppKit/AppKitDefines.h>
@class NSColor, NSView;
enum {
NSCompositeClear = 0,
NSCompositeCopy = 1,
NSCompositeSourceOver = 2,
NSCompositeSourceIn = 3,
NSCompositeSourceOut = 4,
NSCompositeSourceAtop = 5,
NSCompositeDestinationOver = 6,
NSCompositeDestinationIn = 7,
NSCompositeDestinationOut = 8,
NSCompositeDestinationAtop = 9,
NSCompositeXOR = 10,
NSCompositePlusDarker = 11,
NSCompositeHighlight = 12,
NSCompositePlusLighter = 13
};
typedef NSUInteger NSCompositingOperation;
enum {
NSBackingStoreRetained = 0,
NSBackingStoreNonretained = 1,
NSBackingStoreBuffered = 2
};
typedef NSUInteger NSBackingStoreType;
enum {
NSWindowAbove = 1,
NSWindowBelow = -1,
NSWindowOut = 0
};
typedef NSInteger NSWindowOrderingMode;
enum {
NSFocusRingOnly = 0,
NSFocusRingBelow = 1,
NSFocusRingAbove = 2
};
typedef NSUInteger NSFocusRingPlacement;
enum {
NSFocusRingTypeDefault = 0,
NSFocusRingTypeNone = 1,
NSFocusRingTypeExterior = 2
};
typedef NSUInteger NSFocusRingType;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
enum {
NSColorRenderingIntentDefault,
NSColorRenderingIntentAbsoluteColorimetric,
NSColorRenderingIntentRelativeColorimetric,
NSColorRenderingIntentPerceptual,
NSColorRenderingIntentSaturation
};
#endif
typedef NSInteger NSColorRenderingIntent;
EXTERN_C NSString *NSCalibratedWhiteColorSpace;
EXTERN_C NSString *NSCalibratedRGBColorSpace;
EXTERN_C NSString *NSDeviceWhiteColorSpace;
EXTERN_C NSString *NSDeviceRGBColorSpace;
EXTERN_C NSString *NSDeviceCMYKColorSpace;
EXTERN_C NSString *NSNamedColorSpace;
EXTERN_C NSString *NSPatternColorSpace;
EXTERN_C NSString *NSCustomColorSpace;
EXTERN_C NSString *NSCalibratedBlackColorSpace;
EXTERN_C NSString *NSDeviceBlackColorSpace;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
enum {
NSWindowDepthTwentyfourBitRGB = 0x208,
NSWindowDepthSixtyfourBitRGB = 0x210,
NSWindowDepthOnehundredtwentyeightBitRGB = 0x220
};
#endif
typedef int NSWindowDepth;
EXTERN_C NSWindowDepth NSBestDepth (NSString *colorSpace, NSInteger bps, NSInteger bpp, BOOL planar, BOOL *exactMatch);
EXTERN_C BOOL NSPlanarFromDepth (NSWindowDepth depth);
EXTERN_C NSString *NSColorSpaceFromDepth (NSWindowDepth depth);
EXTERN_C NSInteger NSBitsPerSampleFromDepth(NSWindowDepth depth);
EXTERN_C NSInteger NSBitsPerPixelFromDepth(NSWindowDepth depth);
EXTERN_C NSInteger NSNumberOfColorComponents(NSString *colorSpaceName);
EXTERN_C const NSWindowDepth *NSAvailableWindowDepths (void);
EXTERN_C const CGFloat NSWhite;
EXTERN_C const CGFloat NSLightGray;
EXTERN_C const CGFloat NSDarkGray;
EXTERN_C const CGFloat NSBlack;
EXTERN_C NSString *NSDeviceResolution;
EXTERN_C NSString *NSDeviceColorSpaceName;
EXTERN_C NSString *NSDeviceBitsPerSample;
EXTERN_C NSString *NSDeviceIsScreen;
EXTERN_C NSString *NSDeviceIsPrinter;
EXTERN_C NSString *NSDeviceSize;
EXTERN_C void NSRectFill(NSRect aRect);
EXTERN_C void NSRectFillList(const NSRect *rects, NSInteger count);
EXTERN_C void NSRectFillListWithGrays(const NSRect *rects, const CGFloat *grays, NSInteger num);
EXTERN_C void NSRectFillListWithColors(const NSRect *rects, NSColor * const *colors, NSInteger num);
EXTERN_C void NSRectFillUsingOperation(NSRect aRect, NSCompositingOperation op);
EXTERN_C void NSRectFillListUsingOperation(const NSRect *rects, NSInteger count, NSCompositingOperation op);
EXTERN_C void NSRectFillListWithColorsUsingOperation(const NSRect *rects, NSColor * const *colors, NSInteger num, NSCompositingOperation op);
EXTERN_C void NSFrameRect(NSRect aRect);
EXTERN_C void NSFrameRectWithWidth(NSRect aRect, CGFloat frameWidth);
EXTERN_C void NSFrameRectWithWidthUsingOperation(NSRect aRect, CGFloat frameWidth, NSCompositingOperation op);
EXTERN_C void NSRectClip(NSRect aRect);
EXTERN_C void NSRectClipList(const NSRect *rects, NSInteger count);
EXTERN_C NSRect NSDrawTiledRects(NSRect boundsRect, NSRect clipRect, const NSRectEdge *sides, const CGFloat *grays, NSInteger count);
EXTERN_C void NSDrawGrayBezel(NSRect aRect, NSRect clipRect);
EXTERN_C void NSDrawGroove(NSRect aRect, NSRect clipRect);
EXTERN_C void NSDrawWhiteBezel(NSRect aRect, NSRect clipRect);
EXTERN_C void NSDrawButton(NSRect aRect, NSRect clipRect);
EXTERN_C void NSEraseRect(NSRect aRect);
EXTERN_C NSColor *NSReadPixel(NSPoint passedPoint);
EXTERN_C void NSDrawBitmap(NSRect rect, NSInteger width, NSInteger height, NSInteger bps, NSInteger spp, NSInteger bpp, NSInteger bpr, BOOL isPlanar, BOOL hasAlpha, NSString *colorSpaceName, const unsigned char *const data[5]);
EXTERN_C void NSCopyBits(NSInteger srcGState, NSRect srcRect, NSPoint destPoint);
EXTERN_C void NSHighlightRect(NSRect aRect);
EXTERN_C void NSBeep(void);
EXTERN_C NSInteger NSGetWindowServerMemory(NSInteger context, NSInteger *virtualMemory, NSInteger *windowBackingMemory, NSString **windowDumpString);
EXTERN_C NSRect NSDrawColorTiledRects(NSRect boundsRect, NSRect clipRect, const NSRectEdge *sides, NSColor **colors, NSInteger count);
EXTERN_C void NSDrawDarkBezel(NSRect aRect, NSRect clipRect);
EXTERN_C void NSDrawLightBezel(NSRect aRect, NSRect clipRect);
EXTERN_C void NSDottedFrameRect(NSRect aRect);
EXTERN_C void NSDrawWindowBackground(NSRect aRect);
EXTERN_C void NSSetFocusRingStyle(NSFocusRingPlacement placement);
EXTERN_C void NSDisableScreenUpdates(void);
EXTERN_C void NSEnableScreenUpdates(void);
enum {
NSAnimationEffectDisappearingItemDefault = 0,
NSAnimationEffectPoof = 10
};
typedef NSUInteger NSAnimationEffect;
EXTERN_C void NSShowAnimationEffect(NSAnimationEffect animationEffect, NSPoint centerLocation, NSSize size, id animationDelegate, SEL didEndSelector, void *contextInfo);
EXTERN_C void NSCountWindows(NSInteger *count);
EXTERN_C void NSWindowList(NSInteger size, NSInteger list[]);
EXTERN_C void NSCountWindowsForContext(NSInteger context, NSInteger *count);
EXTERN_C void NSWindowListForContext(NSInteger context, NSInteger size, NSInteger list[]);

View File

@ -0,0 +1,111 @@
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSGraphics.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSObject.h>
@class NSDictionary;
@class NSString;
@class NSWindow;
@class NSBitmapImageRep;
EXTERN_C NSString *NSGraphicsContextDestinationAttributeName;
EXTERN_C NSString *NSGraphicsContextRepresentationFormatAttributeName;
EXTERN_C NSString *NSGraphicsContextPSFormat;
EXTERN_C NSString *NSGraphicsContextPDFFormat;
enum {
NSImageInterpolationDefault = 0,
NSImageInterpolationNone = 1,
NSImageInterpolationLow = 2,
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
NSImageInterpolationMedium = 4,
#endif
NSImageInterpolationHigh = 3
};
typedef NSUInteger NSImageInterpolation;
@interface NSGraphicsContext : NSObject {
}
+ (NSGraphicsContext *)graphicsContextWithAttributes:(NSDictionary *)attributes;
+ (NSGraphicsContext *)graphicsContextWithWindow:(NSWindow *)window;
+ (NSGraphicsContext *)graphicsContextWithBitmapImageRep:(NSBitmapImageRep *)bitmapRep;
+ (NSGraphicsContext *)graphicsContextWithGraphicsPort:(void *)graphicsPort flipped:(BOOL)initialFlippedState;
+ (NSGraphicsContext *)currentContext;
+ (void)setCurrentContext:(NSGraphicsContext *)context;
+ (BOOL)currentContextDrawingToScreen;
+ (void)saveGraphicsState;
+ (void)restoreGraphicsState;
+ (void)setGraphicsState:(NSInteger)gState;
- (NSDictionary *)attributes;
- (BOOL)isDrawingToScreen;
- (void)saveGraphicsState;
- (void)restoreGraphicsState;
- (void)flushGraphics;
- (void *)graphicsPort ;
- (BOOL)isFlipped;
@end
@interface NSGraphicsContext(NSGraphicsContext_RenderingOptions)
- (void)setShouldAntialias:(BOOL)antialias;
- (BOOL)shouldAntialias;
- (void)setImageInterpolation:(NSImageInterpolation)interpolation;
- (NSImageInterpolation)imageInterpolation;
- (void)setPatternPhase:(NSPoint)phase;
- (NSPoint)patternPhase;
- (void)setCompositingOperation:(NSCompositingOperation)operation;
- (NSCompositingOperation)compositingOperation;
- (NSColorRenderingIntent)colorRenderingIntent;
- (void)setColorRenderingIntent:(NSColorRenderingIntent)renderingIntent;
@end
@class CIContext;
@interface NSGraphicsContext (NSQuartzCoreAdditions)
- (CIContext *)CIContext;
@end
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
@interface NSGraphicsContext (NSGraphicsContextDeprecated)
- (id)focusStack;
- (void)setFocusStack:(id)stack;
@end
#endif

View File

@ -0,0 +1,63 @@
#import <Foundation/NSObject.h>
#import <Foundation/NSMapTable.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSBundle.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSApplication.h>
@class NSAttributedString, NSWindow;
@interface NSHelpManager : NSObject
{
NSMapTable *_helpMapTable;
NSMapTable *_keyMapTable;
NSMapTable *_bundleMapTable;
NSWindow *_helpWindow;
NSWindow *_shadowWindow;
NSWindow *_evtWindow;
NSBundle *_helpBundle;
}
+ (NSHelpManager *)sharedHelpManager;
+ (void)setContextHelpModeActive:(BOOL)active;
+ (BOOL)isContextHelpModeActive;
- (void)setContextHelp:(NSAttributedString *)attrString forObject:(id)object;
- (void)removeContextHelpForObject:(id)object;
- (NSAttributedString *)contextHelpForObject:(id)object;
- (BOOL)showContextHelpForObject:(id)object locationHint:(NSPoint)pt;
- (void)openHelpAnchor:(NSString *)anchor inBook:(NSString *)book;
- (void)findString:(NSString *)query inBook:(NSString *)book;
- (BOOL)registerBooksInBundle:(NSBundle *)bundle;
@end
EXTERN_C NSString *NSContextHelpModeDidActivateNotification;
EXTERN_C NSString *NSContextHelpModeDidDeactivateNotification;
@interface NSBundle(NSBundleHelpExtension)
- (NSAttributedString *)contextHelpForKey:(NSString *)key;
@end
@interface NSApplication(NSApplicationHelpExtension)
- (void)activateContextHelpMode:(id)sender;
- (void)showHelp:(id)sender;
@end

322
src/AppKit/NSImage.h Normal file
View File

@ -0,0 +1,322 @@
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSBundle.h>
#import <AppKit/NSGraphics.h>
#import <AppKit/NSBitmapImageRep.h>
#import <AppKit/NSPasteboard.h>
@class NSArray, NSColor, NSImageRep, NSGraphicsContext, NSURL;
@protocol NSImageDelegate;
enum {
NSImageLoadStatusCompleted,
NSImageLoadStatusCancelled,
NSImageLoadStatusInvalidData,
NSImageLoadStatusUnexpectedEOF,
NSImageLoadStatusReadError
};
typedef NSUInteger NSImageLoadStatus;
enum {
NSImageCacheDefault,
NSImageCacheAlways,
NSImageCacheBySize,
NSImageCacheNever
};
typedef NSUInteger NSImageCacheMode;
@class _NSImageAuxiliary;
@interface NSImage : NSObject <NSCopying, NSCoding, NSPasteboardReading, NSPasteboardWriting>
{
NSString *_name;
NSSize _size;
struct __imageFlags {
unsigned int scalable:1;
unsigned int dataRetained:1;
unsigned int uniqueWindow:1;
unsigned int sizeWasExplicitlySet:1;
unsigned int builtIn:1;
unsigned int needsToExpand:1;
unsigned int useEPSOnResolutionMismatch:1;
unsigned int matchesOnlyOnBestFittingAxis:1;
unsigned int colorMatchPreferred:1;
unsigned int multipleResolutionMatching:1;
unsigned int focusedWhilePrinting:1;
unsigned int archiveByName:1;
unsigned int unboundedCacheDepth:1;
unsigned int flipped:1;
unsigned int aliased:1;
unsigned int dirtied:1;
unsigned int cacheMode:2;
unsigned int sampleMode:3;
unsigned int resMatchPreferred:1;
unsigned int isTemplate:1;
unsigned int failedToExpand:1;
unsigned int reserved1:8;
} _flags;
volatile id _reps;
_NSImageAuxiliary *_imageAuxiliary;
}
+ (id)imageNamed:(NSString *)name;
- (id)initWithSize:(NSSize)aSize;
- (id)initWithData:(NSData *)data;
- (id)initWithContentsOfFile:(NSString *)fileName;
- (id)initWithContentsOfURL:(NSURL *)url;
- (id)initByReferencingFile:(NSString *)fileName;
- (id)initByReferencingURL:(NSURL *)url;
- (id)initWithIconRef:(IconRef)iconRef;
- (id)initWithPasteboard:(NSPasteboard *)pasteboard;
- (id)initWithDataIgnoringOrientation:(NSData *)data;
+ (id)imageWithSize:(NSSize)size flipped:(BOOL)drawingHandlerShouldBeCalledWithFlippedContext drawingHandler:(BOOL (^)(NSRect dstRect))drawingHandler;
- (void)setSize:(NSSize)aSize;
- (NSSize)size;
- (BOOL)setName:(NSString *)string;
- (NSString *)name;
- (void)setBackgroundColor:(NSColor *)aColor;
- (NSColor *)backgroundColor;
- (void)setUsesEPSOnResolutionMismatch:(BOOL)flag;
- (BOOL)usesEPSOnResolutionMismatch;
- (void)setPrefersColorMatch:(BOOL)flag;
- (BOOL)prefersColorMatch;
- (void)setMatchesOnMultipleResolution:(BOOL)flag;
- (BOOL)matchesOnMultipleResolution;
- (BOOL)matchesOnlyOnBestFittingAxis;
- (void)setMatchesOnlyOnBestFittingAxis:(BOOL)flag;
- (void)drawAtPoint:(NSPoint)point fromRect:(NSRect)fromRect operation:(NSCompositingOperation)op fraction:(CGFloat)delta;
- (void)drawInRect:(NSRect)rect fromRect:(NSRect)fromRect operation:(NSCompositingOperation)op fraction:(CGFloat)delta;
- (void)drawInRect:(NSRect)dstSpacePortionRect fromRect:(NSRect)srcSpacePortionRect operation:(NSCompositingOperation)op fraction:(CGFloat)requestedAlpha respectFlipped:(BOOL)respectContextIsFlipped hints:(NSDictionary *)hints;
- (BOOL)drawRepresentation:(NSImageRep *)imageRep inRect:(NSRect)rect;
- (void)recache;
- (NSData *)TIFFRepresentation;
- (NSData *)TIFFRepresentationUsingCompression:(NSTIFFCompression)comp factor:(float)aFloat;
- (NSArray *)representations;
- (void)addRepresentations:(NSArray *)imageReps;
- (void)addRepresentation:(NSImageRep *)imageRep;
- (void)removeRepresentation:(NSImageRep *)imageRep;
- (BOOL)isValid;
- (void)lockFocus;
- (void)lockFocusFlipped:(BOOL)flipped;
- (void)unlockFocus;
- (NSImageRep *)bestRepresentationForDevice:(NSDictionary *)deviceDescription;
- (void)setDelegate:(id <NSImageDelegate>)anObject;
- (id <NSImageDelegate>)delegate;
+ (NSArray *)imageUnfilteredFileTypes;
+ (NSArray *)imageUnfilteredPasteboardTypes;
+ (NSArray *)imageFileTypes;
+ (NSArray *)imagePasteboardTypes;
+ (NSArray *)imageTypes;
+ (NSArray *)imageUnfilteredTypes;
+ (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard;
- (void)cancelIncrementalLoad;
-(void)setCacheMode:(NSImageCacheMode)mode;
-(NSImageCacheMode)cacheMode;
- (NSRect)alignmentRect;
- (void)setAlignmentRect:(NSRect)rect;
- (BOOL)isTemplate;
- (void)setTemplate:(BOOL)isTemplate;
- (NSString *)accessibilityDescription;
- (void)setAccessibilityDescription:(NSString *)description;
- (id)initWithCGImage:(CGImageRef)cgImage size:(NSSize)size;
- (CGImageRef)CGImageForProposedRect:(NSRect *)proposedDestRect context:(NSGraphicsContext *)referenceContext hints:(NSDictionary *)hints;
- (NSImageRep *)bestRepresentationForRect:(NSRect)rect context:(NSGraphicsContext *)referenceContext hints:(NSDictionary *)hints;
- (BOOL)hitTestRect:(NSRect)testRectDestSpace withImageDestinationRect:(NSRect)imageRectDestSpace context:(NSGraphicsContext *)context hints:(NSDictionary *)hints flipped:(BOOL)flipped;
- (CGFloat)recommendedLayerContentsScale:(CGFloat)preferredContentsScale;
- (id)layerContentsForContentsScale:(CGFloat)layerContentsScale;
@end
EXTERN_C NSString *const NSImageHintCTM;
EXTERN_C NSString *const NSImageHintInterpolation;
@protocol NSImageDelegate <NSObject>
@optional
- (NSImage *)imageDidNotDraw:(id)sender inRect:(NSRect)aRect;
- (void)image:(NSImage *)image willLoadRepresentation:(NSImageRep *)rep;
- (void)image:(NSImage *)image didLoadRepresentationHeader:(NSImageRep *)rep;
- (void)image:(NSImage *)image didLoadPartOfRepresentation:(NSImageRep *)rep withValidRows:(NSInteger)rows;
- (void)image:(NSImage *)image didLoadRepresentation:(NSImageRep *)rep withStatus:(NSImageLoadStatus)status;
@end
@interface NSBundle(NSBundleImageExtension)
- (NSImage *)imageForResource:(NSString *)name;
- (NSString *)pathForImageResource:(NSString *)name;
- (NSURL *)URLForImageResource:(NSString *)name;
@end
@interface NSImage (NSDeprecated)
- (void)setFlipped:(BOOL)flag;
- (BOOL)isFlipped;
- (void)dissolveToPoint:(NSPoint)point fraction:(CGFloat)aFloat;
- (void)dissolveToPoint:(NSPoint)point fromRect:(NSRect)rect fraction:(CGFloat)aFloat;
- (void)compositeToPoint:(NSPoint)point operation:(NSCompositingOperation)op;
- (void)compositeToPoint:(NSPoint)point fromRect:(NSRect)rect operation:(NSCompositingOperation)op;
- (void)compositeToPoint:(NSPoint)point operation:(NSCompositingOperation)op fraction:(CGFloat)delta;
- (void)compositeToPoint:(NSPoint)point fromRect:(NSRect)rect operation:(NSCompositingOperation)op fraction:(CGFloat)delta;
- (void)lockFocusOnRepresentation:(NSImageRep *)imageRepresentation;
- (void)setScalesWhenResized:(BOOL)flag;
- (BOOL)scalesWhenResized;
- (void)setDataRetained:(BOOL)flag;
- (BOOL)isDataRetained;
- (void)setCachedSeparately:(BOOL)flag;
- (BOOL)isCachedSeparately;
- (void)setCacheDepthMatchesImageDepth:(BOOL)flag;
- (BOOL)cacheDepthMatchesImageDepth;
@end
EXTERN_C NSString *const NSImageNameQuickLookTemplate;
EXTERN_C NSString *const NSImageNameBluetoothTemplate;
EXTERN_C NSString *const NSImageNameIChatTheaterTemplate;
EXTERN_C NSString *const NSImageNameSlideshowTemplate;
EXTERN_C NSString *const NSImageNameActionTemplate;
EXTERN_C NSString *const NSImageNameSmartBadgeTemplate;
EXTERN_C NSString *const NSImageNameIconViewTemplate;
EXTERN_C NSString *const NSImageNameListViewTemplate;
EXTERN_C NSString *const NSImageNameColumnViewTemplate;
EXTERN_C NSString *const NSImageNameFlowViewTemplate;
EXTERN_C NSString *const NSImageNamePathTemplate;
EXTERN_C NSString *const NSImageNameInvalidDataFreestandingTemplate;
EXTERN_C NSString *const NSImageNameLockLockedTemplate;
EXTERN_C NSString *const NSImageNameLockUnlockedTemplate;
EXTERN_C NSString *const NSImageNameGoRightTemplate;
EXTERN_C NSString *const NSImageNameGoLeftTemplate;
EXTERN_C NSString *const NSImageNameRightFacingTriangleTemplate;
EXTERN_C NSString *const NSImageNameLeftFacingTriangleTemplate;
EXTERN_C NSString *const NSImageNameAddTemplate;
EXTERN_C NSString *const NSImageNameRemoveTemplate;
EXTERN_C NSString *const NSImageNameRevealFreestandingTemplate;
EXTERN_C NSString *const NSImageNameFollowLinkFreestandingTemplate;
EXTERN_C NSString *const NSImageNameEnterFullScreenTemplate;
EXTERN_C NSString *const NSImageNameExitFullScreenTemplate;
EXTERN_C NSString *const NSImageNameStopProgressTemplate;
EXTERN_C NSString *const NSImageNameStopProgressFreestandingTemplate;
EXTERN_C NSString *const NSImageNameRefreshTemplate;
EXTERN_C NSString *const NSImageNameRefreshFreestandingTemplate;
EXTERN_C NSString *const NSImageNameBonjour;
EXTERN_C NSString *const NSImageNameComputer;
EXTERN_C NSString *const NSImageNameFolderBurnable;
EXTERN_C NSString *const NSImageNameFolderSmart;
EXTERN_C NSString *const NSImageNameFolder;
EXTERN_C NSString *const NSImageNameNetwork;
EXTERN_C NSString *const NSImageNameDotMac;
EXTERN_C NSString *const NSImageNameMobileMe;
EXTERN_C NSString *const NSImageNameMultipleDocuments;
EXTERN_C NSString *const NSImageNameUserAccounts;
EXTERN_C NSString *const NSImageNamePreferencesGeneral;
EXTERN_C NSString *const NSImageNameAdvanced;
EXTERN_C NSString *const NSImageNameInfo;
EXTERN_C NSString *const NSImageNameFontPanel;
EXTERN_C NSString *const NSImageNameColorPanel;
EXTERN_C NSString *const NSImageNameUser;
EXTERN_C NSString *const NSImageNameUserGroup;
EXTERN_C NSString *const NSImageNameEveryone;
EXTERN_C NSString *const NSImageNameUserGuest;
EXTERN_C NSString *const NSImageNameMenuOnStateTemplate;
EXTERN_C NSString *const NSImageNameMenuMixedStateTemplate;
EXTERN_C NSString *const NSImageNameApplicationIcon;
EXTERN_C NSString *const NSImageNameTrashEmpty;
EXTERN_C NSString *const NSImageNameTrashFull;
EXTERN_C NSString *const NSImageNameHomeTemplate;
EXTERN_C NSString *const NSImageNameBookmarksTemplate;
EXTERN_C NSString *const NSImageNameCaution;
EXTERN_C NSString *const NSImageNameStatusAvailable;
EXTERN_C NSString *const NSImageNameStatusPartiallyAvailable;
EXTERN_C NSString *const NSImageNameStatusUnavailable;
EXTERN_C NSString *const NSImageNameStatusNone;
EXTERN_C NSString *const NSImageNameShareTemplate;

50
src/AppKit/NSImageCell.h Normal file
View File

@ -0,0 +1,50 @@
#import <AppKit/NSCell.h>
@class NSImage;
enum {
NSImageAlignCenter = 0,
NSImageAlignTop,
NSImageAlignTopLeft,
NSImageAlignTopRight,
NSImageAlignLeft,
NSImageAlignBottom,
NSImageAlignBottomLeft,
NSImageAlignBottomRight,
NSImageAlignRight
};
typedef NSUInteger NSImageAlignment;
enum {
NSImageFrameNone = 0,
NSImageFramePhoto,
NSImageFrameGrayBezel,
NSImageFrameGroove,
NSImageFrameButton
};
typedef NSUInteger NSImageFrameStyle;
@interface NSImageCell : NSCell <NSCopying, NSCoding>
{
id _controlView;
struct __ICFlags {
unsigned int _unused:22;
unsigned int _animates:1;
unsigned int _align:4;
unsigned int _scale:2;
unsigned int _style:3;
} _icFlags;
struct _NSImageCellAnimationState *_animationState;
NSImage *_scaledImage;
}
- (NSImageAlignment)imageAlignment;
- (void)setImageAlignment:(NSImageAlignment)newAlign;
- (NSImageScaling)imageScaling;
- (void)setImageScaling:(NSImageScaling)newScaling;
- (NSImageFrameStyle)imageFrameStyle;
- (void)setImageFrameStyle:(NSImageFrameStyle)newStyle;
@end

112
src/AppKit/NSImageRep.h Normal file
View File

@ -0,0 +1,112 @@
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSGraphics.h>
@class NSArray, NSPasteboard, NSGraphicsContext, NSURL;
enum {
NSImageRepMatchesDevice = 0
};
@interface NSImageRep : NSObject <NSCopying, NSCoding> {
struct __repFlags {
unsigned int hasAlpha:1;
unsigned int isOpaque:1;
unsigned int cacheParamsComputed:1 __attribute__((deprecated));
unsigned int cacheAlphaComputed:1 __attribute__((deprecated));
unsigned int loadState:2;
unsigned int keepCacheWindow:1 __attribute__((deprecated));
unsigned int reserved:1;
unsigned int bitsPerSample:8;
unsigned int gsaved:16;
} _repFlags;
NSString *_colorSpaceName;
NSSize _size;
int _pixelsWide;
int _pixelsHigh;
}
- (BOOL)draw;
- (BOOL)drawAtPoint:(NSPoint)point;
- (BOOL)drawInRect:(NSRect)rect;
- (BOOL)drawInRect:(NSRect)dstSpacePortionRect fromRect:(NSRect)srcSpacePortionRect operation:(NSCompositingOperation)op fraction:(CGFloat)requestedAlpha respectFlipped:(BOOL)respectContextIsFlipped hints:(NSDictionary *)hints;
- (void)setSize:(NSSize)aSize;
- (NSSize)size;
- (void)setAlpha:(BOOL)flag;
- (BOOL)hasAlpha;
- (void)setOpaque:(BOOL)flag;
- (BOOL)isOpaque;
- (void)setColorSpaceName:(NSString *)string;
- (NSString *)colorSpaceName;
- (void)setBitsPerSample:(NSInteger)anInt;
- (NSInteger)bitsPerSample;
- (void)setPixelsWide:(NSInteger)anInt;
- (NSInteger)pixelsWide;
- (void)setPixelsHigh:(NSInteger)anInt;
- (NSInteger)pixelsHigh;
+ (void)registerImageRepClass:(Class)imageRepClass;
+ (void)unregisterImageRepClass:(Class)imageRepClass;
+ (NSArray *)registeredImageRepClasses;
+ (Class)imageRepClassForFileType:(NSString *)type;
+ (Class)imageRepClassForPasteboardType:(NSString *)type;
+ (Class)imageRepClassForType:(NSString *)type;
+ (Class)imageRepClassForData:(NSData *)data;
+ (BOOL)canInitWithData:(NSData *)data;
+ (NSArray *)imageUnfilteredFileTypes;
+ (NSArray *)imageUnfilteredPasteboardTypes;
+ (NSArray *)imageFileTypes;
+ (NSArray *)imagePasteboardTypes;
+ (NSArray *)imageUnfilteredTypes;
+ (NSArray *)imageTypes;
+ (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard;
+ (NSArray *)imageRepsWithContentsOfFile:(NSString *)filename;
+ (id)imageRepWithContentsOfFile:(NSString *)filename;
+ (NSArray *)imageRepsWithContentsOfURL:(NSURL *)url;
+ (id)imageRepWithContentsOfURL:(NSURL *)url;
+ (NSArray *)imageRepsWithPasteboard:(NSPasteboard *)pasteboard;
+ (id)imageRepWithPasteboard:(NSPasteboard *)pasteboard;
- (CGImageRef)CGImageForProposedRect:(NSRect *)proposedDestRect context:(NSGraphicsContext *)context hints:(NSDictionary *)hints;
@end
#define NSImageRepRegistryChangedNotification NSImageRepRegistryDidChangeNotification
EXTERN_C NSString *NSImageRepRegistryDidChangeNotification;

38
src/AppKit/NSImageView.h Normal file
View File

@ -0,0 +1,38 @@
#import <AppKit/NSControl.h>
#import <AppKit/NSImageCell.h>
@interface NSImageView : NSControl {
struct __IVFlags {
unsigned int _hasImageView:1;
unsigned int _unused:25;
unsigned int _rejectsMultiFileDrops:1;
unsigned int _compatibleScalingAndAlignment:1;
unsigned int _reserved:1;
unsigned int _overridesDrawing:1;
unsigned int _allowsCutCopyPaste:1;
unsigned int _editable:1;
} _ivFlags;
id _target;
SEL _action;
}
- (NSImage *)image;
- (void)setImage:(NSImage *)newImage;
- (NSImageAlignment)imageAlignment;
- (void)setImageAlignment:(NSImageAlignment)newAlign;
- (NSImageScaling)imageScaling;
- (void)setImageScaling:(NSImageScaling)newScaling;
- (NSImageFrameStyle)imageFrameStyle;
- (void)setImageFrameStyle:(NSImageFrameStyle)newStyle;
- (void)setEditable:(BOOL)yn;
- (BOOL)isEditable;
- (void)setAnimates:(BOOL)flag;
- (BOOL)animates;
- (BOOL)allowsCutCopyPaste;
- (void)setAllowsCutCopyPaste:(BOOL)allow;
@end

106
src/AppKit/NSInputManager.h Normal file
View File

@ -0,0 +1,106 @@
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSRange.h>
@class NSArray, NSAttributedString, NSEvent, NSInputServer, NSImage;
@protocol NSTextInput
- (void) insertText:(id)aString;
- (void) doCommandBySelector:(SEL)aSelector;
- (void) setMarkedText:(id)aString selectedRange:(NSRange)selRange;
- (void) unmarkText;
- (BOOL) hasMarkedText;
- (NSInteger) conversationIdentifier;
- (NSAttributedString *) attributedSubstringFromRange:(NSRange)theRange;
- (NSRange) markedRange;
- (NSRange) selectedRange;
- (NSRect) firstRectForCharacterRange:(NSRange)theRange;
- (NSUInteger)characterIndexForPoint:(NSPoint)thePoint;
- (NSArray*) validAttributesForMarkedText;
@end
@interface NSInputManager : NSObject <NSTextInput> {
@private
id _currentClient;
id _server;
id _bundleObj;
id _keybindings;
NSString *_trueName;
NSString *_connectionName;
NSString *_hostName;
NSString *_procToExec;
NSString *_visibleName;
NSString *_bundleName;
NSString *_language;
NSImage *_image;
unsigned int _flags;
NSString *_keyBindingsName;
int _reservedInputManager2;
}
+ (NSInputManager *) currentInputManager;
+ (void)cycleToNextInputLanguage:(id)sender;
+ (void)cycleToNextInputServerInLanguage:(id)sender;
- (NSInputManager *) initWithName:(NSString *)inputServerName host:(NSString *)hostName;
- (NSString *) localizedInputManagerName;
- (void) markedTextAbandoned:(id)cli;
- (void) markedTextSelectionChanged:(NSRange)newSel client:(id)cli;
- (BOOL) wantsToInterpretAllKeystrokes;
- (NSString*) language;
- (NSImage *) image;
- (NSInputServer *) server;
- (BOOL) wantsToHandleMouseEvents;
- (BOOL) handleMouseEvent:(NSEvent*)theMouseEvent;
- (BOOL) wantsToDelayTextChangeNotifications;
@end

View File

@ -0,0 +1,61 @@
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSRange.h>
@protocol NSInputServiceProvider
- (void) insertText:(id)aString client:(id)sender;
- (void) doCommandBySelector:(SEL)aSelector client:(id)sender;
- (void) markedTextAbandoned:(id)sender;
- (void) markedTextSelectionChanged:(NSRange)newSel client:(id)sender;
- (void) terminate:(id)sender;
- (BOOL) canBeDisabled;
- (BOOL) wantsToInterpretAllKeystrokes;
- (BOOL) wantsToHandleMouseEvents;
- (BOOL) wantsToDelayTextChangeNotifications;
- (void) inputClientBecomeActive:(id)sender;
- (void) inputClientResignActive:(id)sender;
- (void) inputClientEnabled:(id)sender;
- (void) inputClientDisabled:(id)sender;
- (void) activeConversationWillChange:(id)sender fromOldConversation:(NSInteger)oldConversation;
- (void) activeConversationChanged:(id)sender toNewConversation:(NSInteger)newConversation;
@end
@protocol NSInputServerMouseTracker
- (BOOL) mouseDownOnCharacterIndex:(NSUInteger)theIndex atCoordinate:(NSPoint)thePoint withModifier:(NSUInteger)theFlags client:(id)sender;
- (BOOL) mouseDraggedOnCharacterIndex:(NSUInteger)theIndex atCoordinate:(NSPoint)thePoint withModifier:(NSUInteger)theFlags client:(id)sender;
- (void) mouseUpOnCharacterIndex:(NSUInteger)theIndex atCoordinate:(NSPoint)thePoint withModifier:(NSUInteger)theFlags client:(id)sender;
@end
@interface NSInputServer : NSObject <NSInputServiceProvider, NSInputServerMouseTracker> {
NSString *_name;
id _delegate;
}
- initWithDelegate:(id)aDelegate name:(NSString *)name;
@end

View File

@ -0,0 +1,23 @@
#import <AppKit/NSResponder.h>
#import <AppKit/AppKitDefines.h>
enum {
NSNoInterfaceStyle = 0,
NSNextStepInterfaceStyle = 1,
NSWindows95InterfaceStyle = 2,
NSMacintoshInterfaceStyle = 3
};
typedef NSUInteger NSInterfaceStyle;
EXTERN_C NSInterfaceStyle NSInterfaceStyleForKey(NSString *key, NSResponder *responder);
@interface NSResponder (NSInterfaceStyle)
- (NSInterfaceStyle)interfaceStyle;
- (void)setInterfaceStyle:(NSInterfaceStyle)interfaceStyle;
@end
EXTERN_C NSString *NSInterfaceStyleDefault;

View File

@ -0,0 +1,175 @@
#import <AppKit/AppKitDefines.h>
#import <Foundation/NSObject.h>
@class NSArray, NSDictionary, NSString, NSError;
EXTERN_C id NSMultipleValuesMarker;
EXTERN_C id NSNoSelectionMarker;
EXTERN_C id NSNotApplicableMarker;
EXTERN_C BOOL NSIsControllerMarker(id object);
EXTERN_C NSString *NSObservedObjectKey;
EXTERN_C NSString *NSObservedKeyPathKey;
EXTERN_C NSString *NSOptionsKey;
@interface NSObject (NSKeyValueBindingCreation)
+ (void)exposeBinding:(NSString *)binding;
- (NSArray *)exposedBindings;
- (Class)valueClassForBinding:(NSString *)binding;
- (void)bind:(NSString *)binding toObject:(id)observable withKeyPath:(NSString *)keyPath options:(NSDictionary *)options;
- (void)unbind:(NSString *)binding;
- (NSDictionary *)infoForBinding:(NSString *)binding;
- (NSArray *)optionDescriptionsForBinding:(NSString *)aBinding;
@end
@interface NSObject (NSPlaceholders)
+ (void)setDefaultPlaceholder:(id)placeholder forMarker:(id)marker withBinding:(NSString *)binding;
+ (id)defaultPlaceholderForMarker:(id)marker withBinding:(NSString *)binding;
@end
@interface NSObject (NSEditorRegistration)
- (void)objectDidBeginEditing:(id)editor;
- (void)objectDidEndEditing:(id)editor;
@end
@interface NSObject (NSEditor)
- (void)discardEditing;
- (BOOL)commitEditing;
- (void)commitEditingWithDelegate:(id)delegate didCommitSelector:(SEL)didCommitSelector contextInfo:(void *)contextInfo;
- (BOOL)commitEditingAndReturnError:(NSError **)error;
@end
EXTERN_C NSString *NSAlignmentBinding;
EXTERN_C NSString *NSAlternateImageBinding;
EXTERN_C NSString *NSAlternateTitleBinding;
EXTERN_C NSString *NSAnimateBinding;
EXTERN_C NSString *NSAnimationDelayBinding;
EXTERN_C NSString *NSArgumentBinding;
EXTERN_C NSString *NSAttributedStringBinding;
EXTERN_C NSString *NSContentArrayBinding;
EXTERN_C NSString *NSContentArrayForMultipleSelectionBinding;
EXTERN_C NSString *NSContentBinding;
EXTERN_C NSString *NSContentDictionaryBinding;
EXTERN_C NSString *NSContentHeightBinding;
EXTERN_C NSString *NSContentObjectBinding;
EXTERN_C NSString *NSContentObjectsBinding;
EXTERN_C NSString *NSContentSetBinding;
EXTERN_C NSString *NSContentValuesBinding;
EXTERN_C NSString *NSContentWidthBinding;
EXTERN_C NSString *NSCriticalValueBinding;
EXTERN_C NSString *NSDataBinding;
EXTERN_C NSString *NSDisplayPatternTitleBinding;
EXTERN_C NSString *NSDisplayPatternValueBinding;
EXTERN_C NSString *NSDocumentEditedBinding;
EXTERN_C NSString *NSDoubleClickArgumentBinding;
EXTERN_C NSString *NSDoubleClickTargetBinding;
EXTERN_C NSString *NSEditableBinding;
EXTERN_C NSString *NSEnabledBinding;
EXTERN_C NSString *NSExcludedKeysBinding;
EXTERN_C NSString *NSFilterPredicateBinding;
EXTERN_C NSString *NSFontBinding;
EXTERN_C NSString *NSFontBoldBinding;
EXTERN_C NSString *NSFontFamilyNameBinding;
EXTERN_C NSString *NSFontItalicBinding;
EXTERN_C NSString *NSFontNameBinding;
EXTERN_C NSString *NSFontSizeBinding;
EXTERN_C NSString *NSHeaderTitleBinding;
EXTERN_C NSString *NSHiddenBinding;
EXTERN_C NSString *NSImageBinding;
EXTERN_C NSString *NSIncludedKeysBinding;
EXTERN_C NSString *NSInitialKeyBinding;
EXTERN_C NSString *NSInitialValueBinding;
EXTERN_C NSString *NSIsIndeterminateBinding;
EXTERN_C NSString *NSLabelBinding;
EXTERN_C NSString *NSLocalizedKeyDictionaryBinding;
EXTERN_C NSString *NSManagedObjectContextBinding;
EXTERN_C NSString *NSMaximumRecentsBinding;
EXTERN_C NSString *NSMaxValueBinding;
EXTERN_C NSString *NSMaxWidthBinding;
EXTERN_C NSString *NSMinValueBinding;
EXTERN_C NSString *NSMinWidthBinding;
EXTERN_C NSString *NSMixedStateImageBinding;
EXTERN_C NSString *NSOffStateImageBinding;
EXTERN_C NSString *NSOnStateImageBinding;
EXTERN_C NSString *NSPositioningRectBinding;
EXTERN_C NSString *NSPredicateBinding;
EXTERN_C NSString *NSRecentSearchesBinding;
EXTERN_C NSString *NSRepresentedFilenameBinding;
EXTERN_C NSString *NSRowHeightBinding;
EXTERN_C NSString *NSSelectedIdentifierBinding;
EXTERN_C NSString *NSSelectedIndexBinding;
EXTERN_C NSString *NSSelectedLabelBinding;
EXTERN_C NSString *NSSelectedObjectBinding;
EXTERN_C NSString *NSSelectedObjectsBinding;
EXTERN_C NSString *NSSelectedTagBinding;
EXTERN_C NSString *NSSelectedValueBinding;
EXTERN_C NSString *NSSelectedValuesBinding;
EXTERN_C NSString *NSSelectionIndexesBinding;
EXTERN_C NSString *NSSelectionIndexPathsBinding;
EXTERN_C NSString *NSSortDescriptorsBinding;
EXTERN_C NSString *NSTargetBinding;
EXTERN_C NSString *NSTextColorBinding;
EXTERN_C NSString *NSTitleBinding;
EXTERN_C NSString *NSToolTipBinding;
EXTERN_C NSString *NSTransparentBinding;
EXTERN_C NSString *NSValueBinding;
EXTERN_C NSString *NSValuePathBinding;
EXTERN_C NSString *NSValueURLBinding;
EXTERN_C NSString *NSVisibleBinding;
EXTERN_C NSString *NSWarningValueBinding;
EXTERN_C NSString *NSWidthBinding;
EXTERN_C NSString *NSAllowsEditingMultipleValuesSelectionBindingOption;
EXTERN_C NSString *NSAllowsNullArgumentBindingOption;
EXTERN_C NSString *NSAlwaysPresentsApplicationModalAlertsBindingOption;
EXTERN_C NSString *NSConditionallySetsEditableBindingOption;
EXTERN_C NSString *NSConditionallySetsEnabledBindingOption;
EXTERN_C NSString *NSConditionallySetsHiddenBindingOption;
EXTERN_C NSString *NSContinuouslyUpdatesValueBindingOption;
EXTERN_C NSString *NSCreatesSortDescriptorBindingOption;
EXTERN_C NSString *NSDeletesObjectsOnRemoveBindingsOption;
EXTERN_C NSString *NSDisplayNameBindingOption;
EXTERN_C NSString *NSDisplayPatternBindingOption;
EXTERN_C NSString *NSContentPlacementTagBindingOption;
EXTERN_C NSString *NSHandlesContentAsCompoundValueBindingOption;
EXTERN_C NSString *NSInsertsNullPlaceholderBindingOption;
EXTERN_C NSString *NSInvokesSeparatelyWithArrayObjectsBindingOption;
EXTERN_C NSString *NSMultipleValuesPlaceholderBindingOption;
EXTERN_C NSString *NSNoSelectionPlaceholderBindingOption;
EXTERN_C NSString *NSNotApplicablePlaceholderBindingOption;
EXTERN_C NSString *NSNullPlaceholderBindingOption;
EXTERN_C NSString *NSRaisesForNotApplicableKeysBindingOption;
EXTERN_C NSString *NSPredicateFormatBindingOption;
EXTERN_C NSString *NSSelectorNameBindingOption;
EXTERN_C NSString *NSSelectsAllWhenSettingContentBindingOption;
EXTERN_C NSString *NSValidatesImmediatelyBindingOption;
EXTERN_C NSString *NSValueTransformerNameBindingOption;
EXTERN_C NSString *NSValueTransformerBindingOption;

View File

@ -0,0 +1,278 @@
#import <AppKit/NSWindow.h>
#import <AppKit/NSControl.h>
#import <AppKit/NSView.h>
#import <AppKit/NSAnimation.h>
#import <Foundation/NSGeometry.h>
#import <Foundation/NSObject.h>
@class NSArray, NSDictionary;
enum {
NSLayoutRelationLessThanOrEqual = -1,
NSLayoutRelationEqual = 0,
NSLayoutRelationGreaterThanOrEqual = 1,
};
typedef NSInteger NSLayoutRelation;
enum {
NSLayoutAttributeLeft = 1,
NSLayoutAttributeRight,
NSLayoutAttributeTop,
NSLayoutAttributeBottom,
NSLayoutAttributeLeading,
NSLayoutAttributeTrailing,
NSLayoutAttributeWidth,
NSLayoutAttributeHeight,
NSLayoutAttributeCenterX,
NSLayoutAttributeCenterY,
NSLayoutAttributeBaseline,
NSLayoutAttributeNotAnAttribute = 0
};
typedef NSInteger NSLayoutAttribute;
enum {
NSLayoutFormatAlignAllLeft = (1 << NSLayoutAttributeLeft),
NSLayoutFormatAlignAllRight = (1 << NSLayoutAttributeRight),
NSLayoutFormatAlignAllTop = (1 << NSLayoutAttributeTop),
NSLayoutFormatAlignAllBottom = (1 << NSLayoutAttributeBottom),
NSLayoutFormatAlignAllLeading = (1 << NSLayoutAttributeLeading),
NSLayoutFormatAlignAllTrailing = (1 << NSLayoutAttributeTrailing),
NSLayoutFormatAlignAllCenterX = (1 << NSLayoutAttributeCenterX),
NSLayoutFormatAlignAllCenterY = (1 << NSLayoutAttributeCenterY),
NSLayoutFormatAlignAllBaseline = (1 << NSLayoutAttributeBaseline),
NSLayoutFormatAlignmentMask = 0xFFFF,
NSLayoutFormatDirectionLeadingToTrailing = 0 << 16,
NSLayoutFormatDirectionLeftToRight = 1 << 16,
NSLayoutFormatDirectionRightToLeft = 2 << 16,
NSLayoutFormatDirectionMask = 0x3 << 16,
};
typedef NSUInteger NSLayoutFormatOptions;
enum {
NSLayoutConstraintOrientationHorizontal = 0,
NSLayoutConstraintOrientationVertical = 1
};
typedef NSInteger NSLayoutConstraintOrientation;
typedef struct {
CGFloat top;
CGFloat left;
CGFloat bottom;
CGFloat right;
} NSEdgeInsets;
NSEdgeInsets NSEdgeInsetsMake(CGFloat top, CGFloat left, CGFloat bottom, CGFloat right) {
NSEdgeInsets e;
e.top = top;
e.left = left;
e.bottom = bottom;
e.right = right;
return e;
}
enum {
NSLayoutPriorityRequired = 1000,
NSLayoutPriorityDefaultHigh = 750,
NSLayoutPriorityDragThatCanResizeWindow = 510,
NSLayoutPriorityWindowSizeStayPut = 500,
NSLayoutPriorityDragThatCannotResizeWindow = 490,
NSLayoutPriorityDefaultLow = 250,
NSLayoutPriorityFittingSizeCompression = 50,
};
typedef float NSLayoutPriority;
@interface NSLayoutConstraint : NSObject <NSAnimatablePropertyContainer>
{
@private
id _container;
id _firstItem;
id _secondItem;
CGFloat _constant;
CGFloat _loweredConstant;
id _markerAndPositiveExtraVar;
id _negativeExtraVar;
float _coefficient;
NSLayoutPriority _priority;
uint64_t _layoutConstraintFlags;
id _flange;
}
+ (NSArray *)constraintsWithVisualFormat:(NSString *)format options:(NSLayoutFormatOptions)opts metrics:(NSDictionary *)metrics views:(NSDictionary *)views;
#define NSDictionaryOfVariableBindings(...) _NSDictionaryOfVariableBindings(@"" #__VA_ARGS__, __VA_ARGS__, nil)
EXTERN_C NSDictionary *_NSDictionaryOfVariableBindings(NSString *commaSeparatedKeysString, id firstValue, ...);
+ (id)constraintWithItem:(id)view1 attribute:(NSLayoutAttribute)attr1 relatedBy:(NSLayoutRelation)relation toItem:(id)view2 attribute:(NSLayoutAttribute)attr2 multiplier:(CGFloat)multiplier constant:(CGFloat)c;
@property NSLayoutPriority priority;
@property BOOL shouldBeArchived;
@property (readonly, assign) id firstItem;
@property (readonly) NSLayoutAttribute firstAttribute;
@property (readonly) NSLayoutRelation relation;
@property (readonly, assign) id secondItem;
@property (readonly) NSLayoutAttribute secondAttribute;
@property (readonly) CGFloat multiplier;
@property CGFloat constant;
@end
@interface NSView (NSConstraintBasedLayoutInstallingConstraints)
- (NSArray *)constraints;
- (void)addConstraint:(NSLayoutConstraint *)constraint;
- (void)addConstraints:(NSArray *)constraints;
- (void)removeConstraint:(NSLayoutConstraint *)constraint;
- (void)removeConstraints:(NSArray *)constraints;
@end
@interface NSWindow (NSConstraintBasedLayoutCoreMethods)
- (void)updateConstraintsIfNeeded;
- (void)layoutIfNeeded;
@end
@interface NSView (NSConstraintBasedLayoutCoreMethods)
- (void)updateConstraintsForSubtreeIfNeeded;
- (void)updateConstraints;
- (BOOL)needsUpdateConstraints;
- (void)setNeedsUpdateConstraints:(BOOL)flag;
- (void)layoutSubtreeIfNeeded;
- (void)layout;
- (BOOL)needsLayout;
- (void)setNeedsLayout:(BOOL)flag;
@end
@interface NSView (NSConstraintBasedCompatibility)
- (BOOL)translatesAutoresizingMaskIntoConstraints;
- (void)setTranslatesAutoresizingMaskIntoConstraints:(BOOL)flag;
+ (BOOL)requiresConstraintBasedLayout;
@end
@interface NSView (NSConstraintBasedLayoutLayering)
- (NSRect)alignmentRectForFrame:(NSRect)frame;
- (NSRect)frameForAlignmentRect:(NSRect)alignmentRect;
- (NSEdgeInsets)alignmentRectInsets;
- (CGFloat)baselineOffsetFromBottom;
EXTERN_C const CGFloat NSViewNoInstrinsicMetric;
- (NSSize)intrinsicContentSize;
- (void)invalidateIntrinsicContentSize;
- (NSLayoutPriority)contentHuggingPriorityForOrientation:(NSLayoutConstraintOrientation)orientation;
- (void)setContentHuggingPriority:(NSLayoutPriority)priority forOrientation:(NSLayoutConstraintOrientation)orientation;
- (NSLayoutPriority)contentCompressionResistancePriorityForOrientation:(NSLayoutConstraintOrientation)orientation;
- (void)setContentCompressionResistancePriority:(NSLayoutPriority)priority forOrientation:(NSLayoutConstraintOrientation)orientation;
@end
@interface NSControl (NSConstraintBasedLayoutLayering)
- (void)invalidateIntrinsicContentSizeForCell:(NSCell *)cell;
@end
@interface NSWindow (NSConstraintBasedLayoutAnchoring)
- (NSLayoutAttribute)anchorAttributeForOrientation:(NSLayoutConstraintOrientation)orientation;
- (void)setAnchorAttribute:(NSLayoutAttribute)attr forOrientation:(NSLayoutConstraintOrientation)orientation;
@end
@interface NSView (NSConstraintBasedLayoutFittingSize)
- (NSSize)fittingSize;
@end
@interface NSView (NSConstraintBasedLayoutDebugging)
- (NSArray *)constraintsAffectingLayoutForOrientation:(NSLayoutConstraintOrientation)orientation;
- (BOOL)hasAmbiguousLayout;
- (void)exerciseAmbiguityInLayout;
@end
@interface NSWindow (NSConstraintBasedLayoutDebugging)
- (void)visualizeConstraints:(NSArray *)constraints;
@end

View File

@ -0,0 +1,550 @@
#import <Foundation/NSObject.h>
#import <AppKit/NSFont.h>
#import <AppKit/NSImageCell.h>
#import <AppKit/NSGlyphGenerator.h>
@class NSTextStorage;
@class NSTypesetter;
@class NSTextContainer;
@class NSTextView;
@class NSWindow;
@class NSColor;
@class NSRulerView;
@class NSParagraphStyle;
@class NSRulerMarker;
@class NSBox;
@class NSTextField;
@class NSMatrix;
@class NSTabWell;
@class NSStorage;
@class NSRunStorage;
@class NSSortedArray;
@class NSView;
@class NSMutableArray;
@class NSEvent;
@class NSCell;
@class NSGlyphGenerator;
@class NSTextBlock;
@protocol NSLayoutManagerDelegate;
enum {
NSGlyphAttributeSoft = 0,
NSGlyphAttributeElastic = 1,
NSGlyphAttributeBidiLevel = 2,
NSGlyphAttributeInscribe = 5
};
enum {
NSGlyphInscribeBase = 0,
NSGlyphInscribeBelow = 1,
NSGlyphInscribeAbove = 2,
NSGlyphInscribeOverstrike = 3,
NSGlyphInscribeOverBelow = 4
};
typedef NSUInteger NSGlyphInscription;
enum {
NSTypesetterLatestBehavior = -1,
NSTypesetterOriginalBehavior = 0,
NSTypesetterBehavior_10_2_WithCompatibility = 1,
NSTypesetterBehavior_10_2 = 2,
NSTypesetterBehavior_10_3 = 3,
NSTypesetterBehavior_10_4 = 4
};
typedef NSInteger NSTypesetterBehavior;
enum {
NSTextLayoutOrientationHorizontal = 0,
NSTextLayoutOrientationVertical = 1,
};
typedef NSInteger NSTextLayoutOrientation;
@protocol NSTextLayoutOrientationProvider
- (NSTextLayoutOrientation)layoutOrientation;
@end
@interface NSLayoutManager : NSObject <NSCoding, NSGlyphStorage> {
@private
NSTextStorage *_textStorage;
NSGlyphGenerator *_glyphGenerator;
NSTypesetter *_typesetter;
NSMutableArray *_textContainers;
NSStorage *_containerUsedRects;
NSStorage *_glyphs;
NSRunStorage *_containerRuns;
NSRunStorage *_fragmentRuns;
NSRunStorage *_glyphLocations;
NSRunStorage *_glyphRotationRuns;
NSRect _extraLineFragmentRect;
NSRect _extraLineFragmentUsedRect;
NSTextContainer *_extraLineFragmentContainer;
NSSortedArray *_glyphHoles;
NSSortedArray *_layoutHoles;
struct __lmFlags {
unsigned int containersAreFull:1;
unsigned int glyphsMightDrawOutsideLines:1;
unsigned int backgroundLayoutEnabled:1;
unsigned int resizingInProgress:1;
unsigned int allowScreenFonts:1;
unsigned int cachedRectArrayInUse:1;
unsigned int displayInvalidationInProgress:1;
unsigned int insertionPointNeedsUpdate:1;
unsigned int layoutManagerInDirtyList:1;
unsigned int usingGlyphCache:1;
unsigned int showInvisibleCharacters:1;
unsigned int showControlCharacters:1;
unsigned int delegateRespondsToDidInvalidate:1;
unsigned int delegateRespondsToDidComplete:1;
unsigned int glyphFormat:2;
unsigned int textStorageRespondsToIsEditing:1;
unsigned int notifyEditedInProgress:1;
unsigned int containersChanged:1;
unsigned int isGeneratingGlyphs:1;
unsigned int hasNonGeneratedGlyphData:1;
unsigned int loggedBGLayoutException:1;
unsigned int isLayoutRequestedFromSubthread:1;
unsigned int defaultAttachmentScaling:2;
unsigned int isInUILayoutMode:1;
unsigned int seenRightToLeft:1;
unsigned int ignoresViewTransformations:1;
unsigned int needToFlushGlyph:1;
unsigned int flipsIfNeeded:1;
unsigned int allowNonContig:1;
unsigned int useNonContig:1;
} _lmFlags;
id _delegate;
unsigned short _textViewResizeDisableStack;
unsigned short _displayInvalidationDisableStack;
NSRange _deferredDisplayCharRange;
NSTextView *_firstTextView;
__strong NSRect *_cachedRectArray;
NSUInteger _cachedRectArrayCapacity;
__strong char *_glyphBuffer;
NSUInteger _glyphBufferSize;
NSRange _cachedLocationNominalGlyphRange;
NSUInteger _cachedLocationGlyphIndex;
NSPoint _cachedLocation;
NSRange _cachedFontCharRange;
NSFont *_cachedFont;
NSUInteger _firstUnlaidGlyphIndex;
NSUInteger _firstUnlaidCharIndex;
NSBox *_rulerAccView;
id _rulerAccViewAlignmentButtons;
id _rulerAccViewSpacing;
NSTabWell *_rulerAccViewLeftTabWell;
NSTabWell *_rulerAccViewRightTabWell;
NSTabWell *_rulerAccViewCenterTabWell;
NSTabWell *_rulerAccViewDecimalTabWell;
id _rulerAccViewStyles;
id _rulerAccViewLists;
NSRange _newlyFilledGlyphRange;
id _extraData;
}
- (id)init;
- (NSTextStorage *)textStorage;
- (void)setTextStorage:(NSTextStorage *)textStorage;
- (NSAttributedString *)attributedString;
- (void)replaceTextStorage:(NSTextStorage *)newTextStorage;
- (NSGlyphGenerator *)glyphGenerator;
- (void)setGlyphGenerator:(NSGlyphGenerator *)glyphGenerator;
- (NSTypesetter *)typesetter;
- (void)setTypesetter:(NSTypesetter *)typesetter;
- (id <NSLayoutManagerDelegate>)delegate;
- (void)setDelegate:(id <NSLayoutManagerDelegate>)delegate;
- (NSArray *)textContainers;
- (void)addTextContainer:(NSTextContainer *)container;
- (void)insertTextContainer:(NSTextContainer *)container atIndex:(NSUInteger)index;
- (void)removeTextContainerAtIndex:(NSUInteger)index;
- (void)textContainerChangedGeometry:(NSTextContainer *)container;
- (void)textContainerChangedTextView:(NSTextContainer *)container;
- (void)setBackgroundLayoutEnabled:(BOOL)flag;
- (BOOL)backgroundLayoutEnabled;
- (void)setUsesScreenFonts:(BOOL)flag;
- (BOOL)usesScreenFonts;
- (void)setShowsInvisibleCharacters:(BOOL)flag;
- (BOOL)showsInvisibleCharacters;
- (void)setShowsControlCharacters:(BOOL)flag;
- (BOOL)showsControlCharacters;
- (void)setHyphenationFactor:(float)factor;
- (float)hyphenationFactor;
- (void)setDefaultAttachmentScaling:(NSImageScaling)scaling;
- (NSImageScaling)defaultAttachmentScaling;
- (void)setTypesetterBehavior:(NSTypesetterBehavior)theBehavior;
- (NSTypesetterBehavior)typesetterBehavior;
- (NSUInteger)layoutOptions;
- (void)setAllowsNonContiguousLayout:(BOOL)flag;
- (BOOL)allowsNonContiguousLayout;
- (BOOL)hasNonContiguousLayout;
- (void)invalidateGlyphsForCharacterRange:(NSRange)charRange changeInLength:(NSInteger)delta actualCharacterRange:(NSRangePointer)actualCharRange;
- (void)invalidateLayoutForCharacterRange:(NSRange)charRange actualCharacterRange:(NSRangePointer)actualCharRange;
- (void)invalidateLayoutForCharacterRange:(NSRange)charRange isSoft:(BOOL)flag actualCharacterRange:(NSRangePointer)actualCharRange;
- (void)invalidateDisplayForCharacterRange:(NSRange)charRange;
- (void)invalidateDisplayForGlyphRange:(NSRange)glyphRange;
- (void)textStorage:(NSTextStorage *)str edited:(NSUInteger)editedMask range:(NSRange)newCharRange changeInLength:(NSInteger)delta invalidatedRange:(NSRange)invalidatedCharRange;
- (void)ensureGlyphsForCharacterRange:(NSRange)charRange;
- (void)ensureGlyphsForGlyphRange:(NSRange)glyphRange;
- (void)ensureLayoutForCharacterRange:(NSRange)charRange;
- (void)ensureLayoutForGlyphRange:(NSRange)glyphRange;
- (void)ensureLayoutForTextContainer:(NSTextContainer *)container;
- (void)ensureLayoutForBoundingRect:(NSRect)bounds inTextContainer:(NSTextContainer *)container;
- (void)insertGlyphs:(const NSGlyph *)glyphs length:(NSUInteger)length forStartingGlyphAtIndex:(NSUInteger)glyphIndex characterIndex:(NSUInteger)charIndex;
- (void)insertGlyph:(NSGlyph)glyph atGlyphIndex:(NSUInteger)glyphIndex characterIndex:(NSUInteger)charIndex;
- (void)replaceGlyphAtIndex:(NSUInteger)glyphIndex withGlyph:(NSGlyph)newGlyph;
- (void)deleteGlyphsInRange:(NSRange)glyphRange;
- (void)setCharacterIndex:(NSUInteger)charIndex forGlyphAtIndex:(NSUInteger)glyphIndex;
- (void)setIntAttribute:(NSInteger)attributeTag value:(NSInteger)val forGlyphAtIndex:(NSUInteger)glyphIndex;
- (void)invalidateGlyphsOnLayoutInvalidationForGlyphRange:(NSRange)glyphRange;
- (NSUInteger)numberOfGlyphs;
- (NSGlyph)glyphAtIndex:(NSUInteger)glyphIndex isValidIndex:(BOOL *)isValidIndex;
- (NSGlyph)glyphAtIndex:(NSUInteger)glyphIndex;
- (BOOL)isValidGlyphIndex:(NSUInteger)glyphIndex;
- (NSUInteger)characterIndexForGlyphAtIndex:(NSUInteger)glyphIndex;
- (NSUInteger)glyphIndexForCharacterAtIndex:(NSUInteger)charIndex;
- (NSInteger)intAttribute:(NSInteger)attributeTag forGlyphAtIndex:(NSUInteger)glyphIndex;
- (NSUInteger)getGlyphsInRange:(NSRange)glyphRange glyphs:(NSGlyph *)glyphBuffer characterIndexes:(NSUInteger *)charIndexBuffer glyphInscriptions:(NSGlyphInscription *)inscribeBuffer elasticBits:(BOOL *)elasticBuffer;
- (NSUInteger)getGlyphsInRange:(NSRange)glyphRange glyphs:(NSGlyph *)glyphBuffer characterIndexes:(NSUInteger *)charIndexBuffer glyphInscriptions:(NSGlyphInscription *)inscribeBuffer elasticBits:(BOOL *)elasticBuffer bidiLevels:(unsigned char *)bidiLevelBuffer;
- (NSUInteger)getGlyphs:(NSGlyph *)glyphArray range:(NSRange)glyphRange;
- (void)setTextContainer:(NSTextContainer *)container forGlyphRange:(NSRange)glyphRange;
- (void)setLineFragmentRect:(NSRect)fragmentRect forGlyphRange:(NSRange)glyphRange usedRect:(NSRect)usedRect;
- (void)setExtraLineFragmentRect:(NSRect)fragmentRect usedRect:(NSRect)usedRect textContainer:(NSTextContainer *)container;
- (void)setLocation:(NSPoint)location forStartOfGlyphRange:(NSRange)glyphRange;
- (void)setLocations:(NSPointArray)locations startingGlyphIndexes:(NSUInteger *)glyphIndexes count:(NSUInteger)count forGlyphRange:(NSRange)glyphRange;
- (void)setNotShownAttribute:(BOOL)flag forGlyphAtIndex:(NSUInteger)glyphIndex;
- (void)setDrawsOutsideLineFragment:(BOOL)flag forGlyphAtIndex:(NSUInteger)glyphIndex;
- (void)setAttachmentSize:(NSSize)attachmentSize forGlyphRange:(NSRange)glyphRange;
- (void)getFirstUnlaidCharacterIndex:(NSUInteger *)charIndex glyphIndex:(NSUInteger *)glyphIndex;
- (NSUInteger)firstUnlaidCharacterIndex;
- (NSUInteger)firstUnlaidGlyphIndex;
- (NSTextContainer *)textContainerForGlyphAtIndex:(NSUInteger)glyphIndex effectiveRange:(NSRangePointer)effectiveGlyphRange;
- (NSRect)usedRectForTextContainer:(NSTextContainer *)container;
- (NSRect)lineFragmentRectForGlyphAtIndex:(NSUInteger)glyphIndex effectiveRange:(NSRangePointer)effectiveGlyphRange;
- (NSRect)lineFragmentUsedRectForGlyphAtIndex:(NSUInteger)glyphIndex effectiveRange:(NSRangePointer)effectiveGlyphRange;
- (NSRect)lineFragmentRectForGlyphAtIndex:(NSUInteger)glyphIndex effectiveRange:(NSRangePointer)effectiveGlyphRange withoutAdditionalLayout:(BOOL)flag;
- (NSRect)lineFragmentUsedRectForGlyphAtIndex:(NSUInteger)glyphIndex effectiveRange:(NSRangePointer)effectiveGlyphRange withoutAdditionalLayout:(BOOL)flag;
- (NSTextContainer *)textContainerForGlyphAtIndex:(NSUInteger)glyphIndex effectiveRange:(NSRangePointer)effectiveGlyphRange withoutAdditionalLayout:(BOOL)flag;
- (NSRect)extraLineFragmentRect;
- (NSRect)extraLineFragmentUsedRect;
- (NSTextContainer *)extraLineFragmentTextContainer;
- (NSPoint)locationForGlyphAtIndex:(NSUInteger)glyphIndex;
- (BOOL)notShownAttributeForGlyphAtIndex:(NSUInteger)glyphIndex;
- (BOOL)drawsOutsideLineFragmentForGlyphAtIndex:(NSUInteger)glyphIndex;
- (NSSize)attachmentSizeForGlyphAtIndex:(NSUInteger)glyphIndex;
- (void)setLayoutRect:(NSRect)rect forTextBlock:(NSTextBlock *)block glyphRange:(NSRange)glyphRange;
- (void)setBoundsRect:(NSRect)rect forTextBlock:(NSTextBlock *)block glyphRange:(NSRange)glyphRange;
- (NSRect)layoutRectForTextBlock:(NSTextBlock *)block glyphRange:(NSRange)glyphRange;
- (NSRect)boundsRectForTextBlock:(NSTextBlock *)block glyphRange:(NSRange)glyphRange;
- (NSRect)layoutRectForTextBlock:(NSTextBlock *)block atIndex:(NSUInteger)glyphIndex effectiveRange:(NSRangePointer)effectiveGlyphRange;
- (NSRect)boundsRectForTextBlock:(NSTextBlock *)block atIndex:(NSUInteger)glyphIndex effectiveRange:(NSRangePointer)effectiveGlyphRange;
- (NSRange)glyphRangeForCharacterRange:(NSRange)charRange actualCharacterRange:(NSRangePointer)actualCharRange;
- (NSRange)characterRangeForGlyphRange:(NSRange)glyphRange actualGlyphRange:(NSRangePointer)actualGlyphRange;
- (NSRange)glyphRangeForTextContainer:(NSTextContainer *)container;
- (NSRange)rangeOfNominallySpacedGlyphsContainingIndex:(NSUInteger)glyphIndex;
- (NSRectArray)rectArrayForCharacterRange:(NSRange)charRange withinSelectedCharacterRange:(NSRange)selCharRange inTextContainer:(NSTextContainer *)container rectCount:(NSUInteger *)rectCount ;
- (NSRectArray)rectArrayForGlyphRange:(NSRange)glyphRange withinSelectedGlyphRange:(NSRange)selGlyphRange inTextContainer:(NSTextContainer *)container rectCount:(NSUInteger *)rectCount ;
- (NSRect)boundingRectForGlyphRange:(NSRange)glyphRange inTextContainer:(NSTextContainer *)container;
- (NSRange)glyphRangeForBoundingRect:(NSRect)bounds inTextContainer:(NSTextContainer *)container;
- (NSRange)glyphRangeForBoundingRectWithoutAdditionalLayout:(NSRect)bounds inTextContainer:(NSTextContainer *)container;
- (NSUInteger)glyphIndexForPoint:(NSPoint)point inTextContainer:(NSTextContainer *)container fractionOfDistanceThroughGlyph:(CGFloat *)partialFraction;
- (NSUInteger)glyphIndexForPoint:(NSPoint)point inTextContainer:(NSTextContainer *)container;
- (CGFloat)fractionOfDistanceThroughGlyphForPoint:(NSPoint)point inTextContainer:(NSTextContainer *)container;
- (NSUInteger)characterIndexForPoint:(NSPoint)point inTextContainer:(NSTextContainer *)container fractionOfDistanceBetweenInsertionPoints:(CGFloat *)partialFraction;
- (NSUInteger)getLineFragmentInsertionPointsForCharacterAtIndex:(NSUInteger)charIndex alternatePositions:(BOOL)aFlag inDisplayOrder:(BOOL)dFlag positions:(CGFloat *)positions characterIndexes:(NSUInteger *)charIndexes;
- (NSDictionary *)temporaryAttributesAtCharacterIndex:(NSUInteger)charIndex effectiveRange:(NSRangePointer)effectiveCharRange;
- (void)setTemporaryAttributes:(NSDictionary *)attrs forCharacterRange:(NSRange)charRange;
- (void)addTemporaryAttributes:(NSDictionary *)attrs forCharacterRange:(NSRange)charRange;
- (void)removeTemporaryAttribute:(NSString *)attrName forCharacterRange:(NSRange)charRange;
- (id)temporaryAttribute:(NSString *)attrName atCharacterIndex:(NSUInteger)location effectiveRange:(NSRangePointer)range;
- (id)temporaryAttribute:(NSString *)attrName atCharacterIndex:(NSUInteger)location longestEffectiveRange:(NSRangePointer)range inRange:(NSRange)rangeLimit;
- (NSDictionary *)temporaryAttributesAtCharacterIndex:(NSUInteger)location longestEffectiveRange:(NSRangePointer)range inRange:(NSRange)rangeLimit;
- (void)addTemporaryAttribute:(NSString *)attrName value:(id)value forCharacterRange:(NSRange)charRange;
- (NSFont *)substituteFontForFont:(NSFont *)originalFont;
- (CGFloat)defaultLineHeightForFont:(NSFont *)theFont;
- (CGFloat)defaultBaselineOffsetForFont:(NSFont *)theFont;
- (BOOL)usesFontLeading;
- (void)setUsesFontLeading:(BOOL)flag;
@end
@interface NSLayoutManager (NSTextViewSupport)
- (NSArray *)rulerMarkersForTextView:(NSTextView *)view paragraphStyle:(NSParagraphStyle *)style ruler:(NSRulerView *)ruler;
- (NSView *)rulerAccessoryViewForTextView:(NSTextView *)view paragraphStyle:(NSParagraphStyle *)style ruler:(NSRulerView *)ruler enabled:(BOOL)isEnabled;
- (BOOL)layoutManagerOwnsFirstResponderInWindow:(NSWindow *)window;
- (NSTextView *)firstTextView;
- (NSTextView *)textViewForBeginningOfSelection;
- (void)drawBackgroundForGlyphRange:(NSRange)glyphsToShow atPoint:(NSPoint)origin;
- (void)drawGlyphsForGlyphRange:(NSRange)glyphsToShow atPoint:(NSPoint)origin;
- (void)showCGGlyphs:(const CGGlyph *)glyphs positions:(const NSPoint *)positions count:(NSUInteger)glyphCount font:(NSFont *)font matrix:(NSAffineTransform *)textMatrix attributes:(NSDictionary *)attributes inContext:(NSGraphicsContext *)graphicsContext;
- (void)showPackedGlyphs:(char *)glyphs length:(NSUInteger)glyphLen glyphRange:(NSRange)glyphRange atPoint:(NSPoint)point font:(NSFont *)font color:(NSColor *)color printingAdjustment:(NSSize)printingAdjustment;
- (void)showAttachmentCell:(NSCell *)cell inRect:(NSRect)rect characterIndex:(NSUInteger)attachmentIndex;
- (void)fillBackgroundRectArray:(NSRectArray)rectArray count:(NSUInteger)rectCount forCharacterRange:(NSRange)charRange color:(NSColor *)color;
- (void)drawUnderlineForGlyphRange:(NSRange)glyphRange underlineType:(NSInteger)underlineVal baselineOffset:(CGFloat)baselineOffset lineFragmentRect:(NSRect)lineRect lineFragmentGlyphRange:(NSRange)lineGlyphRange containerOrigin:(NSPoint)containerOrigin;
- (void)underlineGlyphRange:(NSRange)glyphRange underlineType:(NSInteger)underlineVal lineFragmentRect:(NSRect)lineRect lineFragmentGlyphRange:(NSRange)lineGlyphRange containerOrigin:(NSPoint)containerOrigin;
- (void)drawStrikethroughForGlyphRange:(NSRange)glyphRange strikethroughType:(NSInteger)strikethroughVal baselineOffset:(CGFloat)baselineOffset lineFragmentRect:(NSRect)lineRect lineFragmentGlyphRange:(NSRange)lineGlyphRange containerOrigin:(NSPoint)containerOrigin;
- (void)strikethroughGlyphRange:(NSRange)glyphRange strikethroughType:(NSInteger)strikethroughVal lineFragmentRect:(NSRect)lineRect lineFragmentGlyphRange:(NSRange)lineGlyphRange containerOrigin:(NSPoint)containerOrigin;
@end
@protocol NSLayoutManagerDelegate <NSObject>
@optional
- (void)layoutManagerDidInvalidateLayout:(NSLayoutManager *)sender;
- (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinishedFlag;
- (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager shouldUseTemporaryAttributes:(NSDictionary *)attrs forDrawingToScreen:(BOOL)toScreen atCharacterIndex:(NSUInteger)charIndex effectiveRange:(NSRangePointer)effectiveCharRange;
@end

View File

@ -0,0 +1,32 @@
#import <AppKit/NSControl.h>
#import <AppKit/NSLevelIndicatorCell.h>
@interface NSLevelIndicator : NSControl {
}
- (double)minValue;
- (void)setMinValue:(double)minValue;
- (double)maxValue;
- (void)setMaxValue:(double)maxValue;
- (double)warningValue;
- (void)setWarningValue:(double)warningValue;
- (double)criticalValue;
- (void)setCriticalValue:(double)criticalValue;
- (NSTickMarkPosition)tickMarkPosition;
- (void)setTickMarkPosition:(NSTickMarkPosition)position;
- (NSInteger)numberOfTickMarks;
- (void)setNumberOfTickMarks:(NSInteger)count;
- (NSInteger)numberOfMajorTickMarks;
- (void)setNumberOfMajorTickMarks:(NSInteger)count;
- (double)tickMarkValueAtIndex:(NSInteger)index;
- (NSRect)rectOfTickMarkAtIndex:(NSInteger)index;
@end

View File

@ -0,0 +1,67 @@
#import <AppKit/NSActionCell.h>
#import <AppKit/NSSliderCell.h>
enum {
NSRelevancyLevelIndicatorStyle,
NSContinuousCapacityLevelIndicatorStyle,
NSDiscreteCapacityLevelIndicatorStyle,
NSRatingLevelIndicatorStyle
};
typedef NSUInteger NSLevelIndicatorStyle;
@interface NSLevelIndicatorCell : NSActionCell {
@private
double _value;
double _minValue;
double _maxValue;
double _warningValue;
double _criticalValue;
int _numberOfTickMarks;
int _numberOfMajorTickMarks;
struct {
unsigned int indicatorStyle:4;
unsigned int tickMarkPosition:1;
unsigned int selectable:1;
unsigned int ratingPlaceholder:1;
unsigned int reserved:25;
} _liFlags;
NSRect _cellFrame;
int _reserved1;
int _reserved2;
int _reserved3;
int _reserved4;
}
- (id)initWithLevelIndicatorStyle:(NSLevelIndicatorStyle)levelIndicatorStyle;
- (NSLevelIndicatorStyle)levelIndicatorStyle;
- (void)setLevelIndicatorStyle:(NSLevelIndicatorStyle)levelIndicatorStyle;
- (double)minValue;
- (void)setMinValue:(double)minValue;
- (double)maxValue;
- (void)setMaxValue:(double)maxValue;
- (double)warningValue;
- (void)setWarningValue:(double)warningValue;
- (double)criticalValue;
- (void)setCriticalValue:(double)criticalValue;
- (void)setTickMarkPosition:(NSTickMarkPosition)position;
- (NSTickMarkPosition)tickMarkPosition;
- (void)setNumberOfTickMarks:(NSInteger)count;
- (NSInteger)numberOfTickMarks;
- (void)setNumberOfMajorTickMarks:(NSInteger)count;
- (NSInteger)numberOfMajorTickMarks;
- (NSRect)rectOfTickMarkAtIndex:(NSInteger)index;
- (double)tickMarkValueAtIndex:(NSInteger)index;
- (void)setImage:(NSImage*)image;
@end

221
src/AppKit/NSMatrix.h Normal file
View File

@ -0,0 +1,221 @@
#import <AppKit/NSControl.h>
#import <AppKit/NSUserInterfaceValidation.h>
@class NSColor, NSMutableArray;
@protocol NSMatrixDelegate;
enum {
NSRadioModeMatrix = 0,
NSHighlightModeMatrix = 1,
NSListModeMatrix = 2,
NSTrackModeMatrix = 3
};
typedef NSUInteger NSMatrixMode;
typedef struct __MFlags {
#ifdef __BIG_ENDIAN__
unsigned int highlightMode:1;
unsigned int radioMode:1;
unsigned int listMode:1;
unsigned int allowEmptySel:1;
unsigned int autoscroll:1;
unsigned int selectionByRect:1;
unsigned int drawsCellBackground:1;
unsigned int drawsBackground:1;
unsigned int autosizeCells:1;
unsigned int drawingAncestor:1;
unsigned int tabKeyTraversesCells:1;
unsigned int tabKeyTraversesCellsExplicitlySet:1;
unsigned int allowsIncrementalSearching:1;
unsigned int currentlySelectingCell:1;
unsigned int onlySetKeyCell:1;
unsigned int changingSelectionWithKeyboard:1;
unsigned int dontScroll:1;
unsigned int refusesFirstResponder:1;
unsigned int useSimpleTrackingMode:1;
unsigned int checkForSimpleTrackingMode:1;
unsigned int liveResizeImageCacheingEnabled:1;
unsigned int hasCachedSubclassIsSafeForLiveResize:1;
unsigned int subclassIsSafeForLiveResize:1;
unsigned int tmpAllowNonVisibleCellsToBecomeFirstResponder:1;
unsigned int needsRedrawBeforeFirstLiveResizeCache:1;
unsigned int browserOptimizationsEnabled:1;
unsigned int drawingContextMenuHighlight:1;
unsigned int drawingContextMenuHighlightOnAllSelectedRows:1;
unsigned int autorecalculatesCellSize:1;
unsigned int cellSizeNeedsAutorecalc:1;
unsigned int reservedMatrix:2;
#else
unsigned int reservedMatrix:2;
unsigned int cellSizeNeedsAutorecalc:1;
unsigned int autorecalculatesCellSize:1;
unsigned int drawingContextMenuHighlightOnAllSelectedRows:1;
unsigned int drawingContextMenuHighlight:1;
unsigned int browserOptimizationsEnabled:1;
unsigned int needsRedrawBeforeFirstLiveResizeCache:1;
unsigned int tmpAllowNonVisibleCellsToBecomeFirstResponder:1;
unsigned int subclassIsSafeForLiveResize:1;
unsigned int hasCachedSubclassIsSafeForLiveResize:1;
unsigned int liveResizeImageCacheingEnabled:1;
unsigned int checkForSimpleTrackingMode:1;
unsigned int useSimpleTrackingMode:1;
unsigned int refusesFirstResponder:1;
unsigned int dontScroll:1;
unsigned int changingSelectionWithKeyboard:1;
unsigned int onlySetKeyCell:1;
unsigned int currentlySelectingCell:1;
unsigned int allowsIncrementalSearching:1;
unsigned int tabKeyTraversesCellsExplicitlySet:1;
unsigned int tabKeyTraversesCells:1;
unsigned int drawingAncestor:1;
unsigned int autosizeCells:1;
unsigned int drawsBackground:1;
unsigned int drawsCellBackground:1;
unsigned int selectionByRect:1;
unsigned int autoscroll:1;
unsigned int allowEmptySel:1;
unsigned int listMode:1;
unsigned int radioMode:1;
unsigned int highlightMode:1;
#endif
} _MFlags;
@interface NSMatrix : NSControl <NSUserInterfaceValidations>
{
id _target;
SEL _action;
SEL _doubleAction;
SEL _errorAction;
id _delegate;
id _selectedCell;
NSInteger _selectedRow;
NSInteger _selectedCol;
NSInteger _numRows;
NSInteger _numCols;
NSSize _cellSize;
NSSize _intercell;
id _font;
id _protoCell;
id _cellClass;
NSColor *_backgroundColor;
id _private;
NSMutableArray *_cells;
_MFlags _mFlags;
}
- (id)initWithFrame:(NSRect)frameRect;
- (id)initWithFrame:(NSRect)frameRect mode:(NSMatrixMode)aMode prototype:(NSCell *)aCell numberOfRows:(NSInteger)rowsHigh numberOfColumns:(NSInteger)colsWide;
- (id)initWithFrame:(NSRect)frameRect mode:(NSMatrixMode)aMode cellClass:(Class)factoryId numberOfRows:(NSInteger)rowsHigh numberOfColumns:(NSInteger)colsWide;
- (void)setCellClass:(Class)factoryId;
- (Class)cellClass;
- (id)prototype;
- (void)setPrototype:(NSCell *)aCell;
- (NSCell *)makeCellAtRow:(NSInteger)row column:(NSInteger)col;
- (NSMatrixMode)mode;
- (void)setMode:(NSMatrixMode)aMode;
- (void)setAllowsEmptySelection:(BOOL)flag;
- (BOOL)allowsEmptySelection;
- (void)sendAction:(SEL)aSelector to:(id)anObject forAllCells:(BOOL)flag;
- (NSArray *)cells;
- (void)sortUsingSelector:(SEL)comparator;
- (void)sortUsingFunction:(NSInteger (*)(id, id, void *))compare context:(void *)context;
- (id)selectedCell;
- (NSArray *)selectedCells;
- (NSInteger)selectedRow;
- (NSInteger)selectedColumn;
- (void)setSelectionByRect:(BOOL)flag;
- (BOOL)isSelectionByRect;
- (void)setSelectionFrom:(NSInteger)startPos to:(NSInteger)endPos anchor:(NSInteger)anchorPos highlight:(BOOL)lit;
- (void)deselectSelectedCell;
- (void)deselectAllCells;
- (void)selectCellAtRow:(NSInteger)row column:(NSInteger)col;
- (void)selectAll:(id)sender;
- (BOOL)selectCellWithTag:(NSInteger)anInt;
- (NSSize)cellSize;
- (void)setCellSize:(NSSize)aSize;
- (NSSize)intercellSpacing;
- (void)setIntercellSpacing:(NSSize)aSize;
- (void)setScrollable:(BOOL)flag;
- (void)setBackgroundColor:(NSColor *)color;
- (NSColor *)backgroundColor;
- (void)setCellBackgroundColor:(NSColor *)color;
- (NSColor *)cellBackgroundColor;
- (void)setDrawsCellBackground:(BOOL)flag;
- (BOOL)drawsCellBackground;
- (void)setDrawsBackground:(BOOL)flag;
- (BOOL)drawsBackground;
- (void)setState:(NSInteger)value atRow:(NSInteger)row column:(NSInteger)col;
- (void)getNumberOfRows:(NSInteger *)rowCount columns:(NSInteger *)colCount;
- (NSInteger)numberOfRows;
- (NSInteger)numberOfColumns;
- (id)cellAtRow:(NSInteger)row column:(NSInteger)col;
- (NSRect)cellFrameAtRow:(NSInteger)row column:(NSInteger)col;
- (BOOL)getRow:(NSInteger *)row column:(NSInteger *)col ofCell:(NSCell *)aCell;
- (BOOL)getRow:(NSInteger *)row column:(NSInteger *)col forPoint:(NSPoint)aPoint;
- (void)renewRows:(NSInteger)newRows columns:(NSInteger)newCols;
- (void)putCell:(NSCell *)newCell atRow:(NSInteger)row column:(NSInteger)col;
- (void)addRow;
- (void)addRowWithCells:(NSArray *)newCells;
- (void)insertRow:(NSInteger)row;
- (void)insertRow:(NSInteger)row withCells:(NSArray *)newCells;
- (void)removeRow:(NSInteger)row;
- (void)addColumn;
- (void)addColumnWithCells:(NSArray *)newCells;
- (void)insertColumn:(NSInteger)column;
- (void)insertColumn:(NSInteger)column withCells:(NSArray *)newCells;
- (void)removeColumn:(NSInteger)col;
- (id)cellWithTag:(NSInteger)anInt;
- (SEL)doubleAction;
- (void)setDoubleAction:(SEL)aSelector;
- (void)setAutosizesCells:(BOOL)flag;
- (BOOL)autosizesCells;
- (void)sizeToCells;
- (void)setValidateSize:(BOOL)flag;
- (void)drawCellAtRow:(NSInteger)row column:(NSInteger)col;
- (void)highlightCell:(BOOL)flag atRow:(NSInteger)row column:(NSInteger)col;
- (void)setAutoscroll:(BOOL)flag;
- (BOOL)isAutoscroll;
- (void)scrollCellToVisibleAtRow:(NSInteger)row column:(NSInteger)col;
- (NSInteger)mouseDownFlags;
- (void)mouseDown:(NSEvent *)theEvent;
- (BOOL)performKeyEquivalent:(NSEvent *)theEvent;
- (BOOL)sendAction;
- (void)sendDoubleAction;
- (id <NSMatrixDelegate>)delegate;
- (void)setDelegate:(id <NSMatrixDelegate>)anObject;
- (BOOL)textShouldBeginEditing:(NSText *)textObject;
- (BOOL)textShouldEndEditing:(NSText *)textObject;
- (void)textDidBeginEditing:(NSNotification *)notification;
- (void)textDidEndEditing:(NSNotification *)notification;
- (void)textDidChange:(NSNotification *)notification;
- (void)selectText:(id)sender;
- (id)selectTextAtRow:(NSInteger)row column:(NSInteger)col;
- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent;
- (void)resetCursorRects;
- (void)setToolTip:(NSString *)toolTipString forCell:(NSCell *)cell;
- (NSString *)toolTipForCell:(NSCell *)cell;
- (void)setAutorecalculatesCellSize:(BOOL)flag;
- (BOOL)autorecalculatesCellSize;
@end
@interface NSMatrix(NSKeyboardUI)
- (void)setTabKeyTraversesCells:(BOOL)flag;
- (BOOL)tabKeyTraversesCells;
- (void)setKeyCell:(NSCell *)keyCell;
- (id)keyCell;
@end
@protocol NSMatrixDelegate <NSControlTextEditingDelegate> @end

275
src/AppKit/NSMenu.h Normal file
View File

@ -0,0 +1,275 @@
#import <Foundation/NSObject.h>
#import <Foundation/NSGeometry.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSMenuItem.h>
@class NSEvent, NSView, NSFont;
@class NSMenu;
@class NSMutableArray, NSArray;
@protocol NSMenuDelegate;
@interface NSMenu : NSObject <NSCopying, NSCoding>
{
@private
NSMenu *_supermenu;
NSString *_title;
id _itemArray;
id _extra;
struct __mFlags {
unsigned int noAutoenable:1;
unsigned int inMain:1;
unsigned int internalPerformAction:1;
unsigned int condenseSeparators:1;
unsigned int disabled:1;
unsigned int ownedByPopUp:1;
unsigned int delegateNeedsUpdate:1;
unsigned int delegateUpdateItem:1;
unsigned int delegateHasKeyEquiv:1;
unsigned int delegateHasAltKeyEquiv:1;
unsigned int excludeMarkColumn:1;
unsigned int isContextualMenu:1;
unsigned int cmPluginMode:2;
unsigned int invertedCMPluginTypes:2;
unsigned int allowsDifferentSelection:1;
unsigned int noTopPadding:1;
unsigned int noBottomPadding:1;
unsigned int RESERVED:13;
} _mFlags;
NSString *_uiid;
}
- (id)initWithTitle:(NSString *)aTitle;
- (void)setTitle:(NSString *)aString;
- (NSString *)title;
+ (void)popUpContextMenu:(NSMenu*)menu withEvent:(NSEvent*)event forView:(NSView*)view;
+ (void)popUpContextMenu:(NSMenu*)menu withEvent:(NSEvent*)event forView:(NSView*)view withFont:(NSFont*)font;
- (BOOL)popUpMenuPositioningItem:(NSMenuItem *)item atLocation:(NSPoint)location inView:(NSView *)view;
+ (void)setMenuBarVisible:(BOOL)visible;
+ (BOOL)menuBarVisible;
- (NSMenu *)supermenu;
- (void)setSupermenu:(NSMenu *)supermenu;
- (void)insertItem:(NSMenuItem *)newItem atIndex:(NSInteger)index;
- (void)addItem:(NSMenuItem *)newItem;
- (NSMenuItem *)insertItemWithTitle:(NSString *)aString action:(SEL)aSelector keyEquivalent:(NSString *)charCode atIndex:(NSInteger)index;
- (NSMenuItem *)addItemWithTitle:(NSString *)aString action:(SEL)aSelector keyEquivalent:(NSString *)charCode;
- (void)removeItemAtIndex:(NSInteger)index;
- (void)removeItem:(NSMenuItem *)item;
- (void)setSubmenu:(NSMenu *)aMenu forItem:(NSMenuItem *)anItem;
- (void)removeAllItems;
- (NSArray *)itemArray;
- (NSInteger)numberOfItems;
- (NSMenuItem *)itemAtIndex:(NSInteger)index;
- (NSInteger)indexOfItem:(NSMenuItem *)index;
- (NSInteger)indexOfItemWithTitle:(NSString *)aTitle;
- (NSInteger)indexOfItemWithTag:(NSInteger)aTag;
- (NSInteger)indexOfItemWithRepresentedObject:(id)object;
- (NSInteger)indexOfItemWithSubmenu:(NSMenu *)submenu;
- (NSInteger)indexOfItemWithTarget:(id)target andAction:(SEL)actionSelector;
- (NSMenuItem *)itemWithTitle:(NSString *)aTitle;
- (NSMenuItem *)itemWithTag:(NSInteger)tag;
- (void)setAutoenablesItems:(BOOL)flag;
- (BOOL)autoenablesItems;
- (void)update;
- (BOOL)performKeyEquivalent:(NSEvent *)theEvent;
- (void)itemChanged:(NSMenuItem *)item;
- (void)performActionForItemAtIndex:(NSInteger)index;
- (void)setDelegate:(id <NSMenuDelegate>)anObject;
- (id <NSMenuDelegate>)delegate;
- (CGFloat)menuBarHeight;
- (void)cancelTracking;
- (void)cancelTrackingWithoutAnimation;
- (NSMenuItem *)highlightedItem;
- (CGFloat)minimumWidth;
- (void)setMinimumWidth:(CGFloat)width;
- (NSSize)size;
- (NSFont *)font;
- (void)setFont:(NSFont *)font;
- (BOOL)allowsContextMenuPlugIns;
- (void)setAllowsContextMenuPlugIns:(BOOL)allows;
- (void)setShowsStateColumn:(BOOL)showsState;
- (BOOL)showsStateColumn;
+ (NSZone *)menuZone;
- (void)setMenuChangedMessagesEnabled:(BOOL)flag;
- (BOOL)menuChangedMessagesEnabled;
- (void)helpRequested:(NSEvent *)eventPtr;
- (BOOL)isTornOff;
@end
@interface NSMenu (NSSubmenuAction)
- (void)submenuAction:(id)sender;
@end
@interface NSObject (NSMenuValidation)
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem;
@end
@protocol NSMenuDelegate <NSObject>
@optional
- (void)menuNeedsUpdate:(NSMenu*)menu;
- (NSInteger)numberOfItemsInMenu:(NSMenu*)menu;
- (BOOL)menu:(NSMenu*)menu updateItem:(NSMenuItem*)item atIndex:(NSInteger)index shouldCancel:(BOOL)shouldCancel;
- (BOOL)menuHasKeyEquivalent:(NSMenu*)menu forEvent:(NSEvent*)event target:(id*)target action:(SEL*)action;
- (void)menuWillOpen:(NSMenu *)menu;
- (void)menuDidClose:(NSMenu *)menu;
- (void)menu:(NSMenu *)menu willHighlightItem:(NSMenuItem *)item;
- (NSRect)confinementRectForMenu:(NSMenu *)menu onScreen:(NSScreen *)screen;
@end
enum {
NSMenuPropertyItemTitle = 1 << 0,
NSMenuPropertyItemAttributedTitle = 1 << 1,
NSMenuPropertyItemKeyEquivalent = 1 << 2,
NSMenuPropertyItemImage = 1 << 3,
NSMenuPropertyItemEnabled = 1 << 4,
NSMenuPropertyItemAccessibilityDescription = 1 << 5
};
typedef NSUInteger NSMenuProperties;
@interface NSMenu (NSMenuPropertiesToUpdate)
- (NSMenuProperties)propertiesToUpdate;
@end
EXTERN_C NSString *NSMenuWillSendActionNotification;
EXTERN_C NSString *NSMenuDidSendActionNotification;
EXTERN_C NSString *NSMenuDidAddItemNotification;
EXTERN_C NSString *NSMenuDidRemoveItemNotification;
EXTERN_C NSString *NSMenuDidChangeItemNotification;
EXTERN_C NSString *NSMenuDidBeginTrackingNotification;
EXTERN_C NSString *NSMenuDidEndTrackingNotification;
@interface NSMenu (NSDeprecated)
- (void)setMenuRepresentation:(id)menuRep;
- (id)menuRepresentation;
- (void)setContextMenuRepresentation:(id)menuRep;
- (id)contextMenuRepresentation;
- (void)setTearOffMenuRepresentation:(id)menuRep;
- (id)tearOffMenuRepresentation;
+ (void)setMenuZone:(NSZone *)aZone;
- (NSMenu *)attachedMenu;
- (BOOL)isAttached;
- (void)sizeToFit;
- (NSPoint)locationForSubmenu:(NSMenu *)aSubmenu;
@end

163
src/AppKit/NSMenuItem.h Normal file
View File

@ -0,0 +1,163 @@
#import <Foundation/NSObject.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSUserInterfaceValidation.h>
#import <AppKit/NSView.h>
@class NSMenu;
@class NSImage, NSAttributedString, NSView;
@interface NSMenuItem : NSObject <NSCopying, NSCoding, NSValidatedUserInterfaceItem>
{
@private
NSMenu *_menu;
NSString *_title;
NSString *_keyEquivalent;
#if __LP64__
NSString *_uiid;
id _repObject;
NSMenu *_submenu;
id _extraData;
id _target;
SEL _action;
NSInteger _tag;
unsigned char _keyEquivalentModifierMask;
#else
NSUInteger _keyEquivalentModifierMask;
NSInteger _userKEGenerationCount;
NSInteger _state;
NSImage *_image;
NSMenu *_submenu;
NSString *_uiid;
id _repObject;
id _target;
SEL _action;
NSInteger _tag;
id _extraData;
#endif
struct __miFlags {
unsigned int keGenerationCount:8;
unsigned int disabled:1;
unsigned int isSeparator:1;
unsigned int hidden:1;
unsigned int alternate:1;
unsigned int moreAlternate:1;
unsigned int singleAlternate:1;
unsigned int indent:4;
unsigned int keShareMode:3;
unsigned int state:2;
unsigned int RESERVED1:2;
unsigned int limitedView:1;
unsigned int nextItemIsAlternate:1;
unsigned int blockKE:1;
unsigned int ignoredForAccessibility:1;
unsigned int hiddenActiveKE:1;
unsigned int noRepeatKEs:1;
unsigned int RESERVED2:1;
} _miFlags;
}
+ (void)setUsesUserKeyEquivalents:(BOOL)flag;
+ (BOOL)usesUserKeyEquivalents;
+ (NSMenuItem *)separatorItem;
- (id)initWithTitle:(NSString *)aString action:(SEL)aSelector keyEquivalent:(NSString *)charCode;
- (void)setMenu:(NSMenu *)menu;
- (NSMenu *)menu;
- (BOOL)hasSubmenu;
- (void)setSubmenu:(NSMenu *)submenu;
- (NSMenu *)submenu;
- (NSMenuItem *)parentItem;
- (void)setTitle:(NSString *)aString;
- (NSString *)title;
- (void)setAttributedTitle:(NSAttributedString*)string;
- (NSAttributedString*)attributedTitle;
- (BOOL)isSeparatorItem;
- (void)setKeyEquivalent:(NSString *)aKeyEquivalent;
- (NSString *)keyEquivalent;
- (void)setKeyEquivalentModifierMask:(NSUInteger)mask;
- (NSUInteger)keyEquivalentModifierMask;
- (NSString *)userKeyEquivalent;
- (void)setTitleWithMnemonic:(NSString *)stringWithAmpersand;
- (void)setImage:(NSImage *)menuImage;
- (NSImage *)image;
- (void)setState:(NSInteger)state;
- (NSInteger)state;
- (void)setOnStateImage:(NSImage *)image;
- (NSImage *)onStateImage;
- (void)setOffStateImage:(NSImage *)image;
- (NSImage *)offStateImage;
- (void)setMixedStateImage:(NSImage *)image;
- (NSImage *)mixedStateImage;
- (void)setEnabled:(BOOL)flag;
- (BOOL)isEnabled;
- (void)setAlternate:(BOOL)isAlternate;
- (BOOL)isAlternate;
- (void)setIndentationLevel:(NSInteger)indentationLevel;
- (NSInteger)indentationLevel;
- (void)setTarget:(id)anObject;
- (id)target;
- (void)setAction:(SEL)aSelector;
- (SEL)action;
- (void)setTag:(NSInteger)anInt;
- (NSInteger)tag;
- (void)setRepresentedObject:(id)anObject;
- (id)representedObject;
- (void)setView:(NSView *)view;
- (NSView *)view;
- (BOOL)isHighlighted;
- (void)setHidden:(BOOL)hidden;
- (BOOL)isHidden;
- (BOOL)isHiddenOrHasHiddenAncestor;
- (void) setToolTip:(NSString*)toolTip;
- (NSString*)toolTip;
@end
@interface NSView (NSViewEnclosingMenuItem)
- (NSMenuItem *)enclosingMenuItem;
@end
#if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 2)
#endif
@protocol NSMenuItem;
@interface NSMenuItem (NSDeprecated)
- (void)setMnemonicLocation:(NSUInteger)location;
- (NSUInteger)mnemonicLocation;
- (NSString *)mnemonic;
@end

View File

@ -0,0 +1,61 @@
#import <AppKit/NSButtonCell.h>
#import <AppKit/NSMenu.h>
#import <AppKit/NSMenuItem.h>
#if ! __LP64__
@class NSMenuView;
#endif
@interface NSMenuItemCell : NSButtonCell {
@private
id _extraData;
NSSize _stateImageSize;
NSSize _imageSize;
NSSize _titleSize;
NSSize _keyEquivalentSize;
NSSize _size;
struct __micFlags {
unsigned int needsSizing:1;
unsigned int reserved:1;
unsigned int needsDisplay:1;
unsigned int keyEquivGlyphWidth:16;
unsigned int uniqueAgainstMain:1;
unsigned int RESERVED:12;
} _micFlags;
}
- (void)setMenuItem:(NSMenuItem *)item;
- (NSMenuItem *)menuItem;
#if ! __LP64__
- (void)setMenuView:(NSMenuView *)menuView;
- (NSMenuView *)menuView;
#endif
- (void)setNeedsSizing:(BOOL)flag;
- (BOOL)needsSizing;
- (void)calcSize;
- (void)setNeedsDisplay:(BOOL)flag;
- (BOOL)needsDisplay;
- (CGFloat)stateImageWidth;
- (CGFloat)imageWidth;
- (CGFloat)titleWidth;
- (CGFloat)keyEquivalentWidth;
- (NSRect)stateImageRectForBounds:(NSRect)cellFrame;
- (NSRect)titleRectForBounds:(NSRect)cellFrame;
- (NSRect)keyEquivalentRectForBounds:(NSRect)cellFrame;
- (void)drawSeparatorItemWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
- (void)drawStateImageWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
- (void)drawImageWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
- (void)drawTitleWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
- (void)drawKeyEquivalentWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
- (void)drawBorderAndBackgroundWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
- (NSInteger)tag;
@end

111
src/AppKit/NSMenuView.h Normal file
View File

@ -0,0 +1,111 @@
#if ! __LP64__
#import <AppKit/NSView.h>
#import <AppKit/AppKitDefines.h>
#import <AppKit/NSMenu.h>
#import <AppKit/NSMenuItem.h>
#import <AppKit/NSMenuItemCell.h>
@class NSScreen;
@interface NSMenuView : NSView {
@private
NSMenu *_menu;
NSMutableArray *_cells;
CGFloat _stateImageWidth;
CGFloat _imageAndTitleWidth;
CGFloat _keyEquivalentWidth;
CGFloat *_extents;
unsigned _extentsCapacity;
int _highlightedItemIndex;
BOOL *_submenuPopupCancel;
NSMenuView *_attachedMenuView;
CGFloat _scrollArrowHeight;
CGFloat _maxWinHeight;
NSFont *_font;
NSSize _minSize;
CGFloat _horizontalEdgePad;
void *trackingState;
id _scrollingView;
struct __mvFlags {
unsigned int needsSizing:1;
unsigned int releasingWindow:1;
unsigned int isHorizontal:1;
unsigned int disableSizing:1;
unsigned int attachedSubmenuWhileMouseWasUp:1;
unsigned int needsToCreateCells:1;
unsigned int allowsTearOffs:1;
unsigned int isTearOff:1;
unsigned int keyEquivGlyphWidth:16;
unsigned int disableResize:1;
unsigned int savedHODState:1;
unsigned int drawCenter:1;
unsigned int RESERVED:5;
} _mvFlags;
}
+ (CGFloat)menuBarHeight;
- (id)initWithFrame:(NSRect)frame;
- (id)initAsTearOff;
- (void)setMenu:(NSMenu *)menu;
- (NSMenu *)menu;
- (void)itemChanged:(NSNotification *)notification;
- (void)itemAdded:(NSNotification *)notification;
- (void)itemRemoved:(NSNotification *)notification;
- (void)update;
- (void)setHorizontal:(BOOL)flag;
- (BOOL)isHorizontal;
- (void)setFont:(NSFont *)font;
- (NSFont *)font;
- (NSRect)innerRect;
- (NSRect)rectOfItemAtIndex:(NSInteger)index;
- (NSInteger)indexOfItemAtPoint:(NSPoint)point;
- (void)setNeedsDisplayForItemAtIndex:(NSInteger)index;
- (void)setHighlightedItemIndex:(NSInteger)index;
- (NSInteger)highlightedItemIndex;
- (CGFloat)stateImageOffset;
- (CGFloat)stateImageWidth;
- (CGFloat)imageAndTitleOffset;
- (CGFloat)imageAndTitleWidth;
- (CGFloat)keyEquivalentOffset;
- (CGFloat)keyEquivalentWidth;
- (void)setMenuItemCell:(NSMenuItemCell *)cell forItemAtIndex:(NSInteger)index;
- (NSMenuItemCell *)menuItemCellForItemAtIndex:(NSInteger)index;
- (NSMenuView *)attachedMenuView;
- (void)setNeedsSizing:(BOOL)flag;
- (BOOL)needsSizing;
- (void)sizeToFit;
- (NSMenu *)attachedMenu;
- (BOOL)isAttached;
- (BOOL)isTornOff;
- (NSPoint)locationForSubmenu:(NSMenu *)aSubmenu;
- (void)setWindowFrameForAttachingToRect:(NSRect)screenRect onScreen:(NSScreen *)screen preferredEdge:(NSRectEdge)edge popUpSelectedItem:(NSInteger)selectedItemIndex;
- (void)detachSubmenu;
- (void)attachSubmenuForItemAtIndex:(NSInteger)index;
- (void)performActionWithHighlightingForItemAtIndex:(NSInteger)index;
- (BOOL)trackWithEvent:(NSEvent *)event;
- (CGFloat)horizontalEdgePadding;
- (void)setHorizontalEdgePadding:(CGFloat)pad;
@end
#endif

46
src/AppKit/NSMovie.h Normal file
View File

@ -0,0 +1,46 @@
#import <Foundation/Foundation.h>
@class NSArray, NSPasteboard, NSURL;
#if __LP64__
@class QTMovie;
#endif
#if !__LP64__
@interface NSMovie : NSObject <NSCopying, NSCoding> {
#else
@interface NSMovie : NSObject <NSCoding> {
#endif
@private
void* _movie;
NSURL* _url;
struct {
int dispose:1;
int reserved:31;
} _movieFlags;
long _reserved1;
long _reserved2;
}
#if !__LP64__
- (id) initWithMovie:(void* )movie;
- (id) initWithURL:(NSURL*)url byReference:(BOOL)byRef;
- (id) initWithPasteboard:(NSPasteboard*)pasteboard;
- (void* )QTMovie ;
- (NSURL*)URL;
+ (NSArray*) movieUnfilteredFileTypes;
+ (NSArray*) movieUnfilteredPasteboardTypes;
+ (BOOL) canInitWithPasteboard:(NSPasteboard*)pasteboard;
#else
- (id) initWithMovie:(QTMovie*)movie;
- (QTMovie *)QTMovie;
#endif
@end

100
src/AppKit/NSMovieView.h Normal file
View File

@ -0,0 +1,100 @@
#if !__LP64__
#import <AppKit/NSView.h>
#import <AppKit/NSUserInterfaceValidation.h>
@class NSMovie;
enum {
NSQTMovieNormalPlayback,
NSQTMovieLoopingPlayback,
NSQTMovieLoopingBackAndForthPlayback
};
typedef NSUInteger NSQTMovieLoopMode;
typedef struct __MVFlags {
unsigned int editable:1;
NSQTMovieLoopMode loopMode:3;
unsigned int playsEveryFrame:1;
unsigned int playsSelectionOnly:1;
unsigned int controllerVisible:1;
unsigned int reserved:25;
} _MVFlags;
@interface NSMovieView : NSView <NSUserInterfaceValidations>
{
@protected
NSMovie* _fMovie;
float _fRate;
float _fVolume;
_MVFlags _fFlags;
void* _fAuxData;
unsigned long _fReserved1;
unsigned long _fReserved2;
unsigned long _fReserved3;
}
- (void) setMovie:(NSMovie*)movie;
- (NSMovie*) movie;
- (void* ) movieController ;
- (NSRect) movieRect;
- (void)start:(id)sender;
- (void)stop:(id)sender;
- (BOOL)isPlaying;
- (void)gotoPosterFrame:(id)sender;
- (void)gotoBeginning:(id)sender;
- (void)gotoEnd:(id)sender;
- (void)stepForward:(id)sender;
- (void)stepBack:(id)sender;
- (void)setRate:(float)rate;
- (float)rate;
- (void)setVolume:(float)volume;
- (float)volume;
- (void)setMuted:(BOOL)mute;
- (BOOL)isMuted;
- (void)setLoopMode:(NSQTMovieLoopMode)mode;
- (NSQTMovieLoopMode)loopMode;
- (void)setPlaysSelectionOnly:(BOOL)flag;
- (BOOL)playsSelectionOnly;
- (void)setPlaysEveryFrame:(BOOL)flag;
- (BOOL)playsEveryFrame;
- (void)showController:(BOOL)show adjustingSize:(BOOL)adjustSize;
- (BOOL)isControllerVisible;
- (void)resizeWithMagnification:(CGFloat)magnification;
- (NSSize)sizeForMagnification:(CGFloat)magnification;
- (void)setEditable:(BOOL)editable;
- (BOOL)isEditable;
- (void)cut:(id)sender;
- (void)copy:(id)sender;
- (void)paste:(id)sender;
- (void)delete:(id)sender;
- (void)selectAll:(id)sender;
- (void)clear:(id)sender;
@end
#endif

46
src/AppKit/NSNib.h Normal file
View File

@ -0,0 +1,46 @@
#import <AppKit/AppKitDefines.h>
#import <Foundation/Foundation.h>
@class NSArray, NSBundle, NSData, NSDictionary, NSIBObjectData, NSURL;
@interface NSNib : NSObject <NSCoding> {
@private
NSData *_data;
NSArray *_images;
NSArray *_sounds;
NSBundle *_bundle;
struct _NSNibFlags {
unsigned int _isKeyed:1;
unsigned int _inheritsDecodeTimeBundle:1;
unsigned int _reserved:30;
} _flags;
NSString *_path;
id reserved2;
}
- (id)initWithNibNamed:(NSString *)nibName bundle:(NSBundle *)bundle;
- (id)initWithNibData:(NSData *)nibData bundle:(NSBundle *)bundle;
- (BOOL)instantiateWithOwner:(id)owner topLevelObjects:(NSArray **)topLevelObjects;
@end
@interface NSNib (NSDeprecated)
- (id)initWithContentsOfURL:(NSURL *)nibFileURL;
- (BOOL)instantiateNibWithExternalNameTable:(NSDictionary *)externalNameTable;
- (BOOL)instantiateNibWithOwner:(id)owner topLevelObjects:(NSArray **)topLevelObjects;
@end
EXTERN_C NSString *NSNibOwner;
EXTERN_C NSString *NSNibTopLevelObjects;

View File

@ -0,0 +1,18 @@
#import <Foundation/NSObject.h>
@interface NSNibConnector : NSObject <NSCoding>
{
@private
id _source;
id _destination;
NSString *_label;
}
- (id)source;
- (void)setSource:(id)source;
- (id)destination;
- (void)setDestination:(id)destination;
- (NSString *)label;
- (void)setLabel:(NSString *)label;
- (void)replaceObject:(id)oldObject withObject:(id)newObject;
- (void)establishConnection;
@end

View File

@ -0,0 +1,5 @@
#import <AppKit/NSNibConnector.h>
@interface NSNibControlConnector : NSNibConnector
- (void)establishConnection;
@end

View File

@ -0,0 +1,7 @@
#ifndef IBOutlet
#define IBOutlet
#endif
#ifndef IBAction
#define IBAction void
#endif

21
src/AppKit/NSNibLoading.h Normal file
View File

@ -0,0 +1,21 @@
#import <Foundation/NSBundle.h>
@class NSString, NSDictionary;
@interface NSBundle(NSNibLoading)
- (BOOL)loadNibNamed:(NSString *)nibName owner:(id)owner topLevelObjects:(NSArray **)topLevelObjects;
@end
@interface NSObject (NSNibAwaking)
- (void)awakeFromNib;
@end
@interface NSBundle (NSNibLoadingDeprecated)
+ (BOOL)loadNibFile:(NSString *)fileName externalNameTable:(NSDictionary *)context withZone:(NSZone *)zone;
+ (BOOL)loadNibNamed:(NSString *)nibName owner:(id)owner;
- (BOOL)loadNibFile:(NSString *)fileName externalNameTable:(NSDictionary *)context withZone:(NSZone *)zone;
@end

View File

@ -0,0 +1,5 @@
#import <AppKit/NSNibConnector.h>
@interface NSNibOutletConnector : NSNibConnector
- (void)establishConnection;
@end

View File

@ -0,0 +1,80 @@
#import <AppKit/NSController.h>
#import <AppKit/NSUserInterfaceValidation.h>
@class NSArray, NSPredicate, NSManagedObjectContext, NSFetchRequest, NSError;
@interface NSObjectController : NSController {
@private
void *_reserved3;
id _managedProxy;
struct __objectControllerFlags {
unsigned int _editable:1;
unsigned int _automaticallyPreparesContent:1;
unsigned int _hasLoadedData:1;
unsigned int _explicitlyCannotAdd:1;
unsigned int _explicitlyCannotRemove:1;
unsigned int _isUsingManagedProxy:1;
unsigned int _hasFetched:1;
unsigned int _batches:1;
unsigned int _reservedObjectController:24;
} _objectControllerFlags;
NSString *_objectClassName;
Class _objectClass;
NSArray *_contentObjectArray;
@protected
id _content;
id _objectHandler;
}
- (id)initWithContent:(id)content;
- (void)setContent:(id)content;
- (id)content;
- (id)selection;
- (NSArray *)selectedObjects;
- (void)setAutomaticallyPreparesContent:(BOOL)flag;
- (BOOL)automaticallyPreparesContent;
- (void)prepareContent;
- (void)setObjectClass:(Class)objectClass;
- (Class)objectClass;
- (id)newObject;
- (void)addObject:(id)object;
- (void)removeObject:(id)object;
- (void)setEditable:(BOOL)flag;
- (BOOL)isEditable;
- (void)add:(id)sender;
- (BOOL)canAdd;
- (void)remove:(id)sender;
- (BOOL)canRemove;
- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item;
@end
@interface NSObjectController (NSManagedController)
- (NSManagedObjectContext *)managedObjectContext;
- (void)setManagedObjectContext:(NSManagedObjectContext *)managedObjectContext;
- (NSString *)entityName;
- (void)setEntityName:(NSString *)entityName;
- (NSPredicate *)fetchPredicate;
- (void)setFetchPredicate:(NSPredicate *)predicate;
- (BOOL)fetchWithRequest:(NSFetchRequest *)fetchRequest merge:(BOOL)merge error:(NSError **)error;
- (void)fetch:(id)sender;
- (void)setUsesLazyFetching:(BOOL)enabled;
- (BOOL)usesLazyFetching;
- (NSFetchRequest *)defaultFetchRequest;
@end

229
src/AppKit/NSOpenGL.h Normal file
View File

@ -0,0 +1,229 @@
#import <Foundation/NSObject.h>
#import <OpenGL/gltypes.h>
@class NSData, NSView, NSScreen;
#define NSOPENGL_CURRENT_VERSION 1
typedef enum {
NSOpenGLGOFormatCacheSize = 501,
NSOpenGLGOClearFormatCache = 502,
NSOpenGLGORetainRenderers = 503,
NSOpenGLGOUseBuildCache = 506,
NSOpenGLGOResetLibrary = 504
} NSOpenGLGlobalOption;
extern void NSOpenGLSetOption(NSOpenGLGlobalOption pname, GLint param);
extern void NSOpenGLGetOption(NSOpenGLGlobalOption pname, GLint *param);
extern void NSOpenGLGetVersion(GLint *major, GLint *minor);
enum {
NSOpenGLPFAAllRenderers = 1,
NSOpenGLPFATripleBuffer = 3,
NSOpenGLPFADoubleBuffer = 5,
NSOpenGLPFAStereo = 6,
NSOpenGLPFAAuxBuffers = 7,
NSOpenGLPFAColorSize = 8,
NSOpenGLPFAAlphaSize = 11,
NSOpenGLPFADepthSize = 12,
NSOpenGLPFAStencilSize = 13,
NSOpenGLPFAAccumSize = 14,
NSOpenGLPFAMinimumPolicy = 51,
NSOpenGLPFAMaximumPolicy = 52,
NSOpenGLPFAOffScreen = 53,
NSOpenGLPFAFullScreen = 54,
NSOpenGLPFASampleBuffers = 55,
NSOpenGLPFASamples = 56,
NSOpenGLPFAAuxDepthStencil = 57,
NSOpenGLPFAColorFloat = 58,
NSOpenGLPFAMultisample = 59,
NSOpenGLPFASupersample = 60,
NSOpenGLPFASampleAlpha = 61,
NSOpenGLPFARendererID = 70,
NSOpenGLPFASingleRenderer = 71,
NSOpenGLPFANoRecovery = 72,
NSOpenGLPFAAccelerated = 73,
NSOpenGLPFAClosestPolicy = 74,
NSOpenGLPFABackingStore = 76,
NSOpenGLPFAWindow = 80,
NSOpenGLPFACompliant = 83,
NSOpenGLPFAScreenMask = 84,
NSOpenGLPFAPixelBuffer = 90,
NSOpenGLPFARemotePixelBuffer = 91,
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
NSOpenGLPFAAllowOfflineRenderers = 96,
#endif
NSOpenGLPFAAcceleratedCompute = 97,
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
NSOpenGLPFAOpenGLProfile = 99,
#endif
NSOpenGLPFAVirtualScreenCount = 128,
NSOpenGLPFARobust = 75,
NSOpenGLPFAMPSafe = 78,
NSOpenGLPFAMultiScreen = 81
};
typedef uint32_t NSOpenGLPixelFormatAttribute;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
enum {
NSOpenGLProfileVersionLegacy = 0x1000,
NSOpenGLProfileVersion3_2Core = 0x3200
};
#endif
typedef struct _CGLPixelFormatObject NSOpenGLPixelFormatAuxiliary;
@interface NSOpenGLPixelFormat : NSObject <NSCoding>
{
@private
NSOpenGLPixelFormatAuxiliary* _pixelFormatAuxiliary;
NSData* _pixelAttributes;
NSInteger _reserved1;
NSInteger _reserved2;
NSInteger _reserved3;
}
- (id)initWithAttributes:(const NSOpenGLPixelFormatAttribute *)attribs;
- (id)initWithData:(NSData*)attribs;
- (id)initWithCGLPixelFormatObj:(void *)format;
- (NSData*)attributes;
- (void)setAttributes:(NSData*)attribs;
- (void)getValues:(GLint *)vals forAttribute:(NSOpenGLPixelFormatAttribute)attrib forVirtualScreen:(GLint)screen;
- (GLint)numberOfVirtualScreens;
- (void *)CGLPixelFormatObj ;
@end
@interface NSOpenGLPixelBuffer : NSObject
{
@private
struct _CGLPBufferObject *_pixelBufferAuxiliary;
void *_reserved1;
void *_reserved2;
}
- (id)initWithTextureTarget:(GLenum)target textureInternalFormat:(GLenum)format textureMaxMipMapLevel:(GLint)maxLevel pixelsWide:(GLsizei)pixelsWide pixelsHigh:(GLsizei)pixelsHigh;
- (id)initWithCGLPBufferObj:(void *)pbuffer;
- (void *)CGLPBufferObj ;
- (GLsizei)pixelsWide;
- (GLsizei)pixelsHigh;
- (GLenum)textureTarget;
- (GLenum)textureInternalFormat;
- (GLint)textureMaxMipMapLevel;
@end
typedef enum {
NSOpenGLCPSwapInterval = 222,
NSOpenGLCPSurfaceOrder = 235,
NSOpenGLCPSurfaceOpacity = 236,
NSOpenGLCPSurfaceBackingSize = 304,
NSOpenGLCPReclaimResources = 308,
NSOpenGLCPCurrentRendererID = 309,
NSOpenGLCPGPUVertexProcessing = 310,
NSOpenGLCPGPUFragmentProcessing = 311,
NSOpenGLCPHasDrawable = 314,
NSOpenGLCPMPSwapsInFlight = 315,
NSOpenGLCPSwapRectangle = 200,
NSOpenGLCPSwapRectangleEnable = 201,
NSOpenGLCPRasterizationEnable = 221,
NSOpenGLCPStateValidation = 301,
NSOpenGLCPSurfaceSurfaceVolatile = 306
} NSOpenGLContextParameter;
typedef struct _CGLContextObject NSOpenGLContextAuxiliary;
@interface NSOpenGLContext : NSObject
{
@private
__weak NSView *_view;
NSOpenGLContextAuxiliary *_contextAuxiliary;
}
- (id)initWithFormat:(NSOpenGLPixelFormat *)format shareContext:(NSOpenGLContext *)share;
- (id)initWithCGLContextObj:(void *)context;
- (void)setView:(NSView *)view;
- (NSView *)view;
- (void)setFullScreen;
- (void)setOffScreen:(void *)baseaddr width:(GLsizei)width height:(GLsizei)height rowbytes:(GLint)rowbytes;
- (void)clearDrawable;
- (void)update;
- (void)flushBuffer;
- (void)makeCurrentContext;
+ (void)clearCurrentContext;
+ (NSOpenGLContext *)currentContext;
- (void)copyAttributesFromContext:(NSOpenGLContext *)context withMask:(GLbitfield)mask;
- (void)setValues:(const GLint *)vals forParameter:(NSOpenGLContextParameter)param;
- (void)getValues:(GLint *)vals forParameter:(NSOpenGLContextParameter)param;
- (void)setCurrentVirtualScreen:(GLint)screen;
- (GLint)currentVirtualScreen;
- (void)createTexture:(GLenum)target fromView:(NSView *)view internalFormat:(GLenum)format;
- (void *)CGLContextObj ;
- (void)setPixelBuffer:(NSOpenGLPixelBuffer *)pixelBuffer cubeMapFace:(GLenum)face mipMapLevel:(GLint)level currentVirtualScreen:(GLint)screen;
- (NSOpenGLPixelBuffer *)pixelBuffer;
- (GLenum)pixelBufferCubeMapFace;
- (GLint)pixelBufferMipMapLevel;
- (void)setTextureImageToPixelBuffer:(NSOpenGLPixelBuffer *)pixelBuffer colorBuffer:(GLenum)source;
@end

View File

@ -0,0 +1,43 @@
#import <AppKit/NSView.h>
#import <AppKit/NSOpenGL.h>
#import <QuartzCore/CAOpenGLLayer.h>
@interface NSOpenGLLayer : CAOpenGLLayer
{
@private
NSOpenGLPixelFormat *_openGLPixelFormat;
NSOpenGLContext *_openGLContext;
void *_reserved[5];
}
@property(assign) NSView *view;
@property(retain) NSOpenGLPixelFormat *openGLPixelFormat;
@property(retain) NSOpenGLContext *openGLContext;
- (NSOpenGLPixelFormat *)openGLPixelFormatForDisplayMask:(uint32_t)mask;
- (NSOpenGLContext *)openGLContextForPixelFormat:(NSOpenGLPixelFormat *)pixelFormat;
- (BOOL)canDrawInOpenGLContext:(NSOpenGLContext *)context pixelFormat:(NSOpenGLPixelFormat *)pixelFormat forLayerTime:(CFTimeInterval)t displayTime:(const CVTimeStamp *)ts;
- (void)drawInOpenGLContext:(NSOpenGLContext *)context pixelFormat:(NSOpenGLPixelFormat *)pixelFormat forLayerTime:(CFTimeInterval)t displayTime:(const CVTimeStamp *)ts;
@end

35
src/AppKit/NSOpenGLView.h Normal file
View File

@ -0,0 +1,35 @@
#import <AppKit/NSView.h>
@class NSOpenGLContext, NSOpenGLPixelFormat;
@interface NSOpenGLView : NSView {
@private
NSOpenGLContext* _openGLContext;
NSOpenGLPixelFormat* _pixelFormat;
NSInteger _reserved1;
NSInteger _reserved2;
NSInteger _reserved3;
}
+ (NSOpenGLPixelFormat*)defaultPixelFormat;
- (id)initWithFrame:(NSRect)frameRect pixelFormat:(NSOpenGLPixelFormat*)format;
- (void)setOpenGLContext:(NSOpenGLContext*)context;
- (NSOpenGLContext*)openGLContext;
- (void)clearGLContext;
- (void)update;
- (void)reshape;
- (void)setPixelFormat:(NSOpenGLPixelFormat*)pixelFormat;
- (NSOpenGLPixelFormat*)pixelFormat;
- (void)prepareOpenGL;
@end
@interface NSView (NSOpenGLSurfaceResolution)
- (BOOL)wantsBestResolutionOpenGLSurface;
- (void)setWantsBestResolutionOpenGLSurface:(BOOL)flag;
@end

61
src/AppKit/NSOpenPanel.h Normal file
View File

@ -0,0 +1,61 @@
#import <AppKit/NSSavePanel.h>
@class NSArray;
@class NSString;
@class NSWindow;
@interface NSOpenPanel : NSSavePanel {
@private
char _reservedOpenPanel[4];
void *_privateOpenPanel;
}
+ (NSOpenPanel *)openPanel;
- (NSArray *)URLs;
- (BOOL)resolvesAliases;
- (void)setResolvesAliases:(BOOL)flag;
- (BOOL)canChooseDirectories;
- (void)setCanChooseDirectories:(BOOL)flag;
- (BOOL)allowsMultipleSelection;
- (void)setAllowsMultipleSelection:(BOOL)flag;
- (BOOL)canChooseFiles;
- (void)setCanChooseFiles:(BOOL)flag;
@end
@interface NSOpenPanel (NSDeprecated)
- (NSArray *)filenames;
- (void)beginSheetForDirectory:(NSString *)path file:(NSString *)name types:(NSArray *)fileTypes modalForWindow:(NSWindow *)docWindow modalDelegate:(id)delegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo;
- (void)beginForDirectory:(NSString *)path file:(NSString *)name types:(NSArray *)fileTypes modelessDelegate:(id)delegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo;
- (NSInteger)runModalForDirectory:(NSString *)path file:(NSString *)name types:(NSArray *)fileTypes;
- (NSInteger)runModalForTypes:(NSArray *)fileTypes;
@end

453
src/AppKit/NSOutlineView.h Normal file
View File

@ -0,0 +1,453 @@
#import <AppKit/NSTableView.h>
#import <AppKit/AppKitDefines.h>
#import <CoreFoundation/CFDictionary.h>
@class NSButtonCell;
@class NSTableView;
@class NSTableHeaderView;
@class NSTableColumn;
@class NSMouseTracker;
@class NSNotification;
@class NSString;
@protocol NSOutlineViewDelegate, NSOutlineViewDataSource;
typedef struct __OvFlags {
#ifdef __BIG_ENDIAN__
unsigned int delegateWillDisplayCell:1;
unsigned int delegateShouldEditTableColumn:1;
unsigned int delegateShouldSelectItem:1;
unsigned int delegateShouldSelectTableColumn:1;
unsigned int delegateSelectionShouldChangeInOutlineView:1;
unsigned int delegateShouldCollapseItem:1;
unsigned int delegateShouldExpandItem:1;
unsigned int autoresizesOutlineColumn:1;
unsigned int autoSaveExpandItems:1;
unsigned int enableExpandNotifications:1;
unsigned int delegateWillDisplayOutlineCell:1;
unsigned int subclassRowForItem:1;
unsigned int selectionAdjustmentDisabled:1;
unsigned int autoExpandFlashState:1;
unsigned int animateExpandAndCollapse:1;
unsigned int delegateHeightOfRowByItem:1;
unsigned int delayRowEntryFreeDisabled:1;
unsigned int numberOfRowsDataExpandEntered:1;
unsigned int validDataSourceMethods:1;
unsigned int reloadingData:1;
unsigned int dataSourceDraggingEndedAt:1;
unsigned int dataSourceDraggedImageMovedTo:1;
unsigned int delegateShouldShowOutlineCellForItem:1;
unsigned int delegateAutoExpandItem:1;
unsigned int delegateAutoCollapseItem:1;
unsigned int delegateShouldAutoExpandItem:1;
unsigned int flashingEntireRow:1;
unsigned int flashingOutlineCell:1;
unsigned int dontRedisplayOnFrameChange:1;
unsigned int allowAutomaticAnimations:1;
unsigned int dataSourceObjectValueByItem:1;
unsigned int allItemsLoaded:1;
#else
unsigned int allItemsLoaded:1;
unsigned int dataSourceObjectValueByItem:1;
unsigned int allowAutomaticAnimations:1;
unsigned int dontRedisplayOnFrameChange:1;
unsigned int flashingOutlineCell:1;
unsigned int flashingEntireRow:1;
unsigned int delegateShouldAutoExpandItem:1;
unsigned int delegateAutoCollapseItem:1;
unsigned int delegateAutoExpandItem:1;
unsigned int delegateShouldShowOutlineCellForItem:1;
unsigned int dataSourceDraggedImageMovedTo:1;
unsigned int dataSourceDraggingEndedAt:1;
unsigned int reloadingData:1;
unsigned int validDataSourceMethods:1;
unsigned int numberOfRowsDataExpandEntered:1;
unsigned int delayRowEntryFreeDisabled:1;
unsigned int delegateHeightOfRowByItem:1;
unsigned int animateExpandAndCollapse:1;
unsigned int autoExpandFlashState:1;
unsigned int selectionAdjustmentDisabled:1;
unsigned int subclassRowForItem:1;
unsigned int delegateWillDisplayOutlineCell:1;
unsigned int enableExpandNotifications:1;
unsigned int autoSaveExpandItems:1;
unsigned int autoresizesOutlineColumn:1;
unsigned int delegateShouldExpandItem:1;
unsigned int delegateShouldCollapseItem:1;
unsigned int delegateSelectionShouldChangeInOutlineView:1;
unsigned int delegateShouldSelectTableColumn:1;
unsigned int delegateShouldSelectItem:1;
unsigned int delegateShouldEditTableColumn:1;
unsigned int delegateWillDisplayCell:1;
#endif
} _OVFlags;
enum { NSOutlineViewDropOnItemIndex = -1 };
@class _NSOVRowEntry;
@interface NSOutlineView : NSTableView {
@private
NSInteger _numberOfRows;
_NSOVRowEntry *_rowEntryTree;
NSMapTable *_itemToEntryMap;
__strong CFMutableArrayRef _rowEntryArray;
NSInteger _firstRowIndexDrawn;
id _autoExpandTimerItem;
NSTableColumn *_outlineTableColumn;
BOOL _initedRows;
BOOL _indentationMarkerInCell;
NSInteger _indentationPerLevel;
NSButtonCell *_outlineCell;
NSRect _trackingOutlineFrame;
id _expandingItem;
NSInteger _unused;
_OVFlags _ovFlags;
id _ovLock;
__strong long *_indentArray;
long _originalWidth;
id _expandSet;
id _expandSetToExpandItemsInto;
long _indentArraySize;
NSButtonCell *_trackingOutlineCell;
NSInteger _trackingRow;
id _ovReserved;
}
- (void)setDelegate:(id <NSOutlineViewDelegate>)anObject;
- (id <NSOutlineViewDelegate>)delegate;
- (void)setDataSource:(id <NSOutlineViewDataSource>)aSource;
- (id <NSOutlineViewDataSource>)dataSource;
- (void)setOutlineTableColumn:(NSTableColumn *)outlineTableColumn;
- (NSTableColumn *)outlineTableColumn;
- (BOOL)isExpandable:(id)item;
- (void)expandItem:(id)item expandChildren:(BOOL)expandChildren;
- (void)expandItem:(id)item;
- (void)collapseItem:(id)item collapseChildren:(BOOL)collapseChildren;
- (void)collapseItem:(id)item;
- (void)reloadItem:(id)item reloadChildren:(BOOL)reloadChildren;
- (void)reloadItem:(id)item;
- (id)parentForItem:(id)item;
- (id)itemAtRow:(NSInteger)row;
- (NSInteger)rowForItem:(id)item;
- (NSInteger)levelForItem:(id)item;
- (NSInteger)levelForRow:(NSInteger)row;
- (BOOL)isItemExpanded:(id)item;
- (void)setIndentationPerLevel:(CGFloat)indentationPerLevel;
- (CGFloat)indentationPerLevel;
- (void)setIndentationMarkerFollowsCell:(BOOL)drawInCell;
- (BOOL)indentationMarkerFollowsCell;
- (void)setAutoresizesOutlineColumn:(BOOL)resize;
- (BOOL)autoresizesOutlineColumn;
- (NSRect)frameOfOutlineCellAtRow:(NSInteger)row;
- (void)setDropItem:(id)item dropChildIndex:(NSInteger)index;
- (BOOL)shouldCollapseAutoExpandedItemsForDeposited:(BOOL)deposited;
- (BOOL)autosaveExpandedItems;
- (void)setAutosaveExpandedItems:(BOOL)save;
- (void)insertItemsAtIndexes:(NSIndexSet *)indexes inParent:(id)parent withAnimation:(NSTableViewAnimationOptions)animationOptions;
- (void)removeItemsAtIndexes:(NSIndexSet *)indexes inParent:(id)parent withAnimation:(NSTableViewAnimationOptions)animationOptions;
- (void)moveItemAtIndex:(NSInteger)fromIndex inParent:(id)oldParent toIndex:(NSInteger)toIndex inParent:(id)newParent;
- (void)insertRowsAtIndexes:(NSIndexSet *)indexes withAnimation:(NSTableViewAnimationOptions)animationOptions UNAVAILABLE_ATTRIBUTE;
- (void)removeRowsAtIndexes:(NSIndexSet *)indexes withAnimation:(NSTableViewAnimationOptions)animationOptions UNAVAILABLE_ATTRIBUTE;
- (void)moveRowAtIndex:(NSInteger)oldIndex toIndex:(NSInteger)newIndex UNAVAILABLE_ATTRIBUTE;
@end
@protocol NSOutlineViewDataSource <NSObject>
@optional
- (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item;
- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item;
- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item;
- (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item;
- (void)outlineView:(NSOutlineView *)outlineView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn byItem:(id)item;
- (id)outlineView:(NSOutlineView *)outlineView itemForPersistentObject:(id)object;
- (id)outlineView:(NSOutlineView *)outlineView persistentObjectForItem:(id)item;
- (void)outlineView:(NSOutlineView *)outlineView sortDescriptorsDidChange:(NSArray *)oldDescriptors;
- (id <NSPasteboardWriting>)outlineView:(NSOutlineView *)outlineView pasteboardWriterForItem:(id)item;
- (void)outlineView:(NSOutlineView *)outlineView draggingSession:(NSDraggingSession *)session willBeginAtPoint:(NSPoint)screenPoint forItems:(NSArray *)draggedItems;
- (void)outlineView:(NSOutlineView *)outlineView draggingSession:(NSDraggingSession *)session endedAtPoint:(NSPoint)screenPoint operation:(NSDragOperation)operation;
- (BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray *)items toPasteboard:(NSPasteboard *)pasteboard;
- (void)outlineView:(NSOutlineView *)outlineView updateDraggingItemsForDrag:(id <NSDraggingInfo>)draggingInfo;
- (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id <NSDraggingInfo>)info proposedItem:(id)item proposedChildIndex:(NSInteger)index;
- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id <NSDraggingInfo>)info item:(id)item childIndex:(NSInteger)index;
- (NSArray *)outlineView:(NSOutlineView *)outlineView namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination forDraggedItems:(NSArray *)items;
@end
@protocol NSOutlineViewDelegate <NSControlTextEditingDelegate>
@optional
- (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item;
- (NSTableRowView *)outlineView:(NSOutlineView *)outlineView rowViewForItem:(id)item;
- (void)outlineView:(NSOutlineView *)outlineView didAddRowView:(NSTableRowView *)rowView forRow:(NSInteger)row;
- (void)outlineView:(NSOutlineView *)outlineView didRemoveRowView:(NSTableRowView *)rowView forRow:(NSInteger)row;
- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item;
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item;
- (BOOL)selectionShouldChangeInOutlineView:(NSOutlineView *)outlineView;
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item;
- (NSIndexSet *)outlineView:(NSOutlineView *)outlineView selectionIndexesForProposedSelection:(NSIndexSet *)proposedSelectionIndexes;
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectTableColumn:(NSTableColumn *)tableColumn;
- (void)outlineView:(NSOutlineView *)outlineView mouseDownInHeaderOfTableColumn:(NSTableColumn *)tableColumn;
- (void)outlineView:(NSOutlineView *)outlineView didClickTableColumn:(NSTableColumn *)tableColumn;
- (void)outlineView:(NSOutlineView *)outlineView didDragTableColumn:(NSTableColumn *)tableColumn;
- (NSString *)outlineView:(NSOutlineView *)outlineView toolTipForCell:(NSCell *)cell rect:(NSRectPointer)rect tableColumn:(NSTableColumn *)tableColumn item:(id)item mouseLocation:(NSPoint)mouseLocation;
- (CGFloat)outlineView:(NSOutlineView *)outlineView heightOfRowByItem:(id)item;
- (NSString *)outlineView:(NSOutlineView *)outlineView typeSelectStringForTableColumn:(NSTableColumn *)tableColumn item:(id)item;
- (id)outlineView:(NSOutlineView *)outlineView nextTypeSelectMatchFromItem:(id)startItem toItem:(id)endItem forString:(NSString *)searchString;
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldTypeSelectForEvent:(NSEvent *)event withCurrentSearchString:(NSString *)searchString;
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldShowCellExpansionForTableColumn:(NSTableColumn *)tableColumn item:(id)item;
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldTrackCell:(NSCell *)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item;
- (NSCell *)outlineView:(NSOutlineView *)outlineView dataCellForTableColumn:(NSTableColumn *)tableColumn item:(id)item;
- (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item;
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldExpandItem:(id)item;
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldCollapseItem:(id)item;
- (void)outlineView:(NSOutlineView *)outlineView willDisplayOutlineCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item;
- (CGFloat)outlineView:(NSOutlineView *)outlineView sizeToFitWidthOfColumn:(NSInteger)column;
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldReorderColumn:(NSInteger)columnIndex toColumn:(NSInteger)newColumnIndex;
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldShowOutlineCellForItem:(id)item;
- (void)outlineViewSelectionDidChange:(NSNotification *)notification;
- (void)outlineViewColumnDidMove:(NSNotification *)notification;
- (void)outlineViewColumnDidResize:(NSNotification *)notification;
- (void)outlineViewSelectionIsChanging:(NSNotification *)notification;
- (void)outlineViewItemWillExpand:(NSNotification *)notification;
- (void)outlineViewItemDidExpand:(NSNotification *)notification;
- (void)outlineViewItemWillCollapse:(NSNotification *)notification;
- (void)outlineViewItemDidCollapse:(NSNotification *)notification;
@end
EXTERN_C NSString *NSOutlineViewSelectionDidChangeNotification;
EXTERN_C NSString *NSOutlineViewColumnDidMoveNotification;
EXTERN_C NSString *NSOutlineViewColumnDidResizeNotification;
EXTERN_C NSString *NSOutlineViewSelectionIsChangingNotification;
EXTERN_C NSString *NSOutlineViewItemWillExpandNotification;
EXTERN_C NSString *NSOutlineViewItemDidExpandNotification;
EXTERN_C NSString *NSOutlineViewItemWillCollapseNotification;
EXTERN_C NSString *NSOutlineViewItemDidCollapseNotification;

View File

@ -0,0 +1,23 @@
#import <AppKit/NSImageRep.h>
@interface NSPDFImageRep : NSImageRep
{
@private
NSData* _pdfData;
int _reserved1;
int _reserved2;
id _private;
}
+ (id)imageRepWithData:(NSData*)pdfData;
- (id)initWithData:(NSData*)pdfData;
- (NSData*)PDFRepresentation;
- (NSRect)bounds;
- (void) setCurrentPage:(NSInteger)page;
- (NSInteger) currentPage;
- (NSInteger) pageCount;
@end

View File

@ -0,0 +1,25 @@
#import <AppKit/NSImageRep.h>
@interface NSPICTImageRep : NSImageRep
{
NSPoint _pictOrigin;
NSData* _pictData;
#if !__LP64__
unsigned int _reserved1;
unsigned int _reserved2;
#else
id _imageRep;
NSUInteger _pictOffset;
unsigned int _reserved1;
unsigned int _reserved2;
#endif
}
+ (id)imageRepWithData:(NSData*)pictData;
- (id)initWithData:(NSData*)pictData;
- (NSData*) PICTRepresentation;
- (NSRect) boundingBox;
@end

Some files were not shown because too many files have changed in this diff Show More