diff --git a/src/AppKit/AppKit b/src/AppKit/AppKit new file mode 120000 index 000000000..945c9b46d --- /dev/null +++ b/src/AppKit/AppKit @@ -0,0 +1 @@ +. \ No newline at end of file diff --git a/src/AppKit/AppKit.h b/src/AppKit/AppKit.h index e364f9f26..663ff69fe 100644 --- a/src/AppKit/AppKit.h +++ b/src/AppKit/AppKit.h @@ -1,20 +1,186 @@ -#ifndef APPKIT_H_ -#define APPKIT_H_ - -#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 - -#ifdef DARLING_BUILD -# define DEFINE_CONSTANT(name) NSString* name = @ #name -#endif - -#include "NSApplication.h" - -#endif +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/src/AppKit/AppKitDefines.h b/src/AppKit/AppKitDefines.h new file mode 100644 index 000000000..e902e005b --- /dev/null +++ b/src/AppKit/AppKitDefines.h @@ -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 + diff --git a/src/AppKit/AppKitErrors.h b/src/AppKit/AppKitErrors.h new file mode 100644 index 000000000..0339327ec --- /dev/null +++ b/src/AppKit/AppKitErrors.h @@ -0,0 +1,25 @@ +#import + + + + +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 +}; diff --git a/src/AppKit/NSATSTypesetter.h b/src/AppKit/NSATSTypesetter.h new file mode 100644 index 000000000..21cc9226e --- /dev/null +++ b/src/AppKit/NSATSTypesetter.h @@ -0,0 +1,130 @@ +#import +#import + + +@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 diff --git a/src/AppKit/NSAccessibility.h b/src/AppKit/NSAccessibility.h new file mode 100644 index 000000000..6d5bd4709 --- /dev/null +++ b/src/AppKit/NSAccessibility.h @@ -0,0 +1,515 @@ +#import +#import +#import +#import + +@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; diff --git a/src/AppKit/NSActionCell.h b/src/AppKit/NSActionCell.h new file mode 100644 index 000000000..99b615255 --- /dev/null +++ b/src/AppKit/NSActionCell.h @@ -0,0 +1,19 @@ +#import + +@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 diff --git a/src/AppKit/NSAffineTransform.h b/src/AppKit/NSAffineTransform.h new file mode 100644 index 000000000..30b8c5e4c --- /dev/null +++ b/src/AppKit/NSAffineTransform.h @@ -0,0 +1,12 @@ +#import + +@class NSBezierPath; + +@interface NSAffineTransform (NSAppKitAdditons) + +- (NSBezierPath *)transformBezierPath:(NSBezierPath *)aPath; + + +- (void)set; +- (void)concat; +@end diff --git a/src/AppKit/NSAlert.h b/src/AppKit/NSAlert.h new file mode 100644 index 000000000..216a695ef --- /dev/null +++ b/src/AppKit/NSAlert.h @@ -0,0 +1,137 @@ +#import +#import +@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 )delegate; +- (id )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 +@optional + + +- (BOOL)alertShowHelp:(NSAlert *)alert; +@end diff --git a/src/AppKit/NSAnimation.h b/src/AppKit/NSAnimation.h new file mode 100644 index 000000000..e49ea4623 --- /dev/null +++ b/src/AppKit/NSAnimation.h @@ -0,0 +1,169 @@ +#import +#import + + +@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 { + @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 )delegate; +- (id )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 +@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; diff --git a/src/AppKit/NSAnimationContext.h b/src/AppKit/NSAnimationContext.h new file mode 100644 index 000000000..b03f2c3ef --- /dev/null +++ b/src/AppKit/NSAnimationContext.h @@ -0,0 +1,35 @@ +#import +#import +#import + +@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 diff --git a/src/AppKit/NSApplication.h b/src/AppKit/NSApplication.h index f57fea830..f236e5ca2 100644 --- a/src/AppKit/NSApplication.h +++ b/src/AppKit/NSApplication.h @@ -1,9 +1,5 @@ #ifndef NSAPPLICATION_H #define NSAPPLICATION_H -#include "AppKit.h" -#include "NSResponder.h" -#include "NSApplicationDelegate.h" - #ifdef DARLING_BUILD # include # include @@ -12,6 +8,10 @@ class NSApplicationEventFilter; #endif +#include "NSResponder.h" +#include "NSApplicationDelegate.h" +#include "AppKitDefines.h" + @class NSEvent; @interface NSApplication : NSResponder @@ -90,5 +90,39 @@ extern NSString *NSApplicationDidChangeScreenParametersNotification; 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 diff --git a/src/AppKit/NSApplicationScripting.h b/src/AppKit/NSApplicationScripting.h new file mode 100644 index 000000000..fb27155da --- /dev/null +++ b/src/AppKit/NSApplicationScripting.h @@ -0,0 +1,18 @@ +#import + +@interface NSApplication(NSScripting) + + +- (NSArray *)orderedDocuments; + + +- (NSArray *)orderedWindows; + +@end + +@interface NSObject(NSApplicationScriptingDelegation) + + +- (BOOL)application:(NSApplication *)sender delegateHandlesKey:(NSString *)key; + +@end diff --git a/src/AppKit/NSArrayController.h b/src/AppKit/NSArrayController.h new file mode 100644 index 000000000..f664acc5a --- /dev/null +++ b/src/AppKit/NSArrayController.h @@ -0,0 +1,104 @@ +#import +#import + + +@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 diff --git a/src/AppKit/NSAttributedString.h b/src/AppKit/NSAttributedString.h new file mode 100644 index 000000000..5c61d5c34 --- /dev/null +++ b/src/AppKit/NSAttributedString.h @@ -0,0 +1,296 @@ +#import +#import +#import +#import +#import +@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) + + + +- (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; diff --git a/src/AppKit/NSBezierPath.h b/src/AppKit/NSBezierPath.h new file mode 100644 index 000000000..0f3912068 --- /dev/null +++ b/src/AppKit/NSBezierPath.h @@ -0,0 +1,197 @@ +#import +#import +#import + +@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 +{ + @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 diff --git a/src/AppKit/NSBitmapImageRep.h b/src/AppKit/NSBitmapImageRep.h new file mode 100644 index 000000000..5877f1d73 --- /dev/null +++ b/src/AppKit/NSBitmapImageRep.h @@ -0,0 +1,154 @@ +#import + +@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 diff --git a/src/AppKit/NSBox.h b/src/AppKit/NSBox.h new file mode 100644 index 000000000..5674f440a --- /dev/null +++ b/src/AppKit/NSBox.h @@ -0,0 +1,98 @@ +#import + +@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 diff --git a/src/AppKit/NSBrowser.h b/src/AppKit/NSBrowser.h new file mode 100644 index 000000000..abefb048a --- /dev/null +++ b/src/AppKit/NSBrowser.h @@ -0,0 +1,587 @@ +#import +#import +#import + +#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 )anObject; +- (id )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 +@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 )info proposedRow:(NSInteger *)row column:(NSInteger *)column dropOperation:(NSBrowserDropOperation *)dropOperation; + + + +- (BOOL)browser:(NSBrowser *)browser acceptDrop:(id )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 diff --git a/src/AppKit/NSBrowserCell.h b/src/AppKit/NSBrowserCell.h new file mode 100644 index 000000000..0c011f6e8 --- /dev/null +++ b/src/AppKit/NSBrowserCell.h @@ -0,0 +1,23 @@ +#import + +@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 diff --git a/src/AppKit/NSButton.h b/src/AppKit/NSButton.h new file mode 100644 index 000000000..aac9fce77 --- /dev/null +++ b/src/AppKit/NSButton.h @@ -0,0 +1,72 @@ +#import +#import +#import + +@class NSSound; + +@interface NSButton : NSControl + +- (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 diff --git a/src/AppKit/NSButtonCell.h b/src/AppKit/NSButtonCell.h new file mode 100644 index 000000000..0d229f398 --- /dev/null +++ b/src/AppKit/NSButtonCell.h @@ -0,0 +1,245 @@ +#import + +@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 diff --git a/src/AppKit/NSCIImageRep.h b/src/AppKit/NSCIImageRep.h new file mode 100644 index 000000000..9b91a0d90 --- /dev/null +++ b/src/AppKit/NSCIImageRep.h @@ -0,0 +1,22 @@ +#import +#import + +@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 diff --git a/src/AppKit/NSCachedImageRep.h b/src/AppKit/NSCachedImageRep.h new file mode 100644 index 000000000..2da39e73e --- /dev/null +++ b/src/AppKit/NSCachedImageRep.h @@ -0,0 +1,23 @@ +#import +#import + +@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 diff --git a/src/AppKit/NSCell.h b/src/AppKit/NSCell.h new file mode 100644 index 000000000..214a584c0 --- /dev/null +++ b/src/AppKit/NSCell.h @@ -0,0 +1,437 @@ +#import +#import +#import +#import +#import +#import + +@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 +{ + + 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 )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); diff --git a/src/AppKit/NSClipView.h b/src/AppKit/NSClipView.h new file mode 100644 index 000000000..1447a2c38 --- /dev/null +++ b/src/AppKit/NSClipView.h @@ -0,0 +1,64 @@ +#import + +@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 diff --git a/src/AppKit/NSCollectionView.h b/src/AppKit/NSCollectionView.h new file mode 100644 index 000000000..6ebad8176 --- /dev/null +++ b/src/AppKit/NSCollectionView.h @@ -0,0 +1,211 @@ +#import +#import +#import + + +@class NSCollectionView, NSImageView, NSIndexSet, NSMutableIndexSet, NSNib, NSTextField; +@protocol NSCollectionViewDelegate; + +typedef NSInteger NSCollectionViewDropOperation; + + +@interface NSCollectionViewItem : NSViewController { +@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 { +@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 )aDelegate; +- (id )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 +@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 )draggingInfo proposedIndex:(NSInteger *)proposedDropIndex dropOperation:(NSCollectionViewDropOperation *)proposedDropOperation; + + + + + +- (BOOL)collectionView:(NSCollectionView *)collectionView acceptDrop:(id )draggingInfo index:(NSInteger)index dropOperation:(NSCollectionViewDropOperation)dropOperation; + + + + + + +- (id )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 )draggingInfo; + +@end diff --git a/src/AppKit/NSColor.h b/src/AppKit/NSColor.h new file mode 100644 index 000000000..845e362ec --- /dev/null +++ b/src/AppKit/NSColor.h @@ -0,0 +1,256 @@ +#import +#import +#import +#import +#import + +@class NSDictionary, NSImage, NSColorSpace; +@class CIColor; + +typedef void* CGColorRef; +typedef void* CGColorSpaceRef; + +#define NSAppKitVersionNumberWithPatternColorLeakFix 641.0 + + + +@interface NSColor : NSObject + + + ++ (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; diff --git a/src/AppKit/NSColorList.h b/src/AppKit/NSColorList.h new file mode 100644 index 000000000..6fe8e61e3 --- /dev/null +++ b/src/AppKit/NSColorList.h @@ -0,0 +1,84 @@ +#import +#import +#import + +@class NSArray, NSMutableArray, NSColor, NSBundle; + +@interface NSColorList : NSObject { + + 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; diff --git a/src/AppKit/NSColorPanel.h b/src/AppKit/NSColorPanel.h new file mode 100644 index 000000000..60cf9dc01 --- /dev/null +++ b/src/AppKit/NSColorPanel.h @@ -0,0 +1,105 @@ +#import +#import + +@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; diff --git a/src/AppKit/NSColorPicker.h b/src/AppKit/NSColorPicker.h new file mode 100644 index 000000000..6161f529d --- /dev/null +++ b/src/AppKit/NSColorPicker.h @@ -0,0 +1,22 @@ +#import + +@interface NSColorPicker : NSObject +{ + + 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 diff --git a/src/AppKit/NSColorPicking.h b/src/AppKit/NSColorPicking.h new file mode 100644 index 000000000..e54ef8599 --- /dev/null +++ b/src/AppKit/NSColorPicking.h @@ -0,0 +1,50 @@ +#import +#import + +@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 + + + +- (BOOL)supportsMode:(NSColorPanelMode)mode; + + + +- (NSColorPanelMode)currentMode; + + + +- (NSView *)provideNewView:(BOOL)initialRequest; + + + +- (void)setColor:(NSColor *)newColor; +@end diff --git a/src/AppKit/NSColorSpace.h b/src/AppKit/NSColorSpace.h new file mode 100644 index 000000000..5da0fb6b1 --- /dev/null +++ b/src/AppKit/NSColorSpace.h @@ -0,0 +1,72 @@ +#import +#import + +@class NSData, NSArray; + + + +enum { + NSUnknownColorSpaceModel = -1, + NSGrayColorSpaceModel, + NSRGBColorSpaceModel, + NSCMYKColorSpaceModel, + NSLABColorSpaceModel, + NSDeviceNColorSpaceModel, + NSIndexedColorSpaceModel, + NSPatternColorSpaceModel +}; +typedef NSInteger NSColorSpaceModel; + + + +@interface NSColorSpace : NSObject { + 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 diff --git a/src/AppKit/NSColorWell.h b/src/AppKit/NSColorWell.h new file mode 100644 index 000000000..24acdc4ed --- /dev/null +++ b/src/AppKit/NSColorWell.h @@ -0,0 +1,32 @@ +#import + +@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 diff --git a/src/AppKit/NSComboBox.h b/src/AppKit/NSComboBox.h new file mode 100644 index 000000000..1498c21bb --- /dev/null +++ b/src/AppKit/NSComboBox.h @@ -0,0 +1,85 @@ +#import + +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 )delegate; +- (void)setDelegate:(id )anObject; + + +- (id )dataSource; +- (void)setDataSource:(id )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 +@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 +@optional + + +- (void)comboBoxWillPopUp:(NSNotification *)notification; +- (void)comboBoxWillDismiss:(NSNotification *)notification; +- (void)comboBoxSelectionDidChange:(NSNotification *)notification; +- (void)comboBoxSelectionIsChanging:(NSNotification *)notification; + +@end diff --git a/src/AppKit/NSComboBoxCell.h b/src/AppKit/NSComboBoxCell.h new file mode 100644 index 000000000..f3dc8d720 --- /dev/null +++ b/src/AppKit/NSComboBoxCell.h @@ -0,0 +1,87 @@ +#import + +@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 )dataSource; +- (void)setDataSource:(id )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 +@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 diff --git a/src/AppKit/NSControl.h b/src/AppKit/NSControl.h new file mode 100644 index 000000000..2ad44c20e --- /dev/null +++ b/src/AppKit/NSControl.h @@ -0,0 +1,144 @@ +#import +#import + +@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)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 +@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 diff --git a/src/AppKit/NSController.h b/src/AppKit/NSController.h new file mode 100644 index 000000000..0a9d1bfef --- /dev/null +++ b/src/AppKit/NSController.h @@ -0,0 +1,39 @@ +#import +#import + + +@class NSMutableArray, NSMutableDictionary, NSMutableSet; + +@interface NSController : NSObject { +@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 diff --git a/src/AppKit/NSCursor.h b/src/AppKit/NSCursor.h new file mode 100644 index 000000000..0a02fa8a7 --- /dev/null +++ b/src/AppKit/NSCursor.h @@ -0,0 +1,71 @@ +#import +#import + +@class NSColor, NSEvent, NSImage; + +#define NSAppKitVersionNumberWithCursorSizeSupport 682.0 + +@interface NSCursor : NSObject { + + 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 diff --git a/src/AppKit/NSCustomImageRep.h b/src/AppKit/NSCustomImageRep.h new file mode 100644 index 000000000..0a51af077 --- /dev/null +++ b/src/AppKit/NSCustomImageRep.h @@ -0,0 +1,17 @@ +#import + +@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 diff --git a/src/AppKit/NSDatePicker.h b/src/AppKit/NSDatePicker.h new file mode 100644 index 000000000..d56a5ce93 --- /dev/null +++ b/src/AppKit/NSDatePicker.h @@ -0,0 +1,71 @@ +#import +#import + + +@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 )delegate; +- (void)setDelegate:(id )anObject; + +@end diff --git a/src/AppKit/NSDatePickerCell.h b/src/AppKit/NSDatePickerCell.h new file mode 100644 index 000000000..c338abdc6 --- /dev/null +++ b/src/AppKit/NSDatePickerCell.h @@ -0,0 +1,124 @@ +#import +#import + + +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 )delegate; +- (void)setDelegate:(id )anObject; + +@end + +@protocol NSDatePickerCellDelegate +@optional +- (void)datePickerCell:(NSDatePickerCell *)aDatePickerCell validateProposedDateValue:(NSDate **)proposedDateValue timeInterval:(NSTimeInterval *)proposedTimeInterval; +@end diff --git a/src/AppKit/NSDictionaryController.h b/src/AppKit/NSDictionaryController.h new file mode 100644 index 000000000..4279ebe40 --- /dev/null +++ b/src/AppKit/NSDictionaryController.h @@ -0,0 +1,64 @@ +#import + + +@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 diff --git a/src/AppKit/NSDockTile.h b/src/AppKit/NSDockTile.h new file mode 100644 index 000000000..df6403653 --- /dev/null +++ b/src/AppKit/NSDockTile.h @@ -0,0 +1,72 @@ +#import +#import +#import + +#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 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + +@required +- (void)setDockTile:(NSDockTile*)dockTile; + +@optional +- (NSMenu*)dockMenu; +#endif +@end diff --git a/src/AppKit/NSDocument.h b/src/AppKit/NSDocument.h new file mode 100644 index 000000000..96230ac90 --- /dev/null +++ b/src/AppKit/NSDocument.h @@ -0,0 +1,722 @@ +#import +#import +//#import + +@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 { + @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 )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 diff --git a/src/AppKit/NSDocumentController.h b/src/AppKit/NSDocumentController.h new file mode 100644 index 000000000..df0b5b212 --- /dev/null +++ b/src/AppKit/NSDocumentController.h @@ -0,0 +1,245 @@ +#import +#import +#import + +@class NSArray, NSDocument, NSError, NSMenuItem, NSMutableDictionary, NSOpenPanel, NSURL, NSWindow; + +@interface NSDocumentController : NSObject { + @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 )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 diff --git a/src/AppKit/NSDocumentScripting.h b/src/AppKit/NSDocumentScripting.h new file mode 100644 index 000000000..da9faeabf --- /dev/null +++ b/src/AppKit/NSDocumentScripting.h @@ -0,0 +1,19 @@ +#import + +@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 diff --git a/src/AppKit/NSDragging.h b/src/AppKit/NSDragging.h new file mode 100644 index 000000000..baac8c865 --- /dev/null +++ b/src/AppKit/NSDragging.h @@ -0,0 +1,152 @@ +#import +#import +#import +#import + +@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 +@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 +@optional +- (NSDragOperation)draggingEntered:(id )sender; +- (NSDragOperation)draggingUpdated:(id )sender; +- (void)draggingExited:(id )sender; +- (BOOL)prepareForDragOperation:(id )sender; +- (BOOL)performDragOperation:(id )sender; +- (void)concludeDragOperation:(id )sender; + +- (void)draggingEnded:(id )sender; + +- (BOOL)wantsPeriodicDraggingUpdates; + + + +- (void)updateDraggingItemsForDrag:(id )sender; +@end + + +@protocol NSDraggingSource + + + +@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 diff --git a/src/AppKit/NSDraggingItem.h b/src/AppKit/NSDraggingItem.h new file mode 100644 index 000000000..b823a0028 --- /dev/null +++ b/src/AppKit/NSDraggingItem.h @@ -0,0 +1,76 @@ +#import +#import +#import + +@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 ) 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 diff --git a/src/AppKit/NSDraggingSession.h b/src/AppKit/NSDraggingSession.h new file mode 100644 index 000000000..af274bd72 --- /dev/null +++ b/src/AppKit/NSDraggingSession.h @@ -0,0 +1,61 @@ +#import +#import +#import + +@class NSPasteboard, NSImage, NSDraggingItem; +@protocol NSDraggingSource, NSPasteboardWriting; + + +@interface NSDraggingSession : NSObject { +@private + void *_private; + NSPoint _dragLocation; + NSPoint _offset; + id _source; + id _alternateDragSource; + id _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 diff --git a/src/AppKit/NSDrawer.h b/src/AppKit/NSDrawer.h new file mode 100644 index 000000000..710dd9640 --- /dev/null +++ b/src/AppKit/NSDrawer.h @@ -0,0 +1,110 @@ +#import +#import +#import +#import +#import +#import +#import + +@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 )anObject; +- (id )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 +@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; diff --git a/src/AppKit/NSEPSImageRep.h b/src/AppKit/NSEPSImageRep.h new file mode 100644 index 000000000..c56c1ee85 --- /dev/null +++ b/src/AppKit/NSEPSImageRep.h @@ -0,0 +1,21 @@ +#import + +@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 diff --git a/src/AppKit/NSErrors.h b/src/AppKit/NSErrors.h new file mode 100644 index 000000000..8debdd86f --- /dev/null +++ b/src/AppKit/NSErrors.h @@ -0,0 +1,42 @@ +#import + +@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; diff --git a/src/AppKit/NSEvent.h b/src/AppKit/NSEvent.h index e7ed72f83..7eb13accc 100644 --- a/src/AppKit/NSEvent.h +++ b/src/AppKit/NSEvent.h @@ -153,4 +153,12 @@ enum { }; inline NSUInteger NSEventMaskFromType(NSEventType type) { return (1 << type); }; +enum { + NSEventGestureAxisNone = 0, + NSEventGestureAxisHorizontal, + NSEventGestureAxisVertical +}; +typedef NSInteger NSEventGestureAxis; + + #endif diff --git a/src/AppKit/NSFont.h b/src/AppKit/NSFont.h new file mode 100644 index 000000000..a2671bbd3 --- /dev/null +++ b/src/AppKit/NSFont.h @@ -0,0 +1,232 @@ +#import +#import +#import +#import + +@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 { + + 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 diff --git a/src/AppKit/NSFontCollection.h b/src/AppKit/NSFontCollection.h new file mode 100644 index 000000000..5cae5eee0 --- /dev/null +++ b/src/AppKit/NSFontCollection.h @@ -0,0 +1,143 @@ +#import +#import +#import +#import +#import +#import + + +@class NSFontDescriptor; + + + + +enum { + + NSFontCollectionVisibilityProcess = (1UL << 0), + + + NSFontCollectionVisibilityUser = (1UL << 1), + + + NSFontCollectionVisibilityComputer = (1UL << 2) +}; +typedef NSUInteger NSFontCollectionVisibility; + + + + + + +@interface NSFontCollection : NSObject + + + + + ++ (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; diff --git a/src/AppKit/NSFontDescriptor.h b/src/AppKit/NSFontDescriptor.h new file mode 100644 index 000000000..2b19f1910 --- /dev/null +++ b/src/AppKit/NSFontDescriptor.h @@ -0,0 +1,150 @@ +#import +#import +#import +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 { + + 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; diff --git a/src/AppKit/NSFontManager.h b/src/AppKit/NSFontManager.h new file mode 100644 index 000000000..6e4c0add0 --- /dev/null +++ b/src/AppKit/NSFontManager.h @@ -0,0 +1,159 @@ +#import +#import + +@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 diff --git a/src/AppKit/NSFontPanel.h b/src/AppKit/NSFontPanel.h new file mode 100644 index 000000000..e8895e2e8 --- /dev/null +++ b/src/AppKit/NSFontPanel.h @@ -0,0 +1,129 @@ +#import + +@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 +}; diff --git a/src/AppKit/NSForm.h b/src/AppKit/NSForm.h new file mode 100644 index 000000000..5ee8f2a8f --- /dev/null +++ b/src/AppKit/NSForm.h @@ -0,0 +1,36 @@ +#import + +@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 diff --git a/src/AppKit/NSFormCell.h b/src/AppKit/NSFormCell.h new file mode 100644 index 000000000..f0e48c732 --- /dev/null +++ b/src/AppKit/NSFormCell.h @@ -0,0 +1,50 @@ +#import + +@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 diff --git a/src/AppKit/NSGlyphGenerator.h b/src/AppKit/NSGlyphGenerator.h new file mode 100644 index 000000000..5fe5bccce --- /dev/null +++ b/src/AppKit/NSGlyphGenerator.h @@ -0,0 +1,25 @@ +#import +#import + + +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 )glyphStorage desiredNumberOfCharacters:(NSUInteger)nChars glyphIndex:(NSUInteger *)glyphIndex characterIndex:(NSUInteger *)charIndex; + ++ (id) sharedGlyphGenerator; +@end diff --git a/src/AppKit/NSGlyphInfo.h b/src/AppKit/NSGlyphInfo.h new file mode 100644 index 000000000..e3edd847c --- /dev/null +++ b/src/AppKit/NSGlyphInfo.h @@ -0,0 +1,35 @@ +#import +#import + +enum { + NSIdentityMappingCharacterCollection = 0, + NSAdobeCNS1CharacterCollection = 1, + NSAdobeGB1CharacterCollection = 2, + NSAdobeJapan1CharacterCollection = 3, + NSAdobeJapan2CharacterCollection = 4, + NSAdobeKorea1CharacterCollection = 5, +}; +typedef NSUInteger NSCharacterCollection; + +@interface NSGlyphInfo : NSObject { + 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 diff --git a/src/AppKit/NSGradient.h b/src/AppKit/NSGradient.h new file mode 100644 index 000000000..e7ea97d54 --- /dev/null +++ b/src/AppKit/NSGradient.h @@ -0,0 +1,96 @@ +#import +#import + + +@class NSArray, NSBezierPath, NSColor, NSColorSpace; + +typedef NSUInteger NSGradientDrawingOptions; + +enum { + NSGradientDrawsBeforeStartingLocation = (1 << 0), + NSGradientDrawsAfterEndingLocation = (1 << 1), +}; + +@interface NSGradient : NSObject { +@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 diff --git a/src/AppKit/NSGraphics.h b/src/AppKit/NSGraphics.h new file mode 100644 index 000000000..c366a63d0 --- /dev/null +++ b/src/AppKit/NSGraphics.h @@ -0,0 +1,178 @@ +#import +#import + +@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[]); diff --git a/src/AppKit/NSGraphicsContext.h b/src/AppKit/NSGraphicsContext.h new file mode 100644 index 000000000..3e907af06 --- /dev/null +++ b/src/AppKit/NSGraphicsContext.h @@ -0,0 +1,111 @@ +#import +#import +#import +#import + +@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 diff --git a/src/AppKit/NSHelpManager.h b/src/AppKit/NSHelpManager.h new file mode 100644 index 000000000..098c54112 --- /dev/null +++ b/src/AppKit/NSHelpManager.h @@ -0,0 +1,63 @@ +#import +#import +#import +#import +#import +#import + +@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 diff --git a/src/AppKit/NSImage.h b/src/AppKit/NSImage.h new file mode 100644 index 000000000..0ccbcfc56 --- /dev/null +++ b/src/AppKit/NSImage.h @@ -0,0 +1,322 @@ +#import +#import +#import +#import +#import +#import + +@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 +{ + + 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 )anObject; +- (id )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 +@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; diff --git a/src/AppKit/NSImageCell.h b/src/AppKit/NSImageCell.h new file mode 100644 index 000000000..eefb7ee23 --- /dev/null +++ b/src/AppKit/NSImageCell.h @@ -0,0 +1,50 @@ +#import + +@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 +{ + + 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 diff --git a/src/AppKit/NSImageRep.h b/src/AppKit/NSImageRep.h new file mode 100644 index 000000000..38360cf05 --- /dev/null +++ b/src/AppKit/NSImageRep.h @@ -0,0 +1,112 @@ +#import +#import +#import +#import + +@class NSArray, NSPasteboard, NSGraphicsContext, NSURL; + + + +enum { + NSImageRepMatchesDevice = 0 +}; + +@interface NSImageRep : NSObject { + + 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; diff --git a/src/AppKit/NSImageView.h b/src/AppKit/NSImageView.h new file mode 100644 index 000000000..95f4dbc41 --- /dev/null +++ b/src/AppKit/NSImageView.h @@ -0,0 +1,38 @@ +#import +#import + +@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 diff --git a/src/AppKit/NSInputManager.h b/src/AppKit/NSInputManager.h new file mode 100644 index 000000000..916ed2ea8 --- /dev/null +++ b/src/AppKit/NSInputManager.h @@ -0,0 +1,106 @@ +#import +#import +#import + +@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 { + +@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 diff --git a/src/AppKit/NSInputServer.h b/src/AppKit/NSInputServer.h new file mode 100644 index 000000000..91a3c4fdf --- /dev/null +++ b/src/AppKit/NSInputServer.h @@ -0,0 +1,61 @@ +#import +#import +#import + + + +@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 { + NSString *_name; + id _delegate; +} + +- initWithDelegate:(id)aDelegate name:(NSString *)name; +@end diff --git a/src/AppKit/NSInterfaceStyle.h b/src/AppKit/NSInterfaceStyle.h new file mode 100644 index 000000000..f1ba554bd --- /dev/null +++ b/src/AppKit/NSInterfaceStyle.h @@ -0,0 +1,23 @@ +#import +#import + +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; diff --git a/src/AppKit/NSKeyValueBinding.h b/src/AppKit/NSKeyValueBinding.h new file mode 100644 index 000000000..2a27de15d --- /dev/null +++ b/src/AppKit/NSKeyValueBinding.h @@ -0,0 +1,175 @@ +#import +#import + + +@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; diff --git a/src/AppKit/NSLayoutConstraint.h b/src/AppKit/NSLayoutConstraint.h new file mode 100644 index 000000000..cecdedec8 --- /dev/null +++ b/src/AppKit/NSLayoutConstraint.h @@ -0,0 +1,278 @@ +#import +#import +#import +#import +#import +#import + +@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 +{ + @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 diff --git a/src/AppKit/NSLayoutManager.h b/src/AppKit/NSLayoutManager.h new file mode 100644 index 000000000..8705d3f70 --- /dev/null +++ b/src/AppKit/NSLayoutManager.h @@ -0,0 +1,550 @@ +#import +#import +#import +#import + +@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 { + + + + @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 )delegate; +- (void)setDelegate:(id )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 +@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 diff --git a/src/AppKit/NSLevelIndicator.h b/src/AppKit/NSLevelIndicator.h new file mode 100644 index 000000000..fa71b74b5 --- /dev/null +++ b/src/AppKit/NSLevelIndicator.h @@ -0,0 +1,32 @@ +#import +#import + + +@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 diff --git a/src/AppKit/NSLevelIndicatorCell.h b/src/AppKit/NSLevelIndicatorCell.h new file mode 100644 index 000000000..a528291db --- /dev/null +++ b/src/AppKit/NSLevelIndicatorCell.h @@ -0,0 +1,67 @@ +#import +#import + + +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 diff --git a/src/AppKit/NSMatrix.h b/src/AppKit/NSMatrix.h new file mode 100644 index 000000000..78a50f81e --- /dev/null +++ b/src/AppKit/NSMatrix.h @@ -0,0 +1,221 @@ +#import +#import + +@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 +{ + + 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 )delegate; +- (void)setDelegate:(id )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 @end diff --git a/src/AppKit/NSMenu.h b/src/AppKit/NSMenu.h new file mode 100644 index 000000000..6e5529e98 --- /dev/null +++ b/src/AppKit/NSMenu.h @@ -0,0 +1,275 @@ +#import +#import +#import +#import + +@class NSEvent, NSView, NSFont; +@class NSMenu; +@class NSMutableArray, NSArray; +@protocol NSMenuDelegate; + +@interface NSMenu : NSObject +{ + + @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 )anObject; +- (id )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 +@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 diff --git a/src/AppKit/NSMenuItem.h b/src/AppKit/NSMenuItem.h new file mode 100644 index 000000000..84d5ea398 --- /dev/null +++ b/src/AppKit/NSMenuItem.h @@ -0,0 +1,163 @@ +#import +#import +#import +#import + +@class NSMenu; +@class NSImage, NSAttributedString, NSView; + +@interface NSMenuItem : NSObject +{ + + @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 diff --git a/src/AppKit/NSMenuItemCell.h b/src/AppKit/NSMenuItemCell.h new file mode 100644 index 000000000..ff869ae52 --- /dev/null +++ b/src/AppKit/NSMenuItemCell.h @@ -0,0 +1,61 @@ +#import +#import +#import + +#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 diff --git a/src/AppKit/NSMenuView.h b/src/AppKit/NSMenuView.h new file mode 100644 index 000000000..a41124f80 --- /dev/null +++ b/src/AppKit/NSMenuView.h @@ -0,0 +1,111 @@ +#if ! __LP64__ + +#import +#import +#import +#import +#import +@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 diff --git a/src/AppKit/NSMovie.h b/src/AppKit/NSMovie.h new file mode 100644 index 000000000..6f9a22d09 --- /dev/null +++ b/src/AppKit/NSMovie.h @@ -0,0 +1,46 @@ +#import + +@class NSArray, NSPasteboard, NSURL; + +#if __LP64__ +@class QTMovie; +#endif + +#if !__LP64__ +@interface NSMovie : NSObject { +#else +@interface NSMovie : NSObject { +#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 diff --git a/src/AppKit/NSMovieView.h b/src/AppKit/NSMovieView.h new file mode 100644 index 000000000..6e9c365b6 --- /dev/null +++ b/src/AppKit/NSMovieView.h @@ -0,0 +1,100 @@ +#if !__LP64__ + +#import +#import + +@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 +{ + @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 diff --git a/src/AppKit/NSNib.h b/src/AppKit/NSNib.h new file mode 100644 index 000000000..dbb069fe2 --- /dev/null +++ b/src/AppKit/NSNib.h @@ -0,0 +1,46 @@ +#import +#import + + +@class NSArray, NSBundle, NSData, NSDictionary, NSIBObjectData, NSURL; + +@interface NSNib : NSObject { + @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; diff --git a/src/AppKit/NSNibConnector.h b/src/AppKit/NSNibConnector.h new file mode 100644 index 000000000..ce1d4e2c1 --- /dev/null +++ b/src/AppKit/NSNibConnector.h @@ -0,0 +1,18 @@ +#import + +@interface NSNibConnector : NSObject +{ + @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 diff --git a/src/AppKit/NSNibControlConnector.h b/src/AppKit/NSNibControlConnector.h new file mode 100644 index 000000000..0217094d3 --- /dev/null +++ b/src/AppKit/NSNibControlConnector.h @@ -0,0 +1,5 @@ +#import + +@interface NSNibControlConnector : NSNibConnector +- (void)establishConnection; +@end diff --git a/src/AppKit/NSNibDeclarations.h b/src/AppKit/NSNibDeclarations.h new file mode 100644 index 000000000..0050b5b89 --- /dev/null +++ b/src/AppKit/NSNibDeclarations.h @@ -0,0 +1,7 @@ +#ifndef IBOutlet +#define IBOutlet +#endif + +#ifndef IBAction +#define IBAction void +#endif diff --git a/src/AppKit/NSNibLoading.h b/src/AppKit/NSNibLoading.h new file mode 100644 index 000000000..bbcd7b20e --- /dev/null +++ b/src/AppKit/NSNibLoading.h @@ -0,0 +1,21 @@ +#import + +@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 diff --git a/src/AppKit/NSNibOutletConnector.h b/src/AppKit/NSNibOutletConnector.h new file mode 100644 index 000000000..8205f8c98 --- /dev/null +++ b/src/AppKit/NSNibOutletConnector.h @@ -0,0 +1,5 @@ +#import + +@interface NSNibOutletConnector : NSNibConnector +- (void)establishConnection; +@end diff --git a/src/AppKit/NSObjectController.h b/src/AppKit/NSObjectController.h new file mode 100644 index 000000000..d4d2c4504 --- /dev/null +++ b/src/AppKit/NSObjectController.h @@ -0,0 +1,80 @@ +#import +#import + + +@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 )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 diff --git a/src/AppKit/NSOpenGL.h b/src/AppKit/NSOpenGL.h new file mode 100644 index 000000000..53665f970 --- /dev/null +++ b/src/AppKit/NSOpenGL.h @@ -0,0 +1,229 @@ +#import +#import + +@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 +{ +@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 diff --git a/src/AppKit/NSOpenGLLayer.h b/src/AppKit/NSOpenGLLayer.h new file mode 100644 index 000000000..a6ae497fa --- /dev/null +++ b/src/AppKit/NSOpenGLLayer.h @@ -0,0 +1,43 @@ +#import +#import +#import + + + +@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 diff --git a/src/AppKit/NSOpenGLView.h b/src/AppKit/NSOpenGLView.h new file mode 100644 index 000000000..bbf64d515 --- /dev/null +++ b/src/AppKit/NSOpenGLView.h @@ -0,0 +1,35 @@ +#import + +@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 diff --git a/src/AppKit/NSOpenPanel.h b/src/AppKit/NSOpenPanel.h new file mode 100644 index 000000000..622a896bc --- /dev/null +++ b/src/AppKit/NSOpenPanel.h @@ -0,0 +1,61 @@ +#import +@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 diff --git a/src/AppKit/NSOutlineView.h b/src/AppKit/NSOutlineView.h new file mode 100644 index 000000000..2464c3858 --- /dev/null +++ b/src/AppKit/NSOutlineView.h @@ -0,0 +1,453 @@ +#import +#import +#import + +@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 )anObject; +- (id )delegate; + +- (void)setDataSource:(id )aSource; +- (id )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 +@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 )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 )draggingInfo; + + + +- (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id )info proposedItem:(id)item proposedChildIndex:(NSInteger)index; + + + +- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id )info item:(id)item childIndex:(NSInteger)index; + + + +- (NSArray *)outlineView:(NSOutlineView *)outlineView namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination forDraggedItems:(NSArray *)items; + +@end + + + +@protocol NSOutlineViewDelegate +@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; diff --git a/src/AppKit/NSPDFImageRep.h b/src/AppKit/NSPDFImageRep.h new file mode 100644 index 000000000..f04ff7524 --- /dev/null +++ b/src/AppKit/NSPDFImageRep.h @@ -0,0 +1,23 @@ +#import + +@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 diff --git a/src/AppKit/NSPICTImageRep.h b/src/AppKit/NSPICTImageRep.h new file mode 100644 index 000000000..a00e8e7e8 --- /dev/null +++ b/src/AppKit/NSPICTImageRep.h @@ -0,0 +1,25 @@ +#import + +@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 diff --git a/src/AppKit/NSPageController.h b/src/AppKit/NSPageController.h new file mode 100644 index 000000000..9fe343b7e --- /dev/null +++ b/src/AppKit/NSPageController.h @@ -0,0 +1,123 @@ +#import +#import +#import +#import + +@class NSMutableDictionary, NSMutableArray, NSView; +@protocol NSPageControllerDelegate; + +enum { + NSPageControllerTransitionStyleStackHistory, + NSPageControllerTransitionStyleStackBook, + NSPageControllerTransitionStyleHorizontalStrip +} NS_ENUM_AVAILABLE(10_8, NA); +typedef NSInteger NSPageControllerTransitionStyle; + + +@interface NSPageController : NSViewController { +@private + NSView *_contentView; + NSViewController *_selectedViewController; + NSString *_currentIdentifier; + NSPageControllerTransitionStyle _transitionStyle; + id _delegate; + NSInteger _selectedIndex; + NSMutableArray *_arrangedObjects; + NSMutableArray *_snapshots; + struct __pcDelegateFlags { + unsigned int delegateRespondsToIdentifierForRepresentedObject:1; + unsigned int delegateRespondsToViewControllerForIdentifier:1; + unsigned int delegateRespondsToFrameForRepresentedObject:1; + unsigned int delegateRespondsToPrepareView:1; + unsigned int delegateRespondsToDidTransition:1; + unsigned int delegateRespondsToWillLiveTransition:1; + unsigned int delegateRespondsToDidLiveTransition:1; + unsigned int delegateRespondsToReserved1:1; + unsigned int reserved:24; + }_pcDelegateFlags; + struct __pcFlags { + unsigned int templateCacheIsInvalid:1; + unsigned int private1:1; + unsigned int private2:1; + unsigned int inSwipeGesture:1; + unsigned int reserved:28; + }_pcFlags; + BOOL *_cancelAnimation; + NSMutableDictionary *_reusueQueue; + NSMutableDictionary *_templateCache; + NSView *_transitionView; + + id _animator; + NSDictionary *_animationsDictionary; + + id _private; +} + +@property(assign) IBOutlet id delegate; + + + +@property(retain, readonly) NSViewController *selectedViewController; + + + +@property NSPageControllerTransitionStyle transitionStyle; + + + +@property(copy) NSArray *arrangedObjects; + + +@property NSInteger selectedIndex; + + + + +- (void)navigateForwardToObject:(id)object; + + + + +- (void)completeTransition; + + +- (IBAction)navigateBack:(id)sender; +- (IBAction)navigateForward:(id)sender; +- (IBAction)takeSelectedIndexFrom:(id)sender; +@end + +@protocol NSPageControllerDelegate +@required +@optional +- (NSString *)pageController:(NSPageController *)pageController identifierForObject:(id)object; + + + +- (NSViewController *)pageController:(NSPageController *)pageController viewControllerForIdentifier:(NSString *)identifier; + + + + + + +- (NSRect)pageController:(NSPageController *)pageController frameForObject:(id)object; + + + +- (void)pageController:(NSPageController *)pageController prepareViewController:(NSViewController *)viewController withObject:(id)object; + + + + + +- (void)pageController:(NSPageController *)pageController didTransitionToObject:(id)object; + + +- (void)pageControllerWillStartLiveTransition:(NSPageController *)pageController; + + + +- (void)pageControllerDidEndLiveTransition:(NSPageController *)pageController; + + +@end diff --git a/src/AppKit/NSPageLayout.h b/src/AppKit/NSPageLayout.h new file mode 100644 index 000000000..0fce2e23f --- /dev/null +++ b/src/AppKit/NSPageLayout.h @@ -0,0 +1,70 @@ +#import + +@class NSArray, NSMutableArray, NSPrintInfo, NSView, NSViewController, NSWindow, NSWindowController; + +@interface NSPageLayout : NSObject { + @private + NSMutableArray *_accessoryControllers; + NSPrintInfo *_originalPrintInfo; + id _delegate; + SEL _didEndSelector; + void *_contextInfo; + NSPrintInfo *_presentedPrintInfo; + NSWindowController *_windowController; +#if __LP64__ + id _reserved[4]; +#else + unsigned char _compatibilityPadding[156]; +#endif +} + + + ++ (NSPageLayout *)pageLayout; + + + + +- (void)addAccessoryController:(NSViewController *)accessoryController; +- (void)removeAccessoryController:(NSViewController *)accessoryController; +- (NSArray *)accessoryControllers; + + + + + + +- (void)beginSheetWithPrintInfo:(NSPrintInfo *)printInfo modalForWindow:(NSWindow *)docWindow delegate:(id)delegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo; + + + +- (NSInteger)runModalWithPrintInfo:(NSPrintInfo *)printInfo; +- (NSInteger)runModal; + + + +- (NSPrintInfo *)printInfo; + +@end + +@interface NSPageLayout(NSDeprecated) + + + +- (void)setAccessoryView:(NSView *)accessoryView; +- (NSView *)accessoryView; + + + +- (void)readPrintInfo; +- (void)writePrintInfo; + +@end + +@interface NSApplication(NSPageLayoutPanel) + + + +- (void)runPageLayout:(id)sender; + +@end diff --git a/src/AppKit/NSPanel.h b/src/AppKit/NSPanel.h new file mode 100644 index 000000000..1a996f533 --- /dev/null +++ b/src/AppKit/NSPanel.h @@ -0,0 +1,75 @@ +#import + + + + + + + +EXTERN_C NSInteger NSRunAlertPanel(NSString *title, NSString *msgFormat, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...); +EXTERN_C NSInteger NSRunInformationalAlertPanel(NSString *title, NSString *msgFormat, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...); +EXTERN_C NSInteger NSRunCriticalAlertPanel(NSString *title, NSString *msgFormat, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...); + + + + + +EXTERN_C NSInteger NSRunAlertPanelRelativeToWindow(NSString *title, NSString *msgFormat, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, ...); +EXTERN_C NSInteger NSRunInformationalAlertPanelRelativeToWindow(NSString *title, NSString *msgFormat, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, ...); +EXTERN_C NSInteger NSRunCriticalAlertPanelRelativeToWindow(NSString *title, NSString *msgFormat, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, ...); +EXTERN_C void NSBeginAlertSheet(NSString *title, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, id modalDelegate, SEL didEndSelector, SEL didDismissSelector, void *contextInfo, NSString *msgFormat, ...); +EXTERN_C void NSBeginInformationalAlertSheet(NSString *title, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, id modalDelegate, SEL didEndSelector, SEL didDismissSelector, void *contextInfo, NSString *msgFormat, ...); +EXTERN_C void NSBeginCriticalAlertSheet(NSString *title, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, id modalDelegate, SEL didEndSelector, SEL didDismissSelector, void *contextInfo, NSString *msgFormat, ...); + +EXTERN_C id NSGetAlertPanel(NSString *title, NSString *msgFormat, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...); +EXTERN_C id NSGetInformationalAlertPanel(NSString *title, NSString *msgFormat, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...); +EXTERN_C id NSGetCriticalAlertPanel(NSString *title, NSString *msgFormat, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...); + +EXTERN_C void NSReleaseAlertPanel(id panel); + + + + + + +enum { + NSAlertDefaultReturn = 1, + NSAlertAlternateReturn = 0, + NSAlertOtherReturn = -1, + NSAlertErrorReturn = -2 +}; + +enum { + NSOKButton = 1, + NSCancelButton = 0 +}; + + +enum { + NSUtilityWindowMask = 1 << 4, + NSDocModalWindowMask = 1 << 6 +}; + +enum { + NSNonactivatingPanelMask = 1 << 7 +}; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +enum { + NSHUDWindowMask = 1 << 13 +}; +#endif + +@interface NSPanel : NSWindow +{ + +} + +- (BOOL)isFloatingPanel; +- (void)setFloatingPanel:(BOOL)flag; +- (BOOL)becomesKeyOnlyIfNeeded; +- (void)setBecomesKeyOnlyIfNeeded:(BOOL)flag; +- (BOOL)worksWhenModal; +- (void)setWorksWhenModal:(BOOL)flag; + +@end diff --git a/src/AppKit/NSParagraphStyle.h b/src/AppKit/NSParagraphStyle.h new file mode 100644 index 000000000..9be10465e --- /dev/null +++ b/src/AppKit/NSParagraphStyle.h @@ -0,0 +1,142 @@ +#import +#import + +enum { + NSLeftTabStopType = 0, + NSRightTabStopType, + NSCenterTabStopType, + NSDecimalTabStopType +}; +typedef NSUInteger NSTextTabType; + +enum { + NSLineBreakByWordWrapping = 0, + NSLineBreakByCharWrapping, + NSLineBreakByClipping, + NSLineBreakByTruncatingHead, + NSLineBreakByTruncatingTail, + NSLineBreakByTruncatingMiddle +}; +typedef NSUInteger NSLineBreakMode; + + + +EXTERN_C NSString *NSTabColumnTerminatorsAttributeName; + + +@interface NSTextTab : NSObject { + + struct { + NSTextAlignment alignment:4; + unsigned int refCount:24; + unsigned int unused:4; +#if __LP64__ + unsigned int :32; +#endif + } _flags; + CGFloat _location; + id _reserved; +} +- (id)initWithTextAlignment:(NSTextAlignment)alignment location:(CGFloat)loc options:(NSDictionary *)options; + +- (NSTextAlignment)alignment; +- (NSDictionary *)options; +- (id)initWithType:(NSTextTabType)type location:(CGFloat)loc; +- (CGFloat)location; +- (NSTextTabType)tabStopType; +@end + + +@interface NSParagraphStyle : NSObject { + + CGFloat _lineSpacing; + CGFloat _paragraphSpacing; + CGFloat _headIndent; + CGFloat _tailIndent; + CGFloat _firstLineHeadIndent; + CGFloat _minimumLineHeight; + CGFloat _maximumLineHeight; + NSArray *_tabStops; + struct { + NSTextAlignment alignment:4; + NSLineBreakMode lineBreakMode:4; + unsigned int tabStopsIsMutable:1; + unsigned int isNaturalDirection:1; + unsigned int rightToLeftDirection:1; + unsigned int fixedMultiple:2; + unsigned int refCount:19; +#if __LP64__ + unsigned int :32; +#endif + } _flags; + CGFloat _defaultTabInterval; + id _extraData; +} + ++ (NSParagraphStyle *)defaultParagraphStyle; + ++ (NSWritingDirection)defaultWritingDirectionForLanguage:(NSString *)languageName; + +- (CGFloat)lineSpacing; +- (CGFloat)paragraphSpacing; +- (NSTextAlignment)alignment; + + + +- (CGFloat)headIndent; +- (CGFloat)tailIndent; +- (CGFloat)firstLineHeadIndent; +- (NSArray *)tabStops; + +- (CGFloat)minimumLineHeight; +- (CGFloat)maximumLineHeight; + +- (NSLineBreakMode)lineBreakMode; + +- (NSWritingDirection)baseWritingDirection; + +- (CGFloat)lineHeightMultiple; +- (CGFloat)paragraphSpacingBefore; +- (CGFloat)defaultTabInterval; + +- (NSArray *)textBlocks; +- (NSArray *)textLists; + + + +- (float)hyphenationFactor; + + + +- (float)tighteningFactorForTruncation; + + +- (NSInteger)headerLevel; + +@end + +@interface NSMutableParagraphStyle : NSParagraphStyle + +- (void)setLineSpacing:(CGFloat)aFloat; +- (void)setParagraphSpacing:(CGFloat)aFloat; +- (void)setAlignment:(NSTextAlignment)alignment; +- (void)setFirstLineHeadIndent:(CGFloat)aFloat; +- (void)setHeadIndent:(CGFloat)aFloat; +- (void)setTailIndent:(CGFloat)aFloat; +- (void)setLineBreakMode:(NSLineBreakMode)mode; +- (void)setMinimumLineHeight:(CGFloat)aFloat; +- (void)setMaximumLineHeight:(CGFloat)aFloat; +- (void)addTabStop:(NSTextTab *)anObject; +- (void)removeTabStop:(NSTextTab *)anObject; +- (void)setTabStops:(NSArray *)array; +- (void)setParagraphStyle:(NSParagraphStyle *)obj; +- (void)setBaseWritingDirection:(NSWritingDirection)writingDirection; +- (void)setLineHeightMultiple:(CGFloat)aFloat; +- (void)setParagraphSpacingBefore:(CGFloat)aFloat; +- (void)setDefaultTabInterval:(CGFloat)aFloat; +- (void)setTextBlocks:(NSArray *)array; +- (void)setTextLists:(NSArray *)array; +- (void)setHyphenationFactor:(float)aFactor; +- (void)setTighteningFactorForTruncation:(float)aFactor; +- (void)setHeaderLevel:(NSInteger)level; +@end diff --git a/src/AppKit/NSPasteboard.h b/src/AppKit/NSPasteboard.h new file mode 100644 index 000000000..acb4f9425 --- /dev/null +++ b/src/AppKit/NSPasteboard.h @@ -0,0 +1,282 @@ +#import +#import +#import +#import +#import + +@class NSArray, NSData, NSFileWrapper, NSMutableDictionary; + + + +EXTERN_C NSString *const NSPasteboardTypeString; +EXTERN_C NSString *const NSPasteboardTypePDF; +EXTERN_C NSString *const NSPasteboardTypeTIFF; +EXTERN_C NSString *const NSPasteboardTypePNG; +EXTERN_C NSString *const NSPasteboardTypeRTF; +EXTERN_C NSString *const NSPasteboardTypeRTFD; +EXTERN_C NSString *const NSPasteboardTypeHTML; +EXTERN_C NSString *const NSPasteboardTypeTabularText; +EXTERN_C NSString *const NSPasteboardTypeFont; +EXTERN_C NSString *const NSPasteboardTypeRuler; +EXTERN_C NSString *const NSPasteboardTypeColor; +EXTERN_C NSString *const NSPasteboardTypeSound; +EXTERN_C NSString *const NSPasteboardTypeMultipleTextSelection; +EXTERN_C NSString *const NSPasteboardTypeTextFinderOptions; + + + + +EXTERN_C NSString *NSGeneralPboard; +EXTERN_C NSString *NSFontPboard; +EXTERN_C NSString *NSRulerPboard; +EXTERN_C NSString *NSFindPboard; +EXTERN_C NSString *NSDragPboard; + + + + + + + +@class NSPasteboardItem; + +@interface NSPasteboard : NSObject +{ + @private + id _pboard; + int _gen; + id _owners; + CFIndex _cachedTypeNameChangeCount; + id _cachedTypeNames; + NSMutableDictionary *_promiseTypeNamesByIdentifier; + id _support; + id _pasteboardItems; + void * _reserved[3]; +} + ++ (NSPasteboard *)generalPasteboard; ++ (NSPasteboard *)pasteboardWithName:(NSString *)name; ++ (NSPasteboard *)pasteboardWithUniqueName; + +- (NSString *)name; + +- (NSInteger)changeCount; + +- (oneway void)releaseGlobally; + + + + +- (NSInteger)clearContents; + + + + +- (BOOL)writeObjects:(NSArray *)objects; + + + + + + +- (NSArray *)readObjectsForClasses:(NSArray *)classArray options:(NSDictionary *)options; + + + + +- (NSArray *)pasteboardItems; + + + + +- (NSUInteger)indexOfPasteboardItem:(NSPasteboardItem *)pasteboardItem; + + + + +- (BOOL)canReadItemWithDataConformingToTypes:(NSArray *)types; + + + + +- (BOOL)canReadObjectForClasses:(NSArray *)classArray options:(NSDictionary *)options; + + + + + + + +- (NSInteger)declareTypes:(NSArray *)newTypes owner:(id)newOwner; + + + +- (NSInteger)addTypes:(NSArray *)newTypes owner:(id)newOwner; + + + +- (NSArray *)types; +- (NSString *)availableTypeFromArray:(NSArray *)types; + + + +- (BOOL)setData:(NSData *)data forType:(NSString *)dataType; +- (BOOL)setPropertyList:(id)plist forType:(NSString *)dataType; +- (BOOL)setString:(NSString *)string forType:(NSString *)dataType; + + + +- (NSData *)dataForType:(NSString *)dataType; +- (id)propertyListForType:(NSString *)dataType; +- (NSString *)stringForType:(NSString *)dataType; + + +@end + + +@interface NSPasteboard(FilterServices) ++ (NSArray *)typesFilterableTo:(NSString *)type; + ++ (NSPasteboard *)pasteboardByFilteringFile:(NSString *)filename; ++ (NSPasteboard *)pasteboardByFilteringData:(NSData *)data ofType:(NSString *)type; ++ (NSPasteboard *)pasteboardByFilteringTypesInPasteboard:(NSPasteboard *)pboard; +@end + + +@interface NSObject(NSPasteboardOwner) +- (void)pasteboard:(NSPasteboard *)sender provideDataForType:(NSString *)type; +- (void)pasteboardChangedOwner:(NSPasteboard *)sender; +@end +EXTERN_C NSString *const NSPasteboardURLReadingFileURLsOnlyKey; + + + +EXTERN_C NSString *const NSPasteboardURLReadingContentsConformToTypesKey; + + + + + + + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + + + +enum { + NSPasteboardWritingPromised = 1 << 9, +}; +#endif +typedef NSUInteger NSPasteboardWritingOptions; + + +@protocol NSPasteboardWriting + +@required + + +- (NSArray *)writableTypesForPasteboard:(NSPasteboard *)pasteboard; + + +@optional + + +- (NSPasteboardWritingOptions)writingOptionsForType:(NSString *)type pasteboard:(NSPasteboard *)pasteboard; + + +@required + + +- (id)pasteboardPropertyListForType:(NSString *)type; + +@end +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 +enum { + NSPasteboardReadingAsData = 0, + NSPasteboardReadingAsString = 1 << 0, + NSPasteboardReadingAsPropertyList = 1 << 1, + NSPasteboardReadingAsKeyedArchive = 1 << 2, +}; +#endif +typedef NSUInteger NSPasteboardReadingOptions; + + +@protocol NSPasteboardReading + + + +@required ++ (NSArray *)readableTypesForPasteboard:(NSPasteboard *)pasteboard; + + +@optional + + ++ (NSPasteboardReadingOptions)readingOptionsForType:(NSString *)type pasteboard:(NSPasteboard *)pasteboard; + + + + +@optional +- (id)initWithPasteboardPropertyList:(id)propertyList ofType:(NSString *)type; + +@end +@interface NSURL(NSPasteboardSupport) ++ (NSURL *)URLFromPasteboard:(NSPasteboard *)pasteBoard; +- (void)writeToPasteboard:(NSPasteboard *)pasteBoard; +@end + + + + +@interface NSString(NSPasteboardSupport) +@end + + + + + +EXTERN_C NSString *NSStringPboardType; +EXTERN_C NSString *NSFilenamesPboardType; +EXTERN_C NSString *NSTIFFPboardType; +EXTERN_C NSString *NSRTFPboardType; +EXTERN_C NSString *NSTabularTextPboardType; +EXTERN_C NSString *NSFontPboardType; +EXTERN_C NSString *NSRulerPboardType; +EXTERN_C NSString *NSColorPboardType; +EXTERN_C NSString *NSRTFDPboardType; +EXTERN_C NSString *NSHTMLPboardType; +EXTERN_C NSString *NSURLPboardType; +EXTERN_C NSString *NSPDFPboardType; +EXTERN_C NSString *NSMultipleTextSelectionPboardType; + +EXTERN_C NSString *NSPostScriptPboardType; +EXTERN_C NSString *NSVCardPboardType; +EXTERN_C NSString *NSInkTextPboardType; + + +EXTERN_C NSString *NSFilesPromisePboardType; + + +EXTERN_C NSString *const NSPasteboardTypeFindPanelSearchOptions; + + + + + +@interface NSPasteboard(NSFileContents) +- (BOOL)writeFileContents:(NSString *)filename; +- (NSString *)readFileContentsType:(NSString *)type toFile:(NSString *)filename; + +- (BOOL)writeFileWrapper:(NSFileWrapper *)wrapper; +- (NSFileWrapper *)readFileWrapper; + +@end + +EXTERN_C NSString *NSFileContentsPboardType; + +EXTERN_C NSString *NSCreateFilenamePboardType(NSString *fileType); +EXTERN_C NSString *NSCreateFileContentsPboardType(NSString *fileType); +EXTERN_C NSString *NSGetFileType(NSString *pboardType); +EXTERN_C NSArray *NSGetFileTypes(NSArray *pboardTypes); +EXTERN_C NSString *NSPICTPboardType; diff --git a/src/AppKit/NSPasteboardItem.h b/src/AppKit/NSPasteboardItem.h new file mode 100644 index 000000000..37139dc38 --- /dev/null +++ b/src/AppKit/NSPasteboardItem.h @@ -0,0 +1,57 @@ +#import +#import +#import + + +@class NSPasteboard; +@protocol NSPasteboardItemDataProvider; + +@interface NSPasteboardItem : NSObject { + @private + NSPasteboard *_pasteboard; + NSUInteger _index; + NSInteger _gen; + id _auxObject; + void *_reserved; +} + + + +- (NSArray *)types; + + + +- (NSString *)availableTypeFromArray:(NSArray *)types; + + + +- (BOOL)setDataProvider:(id )dataProvider forTypes:(NSArray *)types; + + + +- (BOOL)setData:(NSData *)data forType:(NSString *)type; +- (BOOL)setString:(NSString *)string forType:(NSString *)type; +- (BOOL)setPropertyList:(id)propertyList forType:(NSString *)type; + + + +- (NSData *)dataForType:(NSString *)type; +- (NSString *)stringForType:(NSString *)type; +- (id)propertyListForType:(NSString *)type; + +@end + + + +@protocol NSPasteboardItemDataProvider + + +@required +- (void)pasteboard:(NSPasteboard *)pasteboard item:(NSPasteboardItem *)item provideDataForType:(NSString *)type; + + + +@optional +- (void)pasteboardFinishedWithDataProvider:(NSPasteboard *)pasteboard; + +@end diff --git a/src/AppKit/NSPathCell.h b/src/AppKit/NSPathCell.h new file mode 100644 index 000000000..98cd4d26a --- /dev/null +++ b/src/AppKit/NSPathCell.h @@ -0,0 +1,137 @@ +#import + + +#import + +@class NSString, NSImage, NSMutableArray, NSArray, NSAnimation, NSPathComponentCell, NSURL, NSPopUpButtonCell, NSNotification, NSOpenPanel; +@protocol NSPathCellDelegate, NSOpenSavePanelDelegate; +enum { + + + NSPathStyleStandard, + + + + NSPathStylePopUp = 2, +}; + +typedef NSInteger NSPathStyle; + + +@interface NSPathCell : NSActionCell { +@private + NSColor *_backgroundColor; + NSMutableArray *_borderColors; + NSMutableArray *_cells; + NSPathComponentCell *_clickedCell; + NSPathComponentCell *_hoveredCell; + NSPopUpButtonCell *_popUpButtonCell; + NSRect _currentRect; + NSAnimation *_animation; + NSArray *_allowedTypes; + SEL _doubleAction; + id _delegate; + struct { + unsigned int cbs:4; + unsigned int reserved:28; + } _piFlags; + NSPathStyle _pathStyle; + id _aux; +} + + + +- (NSPathStyle)pathStyle; +- (void)setPathStyle:(NSPathStyle)style; + + + +- (NSURL *)URL; +- (void)setURL:(NSURL *)url; + + + +- (void)setObjectValue:(id )obj; + + + +- (NSArray *)allowedTypes; +- (void)setAllowedTypes:(NSArray *)allowedTypes; + + + +- (id )delegate; +- (void)setDelegate:(id )value; + + + ++ (Class)pathComponentCellClass; + + + +- (NSArray *)pathComponentCells; + + + +- (void)setPathComponentCells:(NSArray *)cells; + + + +- (NSRect)rectOfPathComponentCell:(NSPathComponentCell *)cell withFrame:(NSRect)frame inView:(NSView *)view; + + + +- (NSPathComponentCell *)pathComponentCellAtPoint:(NSPoint)point withFrame:(NSRect)frame inView:(NSView *)view; + + + +- (NSPathComponentCell *)clickedPathComponentCell; + + + +- (void)mouseEntered:(NSEvent *)event withFrame:(NSRect)frame inView:(NSView *)view; +- (void)mouseExited:(NSEvent *)event withFrame:(NSRect)frame inView:(NSView *)view; + + + +- (SEL)doubleAction; +- (void)setDoubleAction:(SEL)action; + + + +- (void)setBackgroundColor:(NSColor *)color; +- (NSColor *)backgroundColor; + + + +- (void)setPlaceholderString:(NSString *)string; +- (NSString *)placeholderString; + +- (void)setPlaceholderAttributedString:(NSAttributedString *)string; +- (NSAttributedString *)placeholderAttributedString; + + +- (void)setControlSize:(NSControlSize)size; + +@end + +@protocol NSPathCellDelegate + +@optional + + + +- (void)pathCell:(NSPathCell *)pathCell willDisplayOpenPanel:(NSOpenPanel *)openPanel; + + + +- (void)pathCell:(NSPathCell *)pathCell willPopUpMenu:(NSMenu *)menu; + +@end + + +enum { + + + NSPathStyleNavigationBar = 1 +}; diff --git a/src/AppKit/NSPathComponentCell.h b/src/AppKit/NSPathComponentCell.h new file mode 100644 index 000000000..33b3d871b --- /dev/null +++ b/src/AppKit/NSPathComponentCell.h @@ -0,0 +1,43 @@ +#import + + +#import + +@class NSImage, NSString, NSURL; + + + + + +@interface NSPathComponentCell : NSTextFieldCell { +@private + NSImage *_image; + + CGFloat _fullWidth; + + CGFloat _resizedWidth; + + CGFloat _currentWidth; + NSURL *_url; + struct { + unsigned int shouldDrawArrow:1; + unsigned int drawsAsNavigationBar:1; + unsigned int isFirstItem:1; + unsigned int isLastItem:1; + unsigned int isDropTarget:1; + unsigned int reserved:27; + } _flags; + id _aux; +} + + + +- (NSImage *)image; +- (void)setImage:(NSImage *)value; + + + +- (NSURL *)URL; +- (void)setURL:(NSURL *)url; + +@end diff --git a/src/AppKit/NSPathControl.h b/src/AppKit/NSPathControl.h new file mode 100644 index 000000000..a6fb91941 --- /dev/null +++ b/src/AppKit/NSPathControl.h @@ -0,0 +1,92 @@ +#import + + +#import +#import +#import + +@class NSMutableArray, NSPathComponentCell, NSOpenPanel; +@protocol NSPathControlDelegate; + +@interface NSPathControl : NSControl { +@private + NSDragOperation _draggingSourceOperationMaskForLocal; + NSDragOperation _draggingSourceOperationMaskForNonLocal; + NSInteger _reserved; + id _delegate; + id _aux; +} + + + + +- (NSURL *)URL; +- (void)setURL:(NSURL *)url; + +- (SEL)doubleAction; +- (void)setDoubleAction:(SEL)action; + +- (NSPathStyle)pathStyle; +- (void)setPathStyle:(NSPathStyle)style; + +- (NSPathComponentCell *)clickedPathComponentCell; + +- (NSArray *)pathComponentCells; +- (void)setPathComponentCells:(NSArray *)cells; + + + +- (void)setBackgroundColor:(NSColor *)color; +- (NSColor *)backgroundColor; + + + +- (id )delegate; +- (void)setDelegate:(id )delegate; + + + + +- (void)setDraggingSourceOperationMask:(NSDragOperation)mask forLocal:(BOOL)isLocal; + + + +- (void)setMenu:(NSMenu *)menu; +- (NSMenu *)menu; + +@end + + +@protocol NSPathControlDelegate + +@optional + + + +- (BOOL)pathControl:(NSPathControl *)pathControl shouldDragPathComponentCell:(NSPathComponentCell *)pathComponentCell withPasteboard:(NSPasteboard *)pasteboard; + + + + + +- (NSDragOperation)pathControl:(NSPathControl *)pathControl validateDrop:(id )info; + + + + + + +- (BOOL)pathControl:(NSPathControl *)pathControl acceptDrop:(id )info; + + + + + + +- (void)pathControl:(NSPathControl *)pathControl willDisplayOpenPanel:(NSOpenPanel *)openPanel; + + + +- (void)pathControl:(NSPathControl *)pathControl willPopUpMenu:(NSMenu *)menu; + +@end diff --git a/src/AppKit/NSPersistentDocument.h b/src/AppKit/NSPersistentDocument.h new file mode 100644 index 000000000..955b193c9 --- /dev/null +++ b/src/AppKit/NSPersistentDocument.h @@ -0,0 +1,41 @@ +#import +@class NSManagedObjectModel, NSManagedObjectContext, NSMutableDictionary; + +@interface NSPersistentDocument : NSDocument { +@private + NSManagedObjectModel *_managedObjectModel; + NSManagedObjectContext *_managedObjectContext; + id _store; + uintptr_t _pDocFlags; + id _relatedRequestURLs; + void *_reserved3; + void *_reserved4; +} + + +- (NSManagedObjectContext *)managedObjectContext; +- (void)setManagedObjectContext:(NSManagedObjectContext *)managedObjectContext; + +- (id)managedObjectModel; + + + +- (BOOL)configurePersistentStoreCoordinatorForURL:(NSURL *)url ofType:(NSString *)fileType modelConfiguration:(NSString *)configuration storeOptions:(NSDictionary *)storeOptions error:(NSError **)error; + + +- (NSString *)persistentStoreTypeForFileType:(NSString *)fileType; + +- (BOOL)writeToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName forSaveOperation:(NSSaveOperationType)saveOperation originalContentsURL:(NSURL *)absoluteOriginalContentsURL error:(NSError **)error; + +- (BOOL)readFromURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)error; + +- (BOOL)revertToContentsOfURL:(NSURL *)inAbsoluteURL ofType:(NSString *)inTypeName error:(NSError **)outError; + +@end + +@interface NSPersistentDocument (NSDeprecated) + + +- (BOOL)configurePersistentStoreCoordinatorForURL:(NSURL *)url ofType:(NSString *)fileType error:(NSError **)error; + +@end diff --git a/src/AppKit/NSPopUpButton.h b/src/AppKit/NSPopUpButton.h new file mode 100644 index 000000000..d6a27f7a0 --- /dev/null +++ b/src/AppKit/NSPopUpButton.h @@ -0,0 +1,80 @@ +#import +#import +#import + +@class NSMenu; + +@interface NSPopUpButton : NSButton { + + @private + struct __pbFlags { + unsigned int needsPullsDownFromTemplate:1; + unsigned int RESERVED:31; + } _pbFlags; +#if __LP64__ + id _popupReserved; +#endif +} + +- (id)initWithFrame:(NSRect)buttonFrame pullsDown:(BOOL)flag; + + +- (void)setMenu:(NSMenu *)menu; +- (NSMenu *)menu; + + +- (void)setPullsDown:(BOOL)flag; +- (BOOL)pullsDown; + +- (void)setAutoenablesItems:(BOOL)flag; +- (BOOL)autoenablesItems; + +- (void)setPreferredEdge:(NSRectEdge)edge; +- (NSRectEdge)preferredEdge; + + + +- (void)addItemWithTitle:(NSString *)title; +- (void)addItemsWithTitles:(NSArray *)itemTitles; +- (void)insertItemWithTitle:(NSString *)title atIndex:(NSInteger)index; + +- (void)removeItemWithTitle:(NSString *)title; +- (void)removeItemAtIndex:(NSInteger)index; +- (void)removeAllItems; + + + +- (NSArray *)itemArray; +- (NSInteger)numberOfItems; + +- (NSInteger)indexOfItem:(NSMenuItem *)item; +- (NSInteger)indexOfItemWithTitle:(NSString *)title; +- (NSInteger)indexOfItemWithTag:(NSInteger)tag; +- (NSInteger)indexOfItemWithRepresentedObject:(id)obj; +- (NSInteger)indexOfItemWithTarget:(id)target andAction:(SEL)actionSelector; + +- (NSMenuItem *)itemAtIndex:(NSInteger)index; +- (NSMenuItem *)itemWithTitle:(NSString *)title; +- (NSMenuItem *)lastItem; + + + +- (void)selectItem:(NSMenuItem *)item; +- (void)selectItemAtIndex:(NSInteger)index; +- (void)selectItemWithTitle:(NSString *)title; +- (BOOL)selectItemWithTag:(NSInteger)tag; +- (void)setTitle:(NSString *)aString; + +- (NSMenuItem *)selectedItem; +- (NSInteger)indexOfSelectedItem; +- (void)synchronizeTitleAndSelectedItem; + + +- (NSString *)itemTitleAtIndex:(NSInteger)index; +- (NSArray *)itemTitles; +- (NSString *)titleOfSelectedItem; + +@end + + +EXTERN_C NSString *NSPopUpButtonWillPopUpNotification; diff --git a/src/AppKit/NSPopUpButtonCell.h b/src/AppKit/NSPopUpButtonCell.h new file mode 100644 index 000000000..fa09cb0bb --- /dev/null +++ b/src/AppKit/NSPopUpButtonCell.h @@ -0,0 +1,120 @@ +#import +#import + +@class NSMenu; + +enum { + NSPopUpNoArrow = 0, + NSPopUpArrowAtCenter = 1, + NSPopUpArrowAtBottom = 2 +}; +typedef NSUInteger NSPopUpArrowPosition; + +@interface NSPopUpButtonCell : NSMenuItemCell { + + @private + NSMenu *_menu; + int _selectedIndex; + struct __pbcFlags { + unsigned int pullsDown:1; + unsigned int preferredEdge:3; + unsigned int menuIsAttached:1; + unsigned int usesItemFromMenu:1; + unsigned int altersStateOfSelectedItem:1; + unsigned int decoding:1; + unsigned int arrowPosition:2; + unsigned int ignoreMenuLayout:1; + unsigned int drawing:1; + unsigned int menuShouldBeUniquedAgainstMain:1; + unsigned int RESERVED:19; + } _pbcFlags; +#if __LP64__ + id _popupReserved; +#endif +} + +- (id)initTextCell:(NSString *)stringValue pullsDown:(BOOL)pullDown; + + +- (void)setMenu:(NSMenu *)menu; +- (NSMenu *)menu; + + + +- (void)setPullsDown:(BOOL)flag; +- (BOOL)pullsDown; + +- (void)setAutoenablesItems:(BOOL)flag; +- (BOOL)autoenablesItems; + +- (void)setPreferredEdge:(NSRectEdge)edge; +- (NSRectEdge)preferredEdge; + + +- (void)setUsesItemFromMenu:(BOOL)flag; +- (BOOL)usesItemFromMenu; + + +- (void)setAltersStateOfSelectedItem:(BOOL)flag; +- (BOOL)altersStateOfSelectedItem; + + + +- (void)addItemWithTitle:(NSString *)title; +- (void)addItemsWithTitles:(NSArray *)itemTitles; +- (void)insertItemWithTitle:(NSString *)title atIndex:(NSInteger)index; + +- (void)removeItemWithTitle:(NSString *)title; +- (void)removeItemAtIndex:(NSInteger)index; +- (void)removeAllItems; + + + +- (NSArray *)itemArray; +- (NSInteger)numberOfItems; + +- (NSInteger)indexOfItem:(NSMenuItem *)item; +- (NSInteger)indexOfItemWithTitle:(NSString *)title; +- (NSInteger)indexOfItemWithTag:(NSInteger)tag; +- (NSInteger)indexOfItemWithRepresentedObject:(id)obj; +- (NSInteger)indexOfItemWithTarget:(id)target andAction:(SEL)actionSelector; + +- (NSMenuItem *)itemAtIndex:(NSInteger)index; +- (NSMenuItem *)itemWithTitle:(NSString *)title; +- (NSMenuItem *)lastItem; + + + +- (void)selectItem:(NSMenuItem *)item; +- (void)selectItemAtIndex:(NSInteger)index; +- (void)selectItemWithTitle:(NSString *)title; +- (BOOL)selectItemWithTag:(NSInteger)tag; +- (void)setTitle:(NSString *)aString; + +- (NSMenuItem *)selectedItem; +- (NSInteger)indexOfSelectedItem; +- (void)synchronizeTitleAndSelectedItem; + + + +- (NSString *)itemTitleAtIndex:(NSInteger)index; +- (NSArray *)itemTitles; +- (NSString *)titleOfSelectedItem; + +- (void)attachPopUpWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; +- (void)dismissPopUp; +- (void)performClickWithFrame:(NSRect)frame inView:(NSView *)controlView; + + +- (NSPopUpArrowPosition)arrowPosition; +- (void)setArrowPosition:(NSPopUpArrowPosition)position; + + +- (id)objectValue; +- (void)setObjectValue:(id)obj; + +@end + + + +EXTERN_C NSString *NSPopUpButtonCellWillPopUpNotification; diff --git a/src/AppKit/NSPopover.h b/src/AppKit/NSPopover.h new file mode 100644 index 000000000..e5835f71b --- /dev/null +++ b/src/AppKit/NSPopover.h @@ -0,0 +1,210 @@ +#import +#import + +#import +#import +#import + +@class NSView, NSViewController, NSWindow, NSNotification, NSString; + + + + + + + + + + + + +enum { + + + NSPopoverAppearanceMinimal = 0, + + + + NSPopoverAppearanceHUD = 1 +}; +typedef NSInteger NSPopoverAppearance; + + + +enum { + + + NSPopoverBehaviorApplicationDefined = 0, + + + + NSPopoverBehaviorTransient = 1, + + + + NSPopoverBehaviorSemitransient = 2 +}; +typedef NSInteger NSPopoverBehavior; + +@protocol NSPopoverDelegate; + + +@interface NSPopover : NSResponder { +@private + id _bindingAdaptor; + id _delegate; + id _visualRepresentation; + NSView *_positioningView; + NSViewController *_contentViewController; + NSWindow *_positioningWindow; + NSPopoverAppearance _appearance; + NSPopoverBehavior _behavior; + NSRectEdge _unused; + NSRectEdge _preferredEdge; + NSPoint _unused2; + NSSize _contentSize; + NSRect _positioningRect; +#if !__OBJC2__ + id _reserved[3]; +#endif + struct { + unsigned int animates:1; + unsigned int positioningRectIsBounds:1; + unsigned int registeredAsTransient:1; + unsigned int registeredAsSemitransient:1; + unsigned int shown:1; + unsigned int toolbarHidesAnchor:1; + unsigned int closing:1; + unsigned int reserved:25; + } _flags; +} + + + + + + + + + + + + + + + + + + + + + +@property(assign) IBOutlet id delegate; + + + +@property NSPopoverAppearance appearance; + + + +@property NSPopoverBehavior behavior; + + + +@property BOOL animates; + + + +@property(retain) IBOutlet NSViewController *contentViewController; + + + +@property NSSize contentSize; + + + +@property(readonly, getter=isShown) BOOL shown; + + + +@property NSRect positioningRect; + + + + + + +- (void)showRelativeToRect:(NSRect)positioningRect ofView:(NSView *)positioningView preferredEdge:(NSRectEdge)preferredEdge; + + + +- (IBAction)performClose:(id)sender; + + + +- (void)close; + +@end + + + + + + +EXTERN_C NSString * const NSPopoverCloseReasonKey; + + + +EXTERN_C NSString * const NSPopoverCloseReasonStandard; + + + +EXTERN_C NSString * const NSPopoverCloseReasonDetachToWindow; + + + +EXTERN_C NSString * const NSPopoverWillShowNotification; + + + +EXTERN_C NSString * const NSPopoverDidShowNotification; + + + +EXTERN_C NSString * const NSPopoverWillCloseNotification; + + + +EXTERN_C NSString * const NSPopoverDidCloseNotification; + + + + +@protocol NSPopoverDelegate +@optional + + + +- (BOOL)popoverShouldClose:(NSPopover *)popover; + + + +- (NSWindow *)detachableWindowForPopover:(NSPopover *)popover; + + + +- (void)popoverWillShow:(NSNotification *)notification; + + + +- (void)popoverDidShow:(NSNotification *)notification; + + + +- (void)popoverWillClose:(NSNotification *)notification; + + + +- (void)popoverDidClose:(NSNotification *)notification; + +@end diff --git a/src/AppKit/NSPredicateEditor.h b/src/AppKit/NSPredicateEditor.h new file mode 100644 index 000000000..a2f01405c --- /dev/null +++ b/src/AppKit/NSPredicateEditor.h @@ -0,0 +1,27 @@ +#import + +@class NSPredicateTemplate, NSArray; + + +@interface NSPredicateEditor : NSRuleEditor { + id _allTemplates; + NSArray *_rootTrees; + NSArray *_rootHeaderTrees; + id _predicateTarget; + SEL _predicateAction; + struct { + unsigned suppressAction:4; + unsigned reserved:28; + } _peFlags; + id _predicateEditorReserved[3]; +} + + + +- (void)setRowTemplates:(NSArray *)rowTemplates; + + + +- (NSArray *)rowTemplates; + +@end diff --git a/src/AppKit/NSPredicateEditorRowTemplate.h b/src/AppKit/NSPredicateEditorRowTemplate.h new file mode 100644 index 000000000..2f0f94962 --- /dev/null +++ b/src/AppKit/NSPredicateEditorRowTemplate.h @@ -0,0 +1,73 @@ +#import + + +#import +#import + +@class NSPredicate, NSArray, NSEntityDescription; + + +@interface NSPredicateEditorRowTemplate : NSObject { + @private + NSInteger _templateType; + NSUInteger _predicateOptions; + NSUInteger _predicateModifier; + NSUInteger _leftAttributeType; + NSUInteger _rightAttributeType; + NSArray *_views; + + struct { + unsigned leftIsWildcard:1; + unsigned rightIsWildcard:1; + unsigned reserved:30; + } _ptFlags; + + id _patternReserved; +} + + + +- (double)matchForPredicate:(NSPredicate *)predicate; + + + +- (NSArray *)templateViews; + + + +- (void)setPredicate:(NSPredicate *)predicate; + + +- (NSPredicate *)predicateWithSubpredicates:(NSArray *)subpredicates; + + + +- (NSArray *)displayableSubpredicatesOfPredicate:(NSPredicate *)predicate; + + + +- (id)initWithLeftExpressions:(NSArray *)leftExpressions rightExpressions:(NSArray *)rightExpressions modifier:(NSComparisonPredicateModifier)modifier operators:(NSArray *)operators options:(NSUInteger)options; + + + +- (id)initWithLeftExpressions:(NSArray *)leftExpressions rightExpressionAttributeType:(NSAttributeType)attributeType modifier:(NSComparisonPredicateModifier)modifier operators:(NSArray *)operators options:(NSUInteger)options; + + + +- (id)initWithCompoundTypes:(NSArray *)compoundTypes; + + + +- (NSArray *)leftExpressions; +- (NSArray *)rightExpressions; +- (NSAttributeType)rightExpressionAttributeType; +- (NSComparisonPredicateModifier)modifier; +- (NSArray *)operators; +- (NSUInteger)options; +- (NSArray *)compoundTypes; + + + ++ (NSArray *)templatesWithAttributeKeyPaths:(NSArray *)keyPaths inEntityDescription:(NSEntityDescription *)entityDescription; + +@end diff --git a/src/AppKit/NSPrintInfo.h b/src/AppKit/NSPrintInfo.h new file mode 100644 index 000000000..303757de2 --- /dev/null +++ b/src/AppKit/NSPrintInfo.h @@ -0,0 +1,199 @@ +#import +#import +#import + +@class NSMutableDictionary, NSPrinter; + + + +enum { + NSPortraitOrientation = 0, + NSLandscapeOrientation = 1 +}; +typedef NSUInteger NSPrintingOrientation; + + + +enum { + NSAutoPagination = 0, + NSFitPagination = 1, + NSClipPagination = 2 +}; +typedef NSUInteger NSPrintingPaginationMode; + + + +EXTERN_C NSString *const NSPrintSpoolJob; +EXTERN_C NSString *const NSPrintPreviewJob; +EXTERN_C NSString *const NSPrintSaveJob; +EXTERN_C NSString *const NSPrintCancelJob; + + + +EXTERN_C NSString *const NSPrintPaperName; +EXTERN_C NSString *const NSPrintPaperSize; +EXTERN_C NSString *const NSPrintOrientation; +EXTERN_C NSString *const NSPrintScalingFactor; + + + +EXTERN_C NSString *const NSPrintLeftMargin; +EXTERN_C NSString *const NSPrintRightMargin; +EXTERN_C NSString *const NSPrintTopMargin; +EXTERN_C NSString *const NSPrintBottomMargin; +EXTERN_C NSString *const NSPrintHorizontallyCentered; +EXTERN_C NSString *const NSPrintVerticallyCentered; +EXTERN_C NSString *const NSPrintHorizontalPagination; +EXTERN_C NSString *const NSPrintVerticalPagination; + + + +EXTERN_C NSString *const NSPrintPrinter; +EXTERN_C NSString *const NSPrintCopies; +EXTERN_C NSString *const NSPrintAllPages; +EXTERN_C NSString *const NSPrintFirstPage; +EXTERN_C NSString *const NSPrintLastPage; +EXTERN_C NSString *const NSPrintMustCollate; +EXTERN_C NSString *const NSPrintReversePageOrder; +EXTERN_C NSString *const NSPrintJobDisposition; +EXTERN_C NSString *const NSPrintPagesAcross; +EXTERN_C NSString *const NSPrintPagesDown; +EXTERN_C NSString *const NSPrintTime; +EXTERN_C NSString *const NSPrintDetailedErrorReporting; +EXTERN_C NSString *const NSPrintFaxNumber; +EXTERN_C NSString *const NSPrintPrinterName; +EXTERN_C NSString *const NSPrintSelectionOnly; +EXTERN_C NSString *const NSPrintJobSavingURL; +EXTERN_C NSString *const NSPrintJobSavingFileNameExtensionHidden; + + + +EXTERN_C NSString *const NSPrintHeaderAndFooter; + +@interface NSPrintInfo : NSObject { + @private + NSMutableDictionary *_attributes; + id _moreVars; +} + + + ++ (void)setSharedPrintInfo:(NSPrintInfo *)printInfo; ++ (NSPrintInfo *)sharedPrintInfo; + + + +- (id)initWithDictionary:(NSDictionary *)attributes; + + + +- (NSMutableDictionary *)dictionary; + + + +- (void)setPaperName:(NSString *)name; +- (void)setPaperSize:(NSSize)size; +- (void)setOrientation:(NSPrintingOrientation)orientation; +- (void)setScalingFactor:(CGFloat)scalingFactor; +- (NSString *)paperName; +- (NSSize)paperSize; +- (NSPrintingOrientation)orientation; +- (CGFloat)scalingFactor; + + + +- (void)setLeftMargin:(CGFloat)margin; +- (void)setRightMargin:(CGFloat)margin; +- (void)setTopMargin:(CGFloat)margin; +- (void)setBottomMargin:(CGFloat)margin; +- (CGFloat)leftMargin; +- (CGFloat)rightMargin; +- (CGFloat)topMargin; +- (CGFloat)bottomMargin; +- (void)setHorizontallyCentered:(BOOL)flag; +- (void)setVerticallyCentered:(BOOL)flag; +- (BOOL)isHorizontallyCentered; +- (BOOL)isVerticallyCentered; +- (void)setHorizontalPagination:(NSPrintingPaginationMode)mode; +- (void)setVerticalPagination:(NSPrintingPaginationMode)mode; +- (NSPrintingPaginationMode)horizontalPagination; +- (NSPrintingPaginationMode)verticalPagination; + + + +- (void)setJobDisposition:(NSString *)disposition; +- (NSString *)jobDisposition; + + + +- (void)setPrinter:(NSPrinter *)printer; +- (NSPrinter *)printer; + + + +- (void)setUpPrintOperationDefaultValues; + + + + +- (NSRect)imageablePageBounds; + + + + + +- (NSString *)localizedPaperName; + + + + ++ (NSPrinter *)defaultPrinter; + + + + +- (NSMutableDictionary *)printSettings; + + + +- (void *)PMPrintSession ; +- (void *)PMPageFormat ; +- (void *)PMPrintSettings ; + + + +- (void)updateFromPMPageFormat; +- (void)updateFromPMPrintSettings; + + + + + +- (void)setSelectionOnly:(BOOL)selectionOnly; +- (BOOL)isSelectionOnly; + +@end + +@interface NSPrintInfo(NSDeprecated) + + + ++ (void)setDefaultPrinter:(NSPrinter *)printer; + + + ++ (NSSize)sizeForPaperName:(NSString *)name; + +@end + + + +EXTERN_C NSString *const NSPrintFormName; +EXTERN_C NSString *const NSPrintJobFeatures; +EXTERN_C NSString *const NSPrintManualFeed; +EXTERN_C NSString *const NSPrintPagesPerSheet; +EXTERN_C NSString *const NSPrintPaperFeed; + + + +EXTERN_C NSString *const NSPrintSavePath; diff --git a/src/AppKit/NSPrintOperation.h b/src/AppKit/NSPrintOperation.h new file mode 100644 index 000000000..e043ed154 --- /dev/null +++ b/src/AppKit/NSPrintOperation.h @@ -0,0 +1,153 @@ +#import +#import +#import + +@class NSMutableData, NSGraphicsContext, NSPrintPanel, NSPrintInfo, NSView, NSWindow; + + + +enum { + NSDescendingPageOrder = -1, + NSSpecialPageOrder = 0, + NSAscendingPageOrder = 1, + NSUnknownPageOrder = 2 +}; +typedef NSInteger NSPrintingPageOrder; + +#if MAC_OS_X_VERSION_10_7 <= MAC_OS_X_VERSION_MAX_ALLOWED +enum { + + + NSPrintRenderingQualityBest, + + + + + NSPrintRenderingQualityResponsive +}; +#endif +typedef NSInteger NSPrintRenderingQuality; + + + +EXTERN_C NSString *NSPrintOperationExistsException; + +@interface NSPrintOperation : NSObject { +} + + + ++ (NSPrintOperation *)printOperationWithView:(NSView *)view printInfo:(NSPrintInfo *)printInfo; ++ (NSPrintOperation *)PDFOperationWithView:(NSView *)view insideRect:(NSRect)rect toData:(NSMutableData *)data printInfo:(NSPrintInfo *)printInfo; ++ (NSPrintOperation *)PDFOperationWithView:(NSView *)view insideRect:(NSRect)rect toPath:(NSString *)path printInfo:(NSPrintInfo *)printInfo; ++ (NSPrintOperation *)EPSOperationWithView:(NSView *)view insideRect:(NSRect)rect toData:(NSMutableData *)data printInfo:(NSPrintInfo *)printInfo; ++ (NSPrintOperation *)EPSOperationWithView:(NSView *)view insideRect:(NSRect)rect toPath:(NSString *)path printInfo:(NSPrintInfo *)printInfo; + + + ++ (NSPrintOperation *)printOperationWithView:(NSView *)view; ++ (NSPrintOperation *)PDFOperationWithView:(NSView *)view insideRect:(NSRect)rect toData:(NSMutableData *)data; ++ (NSPrintOperation *)EPSOperationWithView:(NSView *)view insideRect:(NSRect)rect toData:(NSMutableData *)data; + + + ++ (NSPrintOperation *)currentOperation; ++ (void)setCurrentOperation:(NSPrintOperation *)operation; + + + +- (BOOL)isCopyingOperation; + + + +- (NSPrintRenderingQuality)preferredRenderingQuality; + + + +- (void)setJobTitle:(NSString *)jobTitle; +- (NSString *)jobTitle; + + + + + +- (void)setShowsPrintPanel:(BOOL)flag; +- (BOOL)showsPrintPanel; +- (void)setShowsProgressPanel:(BOOL)flag; +- (BOOL)showsProgressPanel; + + + + +- (void)setPrintPanel:(NSPrintPanel *)panel; +- (NSPrintPanel *)printPanel; + + + +- (void)setCanSpawnSeparateThread:(BOOL)canSpawnSeparateThread; +- (BOOL)canSpawnSeparateThread; + + + +- (void)setPageOrder:(NSPrintingPageOrder)pageOrder; +- (NSPrintingPageOrder)pageOrder; + + + + + + + +- (void)runOperationModalForWindow:(NSWindow *)docWindow delegate:(id)delegate didRunSelector:(SEL)didRunSelector contextInfo:(void *)contextInfo; + + + +- (BOOL)runOperation; + + + +- (NSView *)view; + + + +- (NSPrintInfo *)printInfo; +- (void)setPrintInfo:(NSPrintInfo *)printInfo; + + + +- (NSGraphicsContext *)context; + + + +- (NSRange)pageRange; + + + + +- (NSInteger)currentPage; + + + +- (NSGraphicsContext *)createContext; +- (void)destroyContext; +- (BOOL)deliverResult; +- (void)cleanUpOperation; + +@end + +@interface NSPrintOperation(NSDeprecated) + + + +- (void)setAccessoryView:(NSView *)view; +- (NSView *)accessoryView; + +- (void)setJobStyleHint:(NSString *)hint; +- (NSString *)jobStyleHint; + + + +- (void)setShowPanels:(BOOL)flag; +- (BOOL)showPanels; + +@end diff --git a/src/AppKit/NSPrintPanel.h b/src/AppKit/NSPrintPanel.h new file mode 100644 index 000000000..d98506700 --- /dev/null +++ b/src/AppKit/NSPrintPanel.h @@ -0,0 +1,155 @@ +#import +#import + +@class NSArray, NSMutableArray, NSPrintInfo, NSSet, NSView, NSViewController, NSWindow, NSWindowController; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 + +enum { + + + + NSPrintPanelShowsCopies = 1 << 0, + NSPrintPanelShowsPageRange = 1 << 1, + NSPrintPanelShowsPaperSize = 1 << 2, + NSPrintPanelShowsOrientation = 1 << 3, + NSPrintPanelShowsScaling = 1 << 4, + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + + + + NSPrintPanelShowsPrintSelection = 1 << 5, + +#endif + + + + NSPrintPanelShowsPageSetupAccessory = 1 << 8, + + + + + + NSPrintPanelShowsPreview = 1 << 17 + +}; +#endif +typedef NSInteger NSPrintPanelOptions; + + + +EXTERN_C NSString *const NSPrintPhotoJobStyleHint; +EXTERN_C NSString *const NSPrintAllPresetsJobStyleHint; +EXTERN_C NSString *const NSPrintNoPresetsJobStyleHint; + + + +EXTERN_C NSString *const NSPrintPanelAccessorySummaryItemNameKey; +EXTERN_C NSString *const NSPrintPanelAccessorySummaryItemDescriptionKey; + + +@protocol NSPrintPanelAccessorizing +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 + + + +- (NSArray *)localizedSummaryItems; + +@optional + + + +- (NSSet *)keyPathsForValuesAffectingPreview; + +#endif +@end + + +@interface NSPrintPanel : NSObject { + @private + NSMutableArray *_accessoryControllers; + id _previewController; + NSView *_thumbnailView; + NSInteger _options; + NSString *_defaultButtonTitle; + NSString *_helpAnchor; + NSString *_jobStyleHint; + NSPrintInfo *_originalPrintInfo; + id _delegate; + SEL _didEndSelector; + void *_contextInfo; + NSPrintInfo *_presentedPrintInfo; + NSWindowController *_windowController; +#if __LP64__ + id _reserved[2]; +#else + unsigned char _compatibilityPadding[192]; +#endif +} + + + ++ (NSPrintPanel *)printPanel; + + + + +- (void)addAccessoryController:(NSViewController *)accessoryController; +- (void)removeAccessoryController:(NSViewController *)accessoryController; +- (NSArray *)accessoryControllers; + + + +- (void)setOptions:(NSPrintPanelOptions)options; +- (NSPrintPanelOptions)options; + + + +- (void)setDefaultButtonTitle:(NSString *)defaultButtonTitle; +- (NSString *)defaultButtonTitle; + + + +- (void)setHelpAnchor:(NSString *)helpAnchor; +- (NSString *)helpAnchor; + + + + +- (void)setJobStyleHint:(NSString *)hint; +- (NSString *)jobStyleHint; + + + + + + +- (void)beginSheetWithPrintInfo:(NSPrintInfo *)printInfo modalForWindow:(NSWindow *)docWindow delegate:(id)delegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo; + + + +- (NSInteger)runModalWithPrintInfo:(NSPrintInfo *)printInfo; +- (NSInteger)runModal; + + + + +- (NSPrintInfo *)printInfo; + + +@end + +@interface NSPrintPanel(NSDeprecated) + + + +- (void)setAccessoryView:(NSView *)accessoryView; +- (NSView *)accessoryView; + + + +- (void)updateFromPrintInfo; +- (void)finalWritePrintInfo; + +@end diff --git a/src/AppKit/NSPrinter.h b/src/AppKit/NSPrinter.h new file mode 100644 index 000000000..16496882a --- /dev/null +++ b/src/AppKit/NSPrinter.h @@ -0,0 +1,103 @@ +#import +#import + +@class NSArray, NSDictionary, NSString; + + + +enum { + NSPrinterTableOK = 0, + NSPrinterTableNotFound = 1, + NSPrinterTableError = 2 +}; +typedef NSUInteger NSPrinterTableStatus; + +@interface NSPrinter: NSObject { + @private + NSString *_printerName; + void *_printer; + NSDictionary *_cachedDeviceDescription; + int _ppdCreationNum; + void *_ppdNodes; + void *_ppdPriv; +#if __LP64__ + id _reserved[3]; +#else + unsigned char _compatibilityPadding[20]; +#endif +} + + + ++ (NSArray *)printerNames; + + + ++ (NSArray *)printerTypes; + + + ++ (NSPrinter *)printerWithName:(NSString *)name; + + + ++ (NSPrinter *)printerWithType:(NSString *)type; + + + +- (NSString *)name; + + + +- (NSString *)type; + + + +- (NSInteger)languageLevel; + + + +- (NSSize)pageSizeForPaper:(NSString *)paperName; + + + +- (NSPrinterTableStatus)statusForTable:(NSString *)tableName; + + + +- (BOOL)isKey:(NSString *)key inTable:(NSString *)table; +- (BOOL)booleanForKey:(NSString *)key inTable:(NSString *)table; +- (float)floatForKey:(NSString *)key inTable:(NSString *)table; +- (int)intForKey:(NSString *)key inTable:(NSString *)table; +- (NSRect)rectForKey:(NSString *)key inTable:(NSString *)table; +- (NSSize)sizeForKey:(NSString *)key inTable:(NSString *)table; +- (NSString *)stringForKey:(NSString *)key inTable:(NSString *)table; +- (NSArray *)stringListForKey:(NSString *)key inTable:(NSString *)table; + + + +- (NSDictionary *)deviceDescription; + +@end + +@interface NSPrinter(NSDeprecated) + + + +- (NSRect)imageRectForPaper:(NSString *)paperName; + + + +- (BOOL)acceptsBinary; +- (BOOL)isColor; +- (BOOL)isFontAvailable:(NSString *)faceName; +- (BOOL)isOutputStackInReverseOrder; + + + ++ (NSPrinter *)printerWithName:(NSString *)name domain:(NSString *)domain includeUnavailable:(BOOL)flag; +- (NSString *)domain; +- (NSString *)host; +- (NSString *)note; + +@end diff --git a/src/AppKit/NSProgressIndicator.h b/src/AppKit/NSProgressIndicator.h new file mode 100644 index 000000000..434385542 --- /dev/null +++ b/src/AppKit/NSProgressIndicator.h @@ -0,0 +1,123 @@ +#import +#import +#import + +struct __NSProgressIndicatorThreadInfo; +typedef struct __NSProgressIndicatorThreadInfo _NSProgressIndicatorThreadInfo; +enum { + NSProgressIndicatorPreferredThickness = 14, + NSProgressIndicatorPreferredSmallThickness = 10, + NSProgressIndicatorPreferredLargeThickness = 18, + NSProgressIndicatorPreferredAquaThickness = 12 +}; +typedef NSUInteger NSProgressIndicatorThickness; + + +enum { + NSProgressIndicatorBarStyle = 0, + NSProgressIndicatorSpinningStyle = 1 +}; +typedef NSUInteger NSProgressIndicatorStyle; + + + + +@interface NSProgressIndicator : NSView +{ +@private + + BOOL _isBezeled; + BOOL _isIndeterminate; + BOOL _threadedAnimation; + + double _minimum; + double _maximum; + + + double _value; + + unsigned int _animationIndex; + NSTimeInterval _animationDelay; + + id _timer; + + CGFloat _drawingWidth; + + id _roundColor; + id _reserved; + + volatile struct __progressIndicatorFlags { + unsigned int isSpinning:1; + unsigned int isVector:1; + unsigned int isLocked:1; + unsigned int controlTint:3; + unsigned int controlSize:2; + unsigned int style:1; + unsigned int _delayedStartup:1; + unsigned int hideWhenStopped:1; + unsigned int revive:1; + unsigned int _temporarilyBlockHeartBeating:1; + unsigned int _isHidden:1; + unsigned int _isHeartBeatInstalled:1; + unsigned int _customRenderer:1; + unsigned int _lastFrame:8; + unsigned int _isDetaching:1; + unsigned int RESERVED:7; + } _progressIndicatorFlags; + + + id _NSProgressIndicatorReserved1; +} + + + +- (BOOL)isIndeterminate; +- (void)setIndeterminate:(BOOL)flag; + +- (BOOL)isBezeled; +- (void)setBezeled:(BOOL)flag; + +- (NSControlTint)controlTint; +- (void)setControlTint:(NSControlTint)tint; + +- (NSControlSize)controlSize; +- (void)setControlSize:(NSControlSize)size; + + + +- (double)doubleValue; +- (void)setDoubleValue:(double)doubleValue; + +- (void)incrementBy:(double)delta; + +- (double)minValue; +- (double)maxValue; +- (void)setMinValue:(double)newMinimum; +- (void)setMaxValue:(double)newMaximum; + + + +- (BOOL)usesThreadedAnimation; +- (void)setUsesThreadedAnimation:(BOOL)threadedAnimation; + +- (void)startAnimation:(id)sender; +- (void)stopAnimation:(id)sender; + + +- (void) setStyle: (NSProgressIndicatorStyle) style; +- (NSProgressIndicatorStyle) style; + + + +- (void) sizeToFit; + +- (BOOL) isDisplayedWhenStopped; +- (void) setDisplayedWhenStopped: (BOOL) isDisplayed; + +@end + +@interface NSProgressIndicator (NSProgressIndicatorDeprecated) +- (NSTimeInterval)animationDelay; +- (void)setAnimationDelay:(NSTimeInterval)delay; +- (void)animate:(id)sender; +@end diff --git a/src/AppKit/NSQuickDrawView.h b/src/AppKit/NSQuickDrawView.h new file mode 100644 index 000000000..42905b533 --- /dev/null +++ b/src/AppKit/NSQuickDrawView.h @@ -0,0 +1,15 @@ +#if !__LP64__ +#import + +@interface NSQuickDrawView : NSView +{ +@private + void* _qdPort; + void* _savePort; + BOOL _synchToView; +} + +- (void*) qdPort ; + +@end +#endif diff --git a/src/AppKit/NSResponder.h b/src/AppKit/NSResponder.h index 58ab8392d..319042c5d 100644 --- a/src/AppKit/NSResponder.h +++ b/src/AppKit/NSResponder.h @@ -1,8 +1,293 @@ -#ifndef NSRESPONDER_H_ -#define NSRESPONDER_H_ -#include +#import +#import -@interface NSResponder : NSObject +@class NSArray, NSError, NSEvent, NSMenu, NSUndoManager, NSWindow; + +@interface NSResponder : NSObject +{ + + id _nextResponder; +} + +- (NSResponder *)nextResponder; +- (void)setNextResponder:(NSResponder *)aResponder; +- (BOOL)tryToPerform:(SEL)anAction with:(id)anObject; +- (BOOL)performKeyEquivalent:(NSEvent *)theEvent; +- (id)validRequestorForSendType:(NSString *)sendType returnType:(NSString *)returnType; +- (void)mouseDown:(NSEvent *)theEvent; +- (void)rightMouseDown:(NSEvent *)theEvent; +- (void)otherMouseDown:(NSEvent *)theEvent; +- (void)mouseUp:(NSEvent *)theEvent; +- (void)rightMouseUp:(NSEvent *)theEvent; +- (void)otherMouseUp:(NSEvent *)theEvent; +- (void)mouseMoved:(NSEvent *)theEvent; +- (void)mouseDragged:(NSEvent *)theEvent; +- (void)scrollWheel:(NSEvent *)theEvent; +- (void)rightMouseDragged:(NSEvent *)theEvent; +- (void)otherMouseDragged:(NSEvent *)theEvent; +- (void)mouseEntered:(NSEvent *)theEvent; +- (void)mouseExited:(NSEvent *)theEvent; +- (void)keyDown:(NSEvent *)theEvent; +- (void)keyUp:(NSEvent *)theEvent; +- (void)flagsChanged:(NSEvent *)theEvent; +- (void)tabletPoint:(NSEvent *)theEvent; +- (void)tabletProximity:(NSEvent *)theEvent; +- (void)cursorUpdate:(NSEvent *)event; + + +- (void)magnifyWithEvent:(NSEvent *)event; +- (void)rotateWithEvent:(NSEvent *)event; +- (void)swipeWithEvent:(NSEvent *)event; +- (void)beginGestureWithEvent:(NSEvent *)event; +- (void)endGestureWithEvent:(NSEvent *)event; + +- (void)smartMagnifyWithEvent:(NSEvent *)event; + + + + +- (void)touchesBeganWithEvent:(NSEvent *)event; + + + +- (void)touchesMovedWithEvent:(NSEvent *)event; + + + +- (void)touchesEndedWithEvent:(NSEvent *)event; + + + +- (void)touchesCancelledWithEvent:(NSEvent *)event; + + +- (void)quickLookWithEvent:(NSEvent *)event; + +- (void)noResponderFor:(SEL)eventSelector; +- (BOOL)acceptsFirstResponder; +- (BOOL)becomeFirstResponder; +- (BOOL)resignFirstResponder; + +- (void)interpretKeyEvents:(NSArray *)eventArray; +- (void)flushBufferedKeyEvents; + +- (void)setMenu:(NSMenu *)menu; +- (NSMenu *)menu; + +- (void)showContextHelp:(id)sender; + +- (void)helpRequested:(NSEvent *)eventPtr; + +- (BOOL)shouldBeTreatedAsInkEvent:(NSEvent *)theEvent; + + + +- (BOOL)wantsScrollEventsForSwipeTrackingOnAxis:(NSEventGestureAxis)axis; + + + +- (BOOL)wantsForwardedScrollEventsForAxis:(NSEventGestureAxis)axis; + + + +- (id)supplementalTargetForAction:(SEL)action sender:(id)sender; @end -#endif +@interface NSResponder (NSStandardKeyBindingMethods) + + + + + +- (void)insertText:(id)insertString; + + +- (void)doCommandBySelector:(SEL)aSelector; + + + + + + +- (void)moveForward:(id)sender; +- (void)moveRight:(id)sender; +- (void)moveBackward:(id)sender; +- (void)moveLeft:(id)sender; +- (void)moveUp:(id)sender; +- (void)moveDown:(id)sender; +- (void)moveWordForward:(id)sender; +- (void)moveWordBackward:(id)sender; +- (void)moveToBeginningOfLine:(id)sender; +- (void)moveToEndOfLine:(id)sender; +- (void)moveToBeginningOfParagraph:(id)sender; +- (void)moveToEndOfParagraph:(id)sender; +- (void)moveToEndOfDocument:(id)sender; +- (void)moveToBeginningOfDocument:(id)sender; +- (void)pageDown:(id)sender; +- (void)pageUp:(id)sender; +- (void)centerSelectionInVisibleArea:(id)sender; + +- (void)moveBackwardAndModifySelection:(id)sender; +- (void)moveForwardAndModifySelection:(id)sender; +- (void)moveWordForwardAndModifySelection:(id)sender; +- (void)moveWordBackwardAndModifySelection:(id)sender; +- (void)moveUpAndModifySelection:(id)sender; +- (void)moveDownAndModifySelection:(id)sender; + +- (void)moveToBeginningOfLineAndModifySelection:(id)sender; +- (void)moveToEndOfLineAndModifySelection:(id)sender; +- (void)moveToBeginningOfParagraphAndModifySelection:(id)sender; +- (void)moveToEndOfParagraphAndModifySelection:(id)sender; +- (void)moveToEndOfDocumentAndModifySelection:(id)sender; +- (void)moveToBeginningOfDocumentAndModifySelection:(id)sender; +- (void)pageDownAndModifySelection:(id)sender; +- (void)pageUpAndModifySelection:(id)sender; +- (void)moveParagraphForwardAndModifySelection:(id)sender; +- (void)moveParagraphBackwardAndModifySelection:(id)sender; + +- (void)moveWordRight:(id)sender; +- (void)moveWordLeft:(id)sender; +- (void)moveRightAndModifySelection:(id)sender; +- (void)moveLeftAndModifySelection:(id)sender; +- (void)moveWordRightAndModifySelection:(id)sender; +- (void)moveWordLeftAndModifySelection:(id)sender; + +- (void)moveToLeftEndOfLine:(id)sender; +- (void)moveToRightEndOfLine:(id)sender; +- (void)moveToLeftEndOfLineAndModifySelection:(id)sender; +- (void)moveToRightEndOfLineAndModifySelection:(id)sender; + +- (void)scrollPageUp:(id)sender; +- (void)scrollPageDown:(id)sender; +- (void)scrollLineUp:(id)sender; +- (void)scrollLineDown:(id)sender; + +- (void)scrollToBeginningOfDocument:(id)sender; +- (void)scrollToEndOfDocument:(id)sender; + + + +- (void)transpose:(id)sender; +- (void)transposeWords:(id)sender; + + + +- (void)selectAll:(id)sender; +- (void)selectParagraph:(id)sender; +- (void)selectLine:(id)sender; +- (void)selectWord:(id)sender; + + + +- (void)indent:(id)sender; +- (void)insertTab:(id)sender; +- (void)insertBacktab:(id)sender; +- (void)insertNewline:(id)sender; +- (void)insertParagraphSeparator:(id)sender; +- (void)insertNewlineIgnoringFieldEditor:(id)sender; +- (void)insertTabIgnoringFieldEditor:(id)sender; +- (void)insertLineBreak:(id)sender; +- (void)insertContainerBreak:(id)sender; +- (void)insertSingleQuoteIgnoringSubstitution:(id)sender; +- (void)insertDoubleQuoteIgnoringSubstitution:(id)sender; + + + +- (void)changeCaseOfLetter:(id)sender; +- (void)uppercaseWord:(id)sender; +- (void)lowercaseWord:(id)sender; +- (void)capitalizeWord:(id)sender; + + + +- (void)deleteForward:(id)sender; +- (void)deleteBackward:(id)sender; +- (void)deleteBackwardByDecomposingPreviousCharacter:(id)sender; +- (void)deleteWordForward:(id)sender; +- (void)deleteWordBackward:(id)sender; +- (void)deleteToBeginningOfLine:(id)sender; +- (void)deleteToEndOfLine:(id)sender; +- (void)deleteToBeginningOfParagraph:(id)sender; +- (void)deleteToEndOfParagraph:(id)sender; + +- (void)yank:(id)sender; + + + +- (void)complete:(id)sender; + + + +- (void)setMark:(id)sender; +- (void)deleteToMark:(id)sender; +- (void)selectToMark:(id)sender; +- (void)swapWithMark:(id)sender; + + + +- (void)cancelOperation:(id)sender; + + + +- (void)makeBaseWritingDirectionNatural:(id)sender; +- (void)makeBaseWritingDirectionLeftToRight:(id)sender; +- (void)makeBaseWritingDirectionRightToLeft:(id)sender; + +- (void)makeTextWritingDirectionNatural:(id)sender; +- (void)makeTextWritingDirectionLeftToRight:(id)sender; +- (void)makeTextWritingDirectionRightToLeft:(id)sender; + + + + +- (void)quickLookPreviewItems:(id)sender; +@end + +@interface NSResponder(NSUndoSupport) +- (NSUndoManager *)undoManager; +@end + +@interface NSResponder (NSControlEditingSupport) + + + +- (BOOL)validateProposedFirstResponder:(NSResponder *)responder forEvent:(NSEvent *)event; + +@end + + + +@interface NSResponder(NSErrorPresentation) +- (void)presentError:(NSError *)error modalForWindow:(NSWindow *)window delegate:(id)delegate didPresentSelector:(SEL)didPresentSelector contextInfo:(void *)contextInfo; + + + + + + + +- (BOOL)presentError:(NSError *)error; + + + + + +- (NSError *)willPresentError:(NSError *)error; + +@end + + +@interface NSResponder(NSTextFinderSupport) + +- (void)performTextFinderAction:(id)sender; + +@end + + +@interface NSResponder(NSDeprecated) + + + +- (BOOL)performMnemonic:(NSString *)theString; + +@end diff --git a/src/AppKit/NSRuleEditor.h b/src/AppKit/NSRuleEditor.h new file mode 100644 index 000000000..5c1f259d6 --- /dev/null +++ b/src/AppKit/NSRuleEditor.h @@ -0,0 +1,225 @@ +#import +#import +@class NSMutableArray, NSIndexSet, NSView, NSPredicate, NSString, NSViewAnimation; +@protocol NSRuleEditorDelegate; + +enum { + NSRuleEditorNestingModeSingle, + NSRuleEditorNestingModeList, + NSRuleEditorNestingModeCompound, + NSRuleEditorNestingModeSimple +}; + +typedef NSUInteger NSRuleEditorNestingMode; + +enum { + NSRuleEditorRowTypeSimple, + NSRuleEditorRowTypeCompound +}; + +typedef NSUInteger NSRuleEditorRowType; + +@interface NSRuleEditor : NSControl { + @private + id _ruleDataSource; + id _ruleDelegate; + NSIndexSet *_draggingRows; + NSMutableArray *_rowCache; + NSView *_slicesHolder; + NSMutableArray *_slices; + CGFloat _sliceHeight; + CGFloat _alignmentGridWidth; + NSInteger _subviewIndexOfDropLine; + id _dropLineView; + NSViewAnimation *_currentAnimation; + id _unused1; + NSString *_stringsFileName; + id _standardLocalizer; + id _headerLocalizer; + NSPredicate *_predicate; + NSInteger _nestingMode; + struct { + unsigned elideUpdating:1; + unsigned lastAlternateKeyValue:1; + unsigned extendedDelegateCalls:1; + unsigned editable:1; + unsigned settingSize:1; + unsigned suppressKeyDown:1; + unsigned dropWasSuccessful:1; + unsigned delegateWantsValidation:1; + unsigned disallowEmpty:1; + unsigned lastDrewWithFRAppearance:1; + unsigned allowsEmptyCompoundRows:1; + unsigned dropChangedRowCount:1; + unsigned reserved:20; + } _ruleEditorFlags; + NSString *_typeKeyPath; + NSString *_itemsKeyPath; + NSString *_valuesKeyPath; + NSString *_subrowsArrayKeyPath; + Class _rowClass; + id _boundArrayOwner; + NSString *_boundArrayKeyPath; + id _ruleReserved1; + NSInteger _lastRow; + id _ruleReserved2; +} + + + + +- (void)setDelegate:(id )delegate; +- (id )delegate; + + +- (void)setFormattingStringsFilename:(NSString *)stringsFilename; +- (NSString *)formattingStringsFilename; + + +- (void)setFormattingDictionary:(NSDictionary *)dictionary; +- (NSDictionary *)formattingDictionary; + + +- (void)reloadCriteria; + + +- (void)setNestingMode:(NSRuleEditorNestingMode)mode; +- (NSRuleEditorNestingMode)nestingMode; + + +- (void)setRowHeight:(CGFloat)height; +- (CGFloat)rowHeight; + + +- (void)setEditable:(BOOL)editable; +- (BOOL)isEditable; + + +- (void)setCanRemoveAllRows:(BOOL)val; +- (BOOL)canRemoveAllRows; + + + + +- (NSPredicate *)predicate; + + +- (void)reloadPredicate; + + +- (NSPredicate *)predicateForRow:(NSInteger)row; + + + + +- (NSInteger)numberOfRows; + + +- (NSIndexSet *)subrowIndexesForRow:(NSInteger)rowIndex; + + +- (NSArray *)criteriaForRow:(NSInteger)row; + + +- (NSArray *)displayValuesForRow:(NSInteger)row; + + +- (NSInteger)rowForDisplayValue:(id)displayValue; + + +- (NSRuleEditorRowType)rowTypeForRow:(NSInteger)rowIndex; + + +- (NSInteger)parentRowForRow:(NSInteger)rowIndex; + + + + +- (void)addRow:(id)sender; + + +- (void)insertRowAtIndex:(NSInteger)rowIndex withType:(NSRuleEditorRowType)rowType asSubrowOfRow:(NSInteger)parentRow animate:(BOOL)shouldAnimate; + + +- (void)setCriteria:(NSArray *)criteria andDisplayValues:(NSArray *)values forRowAtIndex:(NSInteger)rowIndex; + + +- (void)removeRowAtIndex:(NSInteger)rowIndex; + + +- (void)removeRowsAtIndexes:(NSIndexSet *)rowIndexes includeSubrows:(BOOL)includeSubrows; + + +- (NSIndexSet *)selectedRowIndexes; + + +- (void)selectRowIndexes:(NSIndexSet *)indexes byExtendingSelection:(BOOL)extend; + + + + +- (void)setRowClass:(Class)rowClass; +- (Class)rowClass; + + +- (void)setRowTypeKeyPath:(NSString *)keyPath; +- (NSString *)rowTypeKeyPath; + + +- (void)setSubrowsKeyPath:(NSString *)keyPath; +- (NSString *)subrowsKeyPath; + + +- (void)setCriteriaKeyPath:(NSString *)keyPath; +- (NSString *)criteriaKeyPath; + + +- (void)setDisplayValuesKeyPath:(NSString *)keyPath; +- (NSString *)displayValuesKeyPath; + +@end + + +@protocol NSRuleEditorDelegate + +@required + + + + +- (NSInteger)ruleEditor:(NSRuleEditor *)editor numberOfChildrenForCriterion:(id)criterion withRowType:(NSRuleEditorRowType)rowType; + + +- (id)ruleEditor:(NSRuleEditor *)editor child:(NSInteger)index forCriterion:(id)criterion withRowType:(NSRuleEditorRowType)rowType; + + +- (id)ruleEditor:(NSRuleEditor *)editor displayValueForCriterion:(id)criterion inRow:(NSInteger)row; + +@optional + + + + + +- (NSDictionary *)ruleEditor:(NSRuleEditor *)editor predicatePartsForCriterion:(id)criterion withDisplayValue:(id)value inRow:(NSInteger)row; + + +- (void)ruleEditorRowsDidChange:(NSNotification *)notification; + +@end + + + +EXTERN_C NSString * const NSRuleEditorPredicateLeftExpression; +EXTERN_C NSString * const NSRuleEditorPredicateRightExpression; +EXTERN_C NSString * const NSRuleEditorPredicateComparisonModifier; +EXTERN_C NSString * const NSRuleEditorPredicateOptions; +EXTERN_C NSString * const NSRuleEditorPredicateOperatorType; +EXTERN_C NSString * const NSRuleEditorPredicateCustomSelector; + +EXTERN_C NSString * const NSRuleEditorPredicateCompoundType; + + + + +EXTERN_C NSString *const NSRuleEditorRowsDidChangeNotification; diff --git a/src/AppKit/NSRulerMarker.h b/src/AppKit/NSRulerMarker.h new file mode 100644 index 000000000..fdca7bcb2 --- /dev/null +++ b/src/AppKit/NSRulerMarker.h @@ -0,0 +1,74 @@ +#import +#import + +@class NSEvent, NSImage, NSRulerView; + +@interface NSRulerMarker : NSObject { + + NSRulerView *_ruler; + CGFloat _location; + NSImage *_image; + NSPoint _imageOrigin; + + struct __rFlags { + unsigned int movable:1; + unsigned int removable:1; + unsigned int dragging:1; + unsigned int pinned:1; + unsigned int _reserved:28; + } _rFlags; + + id _representedObject; +} + + + +- (id)initWithRulerView:(NSRulerView *)ruler markerLocation:(CGFloat)location image:(NSImage *)image imageOrigin:(NSPoint)imageOrigin; + + + + +- (NSRulerView *)ruler; + + + +- (void)setMarkerLocation:(CGFloat)location; +- (CGFloat)markerLocation; + + +- (void)setImage:(NSImage *)image; +- (NSImage *)image; + + +- (void)setImageOrigin:(NSPoint)imageOrigin; +- (NSPoint)imageOrigin; + + +- (void)setMovable:(BOOL)flag; +- (void)setRemovable:(BOOL)flag; +- (BOOL)isMovable; +- (BOOL)isRemovable; + + +- (BOOL)isDragging; + + +- (void)setRepresentedObject:(id )representedObject; +- (id )representedObject; + + + + +- (NSRect)imageRectInRuler; + + +- (CGFloat)thicknessRequiredInRuler; + + +- (void)drawRect:(NSRect)rect; + + +- (BOOL)trackMouse:(NSEvent *)mouseDownEvent adding:(BOOL)isAdding; + + +@end diff --git a/src/AppKit/NSRulerView.h b/src/AppKit/NSRulerView.h new file mode 100644 index 000000000..20eec46da --- /dev/null +++ b/src/AppKit/NSRulerView.h @@ -0,0 +1,167 @@ +#import + +@class NSScrollView, NSRulerMarker, NSMutableArray; + + +enum { + NSHorizontalRuler, + NSVerticalRuler +}; +typedef NSUInteger NSRulerOrientation; + +@interface NSRulerView : NSView { + + @private + NSScrollView *_scrollView; + NSRulerOrientation _orientation; + + NSString *_units; + CGFloat _originOffset; + + CGFloat _ruleThickness; + CGFloat _thicknessForMarkers; + CGFloat _thicknessForAccessoryView; + + NSView *_clientView; + NSMutableArray *_markers; + NSView *_accessoryView; + + + NSDictionary *_cachedHashDict; + CGFloat _cachedDocViewToRulerConversion; + + + NSPoint _cachedContentBoundsOrigin; + + + NSRulerMarker *_draggingMarker; + + id _reservedRulerView1; +} + + + ++ (void)registerUnitWithName:(NSString *)unitName abbreviation:(NSString *)abbreviation unitToPointsConversionFactor:(CGFloat)conversionFactor stepUpCycle:(NSArray *)stepUpCycle stepDownCycle:(NSArray *)stepDownCycle; + + + +- (id)initWithScrollView:(NSScrollView *)scrollView orientation:(NSRulerOrientation)orientation; + + + + +- (void)setScrollView:(NSScrollView *)scrollView; +- (NSScrollView *)scrollView; + + +- (void)setOrientation:(NSRulerOrientation)orientation; +- (NSRulerOrientation)orientation; + + + + + +- (CGFloat)baselineLocation; + + +- (CGFloat)requiredThickness; + + +- (void)setRuleThickness:(CGFloat)thickness; +- (CGFloat)ruleThickness; + + +- (void)setReservedThicknessForMarkers:(CGFloat)thickness; +- (CGFloat)reservedThicknessForMarkers; + + +- (void)setReservedThicknessForAccessoryView:(CGFloat)thickness; +- (CGFloat)reservedThicknessForAccessoryView; + + + + +- (void)setMeasurementUnits:(NSString *)unitName; +- (NSString *)measurementUnits; + + +- (void)setOriginOffset:(CGFloat)offset; +- (CGFloat)originOffset; + + + + +- (void)setClientView:(NSView *)client; +- (NSView *)clientView; + +- (void)setMarkers:(NSArray *)markers; +- (void)addMarker:(NSRulerMarker *)marker; +- (void)removeMarker:(NSRulerMarker *)marker; +- (NSArray *)markers; + + +- (BOOL)trackMarker:(NSRulerMarker *)marker withMouseEvent:(NSEvent *)event; + + +- (void)setAccessoryView:(NSView *)accessory; +- (NSView *)accessoryView; + + +- (void)moveRulerlineFromLocation:(CGFloat)oldLocation toLocation:(CGFloat)newLocation; + + + + +- (void)invalidateHashMarks; + + +- (void)drawHashMarksAndLabelsInRect:(NSRect)rect; + + +- (void)drawMarkersInRect:(NSRect)rect; + + + + +- (BOOL)isFlipped; + + +@end + + +@interface NSView (NSRulerMarkerClientViewDelegation) + +- (BOOL)rulerView:(NSRulerView *)ruler shouldMoveMarker:(NSRulerMarker *)marker; + + +- (CGFloat)rulerView:(NSRulerView *)ruler willMoveMarker:(NSRulerMarker *)marker toLocation:(CGFloat)location; + + +- (void)rulerView:(NSRulerView *)ruler didMoveMarker:(NSRulerMarker *)marker; + + +- (BOOL)rulerView:(NSRulerView *)ruler shouldRemoveMarker:(NSRulerMarker *)marker; + + +- (void)rulerView:(NSRulerView *)ruler didRemoveMarker:(NSRulerMarker *)marker; + + +- (BOOL)rulerView:(NSRulerView *)ruler shouldAddMarker:(NSRulerMarker *)marker; + + +- (CGFloat)rulerView:(NSRulerView *)ruler willAddMarker:(NSRulerMarker *)marker atLocation:(CGFloat)location; + + +- (void)rulerView:(NSRulerView *)ruler didAddMarker:(NSRulerMarker *)marker; + + +- (void)rulerView:(NSRulerView *)ruler handleMouseDown:(NSEvent *)event; + + +- (void)rulerView:(NSRulerView *)ruler willSetClientView:(NSView *)newClient; + + + +- (CGFloat)rulerView:(NSRulerView *)ruler locationForPoint:(NSPoint)aPoint; +- (NSPoint)rulerView:(NSRulerView *)ruler pointForLocation:(CGFloat)aPoint; +@end diff --git a/src/AppKit/NSRunningApplication.h b/src/AppKit/NSRunningApplication.h new file mode 100644 index 000000000..f5d3a9d7d --- /dev/null +++ b/src/AppKit/NSRunningApplication.h @@ -0,0 +1,149 @@ +#import +#import + + +enum { + + NSApplicationActivateAllWindows = 1 << 0, + + + + + NSApplicationActivateIgnoringOtherApps = 1 << 1 +}; +typedef NSUInteger NSApplicationActivationOptions; + + + +enum { + + NSApplicationActivationPolicyRegular, + + + NSApplicationActivationPolicyAccessory, + + + NSApplicationActivationPolicyProhibited +}; +typedef NSInteger NSApplicationActivationPolicy; + + +@class NSLock, NSDate, NSImage, NSURL; + + +@interface NSRunningApplication : NSObject { + @private + id _superReserved; + __strong void *_asn; + __strong void **_helpers; + id _obsInfo; + NSLock *_lock; + NSString *_bundleID; + NSString *_localizedName; + NSURL *_bundleURL; + NSURL *_executableURL; + NSDate *_launchDate; + NSImage *_icon; + int _pid; + unsigned int _lastSeed; + unsigned int _activeSeed; + unsigned int _staleSeed; + unsigned long long _obsMask; + struct { + unsigned fetchedDynamic:1; + unsigned deadToUs:1; + unsigned terminated:1; + unsigned finishedLaunching:1; + unsigned hidden:1; + unsigned active:1; + unsigned ownsMenuBar:1; + unsigned arch:3; + unsigned activationPolicy:3; + unsigned reserved1:19; + } _aflags; + id _appReserved; +} + + +@property (readonly, getter=isTerminated) BOOL terminated; + + +@property (readonly, getter=isFinishedLaunching) BOOL finishedLaunching; + + +@property (readonly, getter=isHidden) BOOL hidden; + + +@property (readonly, getter=isActive) BOOL active; + + +@property (readonly) BOOL ownsMenuBar; + + +@property (readonly) NSApplicationActivationPolicy activationPolicy; + + +@property (readonly) NSString *localizedName; + + +@property (readonly) NSString *bundleIdentifier; + + +@property (readonly) NSURL *bundleURL; + + +@property (readonly) NSURL *executableURL; + + +@property (readonly) pid_t processIdentifier; + + +@property (readonly) NSDate *launchDate; + + +@property (readonly) NSImage *icon; + + +@property (readonly) NSInteger executableArchitecture; + + +- (BOOL)hide; +- (BOOL)unhide; + + +- (BOOL)activateWithOptions:(NSApplicationActivationOptions)options; + + +- (BOOL)terminate; + + +- (BOOL)forceTerminate; + + ++ (NSArray *)runningApplicationsWithBundleIdentifier:(NSString *)bundleIdentifier; + + ++ (NSRunningApplication *)runningApplicationWithProcessIdentifier:(pid_t)pid; + + ++ (NSRunningApplication *)currentApplication; + + + + + ++ (void) terminateAutomaticallyTerminableApplications; + +@end + +@interface NSWorkspace (NSWorkspaceRunningApplications) + + + + + + + +- (NSArray *)runningApplications; + +@end diff --git a/src/AppKit/NSSavePanel.h b/src/AppKit/NSSavePanel.h new file mode 100644 index 000000000..d0ba26c97 --- /dev/null +++ b/src/AppKit/NSSavePanel.h @@ -0,0 +1,295 @@ +#import +#import + +@class NSBox, NSMutableArray, NSTextField, NSTextView, NSView, NSURL, NSProgressIndicator, NSControl; +@protocol NSOpenSavePanelDelegate; + + + +enum { + NSFileHandlingPanelCancelButton = NSCancelButton, + NSFileHandlingPanelOKButton = NSOKButton, +}; + +typedef struct __SPFlags { + unsigned int saveMode:1; + unsigned int isExpanded:1; + unsigned int allowsOtherFileTypes:1; + unsigned int canCreateDirectories:1; + unsigned int canSelectedHiddenExtension:1; + unsigned int reserved2:1; + unsigned int delegate_shouldShowFilename:1; + unsigned int delegate_compareFilename:1; + unsigned int delegate_shouldEnableURL:1; + unsigned int delegate_validateURL:1; + unsigned int delegate_didChangeToDirectoryURL:1; + unsigned int changingFrameSize:1; + unsigned int movingAccessoryView:1; + unsigned int userAccessoryViewFrameChange:1; + unsigned int canChooseDirectories:1; + unsigned int canChooseFiles:1; + unsigned int delegate_selectionDidChange:1; + unsigned int delegate_didChangeToDirectory:1; + unsigned int calledWindowOrderedIn:1; + unsigned int appCentric:1; + unsigned int disableBottomControls:1; + unsigned int accessoryViewDisclosed:1; + unsigned int reserved:10; +} _SPFlags; + +@class NSSavePanelAuxiliary; + +@interface NSSavePanel : NSPanel { +@protected + + NSView *__navView; + NSView *_accessoryView; + NSArray *_allowedFileTypes; + NSString *_validatedPosixName; + NSString *_hiddenExtension; + + IBOutlet NSTextField *_messageTextField; + IBOutlet NSView *_savePane; + IBOutlet NSBox *_saveNavSeparatorBox; + IBOutlet NSView *_savePaneTopPartsContainer; + IBOutlet NSTextField *_nameField; + IBOutlet NSTextField *_nameFieldLabel; + IBOutlet NSButton *_expansionButton; + IBOutlet NSView *_directoryPopUpContainer; + IBOutlet NSControl *_directoryPopUp; + IBOutlet NSTextField *_directoryPopUpLabel; + IBOutlet NSBox *_navViewContainer; + IBOutlet NSBox *_accessoryViewContainer; + IBOutlet NSView *_bottomControlsContainer; + IBOutlet NSButton *_hideExtensionButton; + IBOutlet NSButton *_newFolderButton; + IBOutlet NSButton *_cancelButton; + IBOutlet NSButton *_okButton; + + id _filepathInputController; + id _reservedID; + + _SPFlags _spFlags; + + NSSavePanelAuxiliary *_spAuxiliaryStorage; + +@private + char _directorySet:1; + char _reserved[4]; + IBOutlet NSProgressIndicator *_openProgressIndicator; +} + + + ++ (NSSavePanel *)savePanel; + + + + + + + +- (NSURL *)URL; + + + + + + +- (NSURL *)directoryURL; +- (void)setDirectoryURL:(NSURL *)url; + + + + + +- (NSArray *)allowedFileTypes; +- (void)setAllowedFileTypes:(NSArray *)types; + + + + +- (BOOL)allowsOtherFileTypes; +- (void)setAllowsOtherFileTypes:(BOOL)flag; + + + +- (NSView *)accessoryView; +- (void)setAccessoryView:(NSView *)view; + + + +- (id )delegate; +- (void)setDelegate:(id)delegate; + + + + +- (BOOL)isExpanded; + + + +- (BOOL)canCreateDirectories; +- (void)setCanCreateDirectories:(BOOL)flag; + + + + +- (BOOL)canSelectHiddenExtension; +- (void)setCanSelectHiddenExtension:(BOOL)flag; + + + + +- (BOOL)isExtensionHidden; +- (void)setExtensionHidden:(BOOL)flag; + + + +- (BOOL)treatsFilePackagesAsDirectories; +- (void)setTreatsFilePackagesAsDirectories:(BOOL)flag; + + + +- (NSString *)prompt; +- (void)setPrompt:(NSString *)prompt; + + + +- (NSString *)title; +- (void)setTitle:(NSString *)title; + + + + +- (NSString *)nameFieldLabel; +- (void)setNameFieldLabel:(NSString *)label; + + + + +- (NSString *)nameFieldStringValue; +- (void)setNameFieldStringValue:(NSString *)value; + + + +- (NSString *)message; +- (void)setMessage:(NSString *)message; + +- (void)validateVisibleColumns; + + + +- (BOOL)showsHiddenFiles; +- (void)setShowsHiddenFiles:(BOOL)flag; + + + + +- (IBAction)ok:(id)sender; +- (IBAction)cancel:(id)sender; + + + + +#if NS_BLOCKS_AVAILABLE + + + +- (void)beginSheetModalForWindow:(NSWindow *)window completionHandler:(void (^)(NSInteger result))handler; + + + +- (void)beginWithCompletionHandler:(void (^)(NSInteger result))handler; + +#endif + + + +- (NSInteger)runModal; + +@end + + +@protocol NSOpenSavePanelDelegate +@optional + + + + + +- (BOOL)panel:(id)sender shouldEnableURL:(NSURL *)url; + + + + + +- (BOOL)panel:(id)sender validateURL:(NSURL *)url error:(NSError **)outError; + + + +- (void)panel:(id)sender didChangeToDirectoryURL:(NSURL *)url; + + + +- (NSString *)panel:(id)sender userEnteredFilename:(NSString *)filename confirmed:(BOOL)okFlag; + + + +- (void)panel:(id)sender willExpand:(BOOL)expanding; + + + +- (void)panelSelectionDidChange:(id)sender; + +@end + +@interface NSObject(NSSavePanelDelegateDeprecated) + + + +- (BOOL)panel:(id)sender isValidFilename:(NSString *)filename; + + + +- (void)panel:(id)sender directoryDidChange:(NSString *)path; + + + + - (NSComparisonResult)panel:(id)sender compareFilename:(NSString *)name1 with:(NSString *)name2 caseSensitive:(BOOL)caseSensitive; + + + +- (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename; + +@end + +@interface NSSavePanel(NSDeprecated) + + + +- (NSString *)filename; + + + +- (NSString *)directory; +- (void)setDirectory:(NSString *)path; + + + +- (NSString *)requiredFileType; +- (void)setRequiredFileType:(NSString *)type; + + + +- (void)beginSheetForDirectory:(NSString *)path file:(NSString *)name modalForWindow:(NSWindow *)docWindow modalDelegate:(id)delegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo; + + + +- (NSInteger)runModalForDirectory:(NSString *)path file:(NSString *)name; + + + +- (IBAction)selectText:(id)sender; + +@end diff --git a/src/AppKit/NSScreen.h b/src/AppKit/NSScreen.h new file mode 100644 index 000000000..7b8ee31d0 --- /dev/null +++ b/src/AppKit/NSScreen.h @@ -0,0 +1,56 @@ +#import +#import +#import + +@class NSArray, NSColorSpace; + +typedef struct NSScreenAuxiliary NSScreenAuxiliaryOpaque; + +@interface NSScreen : NSObject { + +@private + NSRect _frame; + NSWindowDepth _depth; + int _screenNumber; + id _auxiliaryStorage; +} + ++ (NSArray *)screens; ++ (NSScreen *)mainScreen; ++ (NSScreen *)deepestScreen; + +- (NSWindowDepth)depth; +- (NSRect)frame; +- (NSRect)visibleFrame; +- (NSDictionary *)deviceDescription; +- (NSColorSpace *)colorSpace; + +- (const NSWindowDepth *)supportedWindowDepths ; + + + +- (NSRect)convertRectToBacking:(NSRect)aRect; +- (NSRect)convertRectFromBacking:(NSRect)aRect; + + + +- (NSRect)backingAlignedRect:(NSRect)aRect options:(NSAlignmentOptions)options; + + + +- (CGFloat)backingScaleFactor; + +@end + + +EXTERN_C NSString * const NSScreenColorSpaceDidChangeNotification; + + +@interface NSScreen(NSDeprecated) + + + + +- (CGFloat)userSpaceScaleFactor; + +@end diff --git a/src/AppKit/NSScrollView.h b/src/AppKit/NSScrollView.h new file mode 100644 index 000000000..bdad6b0e3 --- /dev/null +++ b/src/AppKit/NSScrollView.h @@ -0,0 +1,244 @@ +#import +#import +#import +#import + +@class NSColor, NSClipView, NSRulerView, NSScroller; + +#if MAC_OS_X_VERSION_10_7 <= MAC_OS_X_VERSION_MAX_ALLOWED +enum { + NSScrollElasticityAutomatic = 0, + NSScrollElasticityNone = 1, + NSScrollElasticityAllowed = 2, +}; +#endif +typedef NSInteger NSScrollElasticity; + +typedef struct __SFlags { +#ifdef __BIG_ENDIAN__ + unsigned int vScrollerRequired:1; + unsigned int hScrollerRequired:1; + unsigned int vScrollerStatus:1; + unsigned int hScrollerStatus:1; + unsigned int noDynamicScrolling:1; + NSBorderType borderType:2; + unsigned int oldRulerInstalled:1; + unsigned int showRulers:1; + unsigned int hasHorizontalRuler:1; + unsigned int hasVerticalRuler:1; + unsigned int needsTile:1; + unsigned int doesNotDrawBackground:1; + unsigned int skipRemoveSuperviewCheck:1; + unsigned int focusRingNeedsRedisplay:1; + unsigned int hasCustomLineBorderColor:1; + unsigned int autohidesScrollers:1; + unsigned int autoforwardsScrollWheelEvents:1; + unsigned int findBarVisible:1; + unsigned int unused:1; + unsigned int vContentElasticity:2; + unsigned int hContentElasticity:2; + unsigned int predominantAxisScrolling:1; + unsigned int findBarPosition:2; + unsigned int RESERVED:5; +#else + unsigned int RESERVED:5; + unsigned int findBarPosition:2; + unsigned int predominantAxisScrolling:1; + unsigned int hContentElasticity:2; + unsigned int vContentElasticity:2; + unsigned int unused:1; + unsigned int findBarVisible:1; + unsigned int autoforwardsScrollWheelEvents:1; + unsigned int autohidesScrollers:1; + unsigned int hasCustomLineBorderColor:1; + unsigned int focusRingNeedsRedisplay:1; + unsigned int skipRemoveSuperviewCheck:1; + unsigned int doesNotDrawBackground:1; + unsigned int needsTile:1; + unsigned int hasVerticalRuler:1; + unsigned int hasHorizontalRuler:1; + unsigned int showRulers:1; + unsigned int oldRulerInstalled:1; + NSBorderType borderType:2; + unsigned int noDynamicScrolling:1; + unsigned int hScrollerStatus:1; + unsigned int vScrollerStatus:1; + unsigned int hScrollerRequired:1; + unsigned int vScrollerRequired:1; +#endif +} _SFlags; + +@interface NSScrollView : NSView +{ + + NSScroller *_vScroller; + NSScroller *_hScroller; + NSClipView *_contentView; + NSClipView *_headerClipView; + NSView * _cornerView; + id _ruler; + _SFlags _sFlags; + __strong void *_extraIvars; + + + NSRulerView *_horizontalRuler; + NSRulerView *_verticalRuler; +} + + + ++ (NSSize)frameSizeForContentSize:(NSSize)cSize horizontalScrollerClass:(Class)horizontalScrollerClass verticalScrollerClass:(Class)verticalScrollerClass borderType:(NSBorderType)aType controlSize:(NSControlSize)controlSize scrollerStyle:(NSScrollerStyle)scrollerStyle; + + + ++ (NSSize)contentSizeForFrameSize:(NSSize)fSize horizontalScrollerClass:(Class)horizontalScrollerClass verticalScrollerClass:(Class)verticalScrollerClass borderType:(NSBorderType)aType controlSize:(NSControlSize)controlSize scrollerStyle:(NSScrollerStyle)scrollerStyle; + + + ++ (NSSize)frameSizeForContentSize:(NSSize)cSize hasHorizontalScroller:(BOOL)hFlag hasVerticalScroller:(BOOL)vFlag borderType:(NSBorderType)aType; + + + ++ (NSSize)contentSizeForFrameSize:(NSSize)fSize hasHorizontalScroller:(BOOL)hFlag hasVerticalScroller:(BOOL)vFlag borderType:(NSBorderType)aType; + +- (NSRect)documentVisibleRect; +- (NSSize)contentSize; + +- (void)setDocumentView:(NSView *)aView; +- (id)documentView; +- (void)setContentView:(NSClipView *)contentView; +- (NSClipView *)contentView; +- (void)setDocumentCursor:(NSCursor *)anObj; +- (NSCursor *)documentCursor; +- (void)setBorderType:(NSBorderType)aType; +- (NSBorderType)borderType; +- (void)setBackgroundColor:(NSColor *)color; +- (NSColor *)backgroundColor; +- (void)setDrawsBackground:(BOOL)flag; +- (BOOL)drawsBackground; +- (void)setHasVerticalScroller:(BOOL)flag; +- (BOOL)hasVerticalScroller; +- (void)setHasHorizontalScroller:(BOOL)flag; +- (BOOL)hasHorizontalScroller; +- (void)setVerticalScroller:(NSScroller *)anObject; +- (NSScroller *)verticalScroller; +- (void)setHorizontalScroller:(NSScroller *)anObject; +- (NSScroller *)horizontalScroller; +- (BOOL)autohidesScrollers; +- (void)setAutohidesScrollers:(BOOL)flag; +- (void)setHorizontalLineScroll:(CGFloat)value; +- (void)setVerticalLineScroll:(CGFloat)value; +- (void)setLineScroll:(CGFloat)value; +- (CGFloat)horizontalLineScroll; +- (CGFloat)verticalLineScroll; +- (CGFloat)lineScroll; +- (void)setHorizontalPageScroll:(CGFloat)value; +- (void)setVerticalPageScroll:(CGFloat)value; +- (void)setPageScroll:(CGFloat)value; +- (CGFloat)horizontalPageScroll; +- (CGFloat)verticalPageScroll; +- (CGFloat)pageScroll; +- (void)setScrollsDynamically:(BOOL)flag; +- (BOOL)scrollsDynamically; +- (void)tile; +- (void)reflectScrolledClipView:(NSClipView *)cView; +- (void)scrollWheel:(NSEvent *)theEvent; + + + +- (NSScrollerStyle)scrollerStyle; +- (void)setScrollerStyle:(NSScrollerStyle)newScrollerStyle; + + + +- (NSScrollerKnobStyle)scrollerKnobStyle; +- (void)setScrollerKnobStyle:(NSScrollerKnobStyle)newScrollerKnobStyle; + + + +- (void)flashScrollers; + + + +- (NSScrollElasticity)horizontalScrollElasticity; +- (void)setHorizontalScrollElasticity:(NSScrollElasticity)elasticity; + + + +- (NSScrollElasticity)verticalScrollElasticity; +- (void)setVerticalScrollElasticity:(NSScrollElasticity)elasticity; + + + +- (BOOL)usesPredominantAxisScrolling; +- (void)setUsesPredominantAxisScrolling:(BOOL)predominantAxisScrolling; + + + +@property BOOL allowsMagnification; + + +@property CGFloat magnification; + + + +@property CGFloat maxMagnification; + + + +@property CGFloat minMagnification; + + + +- (void)magnifyToFitRect:(NSRect)rect; + + + +- (void)setMagnification:(CGFloat)magnification centeredAtPoint:(NSPoint)point; + +@end + + + +EXTERN_C NSString * const NSScrollViewWillStartLiveMagnifyNotification; + + + +EXTERN_C NSString * const NSScrollViewDidEndLiveMagnifyNotification; + + +@interface NSScrollView(NSRulerSupport) + ++ (void)setRulerViewClass:(Class)rulerViewClass; ++ (Class)rulerViewClass; + +- (void)setRulersVisible:(BOOL)flag; +- (BOOL)rulersVisible; + +- (void)setHasHorizontalRuler:(BOOL)flag; +- (BOOL)hasHorizontalRuler; +- (void)setHasVerticalRuler:(BOOL)flag; +- (BOOL)hasVerticalRuler; + +- (void)setHorizontalRulerView:(NSRulerView *)ruler; +- (NSRulerView *)horizontalRulerView; +- (void)setVerticalRulerView:(NSRulerView *)ruler; +- (NSRulerView *)verticalRulerView; + +@end + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 +enum { + NSScrollViewFindBarPositionAboveHorizontalRuler = 0, + NSScrollViewFindBarPositionAboveContent = 1, + NSScrollViewFindBarPositionBelowContent = 2 +}; +#endif +typedef NSInteger NSScrollViewFindBarPosition; + +@interface NSScrollView(NSFindBarSupport) + +- (void)setFindBarPosition:(NSScrollViewFindBarPosition)position; +- (NSScrollViewFindBarPosition)findBarPosition; + +@end diff --git a/src/AppKit/NSScroller.h b/src/AppKit/NSScroller.h new file mode 100644 index 000000000..14ca1e10b --- /dev/null +++ b/src/AppKit/NSScroller.h @@ -0,0 +1,150 @@ +#import +#import + +enum { + NSScrollerArrowsMaxEnd = 0, + NSScrollerArrowsMinEnd = 1, + NSScrollerArrowsDefaultSetting = 0, + NSScrollerArrowsNone = 2 +}; +typedef NSUInteger NSScrollArrowPosition; + +enum { + NSNoScrollerParts = 0, + NSOnlyScrollerArrows = 1, + NSAllScrollerParts = 2 +}; +typedef NSUInteger NSUsableScrollerParts; + +enum { + NSScrollerNoPart = 0, + NSScrollerDecrementPage = 1, + NSScrollerKnob = 2, + NSScrollerIncrementPage = 3, + NSScrollerDecrementLine = 4, + NSScrollerIncrementLine = 5, + NSScrollerKnobSlot = 6 +}; +typedef NSUInteger NSScrollerPart; + +enum { + NSScrollerIncrementArrow = 0, + NSScrollerDecrementArrow = 1 +}; +typedef NSUInteger NSScrollerArrow; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 +enum { + NSScrollerStyleLegacy = 0, + NSScrollerStyleOverlay = 1 +}; +#endif +typedef NSInteger NSScrollerStyle; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 +enum { + NSScrollerKnobStyleDefault = 0, + NSScrollerKnobStyleDark = 1, + NSScrollerKnobStyleLight = 2 +}; +#endif +typedef NSInteger NSScrollerKnobStyle; + +@interface NSScroller : NSControl +{ + + CGFloat _curValue; + CGFloat _percent; + CGFloat _knobSize; + struct __sFlags2 { + unsigned int hitPart:4; + unsigned int controlSize:2; + unsigned int inMaxEnd:1; + unsigned int setFloatValueOverridden:1; + unsigned int setFloatValueKnobProportionOverridden:1; + unsigned int style:1; + unsigned int styleCompatibility:1; + unsigned int overlayScrollerState:2; + unsigned int knobStyle:2; + unsigned int sbPaused:1; + unsigned int isAnimatingKnob:1; + unsigned int reserved:15; + } _sFlags2; + id _target; + SEL _action; + struct _sFlags { + unsigned int isHoriz:1; + NSScrollArrowPosition arrowsLoc:2; + NSUsableScrollerParts partsUsable:2; + unsigned int fine:1; + unsigned int needsEnableFlush:1; + unsigned int thumbing:1; + unsigned int slotDrawn:1; + unsigned int knobDrawn:1; + unsigned int lit:1; + unsigned int knobLit:1; + unsigned int reserved:1; + unsigned int controlTint:3; + unsigned int repeatCount:16; + } sFlags; +} ++ (BOOL)isCompatibleWithOverlayScrollers; + + + ++ (CGFloat)scrollerWidthForControlSize:(NSControlSize)controlSize scrollerStyle:(NSScrollerStyle)scrollerStyle; + + + ++ (CGFloat)scrollerWidthForControlSize:(NSControlSize)controlSize; + + + ++ (CGFloat)scrollerWidth; + + + ++ (NSScrollerStyle)preferredScrollerStyle; + + + +- (NSScrollerStyle)scrollerStyle; +- (void)setScrollerStyle:(NSScrollerStyle)newScrollerStyle; + + + +- (NSScrollerKnobStyle)knobStyle; +- (void)setKnobStyle:(NSScrollerKnobStyle)newKnobStyle; + +- (void)drawParts; +- (NSRect)rectForPart:(NSScrollerPart)partCode; +- (void)checkSpaceForParts; +- (NSUsableScrollerParts)usableParts; +- (void)setArrowsPosition:(NSScrollArrowPosition)where; +- (NSScrollArrowPosition)arrowsPosition; +- (void)setControlTint:(NSControlTint)controlTint; +- (NSControlTint)controlTint; +- (void)setControlSize:(NSControlSize)controlSize; +- (NSControlSize)controlSize; +- (void)drawArrow:(NSScrollerArrow)whichArrow highlight:(BOOL)flag; +- (void)drawKnob; +- (void)drawKnobSlotInRect:(NSRect)slotRect highlight:(BOOL)flag; +- (void)highlight:(BOOL)flag; +- (NSScrollerPart)testPart:(NSPoint)thePoint; +- (void)trackKnob:(NSEvent *)theEvent; +- (void)trackScrollButtons:(NSEvent *)theEvent; +- (NSScrollerPart)hitPart; +- (CGFloat)knobProportion; +- (void)setKnobProportion:(CGFloat)proportion; + +@end + +@interface NSScroller(NSDeprecated) + + +- (void)setFloatValue:(float)aFloat knobProportion:(CGFloat)proportion; +@end + + + +EXTERN_C NSString *const NSPreferredScrollerStyleDidChangeNotification; diff --git a/src/AppKit/NSSearchField.h b/src/AppKit/NSSearchField.h new file mode 100644 index 000000000..5d1f03128 --- /dev/null +++ b/src/AppKit/NSSearchField.h @@ -0,0 +1,20 @@ +#import + + +@interface NSSearchField : NSTextField { + @private + unsigned int _reserved1; + unsigned int _reserved2; + unsigned int _reserved3; + unsigned int _reserved4; +} + +- (void) setRecentSearches:(NSArray*)searches; +- (NSArray*) recentSearches; + + +- (void) setRecentsAutosaveName:(NSString*)string; +- (NSString*) recentsAutosaveName; + + +@end diff --git a/src/AppKit/NSSearchFieldCell.h b/src/AppKit/NSSearchFieldCell.h new file mode 100644 index 000000000..0597a58f5 --- /dev/null +++ b/src/AppKit/NSSearchFieldCell.h @@ -0,0 +1,87 @@ +#import + + + + +#define NSSearchFieldRecentsTitleMenuItemTag 1000 + + +#define NSSearchFieldRecentsMenuItemTag 1001 + + +#define NSSearchFieldClearRecentsMenuItemTag 1002 + + +#define NSSearchFieldNoRecentsMenuItemTag 1003 + + +@class NSButtonCell, NSMenu, NSMutableArray, NSTimer; + +@interface NSSearchFieldCell : NSTextFieldCell { + @private + struct __sfFlags { + unsigned int sendsWholeSearchString:1; + unsigned int maximumRecents:8; + unsigned int cancelVisible:1; + unsigned int reserved2:2; + unsigned int disableText:1; + unsigned int menuTracking:1; + unsigned int deferredUpdate:1; + unsigned int sendsImmediately:1; + + unsigned int reserved:16; + } _sfFlags; + NSButtonCell* _searchButtonCell; + NSButtonCell* _cancelButtonCell; + NSMenu* _searchMenuTemplate; + NSString* _recentsAutosaveName; + NSMutableArray* _recentSearches; + NSMenu* _searchMenu; + NSTimer* _partialStringTimer; + unsigned int _reserved1; + unsigned int _reserved2; + unsigned int _reserved3; + unsigned int _reserved4; +} + +- (NSButtonCell*) searchButtonCell; +- (void) setSearchButtonCell:(NSButtonCell*)cell; + + +- (NSButtonCell*) cancelButtonCell; +- (void) setCancelButtonCell:(NSButtonCell*)cell; + + +- (void) resetSearchButtonCell; +- (void) resetCancelButtonCell; + + +- (NSRect) searchTextRectForBounds:(NSRect)rect; +- (NSRect) searchButtonRectForBounds:(NSRect)rect; +- (NSRect) cancelButtonRectForBounds:(NSRect)rect; + + +- (void) setSearchMenuTemplate:(NSMenu*)menu; +- (NSMenu*)searchMenuTemplate; + + +- (void) setSendsWholeSearchString:(BOOL)flag; +- (BOOL) sendsWholeSearchString; + + +- (void) setMaximumRecents:(NSInteger)maxRecents; +- (NSInteger) maximumRecents; + + +- (void) setRecentSearches:(NSArray*)searches; +- (NSArray*) recentSearches; + + +- (void) setRecentsAutosaveName:(NSString*)string; +- (NSString*) recentsAutosaveName; + + +- (BOOL) sendsSearchStringImmediately; +- (void) setSendsSearchStringImmediately:(BOOL)flag; + +@end diff --git a/src/AppKit/NSSecureTextField.h b/src/AppKit/NSSecureTextField.h new file mode 100644 index 000000000..3be246eca --- /dev/null +++ b/src/AppKit/NSSecureTextField.h @@ -0,0 +1,19 @@ +#import +#import + +@interface NSSecureTextField : NSTextField { + +} +@end + +@interface NSSecureTextFieldCell : NSTextFieldCell { + + @private + BOOL _echosBullets; + BOOL _csMode; +} + +- (void)setEchosBullets:(BOOL)flag; +- (BOOL)echosBullets; + +@end diff --git a/src/AppKit/NSSegmentedCell.h b/src/AppKit/NSSegmentedCell.h new file mode 100644 index 000000000..61fb27c60 --- /dev/null +++ b/src/AppKit/NSSegmentedCell.h @@ -0,0 +1,110 @@ +#import +#import +#import + + +enum { + NSSegmentSwitchTrackingSelectOne = 0, + NSSegmentSwitchTrackingSelectAny = 1, + NSSegmentSwitchTrackingMomentary = 2 +}; +typedef NSUInteger NSSegmentSwitchTracking; + +@class NSMutableArray; + +@interface NSSegmentedCell : NSActionCell { + @private + NSMutableArray* _segmentItems; + NSInteger _selectedSegment; + NSInteger _keySegment; + NSRect _lastBounds; + struct { + unsigned int trackingMode:3; + unsigned int trimmedLabels:1; + unsigned int drawing:1; + unsigned int reserved1:2; + unsigned int recalcToolTips:1; + unsigned int usesWindowsStyle:1; + unsigned int dontShowSelectedAndPressedAppearance:1; + unsigned int menuShouldBeUniquedAgainstMain:1; + unsigned int style:8; + unsigned int flatMinX:1; + unsigned int flatMaxX:1; + unsigned int reserved:11; + } _seFlags; + id _segmentTrackingInfo; + id _menuUniquer; + NSInteger _reserved3; + NSInteger _reserved4; +} + + + +- (void)setSegmentCount:(NSInteger)count; +- (NSInteger)segmentCount; + + + +- (void)setSelectedSegment:(NSInteger)selectedSegment; +- (NSInteger)selectedSegment; + +- (BOOL)selectSegmentWithTag:(NSInteger)tag; + + + +- (void)makeNextSegmentKey; +- (void)makePreviousSegmentKey; + +- (void)setTrackingMode:(NSSegmentSwitchTracking)trackingMode; +- (NSSegmentSwitchTracking)trackingMode; + + + + + + +- (void)setWidth:(CGFloat)width forSegment:(NSInteger)segment; +- (CGFloat)widthForSegment:(NSInteger)segment; + +- (void)setImage:(NSImage *)image forSegment:(NSInteger)segment; +- (NSImage *)imageForSegment:(NSInteger)segment; + + +- (void)setImageScaling:(NSImageScaling)scaling forSegment:(NSInteger)segment; +- (NSImageScaling)imageScalingForSegment:(NSInteger)segment; + + +- (void)setLabel:(NSString *)label forSegment:(NSInteger)segment; +- (NSString *)labelForSegment:(NSInteger)segment; + +- (void)setSelected:(BOOL)selected forSegment:(NSInteger)segment; +- (BOOL)isSelectedForSegment:(NSInteger)segment; + +- (void)setEnabled:(BOOL)enabled forSegment:(NSInteger)segment; +- (BOOL)isEnabledForSegment:(NSInteger)segment; + +- (void)setMenu:(NSMenu *)menu forSegment:(NSInteger)segment; +- (NSMenu *)menuForSegment:(NSInteger)segment; + +- (void)setToolTip:(NSString *)toolTip forSegment:(NSInteger)segment; +- (NSString *)toolTipForSegment:(NSInteger)segment; + +- (void)setTag:(NSInteger)tag forSegment:(NSInteger)segment; +- (NSInteger)tagForSegment:(NSInteger)segment; + + +- (void)setSegmentStyle:(NSSegmentStyle)segmentStyle; +- (NSSegmentStyle)segmentStyle; + + + +- (void)drawSegment:(NSInteger)segment inFrame:(NSRect)frame withView:(NSView *)controlView; + +@end + + +@interface NSSegmentedCell (NSSegmentBackgroundStyle) + + +- (NSBackgroundStyle)interiorBackgroundStyleForSegment:(NSInteger)segment; +@end diff --git a/src/AppKit/NSSegmentedControl.h b/src/AppKit/NSSegmentedControl.h new file mode 100644 index 000000000..1162dd9df --- /dev/null +++ b/src/AppKit/NSSegmentedControl.h @@ -0,0 +1,69 @@ +#import +#import + + +@class NSImage; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +enum { + NSSegmentStyleAutomatic = 0, + NSSegmentStyleRounded = 1, + NSSegmentStyleRoundRect = 3, + NSSegmentStyleTexturedSquare = 4, + NSSegmentStyleSmallSquare = 6 +}; +#endif + +typedef NSInteger NSSegmentStyle; + +@interface NSSegmentedControl : NSControl { + @private + NSInteger _reserved1; + NSInteger _reserved2; + NSInteger _reserved3; + NSInteger _reserved4; +} + +- (void)setSegmentCount:(NSInteger)count; +- (NSInteger)segmentCount; + +- (void)setSelectedSegment:(NSInteger)selectedSegment; +- (NSInteger)selectedSegment; + +- (BOOL)selectSegmentWithTag:(NSInteger)tag; + +- (void)setWidth:(CGFloat)width forSegment:(NSInteger)segment; +- (CGFloat)widthForSegment:(NSInteger)segment; + +- (void)setImage:(NSImage *)image forSegment:(NSInteger)segment; +- (NSImage *)imageForSegment:(NSInteger)segment; + + +- (void)setImageScaling:(NSImageScaling)scaling forSegment:(NSInteger)segment; +- (NSImageScaling)imageScalingForSegment:(NSInteger)segment; + + +- (void)setLabel:(NSString *)label forSegment:(NSInteger)segment; +- (NSString *)labelForSegment:(NSInteger)segment; + +- (void)setMenu:(NSMenu *)menu forSegment:(NSInteger)segment; +- (NSMenu *)menuForSegment:(NSInteger)segment; + +- (void)setSelected:(BOOL)selected forSegment:(NSInteger)segment; +- (BOOL)isSelectedForSegment:(NSInteger)segment; + +- (void)setEnabled:(BOOL)enabled forSegment:(NSInteger)segment; +- (BOOL)isEnabledForSegment:(NSInteger)segment; + +- (void)setSegmentStyle:(NSSegmentStyle)segmentStyle; +- (NSSegmentStyle)segmentStyle; + +@end + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 + +enum { + NSSegmentStyleTexturedRounded = 2, + NSSegmentStyleCapsule = 5 +}; +#endif diff --git a/src/AppKit/NSShadow.h b/src/AppKit/NSShadow.h new file mode 100644 index 000000000..a9ae86512 --- /dev/null +++ b/src/AppKit/NSShadow.h @@ -0,0 +1,30 @@ +#import +#import + +@class NSColor; + + +@interface NSShadow : NSObject { + + NSUInteger _shadowFlags; + NSSize _shadowOffset; + CGFloat _shadowBlurRadius; + NSColor *_shadowColor; + CGFloat _reservedFloat[3]; + void *_reserved; +} + +- (id)init; + +- (NSSize)shadowOffset; +- (void)setShadowOffset:(NSSize)offset; + +- (CGFloat)shadowBlurRadius; +- (void)setShadowBlurRadius:(CGFloat)val; + +- (NSColor *)shadowColor; +- (void)setShadowColor:(NSColor *)color; + +- (void)set; + +@end diff --git a/src/AppKit/NSSharingService.h b/src/AppKit/NSSharingService.h new file mode 100644 index 000000000..08b9d8ae8 --- /dev/null +++ b/src/AppKit/NSSharingService.h @@ -0,0 +1,131 @@ +#import +#import +#import +#import +@class NSString, NSImage, NSArray, NSView, NSError, NSWindow; + + + + + + +EXTERN_C NSString * const NSSharingServiceNamePostOnFacebook; +EXTERN_C NSString * const NSSharingServiceNamePostOnTwitter; +EXTERN_C NSString * const NSSharingServiceNamePostOnSinaWeibo; +EXTERN_C NSString * const NSSharingServiceNameComposeEmail; +EXTERN_C NSString * const NSSharingServiceNameComposeMessage; +EXTERN_C NSString * const NSSharingServiceNameSendViaAirDrop; +EXTERN_C NSString * const NSSharingServiceNameAddToSafariReadingList; +EXTERN_C NSString * const NSSharingServiceNameAddToIPhoto; +EXTERN_C NSString * const NSSharingServiceNameAddToAperture; +EXTERN_C NSString * const NSSharingServiceNameUseAsTwitterProfileImage; +EXTERN_C NSString * const NSSharingServiceNameUseAsDesktopPicture; +EXTERN_C NSString * const NSSharingServiceNamePostImageOnFlickr; +EXTERN_C NSString * const NSSharingServiceNamePostVideoOnVimeo; +EXTERN_C NSString * const NSSharingServiceNamePostVideoOnYouku; +EXTERN_C NSString * const NSSharingServiceNamePostVideoOnTudou; + + +@protocol NSSharingServiceDelegate; + + +@interface NSSharingService : NSObject { +@private + id _reserved; +} +@property (assign) id delegate; +@property (readonly, copy) NSString *title; +@property (readonly, retain) NSImage *image; +@property (readonly, retain) NSImage *alternateImage; + + + + ++ (NSArray *)sharingServicesForItems:(NSArray *)items; + + + + ++ (NSSharingService *)sharingServiceNamed:(NSString *)serviceName; + + +#if NS_BLOCKS_AVAILABLE + + +- (id)initWithTitle:(NSString *)title image:(NSImage *)image alternateImage:(NSImage *)alternateImage handler:(void (^)(void))block; +#endif + + + + +- (BOOL)canPerformWithItems:(NSArray *)items; + + + + +- (void)performWithItems:(NSArray *)items; + +@end +typedef NS_ENUM(NSInteger, NSSharingContentScope) { + NSSharingContentScopeItem, + NSSharingContentScopePartial, + NSSharingContentScopeFull +} NS_ENUM_AVAILABLE_MAC(10_8); + +@protocol NSSharingServiceDelegate +@optional +- (void)sharingService:(NSSharingService *)sharingService willShareItems:(NSArray *)items; +- (void)sharingService:(NSSharingService *)sharingService didFailToShareItems:(NSArray *)items error:(NSError *)error; +- (void)sharingService:(NSSharingService *)sharingService didShareItems:(NSArray *)items; + + + + +- (NSRect)sharingService:(NSSharingService *)sharingService sourceFrameOnScreenForShareItem:(id )item; +- (NSImage *)sharingService:(NSSharingService *)sharingService transitionImageForShareItem:(id )item contentRect:(NSRect *)contentRect; +- (NSWindow *)sharingService:(NSSharingService *)sharingService sourceWindowForShareItems:(NSArray *)items sharingContentScope:(NSSharingContentScope *)sharingContentScope; + +@end + + + + + +@protocol NSSharingServicePickerDelegate; + + +@interface NSSharingServicePicker : NSObject +{ +@private + id _reserved; +} + +@property (assign) id delegate; + + + +- (id)initWithItems:(NSArray *)items; + + + + +- (void)showRelativeToRect:(NSRect)rect ofView:(NSView *)view preferredEdge:(NSRectEdge)preferredEdge; + +@end + + +@protocol NSSharingServicePickerDelegate +@optional +- (NSArray *)sharingServicePicker:(NSSharingServicePicker *)sharingServicePicker sharingServicesForItems:(NSArray *)items proposedSharingServices:(NSArray *)proposedServices; + + + + +- (id )sharingServicePicker:(NSSharingServicePicker *)sharingServicePicker delegateForSharingService:(NSSharingService *)sharingService; + + + + +- (void)sharingServicePicker:(NSSharingServicePicker *)sharingServicePicker didChooseSharingService:(NSSharingService *)service; + +@end diff --git a/src/AppKit/NSSlider.h b/src/AppKit/NSSlider.h new file mode 100644 index 000000000..1ce7127f9 --- /dev/null +++ b/src/AppKit/NSSlider.h @@ -0,0 +1,62 @@ +#import +#import + +@interface NSSlider : NSControl + +- (double)minValue; +- (void)setMinValue:(double)aDouble; +- (double)maxValue; +- (void)setMaxValue:(double)aDouble; +- (void)setAltIncrementValue:(double)incValue; +- (double)altIncrementValue; +- (void)setTitleCell:(NSCell *)aCell; +- (id)titleCell; +- (void)setTitleColor:(NSColor *)newColor; +- (NSColor *)titleColor; +- (void)setTitleFont:(NSFont *)fontObj; +- (NSFont *)titleFont; +- (NSString *)title; +- (void)setTitle:(NSString *)aString; +- (void)setKnobThickness:(CGFloat)aFloat; +- (CGFloat)knobThickness; +- (void)setImage:(NSImage *)backgroundImage; +- (NSImage *)image; +- (NSInteger)isVertical; +- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent; + +@end + +@interface NSSlider(NSTickMarkSupport) + + + +- (void)setNumberOfTickMarks:(NSInteger)count; +- (NSInteger)numberOfTickMarks; + + + +- (void)setTickMarkPosition:(NSTickMarkPosition)position; +- (NSTickMarkPosition)tickMarkPosition; + + + + +- (void)setAllowsTickMarkValuesOnly:(BOOL)yorn; +- (BOOL)allowsTickMarkValuesOnly; + + + +- (double)tickMarkValueAtIndex:(NSInteger)index; + + + +- (NSRect)rectOfTickMarkAtIndex:(NSInteger)index; + + + + +- (NSInteger)indexOfTickMarkAtPoint:(NSPoint)point; + +- (double)closestTickMarkValueToValue:(double)value; + +@end diff --git a/src/AppKit/NSSliderCell.h b/src/AppKit/NSSliderCell.h new file mode 100644 index 000000000..51a801843 --- /dev/null +++ b/src/AppKit/NSSliderCell.h @@ -0,0 +1,105 @@ +#import + +enum { + NSTickMarkBelow = 0, + NSTickMarkAbove = 1, + NSTickMarkLeft = NSTickMarkAbove, + NSTickMarkRight = NSTickMarkBelow +}; +typedef NSUInteger NSTickMarkPosition; + +enum { + NSLinearSlider = 0, + NSCircularSlider = 1 +}; +typedef NSUInteger NSSliderType; + +@interface NSSliderCell : NSActionCell +{ + + int _reserved[3]; + int _numberOfTickMarks; + double _altIncValue; + double _value; + double _maxValue; + double _minValue; + NSRect _trackRect; + struct __sliderCellFlags { + unsigned int weAreVertical:1; + unsigned int weAreVerticalSet:1; + unsigned int reserved1:1; + unsigned int isPressed:1; + unsigned int allowsTickMarkValuesOnly:1; + unsigned int tickMarkPosition:1; + unsigned int sliderType:2; + unsigned int drawing:1; + unsigned int reserved2:23; + } _scFlags; +} + + ++ (BOOL)prefersTrackingUntilMouseUp; + + +- (double)minValue; +- (void)setMinValue:(double)aDouble; +- (double)maxValue; +- (void)setMaxValue:(double)aDouble; +- (void)setAltIncrementValue:(double)incValue; +- (double)altIncrementValue; +- (NSInteger)isVertical; +- (void)setTitleColor:(NSColor *)newColor; +- (NSColor *)titleColor; +- (void)setTitleFont:(NSFont *)fontObj; +- (NSFont *)titleFont; +- (NSString *)title; +- (void)setTitle:(NSString *)aString; +- (void)setTitleCell:(NSCell *)aCell; +- (id)titleCell; +- (void)setKnobThickness:(CGFloat)aFloat; +- (CGFloat)knobThickness; +- (NSRect)knobRectFlipped:(BOOL)flipped; +- (void)drawKnob:(NSRect)knobRect; +- (void)drawKnob; +- (void)drawBarInside:(NSRect)aRect flipped:(BOOL)flipped; +- (NSRect)trackRect; + +- (void) setSliderType:(NSSliderType)sliderType; +- (NSSliderType)sliderType; + +@end + +@interface NSSliderCell(NSTickMarkSupport) + + + +- (void)setNumberOfTickMarks:(NSInteger)count; +- (NSInteger)numberOfTickMarks; + + + +- (void)setTickMarkPosition:(NSTickMarkPosition)position; +- (NSTickMarkPosition)tickMarkPosition; + + + + +- (void)setAllowsTickMarkValuesOnly:(BOOL)yorn; +- (BOOL)allowsTickMarkValuesOnly; + + + +- (double)tickMarkValueAtIndex:(NSInteger)index; + + + +- (NSRect)rectOfTickMarkAtIndex:(NSInteger)index; + + + + +- (NSInteger)indexOfTickMarkAtPoint:(NSPoint)point; + +- (double)closestTickMarkValueToValue:(double)value; + +@end diff --git a/src/AppKit/NSSound.h b/src/AppKit/NSSound.h new file mode 100644 index 000000000..c19f64474 --- /dev/null +++ b/src/AppKit/NSSound.h @@ -0,0 +1,120 @@ +#import +#import +#import +#import + +@class NSData, NSURL; +@protocol NSSoundDelegate; + +EXTERN_C NSString * const NSSoundPboardType; + +@interface NSSound : NSObject +{ +@private + id _delegate; + id _info; + id _reserved[6]; + uint32_t _sFlags; +} + + + ++ (id)soundNamed:(NSString *)name; + + + +- (id)initWithContentsOfURL:(NSURL *)url byReference:(BOOL)byRef; + + +- (id)initWithContentsOfFile:(NSString *)path byReference:(BOOL)byRef; + + + +- (id)initWithData:(NSData *)data; + +- (BOOL)setName:(NSString *)string; +- (NSString *)name; + + ++ (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard; ++ (NSArray*)soundUnfilteredTypes; +- (id)initWithPasteboard:(NSPasteboard *)pasteboard; +- (void)writeToPasteboard:(NSPasteboard *)pasteboard; + + +- (BOOL)play; +- (BOOL)pause; +- (BOOL)resume; +- (BOOL)stop; +- (BOOL)isPlaying; + +- (id )delegate; +- (void)setDelegate:(id )aDelegate; + + + + +- (NSTimeInterval)duration; + + + +- (void)setVolume:(float)volume; +- (float)volume; + + + +- (NSTimeInterval)currentTime; + + + +- (void)setCurrentTime:(NSTimeInterval)seconds; + + + +- (void)setLoops:(BOOL)val; + + +- (BOOL)loops; + + + +- (void)setPlaybackDeviceIdentifier:(NSString *)deviceUID; + + + +- (NSString *)playbackDeviceIdentifier; + + + +- (void)setChannelMapping:(NSArray *)channelMapping; + + + +- (NSArray *)channelMapping; + + +@end + +@interface NSSound (NSDeprecated) + + + ++ (NSArray *)soundUnfilteredFileTypes; ++ (NSArray *)soundUnfilteredPasteboardTypes; + +@end + +@protocol NSSoundDelegate +@optional + +- (void)sound:(NSSound *)sound didFinishPlaying:(BOOL)aBool; + +@end + +@interface NSBundle (NSBundleSoundExtensions) + + + +- (NSString *)pathForSoundResource:(NSString *)name; + +@end diff --git a/src/AppKit/NSSpeechRecognizer.h b/src/AppKit/NSSpeechRecognizer.h new file mode 100644 index 000000000..c1f8c1736 --- /dev/null +++ b/src/AppKit/NSSpeechRecognizer.h @@ -0,0 +1,39 @@ +#import +#import + +@class NSArray, NSString; +@protocol NSSpeechRecognizerDelegate; + + +@interface NSSpeechRecognizer : NSObject { +@private + id _privateNSSpeechRecognizerVars; +} + +- (id)init; + +- (void)startListening; +- (void)stopListening; + +- (id )delegate; +- (void)setDelegate:(id )anObject; + +- (NSArray *)commands; +- (void)setCommands:(NSArray *)commands; + +- (NSString *)displayedCommandsTitle; +- (void)setDisplayedCommandsTitle:(NSString *)title; + +- (BOOL)listensInForegroundOnly; +- (void)setListensInForegroundOnly:(BOOL)flag; + +- (BOOL)blocksOtherRecognizers; +- (void)setBlocksOtherRecognizers:(BOOL)flag; + +@end + +@protocol NSSpeechRecognizerDelegate +@optional +- (void)speechRecognizer:(NSSpeechRecognizer *)sender didRecognizeCommand:(id)command; + +@end diff --git a/src/AppKit/NSSpeechSynthesizer.h b/src/AppKit/NSSpeechSynthesizer.h new file mode 100644 index 000000000..95850edd6 --- /dev/null +++ b/src/AppKit/NSSpeechSynthesizer.h @@ -0,0 +1,145 @@ +#import +#import +#import + +@class NSArray, NSDictionary, NSString, NSURL, NSError; +@protocol NSSpeechSynthesizerDelegate; + +EXTERN_C NSString *const NSVoiceName; +EXTERN_C NSString *const NSVoiceIdentifier; +EXTERN_C NSString *const NSVoiceAge; +EXTERN_C NSString *const NSVoiceGender; +EXTERN_C NSString *const NSVoiceDemoText; +EXTERN_C NSString *const NSVoiceLocaleIdentifier; +EXTERN_C NSString *const NSVoiceSupportedCharacters; +EXTERN_C NSString *const NSVoiceIndividuallySpokenCharacters; + + +EXTERN_C NSString *const NSVoiceGenderNeuter; +EXTERN_C NSString *const NSVoiceGenderMale; +EXTERN_C NSString *const NSVoiceGenderFemale; + + +EXTERN_C NSString *const NSVoiceLanguage; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 + +enum { + NSSpeechImmediateBoundary = 0, + NSSpeechWordBoundary, + NSSpeechSentenceBoundary +}; +#endif +typedef NSUInteger NSSpeechBoundary; + + +@interface NSSpeechSynthesizer : NSObject { +@private + id _privateNSSpeechSynthesizerVars; +} + +- (id)initWithVoice:(NSString *)voice; + +- (BOOL)startSpeakingString:(NSString *)string; +- (BOOL)startSpeakingString:(NSString *)string toURL:(NSURL *)url; + +- (BOOL)isSpeaking; +- (void)stopSpeaking; +- (void)stopSpeakingAtBoundary:(NSSpeechBoundary)boundary; +- (void)pauseSpeakingAtBoundary:(NSSpeechBoundary)boundary; +- (void)continueSpeaking; + +- (id )delegate; +- (void)setDelegate:(id )anObject; +- (NSString *)voice; +- (BOOL)setVoice:(NSString *)voice; +- (float)rate; +- (void)setRate:(float)rate; +- (float)volume; +- (void)setVolume:(float)volume; +- (BOOL)usesFeedbackWindow; +- (void)setUsesFeedbackWindow:(BOOL)flag; + +- (void)addSpeechDictionary:(NSDictionary*)speechDictionary; +- (NSString *)phonemesFromText:(NSString *)text; + +- (id)objectForProperty:(NSString *)property error:(NSError **)outError; +- (BOOL)setObject:(id)object forProperty:(NSString *)property error:(NSError **)outError; + ++ (BOOL)isAnyApplicationSpeaking; ++ (NSString *)defaultVoice; ++ (NSArray *)availableVoices; ++ (NSDictionary *)attributesForVoice:(NSString*)voice; + +@end + +@protocol NSSpeechSynthesizerDelegate +@optional +- (void)speechSynthesizer:(NSSpeechSynthesizer *)sender didFinishSpeaking:(BOOL)finishedSpeaking; +- (void)speechSynthesizer:(NSSpeechSynthesizer *)sender willSpeakWord:(NSRange)characterRange ofString:(NSString *)string; +- (void)speechSynthesizer:(NSSpeechSynthesizer *)sender willSpeakPhoneme:(short)phonemeOpcode; +- (void)speechSynthesizer:(NSSpeechSynthesizer *)sender didEncounterErrorAtIndex:(NSUInteger)characterIndex ofString:(NSString *)string message:(NSString *)message; +- (void)speechSynthesizer:(NSSpeechSynthesizer *)sender didEncounterSyncMessage:(NSString *)message; +@end + + +EXTERN_C NSString *const NSSpeechStatusProperty; +EXTERN_C NSString *const NSSpeechErrorsProperty; +EXTERN_C NSString *const NSSpeechInputModeProperty; +EXTERN_C NSString *const NSSpeechCharacterModeProperty; +EXTERN_C NSString *const NSSpeechNumberModeProperty; +EXTERN_C NSString *const NSSpeechRateProperty; +EXTERN_C NSString *const NSSpeechPitchBaseProperty; +EXTERN_C NSString *const NSSpeechPitchModProperty; +EXTERN_C NSString *const NSSpeechVolumeProperty; +EXTERN_C NSString *const NSSpeechSynthesizerInfoProperty; +EXTERN_C NSString *const NSSpeechRecentSyncProperty; +EXTERN_C NSString *const NSSpeechPhonemeSymbolsProperty; +EXTERN_C NSString *const NSSpeechCurrentVoiceProperty; +EXTERN_C NSString *const NSSpeechCommandDelimiterProperty; +EXTERN_C NSString *const NSSpeechResetProperty; +EXTERN_C NSString *const NSSpeechOutputToFileURLProperty; + + +EXTERN_C NSString *const NSSpeechModeText; +EXTERN_C NSString *const NSSpeechModePhoneme; + + +EXTERN_C NSString *const NSSpeechModeNormal; +EXTERN_C NSString *const NSSpeechModeLiteral; + + +EXTERN_C NSString *const NSSpeechStatusOutputBusy; +EXTERN_C NSString *const NSSpeechStatusOutputPaused; +EXTERN_C NSString *const NSSpeechStatusNumberOfCharactersLeft; +EXTERN_C NSString *const NSSpeechStatusPhonemeCode; + + +EXTERN_C NSString *const NSSpeechErrorCount; +EXTERN_C NSString *const NSSpeechErrorOldestCode; +EXTERN_C NSString *const NSSpeechErrorOldestCharacterOffset; +EXTERN_C NSString *const NSSpeechErrorNewestCode; +EXTERN_C NSString *const NSSpeechErrorNewestCharacterOffset; + + +EXTERN_C NSString *const NSSpeechSynthesizerInfoIdentifier; +EXTERN_C NSString *const NSSpeechSynthesizerInfoVersion; + + +EXTERN_C NSString *const NSSpeechPhonemeInfoOpcode; +EXTERN_C NSString *const NSSpeechPhonemeInfoSymbol; +EXTERN_C NSString *const NSSpeechPhonemeInfoExample; +EXTERN_C NSString *const NSSpeechPhonemeInfoHiliteStart; +EXTERN_C NSString *const NSSpeechPhonemeInfoHiliteEnd; + + +EXTERN_C NSString *const NSSpeechCommandPrefix; +EXTERN_C NSString *const NSSpeechCommandSuffix; + + +EXTERN_C NSString *const NSSpeechDictionaryLocaleIdentifier; +EXTERN_C NSString *const NSSpeechDictionaryModificationDate; +EXTERN_C NSString *const NSSpeechDictionaryPronunciations; +EXTERN_C NSString *const NSSpeechDictionaryAbbreviations; +EXTERN_C NSString *const NSSpeechDictionaryEntrySpelling; +EXTERN_C NSString *const NSSpeechDictionaryEntryPhonemes; diff --git a/src/AppKit/NSSpellChecker.h b/src/AppKit/NSSpellChecker.h new file mode 100644 index 000000000..d51095833 --- /dev/null +++ b/src/AppKit/NSSpellChecker.h @@ -0,0 +1,197 @@ +#import +#import +#import +#import +#import + +@class NSArray, NSDictionary, NSString, NSOrthography, NSPanel, NSView, NSViewController, NSMenu; +@interface NSSpellChecker : NSObject { + + + +@private + + id _guessesBrowser; + id _wordField; + id _languagePopUp; + id _reserved1; + id _panel; + id _reserved2; + id _correctButton; + id _guessButton; + id _ignoreButton; + id _reserved3; + id _languagesBrowser; + id _quotesBrowser; + id _replacementsBrowser; + id _defineButton; + + struct __scFlags { + unsigned int autoShowGuesses:1; + unsigned int needDelayedGuess:1; + unsigned int unignoreInProgress:1; + unsigned int wordFieldEdited:1; + unsigned int inSpelling:1; + unsigned int reconnectSpelling:1; + unsigned int inGrammar:1; + unsigned int reconnectGrammar:1; + unsigned int languageIdentification:1; + unsigned int languagesHidden:1; + unsigned int quotesByLanguage:1; + unsigned int _reserved:21; + } _scFlags; + + id _substitutionsPanel; + id _reserved4; + id _learnButton; + id _infoField; + id _grammarControl; +} + + ++ (NSSpellChecker *)sharedSpellChecker; ++ (BOOL)sharedSpellCheckerExists; + + ++ (NSInteger)uniqueSpellDocumentTag; + + +- (NSRange)checkSpellingOfString:(NSString *)stringToCheck startingAt:(NSInteger)startingOffset language:(NSString *)language wrap:(BOOL)wrapFlag inSpellDocumentWithTag:(NSInteger)tag wordCount:(NSInteger *)wordCount; + +- (NSRange)checkSpellingOfString:(NSString *)stringToCheck startingAt:(NSInteger)startingOffset; + + +- (NSInteger)countWordsInString:(NSString *)stringToCount language:(NSString *)language; + + +- (NSRange)checkGrammarOfString:(NSString *)stringToCheck startingAt:(NSInteger)startingOffset language:(NSString *)language wrap:(BOOL)wrapFlag inSpellDocumentWithTag:(NSInteger)tag details:(NSArray **)details; + + +- (NSArray *)checkString:(NSString *)stringToCheck range:(NSRange)range types:(NSTextCheckingTypes)checkingTypes options:(NSDictionary *)options inSpellDocumentWithTag:(NSInteger)tag orthography:(NSOrthography **)orthography wordCount:(NSInteger *)wordCount; + +#if NS_BLOCKS_AVAILABLE + +- (NSInteger)requestCheckingOfString:(NSString *)stringToCheck range:(NSRange)range types:(NSTextCheckingTypes)checkingTypes options:(NSDictionary *)options inSpellDocumentWithTag:(NSInteger)tag completionHandler:(void (^)(NSInteger sequenceNumber, NSArray *results, NSOrthography *orthography, NSInteger wordCount))completionHandler; +#endif + + +- (NSMenu *)menuForResult:(NSTextCheckingResult *)result string:(NSString *)checkedString options:(NSDictionary *)options atLocation:(NSPoint)location inView:(NSView *)view; + + +EXTERN_C NSString *NSTextCheckingOrthographyKey; +EXTERN_C NSString *NSTextCheckingQuotesKey; +EXTERN_C NSString *NSTextCheckingReplacementsKey; +EXTERN_C NSString *NSTextCheckingReferenceDateKey; +EXTERN_C NSString *NSTextCheckingReferenceTimeZoneKey; +EXTERN_C NSString *NSTextCheckingDocumentURLKey; +EXTERN_C NSString *NSTextCheckingDocumentTitleKey; +EXTERN_C NSString *NSTextCheckingDocumentAuthorKey; +EXTERN_C NSString *NSTextCheckingRegularExpressionsKey; + + +- (NSArray *)userQuotesArrayForLanguage:(NSString *)language; +- (NSDictionary *)userReplacementsDictionary; + + +- (void)updateSpellingPanelWithMisspelledWord:(NSString *)word; + + +- (void)updateSpellingPanelWithGrammarString:(NSString *)string detail:(NSDictionary *)detail; + + +- (NSPanel *)spellingPanel; +- (NSView *)accessoryView; +- (void)setAccessoryView:(NSView *)aView; + + +- (NSPanel *)substitutionsPanel; +- (NSViewController *)substitutionsPanelAccessoryViewController; +- (void)setSubstitutionsPanelAccessoryViewController:(NSViewController *)accessoryController; + + +- (void)updatePanels; + + +- (void)ignoreWord:(NSString *)wordToIgnore inSpellDocumentWithTag:(NSInteger)tag; + +- (NSArray *)ignoredWordsInSpellDocumentWithTag:(NSInteger)tag; +- (void)setIgnoredWords:(NSArray *)words inSpellDocumentWithTag:(NSInteger)tag; + + +- (NSArray *)guessesForWordRange:(NSRange)range inString:(NSString *)string language:(NSString *)language inSpellDocumentWithTag:(NSInteger)tag; + + +- (NSString *)correctionForWordRange:(NSRange)range inString:(NSString *)string language:(NSString *)language inSpellDocumentWithTag:(NSInteger)tag; + + +- (NSArray *)completionsForPartialWordRange:(NSRange)range inString:(NSString *)string language:(NSString *)language inSpellDocumentWithTag:(NSInteger)tag; + + +- (NSString *)languageForWordRange:(NSRange)range inString:(NSString *)string orthography:(NSOrthography *)orthography; + + +- (void)closeSpellDocumentWithTag:(NSInteger)tag; + + +enum { + NSCorrectionResponseNone, + NSCorrectionResponseAccepted, + NSCorrectionResponseRejected, + NSCorrectionResponseIgnored, + NSCorrectionResponseEdited, + NSCorrectionResponseReverted +}; +typedef NSInteger NSCorrectionResponse; + +- (void)recordResponse:(NSCorrectionResponse)response toCorrection:(NSString *)correction forWord:(NSString *)word language:(NSString *)language inSpellDocumentWithTag:(NSInteger)tag; + + +enum { + NSCorrectionIndicatorTypeDefault = 0, + NSCorrectionIndicatorTypeReversion, + NSCorrectionIndicatorTypeGuesses +}; +typedef NSInteger NSCorrectionIndicatorType; + +- (void)showCorrectionIndicatorOfType:(NSCorrectionIndicatorType)type primaryString:(NSString *)primaryString alternativeStrings:(NSArray *)alternativeStrings forStringInRect:(NSRect)rectOfTypedString view:(NSView *)view completionHandler:(void (^)(NSString *acceptedString))completionBlock; +- (void)dismissCorrectionIndicatorForView:(NSView *)view; + + + +- (NSArray *)availableLanguages; +- (NSArray *)userPreferredLanguages; +- (BOOL)automaticallyIdentifiesLanguages; +- (void)setAutomaticallyIdentifiesLanguages:(BOOL)flag; + + +- (void)setWordFieldStringValue:(NSString *)aString; + + +- (void)learnWord:(NSString *)word; +- (BOOL)hasLearnedWord:(NSString *)word; +- (void)unlearnWord:(NSString *)word; + + ++ (BOOL)isAutomaticTextReplacementEnabled; ++ (BOOL)isAutomaticSpellingCorrectionEnabled; + + + +- (NSString *)language; +- (BOOL)setLanguage:(NSString *)language; + +@end + + +EXTERN_C NSString * const NSSpellCheckerDidChangeAutomaticSpellingCorrectionNotification; +EXTERN_C NSString * const NSSpellCheckerDidChangeAutomaticTextReplacementNotification; + +@interface NSSpellChecker(NSDeprecated) + + +- (NSArray *)guessesForWord:(NSString *)word; + + +- (void)forgetWord:(NSString *)word; + +@end diff --git a/src/AppKit/NSSpellProtocol.h b/src/AppKit/NSSpellProtocol.h new file mode 100644 index 000000000..23b568cc9 --- /dev/null +++ b/src/AppKit/NSSpellProtocol.h @@ -0,0 +1,17 @@ +#import + + + + + +@protocol NSChangeSpelling +- (void)changeSpelling:(id)sender; +@end + + + + + +@protocol NSIgnoreMisspelledWords +- (void)ignoreSpelling:(id)sender; +@end diff --git a/src/AppKit/NSSplitView.h b/src/AppKit/NSSplitView.h new file mode 100644 index 000000000..95b015bc5 --- /dev/null +++ b/src/AppKit/NSSplitView.h @@ -0,0 +1,171 @@ +#import +#import + +@class NSNotification; +@protocol NSSplitViewDelegate; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +enum { + NSSplitViewDividerStyleThick = 1, + NSSplitViewDividerStyleThin = 2, +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAX_OS_X_VERSION_10_6 + NSSplitViewDividerStylePaneSplitter = 3, +#endif +}; +#endif +typedef NSInteger NSSplitViewDividerStyle; + + +@interface NSSplitView : NSView { + @private + id _variables; +} + + + +- (void)setVertical:(BOOL)flag; +- (BOOL)isVertical; + + + + +- (void)setDividerStyle:(NSSplitViewDividerStyle)dividerStyle; +- (NSSplitViewDividerStyle)dividerStyle; + + + +- (void)setAutosaveName:(NSString *)autosaveName; +- (NSString *)autosaveName; + + + + +- (void)setDelegate:(id )delegate; +- (id )delegate; + + + +- (void)drawDividerInRect:(NSRect)rect; + + + + +- (NSColor *)dividerColor; + + + + +- (CGFloat)dividerThickness; + + + +- (void)adjustSubviews; + + + +- (BOOL)isSubviewCollapsed:(NSView *)subview; + + + + + + + +- (CGFloat)minPossiblePositionOfDividerAtIndex:(NSInteger)dividerIndex; +- (CGFloat)maxPossiblePositionOfDividerAtIndex:(NSInteger)dividerIndex; + + + +- (void)setPosition:(CGFloat)position ofDividerAtIndex:(NSInteger)dividerIndex; + + + + + +- (NSLayoutPriority)holdingPriorityForSubviewAtIndex:(NSInteger)subviewIndex; +- (void)setHoldingPriority:(NSLayoutPriority)priority forSubviewAtIndex:(NSInteger)subviewIndex; + +@end + +@protocol NSSplitViewDelegate +@optional + + + + + + +- (BOOL)splitView:(NSSplitView *)splitView canCollapseSubview:(NSView *)subview; + + + + +- (BOOL)splitView:(NSSplitView *)splitView shouldCollapseSubview:(NSView *)subview forDoubleClickOnDividerAtIndex:(NSInteger)dividerIndex; + + + + + + +- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMinimumPosition ofSubviewAt:(NSInteger)dividerIndex; + + + + + +- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMaximumPosition ofSubviewAt:(NSInteger)dividerIndex; + + + +- (CGFloat)splitView:(NSSplitView *)splitView constrainSplitPosition:(CGFloat)proposedPosition ofSubviewAt:(NSInteger)dividerIndex; + + + + + +- (void)splitView:(NSSplitView *)splitView resizeSubviewsWithOldSize:(NSSize)oldSize; + + + + +- (BOOL)splitView:(NSSplitView *)splitView shouldAdjustSizeOfSubview:(NSView *)view; + + + + + +- (BOOL)splitView:(NSSplitView *)splitView shouldHideDividerAtIndex:(NSInteger)dividerIndex; + + + +- (NSRect)splitView:(NSSplitView *)splitView effectiveRect:(NSRect)proposedEffectiveRect forDrawnRect:(NSRect)drawnRect ofDividerAtIndex:(NSInteger)dividerIndex; + + + +- (NSRect)splitView:(NSSplitView *)splitView additionalEffectiveRectOfDividerAtIndex:(NSInteger)dividerIndex; + + + + +- (void)splitViewWillResizeSubviews:(NSNotification *)notification; +- (void)splitViewDidResizeSubviews:(NSNotification *)notification; + +@end + + + +EXTERN_C NSString *NSSplitViewWillResizeSubviewsNotification; + + + +EXTERN_C NSString *NSSplitViewDidResizeSubviewsNotification; + + +@interface NSSplitView (NSDeprecated) + + + +- (void)setIsPaneSplitter:(BOOL)flag; +- (BOOL)isPaneSplitter; + +@end diff --git a/src/AppKit/NSStatusBar.h b/src/AppKit/NSStatusBar.h new file mode 100644 index 000000000..1a66ccde3 --- /dev/null +++ b/src/AppKit/NSStatusBar.h @@ -0,0 +1,29 @@ +#import +#import + +@class NSColor; +@class NSFont; +@class NSStatusItem; +@class NSMutableArray; + +#define NSVariableStatusItemLength (-1) +#define NSSquareStatusItemLength (-2) + +@interface NSStatusBar : NSObject +{ + @private + id _items; + void *_fReserved1; + void *_fReserved2; + NSInteger _registeredForNote; +} + ++ (NSStatusBar*)systemStatusBar; + +- (NSStatusItem*)statusItemWithLength:(CGFloat)length; +- (void)removeStatusItem:(NSStatusItem*)item; + +- (BOOL)isVertical; +- (CGFloat)thickness; + +@end diff --git a/src/AppKit/NSStatusItem.h b/src/AppKit/NSStatusItem.h new file mode 100644 index 000000000..c70c964c2 --- /dev/null +++ b/src/AppKit/NSStatusItem.h @@ -0,0 +1,90 @@ +#import +#import + +@class NSAttributedString; +@class NSImage; +@class NSMenu; +@class NSStatusBar; +@class NSString; +@class NSView; +@class NSWindow; + + +@interface NSStatusItem : NSObject +{ + @private + NSStatusBar* _fStatusBar; + CGFloat _fLength; + NSWindow* _fWindow; + NSView* _fView; + int _fPriority; + struct { + unsigned int customView:1; + unsigned int highlightMode:1; + unsigned int hasAlternateImage:1; + unsigned int hidden:1; + unsigned int backgroundStyle:4; + unsigned int inAdjustLength:1; + unsigned int reserved:23; + } _fFlags; + id _statusItemMenu; + id _fReserved2; + id _fReserved3; + id _fReserved4; +} + +- (NSStatusBar* )statusBar; + +- (CGFloat)length; +- (void)setLength:(CGFloat)length; + +@end + +@interface NSStatusItem (NSStatusItemCommon) + +- (SEL)action; +- (void)setAction:(SEL)action; + +- (SEL)doubleAction; +- (void)setDoubleAction:(SEL)action; + +- (id)target; +- (void)setTarget:(id)target; + +- (NSString* )title; +- (void)setTitle:(NSString*)title; + +- (NSAttributedString* )attributedTitle; +- (void)setAttributedTitle:(NSAttributedString*)title; + +- (NSImage* )image; +- (void)setImage:(NSImage*)image; + +- (NSImage *)alternateImage; +- (void)setAlternateImage:(NSImage*)image; + +- (NSMenu* )menu; +- (void)setMenu:(NSMenu*)menu; + +- (BOOL)isEnabled; +- (void)setEnabled:(BOOL)enabled; + +- (NSString* )toolTip; +- (void)setToolTip:(NSString*)toolTip; + +- (void)setHighlightMode:(BOOL)highlightMode; +- (BOOL)highlightMode; + +- (NSInteger)sendActionOn:(NSInteger)mask; + +- (void)popUpStatusItemMenu:(NSMenu*)menu; +- (void)drawStatusBarBackgroundInRect:(NSRect)rect withHighlight:(BOOL)highlight; + +@end + +@interface NSStatusItem (NSStatusItemView) + +- (NSView* )view; +- (void)setView:(NSView*)view; + +@end diff --git a/src/AppKit/NSStepper.h b/src/AppKit/NSStepper.h new file mode 100644 index 000000000..24090f0fa --- /dev/null +++ b/src/AppKit/NSStepper.h @@ -0,0 +1,26 @@ +#import + +@interface NSStepper : NSControl { + @private + unsigned int _reserved1; + unsigned int _reserved2; + unsigned int _reserved3; + unsigned int _reserved4; +} + +- (double)minValue; +- (void)setMinValue:(double)minValue; + +- (double)maxValue; +- (void)setMaxValue:(double)maxValue; + +- (double)increment; +- (void)setIncrement:(double)increment; + +- (BOOL)valueWraps; +- (void)setValueWraps:(BOOL)valueWraps; + +- (BOOL)autorepeat; +- (void)setAutorepeat:(BOOL)autorepeat; + +@end diff --git a/src/AppKit/NSStepperCell.h b/src/AppKit/NSStepperCell.h new file mode 100644 index 000000000..5bcdceae4 --- /dev/null +++ b/src/AppKit/NSStepperCell.h @@ -0,0 +1,36 @@ +#import + +@interface NSStepperCell : NSActionCell { + @private + double _value; + double _minValue; + double _maxValue; + double _increment; + struct { + unsigned int valueWraps:1; + unsigned int autorepeat:1; + unsigned int drawing:1; + unsigned int reserved:29; + } _stFlags; + unsigned int _reserved1; + unsigned int _reserved2; + unsigned int _reserved3; + unsigned int _reserved4; +} + +- (double)minValue; +- (void)setMinValue:(double)minValue; + +- (double)maxValue; +- (void)setMaxValue:(double)maxValue; + +- (double)increment; +- (void)setIncrement:(double)increment; + +- (BOOL)valueWraps; +- (void)setValueWraps:(BOOL)valueWraps; + +- (BOOL)autorepeat; +- (void)setAutorepeat:(BOOL)autorepeat; + +@end diff --git a/src/AppKit/NSStringDrawing.h b/src/AppKit/NSStringDrawing.h new file mode 100644 index 000000000..5bc9d83e7 --- /dev/null +++ b/src/AppKit/NSStringDrawing.h @@ -0,0 +1,45 @@ +#import +#import + +@interface NSString(NSStringDrawing) + +- (NSSize)sizeWithAttributes:(NSDictionary *)attrs; +- (void)drawAtPoint:(NSPoint)point withAttributes:(NSDictionary *)attrs; +- (void)drawInRect:(NSRect)rect withAttributes:(NSDictionary *)attrs; + +@end + +@interface NSAttributedString(NSStringDrawing) + +- (NSSize)size; +- (void)drawAtPoint:(NSPoint)point; +- (void)drawInRect:(NSRect)rect; + +@end + +enum { +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 + NSStringDrawingTruncatesLastVisibleLine = (1 << 5), +#endif + NSStringDrawingUsesLineFragmentOrigin = (1 << 0), + NSStringDrawingUsesFontLeading = (1 << 1), + NSStringDrawingDisableScreenFontSubstitution = (1 << 2), + NSStringDrawingUsesDeviceMetrics = (1 << 3), + NSStringDrawingOneShot = (1 << 4) +}; +typedef NSInteger NSStringDrawingOptions; + +@interface NSString (NSExtendedStringDrawing) + + +- (void)drawWithRect:(NSRect)rect options:(NSStringDrawingOptions)options attributes:(NSDictionary *)attributes; + + + +- (NSRect)boundingRectWithSize:(NSSize)size options:(NSStringDrawingOptions)options attributes:(NSDictionary *)attributes; +@end + +@interface NSAttributedString (NSExtendedStringDrawing) +- (void)drawWithRect:(NSRect)rect options:(NSStringDrawingOptions)options; +- (NSRect)boundingRectWithSize:(NSSize)size options:(NSStringDrawingOptions)options; +@end diff --git a/src/AppKit/NSTabView.h b/src/AppKit/NSTabView.h new file mode 100644 index 000000000..2d77863db --- /dev/null +++ b/src/AppKit/NSTabView.h @@ -0,0 +1,140 @@ +#import +#import + +@class NSArray, NSFont, NSTabViewItem; +@protocol NSTabViewDelegate; + +#define NSAppKitVersionNumberWithDirectionalTabs 631.0 + +enum { + NSTopTabsBezelBorder = 0, + NSLeftTabsBezelBorder = 1, + NSBottomTabsBezelBorder = 2, + NSRightTabsBezelBorder = 3, + NSNoTabsBezelBorder = 4, + NSNoTabsLineBorder = 5, + NSNoTabsNoBorder = 6 +}; +typedef NSUInteger NSTabViewType; + +@interface NSTabView : NSView +{ + @private + + + + id _tabViewItems; + NSTabViewItem *_selectedTabViewItem; + NSFont *_font; + NSTabViewType _tabViewType; + BOOL _allowTruncatedLabels; + id _delegate; + + + + BOOL _tabViewUnusedBOOL1; + + BOOL _drawsBackground; + NSTabViewItem *_pressedTabViewItem; + NSInteger _endTabWidth; + NSInteger _maxOverlap; + CGFloat _tabHeight; + NSTabViewItem *_tabViewItemWithKeyView; + NSView *_originalNextKeyView; + struct __NSTabViewDelegateRespondTo { + unsigned int shouldSelectTabViewItem:1; + unsigned int willSelectTabViewItem:1; + unsigned int didSelectTabViewItem:1; + unsigned int didChangeNumberOfTabViewItems:1; + unsigned int reserved:28; + } _delegateRespondTo; + + struct __NSTabViewFlags { + unsigned int needsLayout:1; + unsigned int controlTint:3; + unsigned int controlSize:2; + unsigned int wiringNibConnections:1; + unsigned int wiringInteriorLastKeyView:1; + unsigned int originalNextKeyViewChanged:1; + unsigned int liveResizeSkippedResetToolTips:1; + unsigned int subviewsAddedForTabs:1; + unsigned int reserved:21; + } _flags; + NSTabViewItem *_focusedTabViewItem; + void *_tabViewUnused2; +} + + + +- (void)selectTabViewItem:(NSTabViewItem *)tabViewItem; +- (void)selectTabViewItemAtIndex:(NSInteger)index; +- (void)selectTabViewItemWithIdentifier:(id)identifier; +- (void)takeSelectedTabViewItemFromSender:(id)sender; + + + +- (void)selectFirstTabViewItem:(id)sender; +- (void)selectLastTabViewItem:(id)sender; +- (void)selectNextTabViewItem:(id)sender; +- (void)selectPreviousTabViewItem:(id)sender; + + + +- (NSTabViewItem *)selectedTabViewItem; +- (NSFont *)font; +- (NSTabViewType)tabViewType; +- (NSArray *)tabViewItems; +- (BOOL)allowsTruncatedLabels; +- (NSSize)minimumSize; +- (BOOL)drawsBackground; +- (NSControlTint)controlTint; +- (NSControlSize)controlSize; + + + +- (void)setFont:(NSFont *)font; +- (void)setTabViewType:(NSTabViewType)tabViewType; +- (void)setAllowsTruncatedLabels:(BOOL)allowTruncatedLabels; +- (void)setDrawsBackground:(BOOL)flag; +- (void)setControlTint:(NSControlTint)controlTint; +- (void)setControlSize:(NSControlSize)controlSize; + + + +- (void)addTabViewItem:(NSTabViewItem *)tabViewItem; +- (void)insertTabViewItem:(NSTabViewItem *)tabViewItem atIndex:(NSInteger)index; +- (void)removeTabViewItem:(NSTabViewItem *)tabViewItem; + + + +- (void)setDelegate:(id )anObject; +- (id )delegate; + + + +- (NSTabViewItem *)tabViewItemAtPoint:(NSPoint)point; + + + +- (NSRect)contentRect; + + + +- (NSInteger)numberOfTabViewItems; +- (NSInteger)indexOfTabViewItem:(NSTabViewItem *)tabViewItem; +- (NSTabViewItem *)tabViewItemAtIndex:(NSInteger)index; +- (NSInteger)indexOfTabViewItemWithIdentifier:(id)identifier; + +@end + + + + + +@protocol NSTabViewDelegate +@optional +- (BOOL)tabView:(NSTabView *)tabView shouldSelectTabViewItem:(NSTabViewItem *)tabViewItem; +- (void)tabView:(NSTabView *)tabView willSelectTabViewItem:(NSTabViewItem *)tabViewItem; +- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem; +- (void)tabViewDidChangeNumberOfTabViewItems:(NSTabView *)tabView; +@end diff --git a/src/AppKit/NSTabViewItem.h b/src/AppKit/NSTabViewItem.h new file mode 100644 index 000000000..6e05b1e56 --- /dev/null +++ b/src/AppKit/NSTabViewItem.h @@ -0,0 +1,83 @@ +#import +#import +#import + +@class NSColor, NSTabView, NSView; + +enum { + NSSelectedTab = 0, + NSBackgroundTab = 1, + NSPressedTab = 2 +}; +typedef NSUInteger NSTabState; + +@interface NSTabViewItem : NSObject +{ + @private + + + + id _identifier; + NSString *_label; + NSView *_view; + NSView *_initialFirstResponder; + NSColor *_color; + NSTabView *_tabView; + + + + NSTabState _tabState; + NSView *_lastKeyView; + + struct __tviFlags { + unsigned int hasCustomColor:1; + unsigned int labelSizeIsValid:1; + unsigned int autoGeneratedIFR:1; + unsigned int isTabDisabled:1; + unsigned int RESERVED:28; + } _tviFlags; + + NSSize _labelSize; + NSRect _tabRect; + NSToolTipTag _tabToolTipTag; + id _auxiliaryStorage; +} + + + +- (id)initWithIdentifier:(id)identifier; + + + +- (id)identifier; +- (id)view; +- (id)initialFirstResponder; +- (NSString *)label; +- (NSColor *)color; +- (NSTabState)tabState; +- (NSTabView *)tabView; + + + +- (void)setIdentifier:(id)identifier; +- (void)setLabel:(NSString *)label; +- (void)setColor:(NSColor *)color; +- (void)setView:(NSView *)view; +- (void)setInitialFirstResponder:(NSView *)view; + + + +- (NSString *)toolTip; +- (void)setToolTip:(NSString *)toolTip; + + + + + +- (void)drawLabel:(BOOL)shouldTruncateLabel inRect:(NSRect)labelRect; + + + +- (NSSize)sizeOfLabel:(BOOL)computeMin; + +@end diff --git a/src/AppKit/NSTableCellView.h b/src/AppKit/NSTableCellView.h new file mode 100644 index 000000000..0eb0ff293 --- /dev/null +++ b/src/AppKit/NSTableCellView.h @@ -0,0 +1,46 @@ +#import + +#import + +#import +#import +#import + +@class NSTextField, NSImageView; + + + + +@interface NSTableCellView : NSView { +@private + NSBackgroundStyle _backgroundStyle; + id _objectValue; + id _aux; + NSTableViewRowSizeStyle _rowSizeStyle; + + NSTextField *_textField; + NSImageView *_imageView; +} + + + +@property(retain) id objectValue; + + + +@property(assign) IBOutlet NSTextField *textField; +@property(assign) IBOutlet NSImageView *imageView; + + + +@property NSBackgroundStyle backgroundStyle; + + + +@property NSTableViewRowSizeStyle rowSizeStyle; + + + +@property(retain, readonly) NSArray *draggingImageComponents; + +@end diff --git a/src/AppKit/NSTableColumn.h b/src/AppKit/NSTableColumn.h new file mode 100644 index 000000000..7e921c868 --- /dev/null +++ b/src/AppKit/NSTableColumn.h @@ -0,0 +1,119 @@ +#import +#import +#import + +@class NSTableView; +@class NSCell; +@class NSImage; +@class NSSortDescriptor; + +@interface NSTableColumn : NSObject { + + id _identifier; + CGFloat _width; + CGFloat _minWidth; + CGFloat _maxWidth; + NSTableView *_tableView; + NSCell *_headerCell; + NSCell *_dataCell; + struct __colFlags { + unsigned int oldIsResizable:1; + unsigned int isEditable:1; + unsigned int resizedPostingDisableCount:8; + unsigned int canUseReorderResizeImageCache:1; + unsigned int userResizingAllowed:1; + unsigned int autoResizingAllowed:1; + unsigned int hidden:1; + unsigned int RESERVED:18; + } _cFlags; + id _tcAuxiliaryStorage; +} + + + +- (id)initWithIdentifier:(NSString *)identifier; + + + +- (void)setIdentifier:(NSString *)identifier; +- (NSString *)identifier; + +- (void)setTableView:(NSTableView *)tableView; +- (NSTableView *)tableView; + + + +- (void)setWidth:(CGFloat)width; +- (CGFloat)width; + + + +- (void)setMinWidth:(CGFloat)minWidth; +- (CGFloat)minWidth; + + + +- (void)setMaxWidth:(CGFloat)maxWidth; +- (CGFloat)maxWidth; + + + +- (void)setHeaderCell:(NSCell *)cell; +- (id)headerCell; + + + +- (void)setDataCell:(NSCell *)cell; +- (id)dataCell; + + + +- (id)dataCellForRow:(NSInteger)row; + + + +- (void)setEditable:(BOOL)flag; +- (BOOL)isEditable; + +- (void)sizeToFit; + + + +- (void)setSortDescriptorPrototype:(NSSortDescriptor *)sortDescriptor; +- (NSSortDescriptor *)sortDescriptorPrototype; + +enum { + NSTableColumnNoResizing = 0, + NSTableColumnAutoresizingMask = ( 1 << 0 ), + NSTableColumnUserResizingMask = ( 1 << 1 ), +}; + + + +- (void)setResizingMask:(NSUInteger)resizingMask; +- (NSUInteger)resizingMask; + + + +- (void)setHeaderToolTip:(NSString *)string; +- (NSString *)headerToolTip; + + + +- (BOOL)isHidden; +- (void)setHidden:(BOOL)hidden; + +@end + + + + + +@interface NSTableColumn(NSDeprecated) + + + +- (void)setResizable:(BOOL)flag; +- (BOOL)isResizable; + +@end diff --git a/src/AppKit/NSTableHeaderCell.h b/src/AppKit/NSTableHeaderCell.h new file mode 100644 index 000000000..2b0e57b91 --- /dev/null +++ b/src/AppKit/NSTableHeaderCell.h @@ -0,0 +1,15 @@ +#import + +@interface NSTableHeaderCell : NSTextFieldCell { + +} + + + +- (void)drawSortIndicatorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView ascending:(BOOL)ascending priority:(NSInteger)priority; + + + +- (NSRect)sortIndicatorRectForBounds:(NSRect)theRect; + +@end diff --git a/src/AppKit/NSTableHeaderView.h b/src/AppKit/NSTableHeaderView.h new file mode 100644 index 000000000..0193ee16f --- /dev/null +++ b/src/AppKit/NSTableHeaderView.h @@ -0,0 +1,38 @@ +#import + +@class NSTableView; +@class NSColor; +@class NSImage; +@class NSCursor; + +@interface NSTableHeaderView : NSView +{ + + NSTableView *_tableView; + NSInteger _resizedColumn; + NSInteger _draggedColumn; + NSInteger _pressedColumn; + NSImage *_headerDragImage; + CGFloat _draggedDistance; + unsigned int _isColumnResizing:1; + unsigned int _showHandCursorFired:1; + unsigned int _toolTipRectsDirty:1; + unsigned int _alignTitleWithDataCell:1; + unsigned int _nextColumnAfterDrawnOneIsSelected:1; + unsigned int _reserved:27; + BOOL _skipDrawingSeparator; + id _viewDataX; +} + +- (void)setTableView:(NSTableView *)tableView; +- (NSTableView *)tableView; + + +- (NSInteger)draggedColumn; +- (CGFloat)draggedDistance; + +- (NSInteger)resizedColumn; +- (NSRect)headerRectOfColumn:(NSInteger)column; +- (NSInteger)columnAtPoint:(NSPoint)point; + +@end diff --git a/src/AppKit/NSTableRowView.h b/src/AppKit/NSTableRowView.h new file mode 100644 index 000000000..3586075b8 --- /dev/null +++ b/src/AppKit/NSTableRowView.h @@ -0,0 +1,105 @@ +#import + +#import +#import +#import + + + + +@interface NSTableRowView : NSView { +@private + NSView **_columnViews; + NSInteger _columnCount; + + NSTableViewSelectionHighlightStyle _selectionHighlightStyle; + NSTableViewDraggingDestinationFeedbackStyle _draggingDestinationFeedbackStyle; + + CGFloat _dropOperationIndentation; + + NSColor *_backgroundColor; + CGFloat _selectionAlpha; + + unsigned int _targetForDropOperation:1; + unsigned int _groupRowStyle:2; + unsigned int _priorRowSelected:1; + unsigned int _nextRowSelected:1; + unsigned int _selected:1; + unsigned int _emphasized:1; + unsigned int _hasAssociatedViews:1; + unsigned int _backgroundStylesDirty:1; + unsigned int _isFloating:1; + unsigned int _hasCustomGridColor:1; + unsigned int _usingCachedImageOnly:1; + unsigned int _gridStyleMask:4; + unsigned int _updatingBackgroundStyle:1; + unsigned int _locationNeedsUpdating:1; + unsigned int _reserved2:13; +} + + + +@property NSTableViewSelectionHighlightStyle selectionHighlightStyle; + + + +@property(getter=isEmphasized) BOOL emphasized; + + + +@property(getter=isGroupRowStyle) BOOL groupRowStyle; + + + +@property(getter=isSelected) BOOL selected; + + + +@property(getter=isFloating) BOOL floating; + + + +@property(getter=isTargetForDropOperation) BOOL targetForDropOperation; +@property NSTableViewDraggingDestinationFeedbackStyle draggingDestinationFeedbackStyle; +@property CGFloat indentationForDropOperation; + + + +@property(readonly) NSBackgroundStyle interiorBackgroundStyle; + + + +@property(copy) NSColor *backgroundColor; + + + +- (void)drawBackgroundInRect:(NSRect)dirtyRect; + + + +- (void)drawSelectionInRect:(NSRect)dirtyRect; + + + +- (void)drawSeparatorInRect:(NSRect)dirtyRect; + + + +- (void)drawDraggingDestinationFeedbackInRect:(NSRect)dirtyRect; + + + + + + + +- (id)viewAtColumn:(NSInteger)column; + + + +@property(readonly) NSInteger numberOfColumns; + + + + +@end diff --git a/src/AppKit/NSTableView.h b/src/AppKit/NSTableView.h new file mode 100644 index 000000000..dcdd1e8d7 --- /dev/null +++ b/src/AppKit/NSTableView.h @@ -0,0 +1,872 @@ +#import +#import +#import +#import +#import + +@class NSTableHeaderView, NSTableColumn, NSMutableArray, NSDictionary, NSIndexSet, NSMutableIndexSet, NSTableRowView, NSNib; + +@protocol NSTableViewDelegate, NSTableViewDataSource; + +typedef struct __TvFlags { +#ifdef __BIG_ENDIAN__ + unsigned int allowsColumnReordering:1; + unsigned int allowsColumnResizing:1; + unsigned int _available:1; + unsigned int allowsEmptySelection:1; + unsigned int allowsMultipleSelection:1; + unsigned int allowsColumnSelection:1; + unsigned int selectionType:2; + unsigned int allowGapRow:1; + unsigned int compareWidthWithSuperview:2; + unsigned int delegateWillDisplayCell:1; + unsigned int delegateShouldEditTableColumn:1; + unsigned int delegateShouldSelectRow:1; + unsigned int delegateShouldSelectTableColumn:1; + unsigned int delegateSelectionShouldChangeInTableView:1; + unsigned int oldAutoresizesAllColumnsToFit:1; + unsigned int dataSourceSetObjectValue:1; + unsigned int selectionPostingDisableCount:7; + unsigned int movedPostingDisableCount:6; + unsigned int refusesFirstResponder:1; +#else + unsigned int refusesFirstResponder:1; + unsigned int movedPostingDisableCount:6; + unsigned int selectionPostingDisableCount:7; + unsigned int dataSourceSetObjectValue:1; + unsigned int oldAutoresizesAllColumnsToFit:1; + unsigned int delegateSelectionShouldChangeInTableView:1; + unsigned int delegateShouldSelectTableColumn:1; + unsigned int delegateShouldSelectRow:1; + unsigned int delegateShouldEditTableColumn:1; + unsigned int delegateWillDisplayCell:1; + unsigned int compareWidthWithSuperview:2; + unsigned int allowGapRow:1; + unsigned int selectionType:2; + unsigned int allowsColumnSelection:1; + unsigned int allowsMultipleSelection:1; + unsigned int allowsEmptySelection:1; + unsigned int _available:1; + unsigned int allowsColumnResizing:1; + unsigned int allowsColumnReordering:1; +#endif +} _TvFlags; + + + +enum { NSTableViewDropOn, NSTableViewDropAbove }; +typedef NSUInteger NSTableViewDropOperation; + + +@interface NSTableView : NSControl +{ + + NSTableHeaderView *_headerView; + NSView *_cornerView; + NSMutableArray *_tableColumns; + NSCell *_editingCell; + id _delegate; + id _dataSource; + NSSize _intercellSpacing; + CGFloat _rowHeight; + NSInteger _lastSelectedColumn; + NSInteger _lastSelectedRow; + NSInteger _editingRow; + NSInteger _editingColumn; + NSMutableIndexSet *_selectedColumns; + NSMutableIndexSet *_selectedRows; + id _columnDragInfoX; + NSColor *_backgroundColor; + NSColor *_gridColor; + id _rowDataX; + id _target; + SEL _action; + SEL _doubleAction; + NSRect _rectOfLastColumn; + NSInteger _lastCachedRectColumn; + NSRect _rectOfLastRow; + NSInteger _lastCachedRectRow; + _TvFlags _tvFlags; + id _reserved; +} + + + +- (void)setDataSource:(id )aSource; +- (id )dataSource; + + + +- (void)setDelegate:(id )delegate; +- (id )delegate; + + + +- (void)setHeaderView:(NSTableHeaderView *)headerView; +- (NSTableHeaderView *)headerView; + + + +- (void)setCornerView:(NSView *)cornerView; +- (NSView *)cornerView; + + + +- (void)setAllowsColumnReordering:(BOOL)flag; +- (BOOL)allowsColumnReordering; + + + +- (void)setAllowsColumnResizing:(BOOL)flag; +- (BOOL)allowsColumnResizing; + +enum { + + + NSTableViewNoColumnAutoresizing = 0, + + + + NSTableViewUniformColumnAutoresizingStyle, + + + + + NSTableViewSequentialColumnAutoresizingStyle, + NSTableViewReverseSequentialColumnAutoresizingStyle, + + + + + + NSTableViewLastColumnOnlyAutoresizingStyle, + NSTableViewFirstColumnOnlyAutoresizingStyle +}; +typedef NSUInteger NSTableViewColumnAutoresizingStyle; + + + + +- (void)setColumnAutoresizingStyle:(NSTableViewColumnAutoresizingStyle)style; +- (NSTableViewColumnAutoresizingStyle)columnAutoresizingStyle; + + + +enum { + NSTableViewGridNone = 0, + NSTableViewSolidVerticalGridLineMask = 1 << 0, + NSTableViewSolidHorizontalGridLineMask = 1 << 1, +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + NSTableViewDashedHorizontalGridLineMask = 1 << 3, +#endif +}; + +typedef NSUInteger NSTableViewGridLineStyle; + + + +- (void)setGridStyleMask:(NSTableViewGridLineStyle)gridStyle; +- (NSTableViewGridLineStyle)gridStyleMask; + + + +- (void)setIntercellSpacing:(NSSize)aSize; +- (NSSize)intercellSpacing; + + + +- (void)setUsesAlternatingRowBackgroundColors:(BOOL)useAlternatingRowColors; +- (BOOL)usesAlternatingRowBackgroundColors; + + + +- (void)setBackgroundColor:(NSColor *)color; +- (NSColor *)backgroundColor; + + + +- (void)setGridColor:(NSColor *)color; +- (NSColor *)gridColor; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 +enum { + + NSTableViewRowSizeStyleDefault = -1, + + + NSTableViewRowSizeStyleCustom = 0, + + + + + NSTableViewRowSizeStyleSmall = 1, + NSTableViewRowSizeStyleMedium = 2, + NSTableViewRowSizeStyleLarge = 3, +}; +#endif + +typedef NSInteger NSTableViewRowSizeStyle; + + + +- (void)setRowSizeStyle:(NSTableViewRowSizeStyle)rowSizeStyle; +- (NSTableViewRowSizeStyle)rowSizeStyle; + + + +- (NSTableViewRowSizeStyle)effectiveRowSizeStyle; + + + + +- (void)setRowHeight:(CGFloat)rowHeight; +- (CGFloat)rowHeight; + + + +- (void)noteHeightOfRowsWithIndexesChanged:(NSIndexSet *)indexSet; + + + +- (NSArray *)tableColumns; + + + +- (NSInteger)numberOfColumns; + + + +- (NSInteger)numberOfRows; + + + +- (void)addTableColumn:(NSTableColumn *)tableColumn; + + + +- (void)removeTableColumn:(NSTableColumn *)tableColumn; + + + +- (void)moveColumn:(NSInteger)oldIndex toColumn:(NSInteger)newIndex; + + + +- (NSInteger)columnWithIdentifier:(NSString *)identifier; + + + +- (NSTableColumn *)tableColumnWithIdentifier:(NSString *)identifier; + + + +- (void)tile; +- (void)sizeToFit; +- (void)sizeLastColumnToFit; + +- (void)scrollRowToVisible:(NSInteger)row; +- (void)scrollColumnToVisible:(NSInteger)column; + + + + +- (void)reloadData; + + + + + +- (void)noteNumberOfRowsChanged; + + + +- (void)reloadDataForRowIndexes:(NSIndexSet *)rowIndexes columnIndexes:(NSIndexSet *)columnIndexes; + + + + + +- (NSInteger)editedColumn; +- (NSInteger)editedRow; + +- (NSInteger)clickedColumn; +- (NSInteger)clickedRow; + +- (void)setDoubleAction:(SEL)aSelector; +- (SEL)doubleAction; + + + + +- (void)setSortDescriptors:(NSArray *)array; +- (NSArray *)sortDescriptors; + + + +- (void)setIndicatorImage:(NSImage *)anImage inTableColumn:(NSTableColumn *)tableColumn; +- (NSImage *)indicatorImageInTableColumn:(NSTableColumn *)tableColumn; + + + +- (void)setHighlightedTableColumn:(NSTableColumn *)tableColumn; +- (NSTableColumn *)highlightedTableColumn; + + + + + + +- (void)setVerticalMotionCanBeginDrag:(BOOL)flag; +- (BOOL)verticalMotionCanBeginDrag; + + + + + +- (BOOL)canDragRowsWithIndexes:(NSIndexSet *)rowIndexes atPoint:(NSPoint)mouseDownPoint; + + + + + +- (NSImage *)dragImageForRowsWithIndexes:(NSIndexSet *)dragRows tableColumns:(NSArray *)tableColumns event:(NSEvent*)dragEvent offset:(NSPointPointer)dragImageOffset; + + + +- (void)setDraggingSourceOperationMask:(NSDragOperation)mask forLocal:(BOOL)isLocal; + + + +- (void)setDropRow:(NSInteger)row dropOperation:(NSTableViewDropOperation)dropOperation; + + + + + + +- (void)setAllowsMultipleSelection:(BOOL)flag; +- (BOOL)allowsMultipleSelection; + + + +- (void)setAllowsEmptySelection:(BOOL)flag; +- (BOOL)allowsEmptySelection; + + + +- (void)setAllowsColumnSelection:(BOOL)flag; +- (BOOL)allowsColumnSelection; + +- (void)selectAll:(id)sender; + +- (void)deselectAll:(id)sender; + + + + + +- (void)selectColumnIndexes:(NSIndexSet *)indexes byExtendingSelection:(BOOL)extend; + + + + + + +- (void)selectRowIndexes:(NSIndexSet *)indexes byExtendingSelection:(BOOL)extend; + +- (NSIndexSet *)selectedColumnIndexes; +- (NSIndexSet *)selectedRowIndexes; + +- (void)deselectColumn:(NSInteger)column; +- (void)deselectRow:(NSInteger)row; +- (NSInteger)selectedColumn; +- (NSInteger)selectedRow; +- (BOOL)isColumnSelected:(NSInteger)column; +- (BOOL)isRowSelected:(NSInteger)row; +- (NSInteger)numberOfSelectedColumns; +- (NSInteger)numberOfSelectedRows; + + + + + + + +- (BOOL)allowsTypeSelect; +- (void)setAllowsTypeSelect:(BOOL)value; + +enum { +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + + + + NSTableViewSelectionHighlightStyleNone = -1, + +#endif + + + + NSTableViewSelectionHighlightStyleRegular = 0, + + + + NSTableViewSelectionHighlightStyleSourceList = 1, +}; +typedef NSInteger NSTableViewSelectionHighlightStyle; + + + +- (NSTableViewSelectionHighlightStyle)selectionHighlightStyle; +- (void)setSelectionHighlightStyle:(NSTableViewSelectionHighlightStyle)selectionHighlightStyle; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + +enum { + + + NSTableViewDraggingDestinationFeedbackStyleNone = -1, + + + + NSTableViewDraggingDestinationFeedbackStyleRegular = 0, + + + + NSTableViewDraggingDestinationFeedbackStyleSourceList = 1, +}; + +#endif + +typedef NSInteger NSTableViewDraggingDestinationFeedbackStyle; + + + +- (void)setDraggingDestinationFeedbackStyle:(NSTableViewDraggingDestinationFeedbackStyle)style; +- (NSTableViewDraggingDestinationFeedbackStyle)draggingDestinationFeedbackStyle; + + + +- (NSRect)rectOfColumn:(NSInteger)column; + + + +- (NSRect)rectOfRow:(NSInteger)row; + + + +- (NSIndexSet *)columnIndexesInRect:(NSRect)rect; + + + +- (NSRange)rowsInRect:(NSRect)rect; + + + +- (NSInteger)columnAtPoint:(NSPoint)point; + +- (NSInteger)rowAtPoint:(NSPoint)point; + + + +- (NSRect)frameOfCellAtColumn:(NSInteger)column row:(NSInteger)row; + + + +- (NSCell *)preparedCellAtColumn:(NSInteger)column row:(NSInteger)row; + + + + +- (BOOL)textShouldBeginEditing:(NSText *)textObject; +- (BOOL)textShouldEndEditing:(NSText *)textObject; +- (void)textDidBeginEditing:(NSNotification *)notification; +- (void)textDidEndEditing:(NSNotification *)notification; +- (void)textDidChange:(NSNotification *)notification; + + + + +- (void)setAutosaveName:(NSString *)name; +- (NSString *)autosaveName; + + + +- (void)setAutosaveTableColumns:(BOOL)save; +- (BOOL)autosaveTableColumns; + + + + + + +- (BOOL)shouldFocusCell:(NSCell *)cell atColumn:(NSInteger)column row:(NSInteger)row; + + + +- (NSInteger)focusedColumn; + + + +- (void)setFocusedColumn:(NSInteger)focusedColumn; + + + +- (void)performClickOnCellAtColumn:(NSInteger)column row:(NSInteger)row; +- (void)editColumn:(NSInteger)column row:(NSInteger)row withEvent:(NSEvent *)theEvent select:(BOOL)select; + + + + +- (void)drawRow:(NSInteger)row clipRect:(NSRect)clipRect; + + + + +- (void)highlightSelectionInClipRect:(NSRect)clipRect; + + + +- (void)drawGridInClipRect:(NSRect)clipRect; + + + +- (void)drawBackgroundInClipRect:(NSRect)clipRect; + + + + + + + + + +- (id)viewAtColumn:(NSInteger)column row:(NSInteger)row makeIfNecessary:(BOOL)makeIfNecessary; +- (id)rowViewAtRow:(NSInteger)row makeIfNecessary:(BOOL)makeIfNecessary; + + + +- (NSInteger)rowForView:(NSView *)view; +- (NSInteger)columnForView:(NSView *)view; + + + +- (id)makeViewWithIdentifier:(NSString *)identifier owner:(id)owner; + +#if NS_BLOCKS_AVAILABLE + + +- (void)enumerateAvailableRowViewsUsingBlock:(void (^)(NSTableRowView *rowView, NSInteger row))handler; +#endif + + + +- (BOOL)floatsGroupRows; +- (void)setFloatsGroupRows:(BOOL)value; + + + + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + + + + + +enum { + NSTableViewAnimationEffectNone = 0x0, +}; + + + +enum { + + + NSTableViewAnimationEffectFade = 0x1, + + + + NSTableViewAnimationEffectGap = 0x2, +}; + + + +enum { + NSTableViewAnimationSlideUp = 0x10, + NSTableViewAnimationSlideDown = 0x20, + NSTableViewAnimationSlideLeft = 0x30, + NSTableViewAnimationSlideRight = 0x40, +}; + +#endif + +typedef NSUInteger NSTableViewAnimationOptions; + + + + + +- (void)beginUpdates; +- (void)endUpdates; + + + + +- (void)insertRowsAtIndexes:(NSIndexSet *)indexes withAnimation:(NSTableViewAnimationOptions)animationOptions; + + + +- (void)removeRowsAtIndexes:(NSIndexSet *)indexes withAnimation:(NSTableViewAnimationOptions)animationOptions; + + + +- (void)moveRowAtIndex:(NSInteger)oldIndex toIndex:(NSInteger)newIndex; + + + +- (void)registerNib:(NSNib *)nib forIdentifier:(NSString *)identifier; + + + +- (NSDictionary *)registeredNibsByIdentifier; + +@end + + + +@protocol NSTableViewDelegate +@optional + + + +- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row; + + + +- (NSTableRowView *)tableView:(NSTableView *)tableView rowViewForRow:(NSInteger)row; + + + +- (void)tableView:(NSTableView *)tableView didAddRowView:(NSTableRowView *)rowView forRow:(NSInteger)row; + + + +- (void)tableView:(NSTableView *)tableView didRemoveRowView:(NSTableRowView *)rowView forRow:(NSInteger)row; + + + + + + +- (void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row; +- (BOOL)tableView:(NSTableView *)tableView shouldEditTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row; + + + + +- (NSString *)tableView:(NSTableView *)tableView toolTipForCell:(NSCell *)cell rect:(NSRectPointer)rect tableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row mouseLocation:(NSPoint)mouseLocation; + + + + + +- (BOOL)tableView:(NSTableView *)tableView shouldShowCellExpansionForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row; + + + + +- (BOOL)tableView:(NSTableView *)tableView shouldTrackCell:(NSCell *)cell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row; + + + + + + +- (NSCell *)tableView:(NSTableView *)tableView dataCellForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row; + + + + +- (BOOL)selectionShouldChangeInTableView:(NSTableView *)tableView; + + + +- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(NSInteger)row; + + + +- (NSIndexSet *)tableView:(NSTableView *)tableView selectionIndexesForProposedSelection:(NSIndexSet *)proposedSelectionIndexes; + +- (BOOL)tableView:(NSTableView *)tableView shouldSelectTableColumn:(NSTableColumn *)tableColumn; + +- (void)tableView:(NSTableView *)tableView mouseDownInHeaderOfTableColumn:(NSTableColumn *)tableColumn; +- (void)tableView:(NSTableView *)tableView didClickTableColumn:(NSTableColumn *)tableColumn; +- (void)tableView:(NSTableView *)tableView didDragTableColumn:(NSTableColumn *)tableColumn; + + + + +- (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row; + + + + +- (NSString *)tableView:(NSTableView *)tableView typeSelectStringForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row; + + + + +- (NSInteger)tableView:(NSTableView *)tableView nextTypeSelectMatchFromRow:(NSInteger)startRow toRow:(NSInteger)endRow forString:(NSString *)searchString; + + + + +- (BOOL)tableView:(NSTableView *)tableView shouldTypeSelectForEvent:(NSEvent *)event withCurrentSearchString:(NSString *)searchString; + + + + +- (BOOL)tableView:(NSTableView *)tableView isGroupRow:(NSInteger)row; + + + + +- (CGFloat)tableView:(NSTableView *)tableView sizeToFitWidthOfColumn:(NSInteger)column; + + + + +- (BOOL)tableView:(NSTableView *)tableView shouldReorderColumn:(NSInteger)columnIndex toColumn:(NSInteger)newColumnIndex; + + + + +- (void)tableViewSelectionDidChange:(NSNotification *)notification; +- (void)tableViewColumnDidMove:(NSNotification *)notification; +- (void)tableViewColumnDidResize:(NSNotification *)notification; +- (void)tableViewSelectionIsChanging:(NSNotification *)notification; + +@end + +EXTERN_C NSString *NSTableViewSelectionDidChangeNotification; +EXTERN_C NSString *NSTableViewColumnDidMoveNotification; +EXTERN_C NSString *NSTableViewColumnDidResizeNotification; +EXTERN_C NSString *NSTableViewSelectionIsChangingNotification; + + +EXTERN_C NSString *const NSTableViewRowViewKey; + + + +@protocol NSTableViewDataSource +@optional + + + + +- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView; + + + +- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row; + + + + + + +- (void)tableView:(NSTableView *)tableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row; + + + + +- (void)tableView:(NSTableView *)tableView sortDescriptorsDidChange:(NSArray *)oldDescriptors; + + + +- (id )tableView:(NSTableView *)tableView pasteboardWriterForRow:(NSInteger)row; + + + +- (void)tableView:(NSTableView *)tableView draggingSession:(NSDraggingSession *)session willBeginAtPoint:(NSPoint)screenPoint forRowIndexes:(NSIndexSet *)rowIndexes; + + + +- (void)tableView:(NSTableView *)tableView draggingSession:(NSDraggingSession *)session endedAtPoint:(NSPoint)screenPoint operation:(NSDragOperation)operation; + + + +- (void)tableView:(NSTableView *)tableView updateDraggingItemsForDrag:(id )draggingInfo; + + + +- (BOOL)tableView:(NSTableView *)tableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard; + + + +- (NSDragOperation)tableView:(NSTableView *)tableView validateDrop:(id )info proposedRow:(NSInteger)row proposedDropOperation:(NSTableViewDropOperation)dropOperation; + + + +- (BOOL)tableView:(NSTableView *)tableView acceptDrop:(id )info row:(NSInteger)row dropOperation:(NSTableViewDropOperation)dropOperation; + + + +- (NSArray *)tableView:(NSTableView *)tableView namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination forDraggedRowsWithIndexes:(NSIndexSet *)indexSet; + +@end + +@interface NSObject(NSTableViewDataSourceDeprecated) + + + + + + + +- (BOOL)tableView:(NSTableView *)tableView writeRows:(NSArray *)rows toPasteboard:(NSPasteboard *)pboard; + +@end + + + + +@interface NSTableView(NSDeprecated) + + + +- (void)setDrawsGrid:(BOOL)flag; + + + +- (BOOL)drawsGrid; + + + +- (void)selectColumn:(NSInteger)column byExtendingSelection:(BOOL)extend; + + + +- (void)selectRow:(NSInteger)row byExtendingSelection:(BOOL)extend; + + + +- (NSEnumerator *)selectedColumnEnumerator; + + + +- (NSEnumerator *)selectedRowEnumerator; + + + +- (NSImage *)dragImageForRows:(NSArray*)dragRows event:(NSEvent *)dragEvent dragImageOffset:(NSPointPointer)dragImageOffset; + + + +- (void)setAutoresizesAllColumnsToFit:(BOOL)flag; +- (BOOL)autoresizesAllColumnsToFit; + + + +- (NSRange)columnsInRect:(NSRect)rect; + +@end diff --git a/src/AppKit/NSText.h b/src/AppKit/NSText.h new file mode 100644 index 000000000..846c182ff --- /dev/null +++ b/src/AppKit/NSText.h @@ -0,0 +1,164 @@ +#import +#import + +@class NSColor, NSFont, NSNotification; +@protocol NSTextDelegate; + + +enum { + NSEnterCharacter = 0x0003, + NSBackspaceCharacter = 0x0008, + NSTabCharacter = 0x0009, + NSNewlineCharacter = 0x000a, + NSFormFeedCharacter = 0x000c, + NSCarriageReturnCharacter = 0x000d, + NSBackTabCharacter = 0x0019, + NSDeleteCharacter = 0x007f, + NSLineSeparatorCharacter = 0x2028, + NSParagraphSeparatorCharacter = 0x2029 +}; + + +enum { + NSLeftTextAlignment = 0, + NSRightTextAlignment = 1, + NSCenterTextAlignment = 2, + NSJustifiedTextAlignment = 3, + NSNaturalTextAlignment = 4 +}; +typedef NSUInteger NSTextAlignment; + + +enum { + NSWritingDirectionNatural = -1, + NSWritingDirectionLeftToRight = 0, + NSWritingDirectionRightToLeft = 1 +}; +typedef NSInteger NSWritingDirection; + + +enum { + NSTextWritingDirectionEmbedding = (0 << 1), + NSTextWritingDirectionOverride = (1 << 1) +}; + + + +enum { + NSIllegalTextMovement = 0, + NSReturnTextMovement = 0x10, + NSTabTextMovement = 0x11, + NSBacktabTextMovement = 0x12, + NSLeftTextMovement = 0x13, + NSRightTextMovement = 0x14, + NSUpTextMovement = 0x15, + NSDownTextMovement = 0x16, + NSCancelTextMovement = 0x17, + NSOtherTextMovement = 0 +}; + +@interface NSText : NSView { + + id _ivars; +} + +- (NSString *)string; +- (void)setString:(NSString *)string; + +- (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)aString; +- (void)replaceCharactersInRange:(NSRange)range withRTF:(NSData *)rtfData; +- (void)replaceCharactersInRange:(NSRange)range withRTFD:(NSData *)rtfdData; + +- (NSData *)RTFFromRange:(NSRange)range; +- (NSData *)RTFDFromRange:(NSRange)range; + +- (BOOL)writeRTFDToFile:(NSString *)path atomically:(BOOL)flag; +- (BOOL)readRTFDFromFile:(NSString *)path; + +- (id )delegate; +- (void)setDelegate:(id )anObject; + +- (BOOL)isEditable; +- (void)setEditable:(BOOL)flag; +- (BOOL)isSelectable; +- (void)setSelectable:(BOOL)flag; +- (BOOL)isRichText; +- (void)setRichText:(BOOL)flag; +- (BOOL)importsGraphics; +- (void)setImportsGraphics:(BOOL)flag; +- (BOOL)isFieldEditor; +- (void)setFieldEditor:(BOOL)flag; +- (BOOL)usesFontPanel; +- (void)setUsesFontPanel:(BOOL)flag; +- (BOOL)drawsBackground; +- (void)setDrawsBackground:(BOOL)flag; +- (NSColor *)backgroundColor; +- (void)setBackgroundColor:(NSColor *)color; + +- (BOOL)isRulerVisible; + +- (NSRange)selectedRange; +- (void)setSelectedRange:(NSRange)range; + +- (void)scrollRangeToVisible:(NSRange)range; + +- (void)setFont:(NSFont *)obj; +- (NSFont *)font; +- (void)setTextColor:(NSColor *)color; +- (NSColor *)textColor; +- (NSTextAlignment)alignment; +- (void)setAlignment:(NSTextAlignment)mode; +- (NSWritingDirection)baseWritingDirection; +- (void)setBaseWritingDirection:(NSWritingDirection)writingDirection; + +- (void)setTextColor:(NSColor *)color range:(NSRange)range; +- (void)setFont:(NSFont *)font range:(NSRange)range; + +- (NSSize)maxSize; +- (void)setMaxSize:(NSSize)newMaxSize; +- (NSSize)minSize; +- (void)setMinSize:(NSSize)newMinSize; + +- (BOOL)isHorizontallyResizable; +- (void)setHorizontallyResizable:(BOOL)flag; +- (BOOL)isVerticallyResizable; +- (void)setVerticallyResizable:(BOOL)flag; + +- (void)sizeToFit; + +- (void)copy:(id)sender; +- (void)copyFont:(id)sender; +- (void)copyRuler:(id)sender; +- (void)cut:(id)sender; +- (void)delete:(id)sender; +- (void)paste:(id)sender; +- (void)pasteFont:(id)sender; +- (void)pasteRuler:(id)sender; +- (void)selectAll:(id)sender; +- (void)changeFont:(id)sender; +- (void)alignLeft:(id)sender; +- (void)alignRight:(id)sender; +- (void)alignCenter:(id)sender; +- (void)subscript:(id)sender; +- (void)superscript:(id)sender; +- (void)underline:(id)sender; +- (void)unscript:(id)sender; +- (void)showGuessPanel:(id)sender; +- (void)checkSpelling:(id)sender; +- (void)toggleRuler:(id)sender; + +@end + +@protocol NSTextDelegate +@optional +- (BOOL)textShouldBeginEditing:(NSText *)textObject; +- (BOOL)textShouldEndEditing:(NSText *)textObject; +- (void)textDidBeginEditing:(NSNotification *)notification; +- (void)textDidEndEditing:(NSNotification *)notification; +- (void)textDidChange:(NSNotification *)notification; +@end + + +EXTERN_C NSString *NSTextDidBeginEditingNotification; +EXTERN_C NSString *NSTextDidEndEditingNotification; +EXTERN_C NSString *NSTextDidChangeNotification; diff --git a/src/AppKit/NSTextAlternatives.h b/src/AppKit/NSTextAlternatives.h new file mode 100644 index 000000000..11431c382 --- /dev/null +++ b/src/AppKit/NSTextAlternatives.h @@ -0,0 +1,23 @@ +#import +#import + +@class NSString, NSArray; + + +@interface NSTextAlternatives : NSObject { +@private + NSString *_primaryString; + NSArray *_alternativeStrings; + id _internal; +} + +- (id)initWithPrimaryString:(NSString *)primaryString alternativeStrings:(NSArray *)alternativeStrings; + +@property (readonly) NSString *primaryString; +@property (readonly) NSArray *alternativeStrings; + +- (void)noteSelectedAlternativeString:(NSString *)alternativeString; + +@end + +EXTERN_C NSString *NSTextAlternativesSelectedAlternativeStringNotification; diff --git a/src/AppKit/NSTextAttachment.h b/src/AppKit/NSTextAttachment.h new file mode 100644 index 000000000..23f6c34ca --- /dev/null +++ b/src/AppKit/NSTextAttachment.h @@ -0,0 +1,83 @@ +#import +#import +#import + +@class NSFileWrapper; +@class NSLayoutManager; +@class NSTextAttachment; +@class NSTextContainer; + +enum { + NSAttachmentCharacter = 0xfffc +}; + + + +@protocol NSTextAttachmentCell +- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; +- (BOOL)wantsToTrackMouse; +- (void)highlight:(BOOL)flag withFrame:(NSRect)cellFrame inView:(NSView *)controlView; +- (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(NSView *)controlView untilMouseUp:(BOOL)flag; +- (NSSize)cellSize; +- (NSPoint)cellBaselineOffset; +- (void)setAttachment:(NSTextAttachment *)anObject; +- (NSTextAttachment *)attachment; + + +- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView characterIndex:(NSUInteger)charIndex; +- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView characterIndex:(NSUInteger)charIndex layoutManager:(NSLayoutManager *)layoutManager; +- (BOOL)wantsToTrackMouseForEvent:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(NSView *)controlView atCharacterIndex:(NSUInteger)charIndex; +- (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(NSView *)controlView atCharacterIndex:(NSUInteger)charIndex untilMouseUp:(BOOL)flag; +- (NSRect)cellFrameForTextContainer:(NSTextContainer *)textContainer proposedLineFragment:(NSRect)lineFrag glyphPosition:(NSPoint)position characterIndex:(NSUInteger)charIndex; +@end + + + +@interface NSTextAttachmentCell : NSCell { + + NSTextAttachment *_attachment; +} +@end + + +@interface NSTextAttachment : NSObject { + + NSFileWrapper *_fileWrapper; + id _cell; + struct { + unsigned int cellWasExplicitlySet:1; + unsigned int ignoresOrientation:1; + unsigned int :30; + } _flags; +} + + + +- (id)initWithFileWrapper:(NSFileWrapper *)fileWrapper; + + + +- (void)setFileWrapper:(NSFileWrapper *)fileWrapper; +- (NSFileWrapper *)fileWrapper; + + + +- (id )attachmentCell; +- (void)setAttachmentCell:(id )cell; + +@end + + + + +@interface NSAttributedString (NSAttributedStringAttachmentConveniences) + ++ (NSAttributedString *)attributedStringWithAttachment:(NSTextAttachment *)attachment; + +@end + +@interface NSMutableAttributedString (NSMutableAttributedStringAttachmentConveniences) + +- (void)updateAttachmentsFromPath:(NSString *)path; + +@end diff --git a/src/AppKit/NSTextContainer.h b/src/AppKit/NSTextContainer.h new file mode 100644 index 000000000..65fbab437 --- /dev/null +++ b/src/AppKit/NSTextContainer.h @@ -0,0 +1,90 @@ +#import +#import +#import + +@class NSTextView; + + +enum { + NSLineSweepLeft = 0, + NSLineSweepRight = 1, + NSLineSweepDown = 2, + NSLineSweepUp = 3 +}; +typedef NSUInteger NSLineSweepDirection; + + +enum { + NSLineDoesntMove = 0, + NSLineMovesLeft = 1, + NSLineMovesRight = 2, + NSLineMovesDown = 3, + NSLineMovesUp = 4 +}; +typedef NSUInteger NSLineMovementDirection; + + +@interface NSTextContainer : NSObject { + + + + @private + NSLayoutManager *_layoutManager; + NSTextView *_textView; + NSSize _size; + CGFloat _lineFragmentPadding; + struct __tcFlags { + unsigned short widthTracksTextView:1; + unsigned short heightTracksTextView:1; + unsigned short observingFrameChanges:1; + unsigned short _reserved:13; + } _tcFlags; +} + + + +- (id)initWithContainerSize:(NSSize)size; + + + +- (NSLayoutManager *)layoutManager; +- (void)setLayoutManager:(NSLayoutManager *)layoutManager; + + +- (void)replaceLayoutManager:(NSLayoutManager *)newLayoutManager; + + +- (NSTextView *)textView; +- (void)setTextView:(NSTextView *)textView; + + +- (void)setWidthTracksTextView:(BOOL)flag; +- (BOOL)widthTracksTextView; +- (void)setHeightTracksTextView:(BOOL)flag; +- (BOOL)heightTracksTextView; + + + + +- (void)setContainerSize:(NSSize)size; +- (NSSize)containerSize; + + +- (void)setLineFragmentPadding:(CGFloat)pad; +- (CGFloat)lineFragmentPadding; + + + + +- (NSRect)lineFragmentRectForProposedRect:(NSRect)proposedRect sweepDirection:(NSLineSweepDirection)sweepDirection movementDirection:(NSLineMovementDirection)movementDirection remainingRect:(NSRectPointer)remainingRect; + + +- (BOOL)isSimpleRectangularTextContainer; + + + + +- (BOOL)containsPoint:(NSPoint)point; + + +@end diff --git a/src/AppKit/NSTextField.h b/src/AppKit/NSTextField.h new file mode 100644 index 000000000..c819e2f62 --- /dev/null +++ b/src/AppKit/NSTextField.h @@ -0,0 +1,66 @@ +#import +#import +#import + +@protocol NSTextFieldDelegate; + +@interface NSTextField : NSControl +{ + + id _delegate; + SEL _errorAction; +#if __LP64__ + CGFloat _maxLayoutWidth; +#endif +} + +- (void)setBackgroundColor:(NSColor *)color; +- (NSColor *)backgroundColor; +- (void)setDrawsBackground:(BOOL)flag; +- (BOOL)drawsBackground; +- (void)setTextColor:(NSColor *)color; +- (NSColor *)textColor; +- (BOOL)isBordered; +- (void)setBordered:(BOOL)flag; +- (BOOL)isBezeled; +- (void)setBezeled:(BOOL)flag; +- (BOOL)isEditable; +- (void)setEditable:(BOOL)flag; +- (BOOL)isSelectable; +- (void)setSelectable:(BOOL)flag; +- (void)selectText:(id)sender; +- (id )delegate; +- (void)setDelegate:(id )anObject; +- (BOOL)textShouldBeginEditing:(NSText *)textObject; +- (BOOL)textShouldEndEditing:(NSText *)textObject; +- (void)textDidBeginEditing:(NSNotification *)notification; +- (void)textDidEndEditing:(NSNotification *)notification; +- (void)textDidChange:(NSNotification *)notification; +- (BOOL)acceptsFirstResponder; + +- (void)setBezelStyle:(NSTextFieldBezelStyle)style; +- (NSTextFieldBezelStyle)bezelStyle; + + + +- (void)setPreferredMaxLayoutWidth:(CGFloat)width; +- (CGFloat)preferredMaxLayoutWidth; + +@end + +@interface NSTextField(NSTextFieldAttributedStringMethods) +- (BOOL)allowsEditingTextAttributes; +- (void)setAllowsEditingTextAttributes:(BOOL)flag; +- (BOOL)importsGraphics; +- (void)setImportsGraphics:(BOOL)flag; +@end + +@protocol NSTextFieldDelegate @end + +@interface NSTextField(NSDeprecated) + + + +- (void)setTitleWithMnemonic:(NSString *)stringWithAmpersand; + +@end diff --git a/src/AppKit/NSTextFieldCell.h b/src/AppKit/NSTextFieldCell.h new file mode 100644 index 000000000..2fc274a56 --- /dev/null +++ b/src/AppKit/NSTextFieldCell.h @@ -0,0 +1,56 @@ +#import + +enum { + NSTextFieldSquareBezel = 0, + NSTextFieldRoundedBezel = 1 +}; +typedef NSUInteger NSTextFieldBezelStyle; + +@class NSColor; + +@interface NSTextFieldCell : NSActionCell { + + NSColor *_backgroundColor; + NSColor *_textColor; + struct __tfFlags { + unsigned int drawsBackground:1; + unsigned int bezelStyle:3; + unsigned int thcSortDirection:2; + unsigned int thcSortPriority:4; + unsigned int mini:1; + unsigned int textColorIgnoresNormalDisableFlag:1; + unsigned int textColorDisableFlag:1; + unsigned int thcForceHighlightForSort:1; + unsigned int invalidTextColor:1; + unsigned int notificationForMarkedText:1; + unsigned int inToolbar:1; + unsigned int hasTextLayer:1; + unsigned int isButtonTitle:1; + unsigned int reservedTextFieldCell:13; + } _tfFlags; +} + +- (void)setBackgroundColor:(NSColor *)color; +- (NSColor *)backgroundColor; +- (void)setDrawsBackground:(BOOL)flag; +- (BOOL)drawsBackground; +- (void)setTextColor:(NSColor *)color; +- (NSColor *)textColor; +- (NSText *)setUpFieldEditorAttributes:(NSText *)textObj; + +- (void)setBezelStyle:(NSTextFieldBezelStyle)style; +- (NSTextFieldBezelStyle)bezelStyle; + +- (void)setPlaceholderString:(NSString*)string; +- (NSString*)placeholderString; +- (void)setPlaceholderAttributedString:(NSAttributedString*)string; +- (NSAttributedString*)placeholderAttributedString; + +- (void)setWantsNotificationForMarkedText:(BOOL)flag; + + + +- (NSArray *)allowedInputSourceLocales; +- (void)setAllowedInputSourceLocales:(NSArray *)localeIdentifiers; + +@end diff --git a/src/AppKit/NSTextFinder.h b/src/AppKit/NSTextFinder.h new file mode 100644 index 000000000..622a290e5 --- /dev/null +++ b/src/AppKit/NSTextFinder.h @@ -0,0 +1,175 @@ +#import +#import +#import +#import +#import + +@class NSArray, NSView, NSOperationQueue; +@protocol NSTextFinderClient, NSTextFinderBarContainer; + +#if MAC_OS_X_VERSION_10_7 <= MAC_OS_X_VERSION_MAX_ALLOWED +enum { + NSTextFinderActionShowFindInterface = 1, + NSTextFinderActionNextMatch = 2, + NSTextFinderActionPreviousMatch = 3, + NSTextFinderActionReplaceAll = 4, + NSTextFinderActionReplace = 5, + NSTextFinderActionReplaceAndFind = 6, + NSTextFinderActionSetSearchString = 7, + NSTextFinderActionReplaceAllInSelection = 8, + NSTextFinderActionSelectAll = 9, + NSTextFinderActionSelectAllInSelection = 10, + NSTextFinderActionHideFindInterface = 11, + NSTextFinderActionShowReplaceInterface = 12, + NSTextFinderActionHideReplaceInterface = 13 +}; +#endif +typedef NSInteger NSTextFinderAction; + + + + +EXTERN_C NSString *const NSTextFinderCaseInsensitiveKey; +EXTERN_C NSString *const NSTextFinderMatchingTypeKey; + +#if MAC_OS_X_VERSION_10_7 <= MAC_OS_X_VERSION_MAX_ALLOWED +enum { + NSTextFinderMatchingTypeContains = 0, + NSTextFinderMatchingTypeStartsWith = 1, + NSTextFinderMatchingTypeFullWord = 2, + NSTextFinderMatchingTypeEndsWith = 3 +}; +#endif +typedef NSInteger NSTextFinderMatchingType; + + + +@interface NSTextFinder : NSObject { +@private + id _client; + id _content; + id _container; + NSUInteger _style; + BOOL _incrementalEnabled; + BOOL _shouldDim; + + id _private; +} + +- (id)init; + + +@property (assign) IBOutlet id client; + + +- (void)performAction:(NSTextFinderAction)op; +- (BOOL)validateAction:(NSTextFinderAction)op; + + +@property (assign) IBOutlet id findBarContainer; + + + + + +- (void)cancelFindIndicator; + + +@property BOOL findIndicatorNeedsUpdate; + + + + + +@property (getter=isIncrementalSearchingEnabled) BOOL incrementalSearchingEnabled; + + +@property BOOL incrementalSearchingShouldDimContentView; + + +@property (readonly) NSArray *incrementalMatchRanges; + + ++ (void)drawIncrementalMatchHighlightInRect:(NSRect)rect; + + +- (void)noteClientStringWillChange; + +@end + + +@protocol NSTextFinderClient + + + + + + + +@optional + + +@property (getter=isSelectable, readonly) BOOL selectable; +@property (readonly) BOOL allowsMultipleSelection; +@property (getter=isEditable, readonly) BOOL editable; + + + + + +@property (readonly) NSString *string; +- (NSString *)stringAtIndex:(NSUInteger)characterIndex effectiveRange:(NSRangePointer)outRange endsWithSearchBoundary:(BOOL *)outFlag; +- (NSUInteger)stringLength; + + + + + +@property (readonly) NSRange firstSelectedRange; + + +@property (copy) NSArray *selectedRanges; + + +- (void)scrollRangeToVisible:(NSRange)range; + + +- (BOOL)shouldReplaceCharactersInRanges:(NSArray *)ranges withStrings:(NSArray *)strings; +- (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)string; +- (void)didReplaceCharacters; + + + +- (NSView *)contentViewAtIndex:(NSUInteger)index effectiveCharacterRange:(NSRangePointer)outRange; + + +- (NSArray *)rectsForCharacterRange:(NSRange)range; + + +@property (readonly) NSArray *visibleCharacterRanges; + + +- (void)drawCharactersInRange:(NSRange)range forContentView:(NSView *)view; + +@end + + +@protocol NSTextFinderBarContainer + +@required + + +@property (retain) NSView *findBarView; + + +@property (getter=isFindBarVisible) BOOL findBarVisible; + + +- (void)findBarViewDidChangeHeight; + +@optional + + +- (NSView *)contentView; + +@end diff --git a/src/AppKit/NSTextInputClient.h b/src/AppKit/NSTextInputClient.h new file mode 100644 index 000000000..e3e52d830 --- /dev/null +++ b/src/AppKit/NSTextInputClient.h @@ -0,0 +1,74 @@ +#import +#import +#import + +@class NSArray; +@class NSAttributedString; + +@protocol NSTextInputClient +@required + + +- (void)insertText:(id)aString replacementRange:(NSRange)replacementRange; + + + + - (void)doCommandBySelector:(SEL)aSelector; + + + +- (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange; + + + +- (void)unmarkText; + + + +- (NSRange)selectedRange; + + + +- (NSRange)markedRange; + + + +- (BOOL)hasMarkedText; + + + +- (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange; + + + +- (NSArray*)validAttributesForMarkedText; + + + +- (NSRect)firstRectForCharacterRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange; + + + +- (NSUInteger)characterIndexForPoint:(NSPoint)aPoint; + +@optional + + +- (NSAttributedString *)attributedString; + + + +- (CGFloat)fractionOfDistanceThroughGlyphForPoint:(NSPoint)aPoint; + + + +- (CGFloat)baselineDeltaForCharacterAtIndex:(NSUInteger)anIndex; + + + +- (NSInteger)windowLevel; + + + +- (BOOL)drawsVerticallyForCharacterAtIndex:(NSUInteger)charIndex; +@end diff --git a/src/AppKit/NSTextInputContext.h b/src/AppKit/NSTextInputContext.h new file mode 100644 index 000000000..4e958711d --- /dev/null +++ b/src/AppKit/NSTextInputContext.h @@ -0,0 +1,105 @@ +#import +#import + + +@class NSEvent; + + +@interface NSTextInputContext : NSObject { +@private + id _client; + + NSArray *_inputLocales; + + void *_documentID; + id _keyBindings; + id _keyBindingManager; + + NSString *_commandCharacters; + + NSInteger _documentRefcon; + + id _reserved[2]; + id _auxiliary; + + struct { + unsigned int _acceptsGlyphInfo:1; + unsigned int _secureInput:1; + + unsigned int _attributedString:1; + unsigned int _fractionOfDistance:1; + unsigned int _baselineDelta:1; + unsigned int _windowLevel:1; + unsigned int _drawsVertically:1; + + unsigned int _compatibilityMode:1; + unsigned int _hasTS:1; + unsigned int _hasLM:1; + + unsigned int _inputLocaleGeneration:16; + unsigned int _blockTSM:1; + unsigned int _keyProcess:1; + unsigned int _preflight:1; + unsigned int _bindingFound:1; + + unsigned int _reserved:2; + } _ticFlags; +} + + + ++ (NSTextInputContext *)currentInputContext; + + + +- (id)initWithClient:(id )theClient; + + + + +@property(readonly) id client; + + + +@property BOOL acceptsGlyphInfo; + + + +@property(copy) NSArray *allowedInputSourceLocales; + + + + + +- (void)activate; +- (void)deactivate; + + + + +- (BOOL)handleEvent:(NSEvent *)theEvent; + + + +- (void)discardMarkedText; + + + +- (void)invalidateCharacterCoordinates; +@property(readonly) NSArray *keyboardInputSources; + + + +@property(copy) NSString *selectedKeyboardInputSource; + + + + + ++ (NSString *)localizedNameForInputSource:(NSString *)inputSourceIdentifier; +@end + + + + +EXTERN_C NSString *NSTextInputContextKeyboardSelectionDidChangeNotification; diff --git a/src/AppKit/NSTextList.h b/src/AppKit/NSTextList.h new file mode 100644 index 000000000..2fe8120ac --- /dev/null +++ b/src/AppKit/NSTextList.h @@ -0,0 +1,23 @@ +#import + + +enum { + NSTextListPrependEnclosingMarker = (1 << 0) +}; + +@interface NSTextList : NSObject { + + NSString *_markerFormat; + NSUInteger _listFlags; + NSInteger _startIndex; + void *_listSecondary; +} + +- (id)initWithMarkerFormat:(NSString *)format options:(NSUInteger)mask; +- (NSString *)markerFormat; +- (NSUInteger)listOptions; +- (NSString *)markerForItemNumber:(NSInteger)itemNum; +- (void)setStartingItemNumber:(NSInteger)itemNum; +- (NSInteger)startingItemNumber; + +@end diff --git a/src/AppKit/NSTextStorage.h b/src/AppKit/NSTextStorage.h new file mode 100644 index 000000000..986fbab23 --- /dev/null +++ b/src/AppKit/NSTextStorage.h @@ -0,0 +1,84 @@ +#import +#import + +@class NSLayoutManager; +@class NSMutableArray; +@protocol NSTextStorageDelegate; + + + +enum { + NSTextStorageEditedAttributes = 1, + NSTextStorageEditedCharacters = 2 +}; + +@interface NSTextStorage : NSMutableAttributedString { + + NSRange _editedRange; + NSInteger _editedDelta; + struct { + unsigned int editedMask:8; + unsigned int :8; + unsigned int disabled:16; +#if __LP64__ + unsigned int :32; +#endif + } _flags; + NSMutableArray *_layoutManagers; + id _sideData; +} + + + +- (void)addLayoutManager:(NSLayoutManager *)obj; +- (void)removeLayoutManager:(NSLayoutManager *)obj; +- (NSArray *)layoutManagers; + + + +- (void)edited:(NSUInteger)editedMask range:(NSRange)range changeInLength:(NSInteger)delta; + + + +- (void)processEditing; + + +- (void)invalidateAttributesInRange:(NSRange)range; + + +- (void)ensureAttributesAreFixedInRange:(NSRange)range; + + + +- (BOOL)fixesAttributesLazily; + + + +- (NSUInteger)editedMask; +- (NSRange)editedRange; +- (NSInteger)changeInLength; + + + +- (void)setDelegate:(id )delegate; +- (id )delegate; + +@end + + + + +@protocol NSTextStorageDelegate +@optional + + + +- (void)textStorageWillProcessEditing:(NSNotification *)notification; +- (void)textStorageDidProcessEditing:(NSNotification *)notification; + +@end + + + +EXTERN_C NSString *NSTextStorageWillProcessEditingNotification; +EXTERN_C NSString *NSTextStorageDidProcessEditingNotification; diff --git a/src/AppKit/NSTextStorageScripting.h b/src/AppKit/NSTextStorageScripting.h new file mode 100644 index 000000000..e7f4e16c8 --- /dev/null +++ b/src/AppKit/NSTextStorageScripting.h @@ -0,0 +1,23 @@ +#import + +@interface NSTextStorage (Scripting) + +- (NSArray *)attributeRuns; +- (void)setAttributeRuns:(NSArray *)attributeRuns; + +- (NSArray *)paragraphs; +- (void)setParagraphs:(NSArray *)paragraphs; + +- (NSArray *)words; +- (void)setWords:(NSArray *)words; + +- (NSArray *)characters; +- (void)setCharacters:(NSArray *)characters; + +- (NSFont *)font; +- (void)setFont:(NSFont *)font; + +- (NSColor *)foregroundColor; +- (void)setForegroundColor:(NSColor *)color; + +@end diff --git a/src/AppKit/NSTextTable.h b/src/AppKit/NSTextTable.h new file mode 100644 index 000000000..ca8418e70 --- /dev/null +++ b/src/AppKit/NSTextTable.h @@ -0,0 +1,146 @@ +#import + +@class NSTextTable; +@class NSLayoutManager; +@class NSTextContainer; + + + +enum { + NSTextBlockAbsoluteValueType = 0, + NSTextBlockPercentageValueType = 1 +}; +typedef NSUInteger NSTextBlockValueType; + + +enum { + NSTextBlockWidth = 0, + NSTextBlockMinimumWidth = 1, + NSTextBlockMaximumWidth = 2, + NSTextBlockHeight = 4, + NSTextBlockMinimumHeight = 5, + NSTextBlockMaximumHeight = 6 +}; +typedef NSUInteger NSTextBlockDimension; + + +enum { + NSTextBlockPadding = -1, + NSTextBlockBorder = 0, + NSTextBlockMargin = 1 +}; +typedef NSInteger NSTextBlockLayer; + + +enum { + NSTextBlockTopAlignment = 0, + NSTextBlockMiddleAlignment = 1, + NSTextBlockBottomAlignment = 2, + NSTextBlockBaselineAlignment = 3 +}; +typedef NSUInteger NSTextBlockVerticalAlignment; + + +enum { + NSTextTableAutomaticLayoutAlgorithm = 0, + NSTextTableFixedLayoutAlgorithm = 1 +}; +typedef NSUInteger NSTextTableLayoutAlgorithm; + + +@interface NSTextBlock : NSObject { + + void *_propVals; + NSUInteger _propMask; + NSUInteger _typeMask; + id _primParamVal; + id _otherParamVals; + void *_blockPrimary; + void *_blockSecondary; +} + +- (id)init; + + +- (void)setValue:(CGFloat)val type:(NSTextBlockValueType)type forDimension:(NSTextBlockDimension)dimension; +- (CGFloat)valueForDimension:(NSTextBlockDimension)dimension; +- (NSTextBlockValueType)valueTypeForDimension:(NSTextBlockDimension)dimension; + + +- (void)setContentWidth:(CGFloat)val type:(NSTextBlockValueType)type; +- (CGFloat)contentWidth; +- (NSTextBlockValueType)contentWidthValueType; + + +- (void)setWidth:(CGFloat)val type:(NSTextBlockValueType)type forLayer:(NSTextBlockLayer)layer edge:(NSRectEdge)edge; +- (void)setWidth:(CGFloat)val type:(NSTextBlockValueType)type forLayer:(NSTextBlockLayer)layer; +- (CGFloat)widthForLayer:(NSTextBlockLayer)layer edge:(NSRectEdge)edge; +- (NSTextBlockValueType)widthValueTypeForLayer:(NSTextBlockLayer)layer edge:(NSRectEdge)edge; + + +- (void)setVerticalAlignment:(NSTextBlockVerticalAlignment)alignment; +- (NSTextBlockVerticalAlignment)verticalAlignment; + + +- (void)setBackgroundColor:(NSColor *)color; +- (NSColor *)backgroundColor; +- (void)setBorderColor:(NSColor *)color forEdge:(NSRectEdge)edge; +- (void)setBorderColor:(NSColor *)color; +- (NSColor *)borderColorForEdge:(NSRectEdge)edge; + + +- (NSRect)rectForLayoutAtPoint:(NSPoint)startingPoint inRect:(NSRect)rect textContainer:(NSTextContainer *)textContainer characterRange:(NSRange)charRange; +- (NSRect)boundsRectForContentRect:(NSRect)contentRect inRect:(NSRect)rect textContainer:(NSTextContainer *)textContainer characterRange:(NSRange)charRange; + + +- (void)drawBackgroundWithFrame:(NSRect)frameRect inView:(NSView *)controlView characterRange:(NSRange)charRange layoutManager:(NSLayoutManager *)layoutManager; + +@end + + +@interface NSTextTableBlock : NSTextBlock { + NSTextTable *_table; + NSInteger _rowNum; + NSInteger _colNum; + NSInteger _rowSpan; + NSInteger _colSpan; + void *_tableBlockPrimary; + void *_tableBlockSecondary; +} + +- (id)initWithTable:(NSTextTable *)table startingRow:(NSInteger)row rowSpan:(NSInteger)rowSpan startingColumn:(NSInteger)col columnSpan:(NSInteger)colSpan; + + +- (NSTextTable *)table; +- (NSInteger)startingRow; +- (NSInteger)rowSpan; +- (NSInteger)startingColumn; +- (NSInteger)columnSpan; + +@end + + +@interface NSTextTable : NSTextBlock { + NSUInteger _numCols; + NSUInteger _tableFlags; + id _lcache; + void *_tablePrimary; + void *_tableSecondary; +} + + +- (NSUInteger)numberOfColumns; +- (void)setNumberOfColumns:(NSUInteger)numCols; +- (NSTextTableLayoutAlgorithm)layoutAlgorithm; +- (void)setLayoutAlgorithm:(NSTextTableLayoutAlgorithm)algorithm; +- (BOOL)collapsesBorders; +- (void)setCollapsesBorders:(BOOL)flag; +- (BOOL)hidesEmptyCells; +- (void)setHidesEmptyCells:(BOOL)flag; + + +- (NSRect)rectForBlock:(NSTextTableBlock *)block layoutAtPoint:(NSPoint)startingPoint inRect:(NSRect)rect textContainer:(NSTextContainer *)textContainer characterRange:(NSRange)charRange; +- (NSRect)boundsRectForBlock:(NSTextTableBlock *)block contentRect:(NSRect)contentRect inRect:(NSRect)rect textContainer:(NSTextContainer *)textContainer characterRange:(NSRange)charRange; +- (void)drawBackgroundForBlock:(NSTextTableBlock *)block withFrame:(NSRect)frameRect inView:(NSView *)controlView characterRange:(NSRange)charRange layoutManager:(NSLayoutManager *)layoutManager; + +@end diff --git a/src/AppKit/NSTextView.h b/src/AppKit/NSTextView.h new file mode 100644 index 000000000..b2edeb030 --- /dev/null +++ b/src/AppKit/NSTextView.h @@ -0,0 +1,581 @@ +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +@class NSTextContainer; +@class NSTextStorage; +@class NSLayoutManager; +@class NSRulerView; +@class NSRulerMarker; +@class NSUndoManager; +@class NSParagraphStyle; +@class NSOrthography; +@class NSSharingServicePicker; +@protocol NSTextViewDelegate; + + +enum { + NSSelectByCharacter = 0, + NSSelectByWord = 1, + NSSelectByParagraph = 2 +}; +typedef NSUInteger NSSelectionGranularity; + + +enum { + NSSelectionAffinityUpstream = 0, + NSSelectionAffinityDownstream = 1 +}; +typedef NSUInteger NSSelectionAffinity; + + + + +EXTERN_C NSString *NSAllRomanInputSourcesLocaleIdentifier; + + +@interface NSTextView : NSText + + + +- (id)initWithFrame:(NSRect)frameRect textContainer:(NSTextContainer *)container; + + +- (id)initWithFrame:(NSRect)frameRect; + + + + +- (NSTextContainer *)textContainer; +- (void)setTextContainer:(NSTextContainer *)container; + + +- (void)replaceTextContainer:(NSTextContainer *)newContainer; + + +- (void)setTextContainerInset:(NSSize)inset; +- (NSSize)textContainerInset; + + +- (NSPoint)textContainerOrigin; +- (void)invalidateTextContainerOrigin; + + +- (NSLayoutManager *)layoutManager; +- (NSTextStorage *)textStorage; + + + + +- (void)insertText:(id)insertString; + + + + +- (void)setConstrainedFrameSize:(NSSize)desiredSize; + + + + + +- (void)setAlignment:(NSTextAlignment)alignment range:(NSRange)range; +- (void)setBaseWritingDirection:(NSWritingDirection)writingDirection range:(NSRange)range; + + + +- (void)turnOffKerning:(id)sender; +- (void)tightenKerning:(id)sender; +- (void)loosenKerning:(id)sender; +- (void)useStandardKerning:(id)sender; +- (void)turnOffLigatures:(id)sender; +- (void)useStandardLigatures:(id)sender; +- (void)useAllLigatures:(id)sender; +- (void)raiseBaseline:(id)sender; +- (void)lowerBaseline:(id)sender; +- (void)toggleTraditionalCharacterShape:(id)sender; +- (void)outline:(id)sender; + + + +- (void)performFindPanelAction:(id)sender; + + + + +- (void)alignJustified:(id)sender; +- (void)changeColor:(id)sender; +- (void)changeAttributes:(id)sender; +- (void)changeDocumentBackgroundColor:(id)sender; +- (void)orderFrontSpacingPanel:(id)sender; +- (void)orderFrontLinkPanel:(id)sender; +- (void)orderFrontListPanel:(id)sender; +- (void)orderFrontTablePanel:(id)sender; + + + +- (void)rulerView:(NSRulerView *)ruler didMoveMarker:(NSRulerMarker *)marker; +- (void)rulerView:(NSRulerView *)ruler didRemoveMarker:(NSRulerMarker *)marker; +- (void)rulerView:(NSRulerView *)ruler didAddMarker:(NSRulerMarker *)marker; +- (BOOL)rulerView:(NSRulerView *)ruler shouldMoveMarker:(NSRulerMarker *)marker; +- (BOOL)rulerView:(NSRulerView *)ruler shouldAddMarker:(NSRulerMarker *)marker; +- (CGFloat)rulerView:(NSRulerView *)ruler willMoveMarker:(NSRulerMarker *)marker toLocation:(CGFloat)location; +- (BOOL)rulerView:(NSRulerView *)ruler shouldRemoveMarker:(NSRulerMarker *)marker; +- (CGFloat)rulerView:(NSRulerView *)ruler willAddMarker:(NSRulerMarker *)marker atLocation:(CGFloat)location; +- (void)rulerView:(NSRulerView *)ruler handleMouseDown:(NSEvent *)event; + + + +- (void)setNeedsDisplayInRect:(NSRect)rect avoidAdditionalLayout:(BOOL)flag; + + +- (BOOL)shouldDrawInsertionPoint; +- (void)drawInsertionPointInRect:(NSRect)rect color:(NSColor *)color turnedOn:(BOOL)flag; + +- (void)drawViewBackgroundInRect:(NSRect)rect; + + + + +- (void)updateRuler; +- (void)updateFontPanel; + +- (void)updateDragTypeRegistration; + +- (NSRange)selectionRangeForProposedRange:(NSRange)proposedCharRange granularity:(NSSelectionGranularity)granularity; + + + +- (void)clickedOnLink:(id)link atIndex:(NSUInteger)charIndex; + + + + +- (void)startSpeaking:(id)sender; +- (void)stopSpeaking:(id)sender; + + +- (void)setLayoutOrientation:(NSTextLayoutOrientation)theOrientation; + + +- (void)changeLayoutOrientation:(id)sender; + + + + +- (NSUInteger)characterIndexForInsertionAtPoint:(NSPoint)point; + + +@end + +@interface NSTextView (NSCompletion) + + + +- (void)complete:(id)sender; + + +- (NSRange)rangeForUserCompletion; + + +- (NSArray *)completionsForPartialWordRange:(NSRange)charRange indexOfSelectedItem:(NSInteger *)index; + + +- (void)insertCompletion:(NSString *)word forPartialWordRange:(NSRange)charRange movement:(NSInteger)movement isFinal:(BOOL)flag; + +@end + +@interface NSTextView (NSPasteboard) +- (NSArray *)writablePasteboardTypes; + + +- (BOOL)writeSelectionToPasteboard:(NSPasteboard *)pboard type:(NSString *)type; + + +- (BOOL)writeSelectionToPasteboard:(NSPasteboard *)pboard types:(NSArray *)types; + + + +- (NSArray *)readablePasteboardTypes; + + +- (NSString *)preferredPasteboardTypeFromArray:(NSArray *)availableTypes restrictedToTypesFromArray:(NSArray *)allowedTypes; + + +- (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pboard type:(NSString *)type; + + +- (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pboard; + + ++ (void)registerForServices; + + +- (id)validRequestorForSendType:(NSString *)sendType returnType:(NSString *)returnType; + + +- (void)pasteAsPlainText:(id)sender; +- (void)pasteAsRichText:(id)sender; + + +@end + +@interface NSTextView (NSDragging) + +- (BOOL)dragSelectionWithEvent:(NSEvent *)event offset:(NSSize)mouseOffset slideBack:(BOOL)slideBack; + + +- (NSImage *)dragImageForSelectionWithEvent:(NSEvent *)event origin:(NSPointPointer)origin; + + +- (NSArray *)acceptableDragTypes; + + +- (NSDragOperation)dragOperationForDraggingInfo:(id )dragInfo type:(NSString *)type; + + +- (void)cleanUpAfterDragOperation; + + +@end + +@interface NSTextView (NSSharing) + + + + + +- (NSArray *)selectedRanges; +- (void)setSelectedRanges:(NSArray *)ranges affinity:(NSSelectionAffinity)affinity stillSelecting:(BOOL)stillSelectingFlag; +- (void)setSelectedRanges:(NSArray *)ranges; + + +- (void)setSelectedRange:(NSRange)charRange affinity:(NSSelectionAffinity)affinity stillSelecting:(BOOL)stillSelectingFlag; +- (NSSelectionAffinity)selectionAffinity; +- (NSSelectionGranularity)selectionGranularity; +- (void)setSelectionGranularity:(NSSelectionGranularity)granularity; + +- (void)setSelectedTextAttributes:(NSDictionary *)attributeDictionary; +- (NSDictionary *)selectedTextAttributes; + + +- (void)setInsertionPointColor:(NSColor *)color; +- (NSColor *)insertionPointColor; + +- (void)updateInsertionPointStateAndRestartTimer:(BOOL)restartFlag; + +- (void)setMarkedTextAttributes:(NSDictionary *)attributeDictionary; +- (NSDictionary *)markedTextAttributes; + + +- (void)setLinkTextAttributes:(NSDictionary *)attributeDictionary; +- (NSDictionary *)linkTextAttributes; + + +- (BOOL)displaysLinkToolTips; +- (void)setDisplaysLinkToolTips:(BOOL)flag; + + + + +- (BOOL)acceptsGlyphInfo; +- (void)setAcceptsGlyphInfo:(BOOL)flag; + + + +- (void)setRulerVisible:(BOOL)flag; +- (BOOL)usesRuler; +- (void)setUsesRuler:(BOOL)flag; + +- (BOOL)usesInspectorBar; +- (void)setUsesInspectorBar:(BOOL)flag; + +- (void)setContinuousSpellCheckingEnabled:(BOOL)flag; +- (BOOL)isContinuousSpellCheckingEnabled; +- (void)toggleContinuousSpellChecking:(id)sender; + +- (NSInteger)spellCheckerDocumentTag; + +- (void)setGrammarCheckingEnabled:(BOOL)flag; +- (BOOL)isGrammarCheckingEnabled; +- (void)toggleGrammarChecking:(id)sender; + + +- (void)setSpellingState:(NSInteger)value range:(NSRange)charRange; + + +- (NSDictionary *)typingAttributes; +- (void)setTypingAttributes:(NSDictionary *)attrs; + + +- (BOOL)shouldChangeTextInRanges:(NSArray *)affectedRanges replacementStrings:(NSArray *)replacementStrings; +- (NSArray *)rangesForUserTextChange; +- (NSArray *)rangesForUserCharacterAttributeChange; +- (NSArray *)rangesForUserParagraphAttributeChange; + +- (BOOL)shouldChangeTextInRange:(NSRange)affectedCharRange replacementString:(NSString *)replacementString; +- (void)didChangeText; + +- (NSRange)rangeForUserTextChange; +- (NSRange)rangeForUserCharacterAttributeChange; +- (NSRange)rangeForUserParagraphAttributeChange; + +- (void)setAllowsDocumentBackgroundColorChange:(BOOL)flag; +- (BOOL)allowsDocumentBackgroundColorChange; + +- (void)setDefaultParagraphStyle:(NSParagraphStyle *)paragraphStyle; +- (NSParagraphStyle *)defaultParagraphStyle; + +- (void)setAllowsUndo:(BOOL)flag; +- (BOOL)allowsUndo; + +- (void)breakUndoCoalescing; + +- (BOOL)isCoalescingUndo; + +- (BOOL)allowsImageEditing; +- (void)setAllowsImageEditing:(BOOL)flag; + + +- (void)showFindIndicatorForRange:(NSRange)charRange; + + + + +- (id )delegate; +- (void)setDelegate:(id )anObject; +- (BOOL)isEditable; +- (void)setEditable:(BOOL)flag; +- (BOOL)isSelectable; +- (void)setSelectable:(BOOL)flag; +- (BOOL)isRichText; +- (void)setRichText:(BOOL)flag; +- (BOOL)importsGraphics; +- (void)setImportsGraphics:(BOOL)flag; +- (BOOL)drawsBackground; +- (void)setDrawsBackground:(BOOL)flag; +- (NSColor *)backgroundColor; +- (void)setBackgroundColor:(NSColor *)color; +- (BOOL)isFieldEditor; +- (void)setFieldEditor:(BOOL)flag; +- (BOOL)usesFontPanel; +- (void)setUsesFontPanel:(BOOL)flag; +- (BOOL)isRulerVisible; +- (void)setSelectedRange:(NSRange)charRange; + + + + + +- (NSArray *)allowedInputSourceLocales; +- (void)setAllowedInputSourceLocales:(NSArray *)localeIdentifiers; +@end + +@interface NSTextView (NSTextChecking) + + + +- (BOOL)smartInsertDeleteEnabled; +- (void)setSmartInsertDeleteEnabled:(BOOL)flag; +- (NSRange)smartDeleteRangeForProposedRange:(NSRange)proposedCharRange; +- (void)toggleSmartInsertDelete:(id)sender; + +- (void)smartInsertForString:(NSString *)pasteString replacingRange:(NSRange)charRangeToReplace beforeString:(NSString **)beforeString afterString:(NSString **)afterString; +- (NSString *)smartInsertBeforeStringForString:(NSString *)pasteString replacingRange:(NSRange)charRangeToReplace; +- (NSString *)smartInsertAfterStringForString:(NSString *)pasteString replacingRange:(NSRange)charRangeToReplace; + +- (void)setAutomaticQuoteSubstitutionEnabled:(BOOL)flag; +- (BOOL)isAutomaticQuoteSubstitutionEnabled; +- (void)toggleAutomaticQuoteSubstitution:(id)sender; +- (void)setAutomaticLinkDetectionEnabled:(BOOL)flag; +- (BOOL)isAutomaticLinkDetectionEnabled; +- (void)toggleAutomaticLinkDetection:(id)sender; + +- (void)setAutomaticDataDetectionEnabled:(BOOL)flag; +- (BOOL)isAutomaticDataDetectionEnabled; +- (void)toggleAutomaticDataDetection:(id)sender; +- (void)setAutomaticDashSubstitutionEnabled:(BOOL)flag; +- (BOOL)isAutomaticDashSubstitutionEnabled; +- (void)toggleAutomaticDashSubstitution:(id)sender; +- (void)setAutomaticTextReplacementEnabled:(BOOL)flag; +- (BOOL)isAutomaticTextReplacementEnabled; +- (void)toggleAutomaticTextReplacement:(id)sender; +- (void)setAutomaticSpellingCorrectionEnabled:(BOOL)flag; +- (BOOL)isAutomaticSpellingCorrectionEnabled; +- (void)toggleAutomaticSpellingCorrection:(id)sender; + +- (NSTextCheckingTypes)enabledTextCheckingTypes; +- (void)setEnabledTextCheckingTypes:(NSTextCheckingTypes)checkingTypes; + + +- (void)checkTextInRange:(NSRange)range types:(NSTextCheckingTypes)checkingTypes options:(NSDictionary *)options; +- (void)handleTextCheckingResults:(NSArray *)results forRange:(NSRange)range types:(NSTextCheckingTypes)checkingTypes options:(NSDictionary *)options orthography:(NSOrthography *)orthography wordCount:(NSInteger)wordCount; + + +- (void)orderFrontSubstitutionsPanel:(id)sender; +- (void)checkTextInSelection:(id)sender; +- (void)checkTextInDocument:(id)sender; + + +- (void)setUsesFindPanel:(BOOL)flag; +- (BOOL)usesFindPanel; + +- (void)setUsesFindBar:(BOOL)flag; +- (BOOL)usesFindBar; + +- (void)setIncrementalSearchingEnabled:(BOOL)flag; +- (BOOL)isIncrementalSearchingEnabled; + +@end + +@interface NSTextView (NSQuickLookPreview) + +- (IBAction)toggleQuickLookPreviewPanel:(id)sender; + + + +- (NSArray *)quickLookPreviewableItemsInRanges:(NSArray *)ranges; + + +- (void)updateQuickLookPreviewPanel; + +@end + +@interface NSTextView (NSTextView_SharingService) + +- (IBAction)orderFrontSharingServicePicker:(id)sender; + +@end + +@interface NSTextView (NSDeprecated) +- (void)toggleBaseWritingDirection:(id)sender; + + +@end + + + +@protocol NSTextViewDelegate +@optional + +- (BOOL)textView:(NSTextView *)textView clickedOnLink:(id)link atIndex:(NSUInteger)charIndex; + + +- (void)textView:(NSTextView *)textView clickedOnCell:(id )cell inRect:(NSRect)cellFrame atIndex:(NSUInteger)charIndex; + + +- (void)textView:(NSTextView *)textView doubleClickedOnCell:(id )cell inRect:(NSRect)cellFrame atIndex:(NSUInteger)charIndex; + + +- (void)textView:(NSTextView *)view draggedCell:(id )cell inRect:(NSRect)rect event:(NSEvent *)event atIndex:(NSUInteger)charIndex; + + +- (NSArray *)textView:(NSTextView *)view writablePasteboardTypesForCell:(id )cell atIndex:(NSUInteger)charIndex; + + +- (BOOL)textView:(NSTextView *)view writeCell:(id )cell atIndex:(NSUInteger)charIndex toPasteboard:(NSPasteboard *)pboard type:(NSString *)type ; + + +- (NSRange)textView:(NSTextView *)textView willChangeSelectionFromCharacterRange:(NSRange)oldSelectedCharRange toCharacterRange:(NSRange)newSelectedCharRange; + + +- (NSArray *)textView:(NSTextView *)textView willChangeSelectionFromCharacterRanges:(NSArray *)oldSelectedCharRanges toCharacterRanges:(NSArray *)newSelectedCharRanges; + + +- (BOOL)textView:(NSTextView *)textView shouldChangeTextInRanges:(NSArray *)affectedRanges replacementStrings:(NSArray *)replacementStrings; + + +- (NSDictionary *)textView:(NSTextView *)textView shouldChangeTypingAttributes:(NSDictionary *)oldTypingAttributes toAttributes:(NSDictionary *)newTypingAttributes; + + +- (void)textViewDidChangeSelection:(NSNotification *)notification; + +- (void)textViewDidChangeTypingAttributes:(NSNotification *)notification; + +- (NSString *)textView:(NSTextView *)textView willDisplayToolTip:(NSString *)tooltip forCharacterAtIndex:(NSUInteger)characterIndex; + + +- (NSArray *)textView:(NSTextView *)textView completions:(NSArray *)words forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(NSInteger *)index; + + +- (BOOL)textView:(NSTextView *)textView shouldChangeTextInRange:(NSRange)affectedCharRange replacementString:(NSString *)replacementString; + + +- (BOOL)textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector; + +- (NSInteger)textView:(NSTextView *)textView shouldSetSpellingState:(NSInteger)value range:(NSRange)affectedCharRange; + + +- (NSMenu *)textView:(NSTextView *)view menu:(NSMenu *)menu forEvent:(NSEvent *)event atIndex:(NSUInteger)charIndex; + + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 +- (NSDictionary *)textView:(NSTextView *)view willCheckTextInRange:(NSRange)range options:(NSDictionary *)options types:(NSTextCheckingTypes *)checkingTypes; + + +- (NSArray *)textView:(NSTextView *)view didCheckTextInRange:(NSRange)range types:(NSTextCheckingTypes)checkingTypes options:(NSDictionary *)options results:(NSArray *)results orthography:(NSOrthography *)orthography wordCount:(NSInteger)wordCount; + +#endif + +- (NSURL *)textView:(NSTextView *)textView URLForContentsOfTextAttachment:(NSTextAttachment *)textAttachment atIndex:(NSUInteger)charIndex; + + +- (NSSharingServicePicker *)textView:(NSTextView *)textView willShowSharingServicePicker:(NSSharingServicePicker *)servicePicker forItems:(NSArray *)items; + + + +- (BOOL)textView:(NSTextView *)textView clickedOnLink:(id)link; +- (void)textView:(NSTextView *)textView clickedOnCell:(id )cell inRect:(NSRect)cellFrame; +- (void)textView:(NSTextView *)textView doubleClickedOnCell:(id )cell inRect:(NSRect)cellFrame; +- (void)textView:(NSTextView *)view draggedCell:(id )cell inRect:(NSRect)rect event:(NSEvent *)event; +- (NSUndoManager *)undoManagerForTextView:(NSTextView *)view; + +@end + +EXTERN_C NSString *NSTextViewWillChangeNotifyingTextViewNotification; + + +EXTERN_C NSString *NSTextViewDidChangeSelectionNotification; + + +EXTERN_C NSString *NSTextViewDidChangeTypingAttributesNotification; + + + + + +enum { + NSFindPanelActionShowFindPanel = 1, + NSFindPanelActionNext = 2, + NSFindPanelActionPrevious = 3, + NSFindPanelActionReplaceAll = 4, + NSFindPanelActionReplace = 5, + NSFindPanelActionReplaceAndFind = 6, + NSFindPanelActionSetFindString = 7, + NSFindPanelActionReplaceAllInSelection = 8, + NSFindPanelActionSelectAll = 9, + NSFindPanelActionSelectAllInSelection = 10 +}; +typedef NSUInteger NSFindPanelAction; + + + +EXTERN_C NSString *NSFindPanelSearchOptionsPboardType; + +EXTERN_C NSString *NSFindPanelCaseInsensitiveSearch; +EXTERN_C NSString *NSFindPanelSubstringMatch; + +enum { + NSFindPanelSubstringMatchTypeContains = 0, + NSFindPanelSubstringMatchTypeStartsWith = 1, + NSFindPanelSubstringMatchTypeFullWord = 2, + NSFindPanelSubstringMatchTypeEndsWith = 3 +}; +typedef NSUInteger NSFindPanelSubstringMatchType; diff --git a/src/AppKit/NSTokenField.h b/src/AppKit/NSTokenField.h new file mode 100644 index 000000000..014ee6158 --- /dev/null +++ b/src/AppKit/NSTokenField.h @@ -0,0 +1,74 @@ +#import +#import +#import +#import + +@protocol NSTokenFieldDelegate; + + +@interface NSTokenField : NSTextField { + BOOL _reserved1; + BOOL _reserved2; + BOOL _reserved3; + BOOL _reserved4; + + NSTrackingRectTag _trackingRectTag; + id _reserved5; + id _reserved6; + id _reserved7; +} + +- (void)setDelegate:(id )anObject; +- (id )delegate; + + + +- (void)setTokenStyle: (NSTokenStyle) style; +- (NSTokenStyle)tokenStyle; + +- (void)setCompletionDelay: (NSTimeInterval) delay; +- (NSTimeInterval)completionDelay; ++ (NSTimeInterval)defaultCompletionDelay; + +- (void)setTokenizingCharacterSet:(NSCharacterSet *)characterSet; +- (NSCharacterSet *)tokenizingCharacterSet; ++ (NSCharacterSet *)defaultTokenizingCharacterSet; + +@end + +@protocol NSTokenFieldDelegate + +@optional + + + + + +- (NSArray *)tokenField:(NSTokenField *)tokenField completionsForSubstring:(NSString *)substring indexOfToken:(NSInteger)tokenIndex indexOfSelectedItem:(NSInteger *)selectedIndex; + + + + +- (NSArray *)tokenField:(NSTokenField *)tokenField shouldAddObjects:(NSArray *)tokens atIndex:(NSUInteger)index; + + + +- (NSString *)tokenField:(NSTokenField *)tokenField displayStringForRepresentedObject:(id)representedObject; +- (NSString *)tokenField:(NSTokenField *)tokenField editingStringForRepresentedObject:(id)representedObject; +- (id)tokenField:(NSTokenField *)tokenField representedObjectForEditingString: (NSString *)editingString; + + + +- (BOOL)tokenField:(NSTokenField *)tokenField writeRepresentedObjects:(NSArray *)objects toPasteboard:(NSPasteboard *)pboard; + + +- (NSArray *)tokenField:(NSTokenField *)tokenField readFromPasteboard:(NSPasteboard *)pboard; + + +- (NSMenu *)tokenField:(NSTokenField *)tokenField menuForRepresentedObject:(id)representedObject; +- (BOOL)tokenField:(NSTokenField *)tokenField hasMenuForRepresentedObject:(id)representedObject; + + +- (NSTokenStyle)tokenField:(NSTokenField *)tokenField styleForRepresentedObject:(id)representedObject; + +@end diff --git a/src/AppKit/NSTokenFieldCell.h b/src/AppKit/NSTokenFieldCell.h new file mode 100644 index 000000000..08c647002 --- /dev/null +++ b/src/AppKit/NSTokenFieldCell.h @@ -0,0 +1,98 @@ +#import +#import + + +@class NSMutableArray, NSMutableCharacterSet, NSMutableDictionary, NSTextContainer; +@protocol NSTokenFieldCellDelegate; + +enum { + NSDefaultTokenStyle, + NSPlainTextTokenStyle, + NSRoundedTokenStyle +}; +typedef NSUInteger NSTokenStyle; + + +@interface NSTokenFieldCell : NSTextFieldCell { +@private + NSCharacterSet *_tokenizingCharacterSet; + id _delegate; + NSTimeInterval _completionDelay; + id _cache; + id _defaultTerminator; + id _trackingArea; + id _lastCell; + NSRect _lastCellFrame; + BOOL *_autoCompleteCancel; + id _reserved[6]; + struct { + unsigned int _style:4; + + unsigned int _invalidCache:1; + unsigned int _inDidChange:1; + unsigned int _validationDisabled:1; + unsigned int _reserved1:1; + unsigned int _autoCompleteMode:2; + unsigned int _inValidateEditing:1; + unsigned int _performingDrop:1; + + unsigned int _reserved:20; + } _tfcFlags; +} + + + +- (void)setTokenStyle:(NSTokenStyle)style; +- (NSTokenStyle)tokenStyle; + + + +- (void)setCompletionDelay:(NSTimeInterval)delay; +- (NSTimeInterval)completionDelay; ++ (NSTimeInterval)defaultCompletionDelay; + +- (void)setTokenizingCharacterSet:(NSCharacterSet *)characterSet; +- (NSCharacterSet *)tokenizingCharacterSet; ++ (NSCharacterSet *)defaultTokenizingCharacterSet; + +- (void)setDelegate:(id )anObject; +- (id )delegate; + +@end + +@protocol NSTokenFieldCellDelegate + +@optional + + + + + +- (NSArray *)tokenFieldCell:(NSTokenFieldCell *)tokenFieldCell completionsForSubstring:(NSString *)substring indexOfToken:(NSInteger)tokenIndex indexOfSelectedItem:(NSInteger *)selectedIndex; + + + + +- (NSArray *)tokenFieldCell:(NSTokenFieldCell *)tokenFieldCell shouldAddObjects:(NSArray *)tokens atIndex:(NSUInteger)index; + + + +- (NSString *)tokenFieldCell:(NSTokenFieldCell *)tokenFieldCell displayStringForRepresentedObject:(id)representedObject; +- (NSString *)tokenFieldCell:(NSTokenFieldCell *)tokenFieldCell editingStringForRepresentedObject:(id)representedObject; +- (id)tokenFieldCell:(NSTokenFieldCell *)tokenFieldCell representedObjectForEditingString: (NSString *)editingString; + + + +- (BOOL)tokenFieldCell:(NSTokenFieldCell *)tokenFieldCell writeRepresentedObjects:(NSArray *)objects toPasteboard:(NSPasteboard *)pboard; + + +- (NSArray *)tokenFieldCell:(NSTokenFieldCell *)tokenFieldCell readFromPasteboard:(NSPasteboard *)pboard; + + +- (NSMenu *)tokenFieldCell:(NSTokenFieldCell *)tokenFieldCell menuForRepresentedObject:(id)representedObject; +- (BOOL)tokenFieldCell:(NSTokenFieldCell *)tokenFieldCell hasMenuForRepresentedObject:(id)representedObject; + + +- (NSTokenStyle)tokenFieldCell:(NSTokenFieldCell *)tokenFieldCell styleForRepresentedObject:(id)representedObject; + +@end diff --git a/src/AppKit/NSToolbar.h b/src/AppKit/NSToolbar.h new file mode 100644 index 000000000..9fa1a00aa --- /dev/null +++ b/src/AppKit/NSToolbar.h @@ -0,0 +1,190 @@ +#import +#import + +@class NSArray, NSDictionary, NSMutableArray, NSNotification, NSString, NSToolbarItem, NSWindow, NSView; +@protocol NSToolbarDelegate; + +enum { NSToolbarDisplayModeDefault, NSToolbarDisplayModeIconAndLabel, NSToolbarDisplayModeIconOnly, NSToolbarDisplayModeLabelOnly }; +typedef NSUInteger NSToolbarDisplayMode; + +enum { NSToolbarSizeModeDefault, NSToolbarSizeModeRegular, NSToolbarSizeModeSmall }; +typedef NSUInteger NSToolbarSizeMode; + +@interface NSToolbar : NSObject { +@private + NSString * _toolbarIdentifier; + + NSMutableArray * _currentItems; + NSMutableArray * _currentItemIdentifiers; + + id _res1; + id _res2; + + NSString * _selectedItemIdentifier; + __strong void * _metrics; + + id _delegate; + NSWindow * _logicalWindow; + id _configPalette; + id _toolbarView; + NSInteger _syncPostEnabledCount; + + struct __tbFlags { + unsigned int allowsUserCustomization:1; + unsigned int autosavesUsingIdentifier:1; + unsigned int initialConfigurationDone:1; + unsigned int doesNotAttachToMenuBar:1; + unsigned int delegateDefaultItemIdentifiers:1; + unsigned int delegateAllowedItemIdentifiers:1; + unsigned int delegateItemWithItemIdentifier:1; + unsigned int delegateNotificationsEnabled:1; + unsigned int prefersToBeShown:1; + unsigned int loadItemsImmediately:1; + unsigned int currentItemsContainsPlaceholder:1; + unsigned int customizationPanelIsRunning:1; + unsigned int usesCustomSheetWidth:1; + unsigned int clickAndDragPerformsCustomization:1; + unsigned int showsNoContextMenu:1; + unsigned int currentlyLoadingPlaceholders:1; + unsigned int delegateItemWithItemIdentifier2:1; + unsigned int inGlobalWindow:1; + unsigned int reserved:2; + unsigned int usingFSMetrics:1; + unsigned int keyboardLoopNeedsUpdating:1; + unsigned int showHideDuringConfigurationChangeDisabled:1; + unsigned int displayMode:2; + unsigned int sizeMode:2; + unsigned int doNotShowBaselineSeparator:1; + unsigned int hideWithoutResizingWindowHint:1; + unsigned int autovalidatesItemsDisabled:1; + unsigned int inAutovalidation:1; + unsigned int loadedMetrics:1; + } _tbFlags; + + NSInteger _customizationSheetWidth; + id _tbReserved; +} + + +- (id)initWithIdentifier:(NSString *)identifier; + + +- (void)insertItemWithItemIdentifier:(NSString *)itemIdentifier atIndex:(NSInteger)index; +- (void)removeItemAtIndex:(NSInteger)index; + + +- (void)setDelegate:(id )delegate; +- (id )delegate; + + +- (void)setVisible:(BOOL)shown; +- (BOOL)isVisible; + + +- (void)runCustomizationPalette:(id)sender; +- (BOOL)customizationPaletteIsRunning; + + + + +- (void)setDisplayMode:(NSToolbarDisplayMode)displayMode; +- (NSToolbarDisplayMode)displayMode; + + +- (void)setSelectedItemIdentifier:(NSString *)itemIdentifier; +- (NSString *)selectedItemIdentifier; + +- (void)setSizeMode:(NSToolbarSizeMode)sizeMode; +- (NSToolbarSizeMode)sizeMode; + + + +- (void)setShowsBaselineSeparator:(BOOL)flag; +- (BOOL)showsBaselineSeparator; + + +- (void)setAllowsUserCustomization:(BOOL)allowCustomization; +- (BOOL)allowsUserCustomization; + + + + +- (void)setFullScreenAccessoryView:(NSView *)view; +- (NSView *)fullScreenAccessoryView; + + + + + + + +- (void)setFullScreenAccessoryViewMinHeight:(CGFloat)minHeight; +- (void)setFullScreenAccessoryViewMaxHeight:(CGFloat)maxHeight; +- (CGFloat)fullScreenAccessoryViewMinHeight; +- (CGFloat)fullScreenAccessoryViewMaxHeight; + + + + + + +- (NSString *)identifier; + + +- (NSArray *)items; + + +- (NSArray *)visibleItems; + + + + + +- (void)setAutosavesConfiguration:(BOOL)flag; +- (BOOL)autosavesConfiguration; + + +- (void)setConfigurationFromDictionary:(NSDictionary *)configDict; +- (NSDictionary *)configurationDictionary; + + + + + + +- (void)validateVisibleItems; + +@end + +@protocol NSToolbarDelegate + + +@optional + + +- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag; + + +- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar; + + +- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar; + +@optional + + +- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar; + + + + +- (void)toolbarWillAddItem: (NSNotification *)notification; + + +- (void)toolbarDidRemoveItem: (NSNotification *)notification; + +@end + + +EXTERN_C NSString *NSToolbarWillAddItemNotification; +EXTERN_C NSString *NSToolbarDidRemoveItemNotification; diff --git a/src/AppKit/NSToolbarItem.h b/src/AppKit/NSToolbarItem.h new file mode 100644 index 000000000..4bf960cd4 --- /dev/null +++ b/src/AppKit/NSToolbarItem.h @@ -0,0 +1,166 @@ +#import +#import +#import +#import + +@class NSToolbarItemViewer, NSMenuItem, NSView, NSImage; + +@interface NSToolbarItem : NSObject { +@private + NSToolbar * _toolbar; + NSImage * _image; + NSString * _itemIdentifier; + + NSString * _label; + NSTextAlignment _labelAlignment; + NSString * _paletteLabel; + + NSString * _toolTip; + NSMenuItem * _menuItemRep; + NSInteger _tag; + + struct __tbiFlags { + unsigned int viewRespondsToIsEnabled:1; + unsigned int viewRespondsToSetEnabled:1; + unsigned int viewRespondsToTag:1; + unsigned int viewRespondsToSetTag:1; + unsigned int viewRespondsToAction:1; + unsigned int viewRespondsToSetAction:1; + unsigned int viewRespondsToTarget:1; + unsigned int viewRespondsToSetTarget:1; + unsigned int viewRespondsToImage:1; + unsigned int viewRespondsToSetImage:1; + unsigned int isEnabled:1; + unsigned int isUserRemovable:1; + unsigned int menuHasBeenSet:1; + unsigned int menuRepIsDefault:1; + unsigned int viewHasBeenLoaded:1; + unsigned int drawingForDragImage:1; + unsigned int isCustomItemType:1; + unsigned int hasValidatedAutoModeConfiguration:1; + unsigned int useAutoModeConfiguration:1; + unsigned int RESERVED2:1; + unsigned int autovalidationDisabled:1; + unsigned int tagHasBeenSet:1; + unsigned int sizeHasBeenSet:1; + unsigned int stateWasDisabledBeforeSheet:1; + unsigned int RESERVED:8; + } _tbiFlags; + id _tbiReserved; + + id _itemViewer; + NSView * _view; + NSSize _minSize; + NSSize _maxSize; +#if __LP64__ + id _toolbarItemReserved; +#endif +} + +- (id)initWithItemIdentifier:(NSString *)itemIdentifier; + + +- (NSString *)itemIdentifier; +- (NSToolbar *)toolbar; + + + + +- (void)setLabel:(NSString *)label; +- (NSString *)label; + + +- (void)setPaletteLabel:(NSString *)paletteLabel; +- (NSString *)paletteLabel; + + +- (void)setToolTip:(NSString*)toolTip; +- (NSString *)toolTip; + + +- (void)setMenuFormRepresentation:(NSMenuItem *)menuItem; +- (NSMenuItem *)menuFormRepresentation; + + +- (void)setTag:(NSInteger)tag; +- (NSInteger)tag; + + +- (void)setTarget:(id)target; +- (id)target; + + +- (void)setAction:(SEL)action; +- (SEL)action; + + +- (void)setEnabled:(BOOL)enabled; +- (BOOL)isEnabled; + + +- (void)setImage:(NSImage*)image; +- (NSImage *)image; + + +- (void)setView:(NSView *)view; +- (NSView *)view; + + +- (void)setMinSize:(NSSize)size; +- (NSSize)minSize; + + +- (void)setMaxSize:(NSSize)size; +- (NSSize)maxSize; + + + +enum { + NSToolbarItemVisibilityPriorityStandard = 0, + NSToolbarItemVisibilityPriorityLow = -1000, + NSToolbarItemVisibilityPriorityHigh = 1000, + NSToolbarItemVisibilityPriorityUser = 2000 +}; + +- (void)setVisibilityPriority:(NSInteger)visibilityPriority; +- (NSInteger)visibilityPriority; + + + + + +- (void)validate; + + + +- (void)setAutovalidates:(BOOL)resistance; +- (BOOL)autovalidates; + + + + + + +- (BOOL)allowsDuplicatesInToolbar; + + +@end + + +@interface NSObject (NSToolbarItemValidation) +- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem; + + +@end + + + + +EXTERN_C NSString *NSToolbarSeparatorItemIdentifier; +EXTERN_C NSString *NSToolbarSpaceItemIdentifier; +EXTERN_C NSString *NSToolbarFlexibleSpaceItemIdentifier; + +EXTERN_C NSString *NSToolbarShowColorsItemIdentifier; +EXTERN_C NSString *NSToolbarShowFontsItemIdentifier; +EXTERN_C NSString *NSToolbarCustomizeToolbarItemIdentifier; +EXTERN_C NSString *NSToolbarPrintItemIdentifier; diff --git a/src/AppKit/NSToolbarItemGroup.h b/src/AppKit/NSToolbarItemGroup.h new file mode 100644 index 000000000..de9368241 --- /dev/null +++ b/src/AppKit/NSToolbarItemGroup.h @@ -0,0 +1,24 @@ +#import +#import +#import + + + + + +@interface NSToolbarItemGroup : NSToolbarItem { + @private + id _groupItems; + struct { + unsigned dirtiedLayout:1; + unsigned reserved:31; + } _giFlags; + id _giReserved; +} + + + +- (void)setSubitems:(NSArray *)subitems; +- (NSArray *)subitems; + +@end diff --git a/src/AppKit/NSTouch.h b/src/AppKit/NSTouch.h new file mode 100644 index 000000000..2bdc24caf --- /dev/null +++ b/src/AppKit/NSTouch.h @@ -0,0 +1,61 @@ +#import +#import +#import + +@class NSView; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 +enum { + NSTouchPhaseBegan = 1U << 0, + NSTouchPhaseMoved = 1U << 1, + NSTouchPhaseStationary = 1U << 2, + NSTouchPhaseEnded = 1U << 3, + NSTouchPhaseCancelled = 1U << 4, + + NSTouchPhaseTouching = NSTouchPhaseBegan | NSTouchPhaseMoved | NSTouchPhaseStationary, + NSTouchPhaseAny = NSUIntegerMax +}; +#endif +typedef NSUInteger NSTouchPhase; + + + + + +@interface NSTouch : NSObject { +@private + NSInteger _index; + id _identity; + NSTouchPhase _phase; + NSPoint _normalizedPosition; + NSInteger _privateFlags; + NSView *_view; + id _reserved1; + id _reserved2; + id _reserved3; + id _reserved4; + + id _device; + NSSize _deviceSize; + id _reserved5; + id _reserved6; + id _reserved7; + id _reserved8; +} + + + + +@property(readonly, retain) id identity; +@property(readonly) NSTouchPhase phase; +@property(readonly) NSPoint normalizedPosition; +@property(readonly) BOOL isResting; + + +@property(readonly, retain) id device; + + + +@property(readonly) NSSize deviceSize; + +@end diff --git a/src/AppKit/NSTrackingArea.h b/src/AppKit/NSTrackingArea.h new file mode 100644 index 000000000..e2f502d12 --- /dev/null +++ b/src/AppKit/NSTrackingArea.h @@ -0,0 +1,48 @@ +#import +#import +#import + + +@class NSDictionary; + + +enum { + NSTrackingMouseEnteredAndExited = 0x01, + NSTrackingMouseMoved = 0x02, + NSTrackingCursorUpdate = 0x04, +}; + + +enum { + NSTrackingActiveWhenFirstResponder = 0x10, + NSTrackingActiveInKeyWindow = 0x20, + NSTrackingActiveInActiveApp = 0x40, + NSTrackingActiveAlways = 0x80, +}; + + +enum { + NSTrackingAssumeInside = 0x100, + NSTrackingInVisibleRect = 0x200, + NSTrackingEnabledDuringMouseDrag = 0x400 +}; + +typedef NSUInteger NSTrackingAreaOptions; + + +@interface NSTrackingArea : NSObject +{ +@private + NSRect _rect; + __weak id _owner; + NSDictionary * _userInfo; + NSTrackingAreaOptions _options; + NSInteger _privateFlags; + void *_reserved; +} +- (id)initWithRect:(NSRect)rect options:(NSTrackingAreaOptions)options owner:(id)owner userInfo:(NSDictionary *)userInfo; +- (NSRect)rect; +- (NSTrackingAreaOptions)options; +- (id)owner; +- (NSDictionary *)userInfo; +@end diff --git a/src/AppKit/NSTreeController.h b/src/AppKit/NSTreeController.h new file mode 100644 index 000000000..cf2c2cf96 --- /dev/null +++ b/src/AppKit/NSTreeController.h @@ -0,0 +1,100 @@ +#import +#import + +@class NSTreeNode; + + +@interface NSTreeController : NSObjectController { + id _treeControllerReserved1; + NSArray *_modelObservingKeyPaths; + id _treeStructureObservers; + id _arrangedObjects; + id _rootNode; + id _selectionIndexPaths; + struct __treeControllerFlags { + unsigned int _avoidsEmptySelection:1; + unsigned int _preservesSelection:1; + unsigned int _selectsInsertedObjects:1; + unsigned int _explicitlyCannotInsert:1; + unsigned int _explicitlyCannotInsertChild:1; + unsigned int _explicitlyCannotAddChild:1; + unsigned int _alwaysUsesMultipleValuesMarker:1; + unsigned int _observingThroughArrangedObjects:1; + unsigned int _mutatingNodes:1; + unsigned int _performingFetch:1; + unsigned int _skipSortingAfterFetch:1; + unsigned int _usesIdenticalComparisonOfModelObjects:1; + unsigned int _reservedTreeController:20; + } _treeControllerFlags; + NSArray *_selectedObjects; + NSString *_childrenKeyPath; + NSString *_countKeyPath; + NSString *_leafKeyPath; + NSArray *_sortDescriptors; +} + +- (void)rearrangeObjects; + + +- (id)arrangedObjects; + +- (void)setChildrenKeyPath:(NSString *)keyPath; +- (NSString *)childrenKeyPath; +- (void)setCountKeyPath:(NSString *)keyPath; +- (NSString *)countKeyPath; +- (void)setLeafKeyPath:(NSString *)keyPath; +- (NSString *)leafKeyPath; + +- (void)setSortDescriptors:(NSArray *)sortDescriptors; +- (NSArray *)sortDescriptors; + +- (id)content; +- (void)setContent:(id)content; + +- (void)add:(id)sender; +- (void)remove:(id)sender; +- (void)addChild:(id)sender; +- (void)insert:(id)sender; +- (void)insertChild:(id)sender; + +- (BOOL)canInsert; +- (BOOL)canInsertChild; +- (BOOL)canAddChild; + +- (void)insertObject:(id)object atArrangedObjectIndexPath:(NSIndexPath *)indexPath; +- (void)insertObjects:(NSArray *)objects atArrangedObjectIndexPaths:(NSArray *)indexPaths; +- (void)removeObjectAtArrangedObjectIndexPath:(NSIndexPath *)indexPath; +- (void)removeObjectsAtArrangedObjectIndexPaths:(NSArray *)indexPaths; + + +- (void)setAvoidsEmptySelection:(BOOL)flag; +- (BOOL)avoidsEmptySelection; +- (void)setPreservesSelection:(BOOL)flag; +- (BOOL)preservesSelection; +- (void)setSelectsInsertedObjects:(BOOL)flag; +- (BOOL)selectsInsertedObjects; +- (void)setAlwaysUsesMultipleValuesMarker:(BOOL)flag; +- (BOOL)alwaysUsesMultipleValuesMarker; + + + +- (NSArray *)selectedObjects; + +- (BOOL)setSelectionIndexPaths:(NSArray *)indexPaths; +- (NSArray *)selectionIndexPaths; +- (BOOL)setSelectionIndexPath:(NSIndexPath *)indexPath; +- (NSIndexPath *)selectionIndexPath; +- (BOOL)addSelectionIndexPaths:(NSArray *)indexPaths; +- (BOOL)removeSelectionIndexPaths:(NSArray *)indexPaths; + +- (NSArray *)selectedNodes; + +- (void)moveNode:(NSTreeNode *)node toIndexPath:(NSIndexPath *)indexPath; +- (void)moveNodes:(NSArray *)nodes toIndexPath:(NSIndexPath *)startingIndexPath; + +- (NSString *)childrenKeyPathForNode:(NSTreeNode *)node; +- (NSString *)countKeyPathForNode:(NSTreeNode *)node; +- (NSString *)leafKeyPathForNode:(NSTreeNode *)node; + + +@end diff --git a/src/AppKit/NSTreeNode.h b/src/AppKit/NSTreeNode.h new file mode 100644 index 000000000..f44e4172b --- /dev/null +++ b/src/AppKit/NSTreeNode.h @@ -0,0 +1,38 @@ +#import + + +@class NSArray, NSMutableArray, NSIndexPath, NSTreeController; + + +@interface NSTreeNode : NSObject { + id _childNodesProxy; + id _representedObject; + __strong void *_observationInfo; + id _reserved2; + NSMutableArray *_childNodes; + NSTreeNode *_parentNode; + struct __NSTreeNodeFlags { + unsigned int ignoreObserving:1; + unsigned int reserved:31; + } _NSTreeNodeFlags; +} + ++ (id)treeNodeWithRepresentedObject:(id)modelObject; +- (id)initWithRepresentedObject:(id)modelObject; + +- (id)representedObject; + + +- (NSIndexPath *)indexPath; +- (BOOL)isLeaf; + +- (NSArray *)childNodes; +- (NSMutableArray *)mutableChildNodes; +- (NSTreeNode *)descendantNodeAtIndexPath:(NSIndexPath *)indexPath; + +- (NSTreeNode *)parentNode; + + +- (void)sortWithSortDescriptors:(NSArray *)sortDescriptors recursively:(BOOL)recursively; + +@end diff --git a/src/AppKit/NSTypesetter.h b/src/AppKit/NSTypesetter.h new file mode 100644 index 000000000..256cf7fb8 --- /dev/null +++ b/src/AppKit/NSTypesetter.h @@ -0,0 +1,175 @@ +#import +#import +#import +#import + +enum { + NSTypesetterZeroAdvancementAction = (1 << 0), + NSTypesetterWhitespaceAction = (1 << 1), + NSTypesetterHorizontalTabAction = (1 << 2), + NSTypesetterLineBreakAction = (1 << 3), + NSTypesetterParagraphBreakAction = (1 << 4), + NSTypesetterContainerBreakAction = (1 << 5) +}; +typedef NSUInteger NSTypesetterControlCharacterAction; + +@interface NSTypesetter : NSObject { +#if __LP64__ + void *_reserved; +#else + unsigned _reserved[2]; +#endif +} + + + + + +- (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; +- (NSRange)paragraphCharacterRange; +- (NSRange)paragraphSeparatorCharacterRange; + + + + +- (NSUInteger)layoutParagraphAtPoint:(NSPointPointer)lineFragmentOrigin; + + +- (void)beginParagraph; +- (void)endParagraph; +- (void)beginLineWithGlyphAtIndex:(NSUInteger)glyphIndex; +- (void)endLineWithGlyphRange:(NSRange)lineGlyphRange; + + +- (CGFloat)lineSpacingAfterGlyphAtIndex:(NSUInteger)glyphIndex withProposedLineFragmentRect:(NSRect)rect; +- (CGFloat)paragraphSpacingBeforeGlyphAtIndex:(NSUInteger)glyphIndex withProposedLineFragmentRect:(NSRect)rect; +- (CGFloat)paragraphSpacingAfterGlyphAtIndex:(NSUInteger)glyphIndex withProposedLineFragmentRect:(NSRect)rect; + + + + +- (void)getLineFragmentRect:(NSRectPointer)lineFragmentRect usedRect:(NSRectPointer)lineFragmentUsedRect forParagraphSeparatorGlyphRange:(NSRange)paragraphSeparatorGlyphRange atProposedOrigin:(NSPoint)lineOrigin; + + + + +- (NSDictionary *)attributesForExtraLineFragment; + + + + +- (NSTypesetterControlCharacterAction)actionForControlCharacterAtIndex:(NSUInteger)charIndex; + + + +- (NSLayoutManager *)layoutManager; +- (NSArray *)textContainers; +- (NSTextContainer *)currentTextContainer; +- (NSParagraphStyle *)currentParagraphStyle; + + + +- (void)setHardInvalidation:(BOOL)flag forGlyphRange:(NSRange)glyphRange; + + + +- (void)layoutGlyphsInLayoutManager:(NSLayoutManager *)layoutManager startingAtGlyphIndex:(NSUInteger)startGlyphIndex maxNumberOfLineFragments:(NSUInteger)maxNumLines nextGlyphIndex:(NSUInteger *)nextGlyph; + + + +- (NSRange)layoutCharactersInRange:(NSRange)characterRange forLayoutManager:(NSLayoutManager *)layoutManager maximumNumberOfLineFragments:(NSUInteger)maxNumLines; + + + ++ (NSSize)printingAdjustmentInLayoutManager:(NSLayoutManager *)layoutMgr forNominallySpacedGlyphRange:(NSRange)nominallySpacedGlyphsRange packedGlyphs:(const unsigned char *)packedGlyphs count:(NSUInteger)packedGlyphsCount; + +- (CGFloat)baselineOffsetInLayoutManager:(NSLayoutManager *)layoutMgr glyphIndex:(NSUInteger)glyphIndex; + + + ++ (id)sharedSystemTypesetter; ++ (id)sharedSystemTypesetterForBehavior:(NSTypesetterBehavior)theBehavior; ++ (NSTypesetterBehavior)defaultTypesetterBehavior; +@end + + +@interface NSTypesetter (NSLayoutPhaseInterface) + +- (void)willSetLineFragmentRect:(NSRectPointer)lineRect forGlyphRange:(NSRange)glyphRange usedRect:(NSRectPointer)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 NSTypesetter (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 bidiLevels:(unsigned char *)bidiLevelBuffer; + + + + +- (void)getLineFragmentRect:(NSRectPointer)lineFragmentRect usedRect:(NSRectPointer)lineFragmentUsedRect remainingRect:(NSRectPointer)remainingRect forStartingGlyphAtIndex:(NSUInteger)startingGlyphIndex proposedRect:(NSRect)proposedRect lineSpacing:(CGFloat)lineSpacing paragraphSpacingBefore:(CGFloat)paragraphSpacingBefore paragraphSpacingAfter:(CGFloat)paragraphSpacingAfter; + + +- (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 + +#if !__LP64__ && MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 +#import +#endif diff --git a/src/AppKit/NSUserDefaultsController.h b/src/AppKit/NSUserDefaultsController.h new file mode 100644 index 000000000..ba28b66e5 --- /dev/null +++ b/src/AppKit/NSUserDefaultsController.h @@ -0,0 +1,39 @@ +#import + + +@class NSDictionary, NSUserDefaults; + +@interface NSUserDefaultsController : NSController { +@private + void *_reserved3; + void *_reserved4; + NSUserDefaults *_defaults; + NSMutableDictionary *_valueBuffer; + NSDictionary *_initialValues; + struct __userDefaultsControllerFlags { + unsigned int _sharedInstance:1; + unsigned int _appliesImmediately:1; + unsigned int _reservedUserDefaultsController:30; + } _userDefaultsControllerFlags; +} + ++ (id)sharedUserDefaultsController; + +- (id)initWithDefaults:(NSUserDefaults *)defaults initialValues:(NSDictionary *)initialValues; + +- (NSUserDefaults *)defaults; +- (void)setInitialValues:(NSDictionary *)initialValues; +- (NSDictionary *)initialValues; + +- (void)setAppliesImmediately:(BOOL)flag; +- (BOOL)appliesImmediately; + +- (BOOL)hasUnappliedChanges; + +- (id)values; + +- (void)revert:(id)sender; +- (void)save:(id)sender; +- (void)revertToInitialValues:(id)sender; + +@end diff --git a/src/AppKit/NSUserInterfaceItemIdentification.h b/src/AppKit/NSUserInterfaceItemIdentification.h new file mode 100644 index 000000000..44db0e356 --- /dev/null +++ b/src/AppKit/NSUserInterfaceItemIdentification.h @@ -0,0 +1,18 @@ +#import +#import + +@class NSString; + + +@protocol NSUserInterfaceItemIdentification +@required + + + + + + + +@property (copy) NSString *identifier; + +@end diff --git a/src/AppKit/NSUserInterfaceItemSearching.h b/src/AppKit/NSUserInterfaceItemSearching.h new file mode 100644 index 000000000..abe471686 --- /dev/null +++ b/src/AppKit/NSUserInterfaceItemSearching.h @@ -0,0 +1,51 @@ +#import +#import + + +@protocol NSUserInterfaceItemSearching +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + +@required + + + + + +#if NS_BLOCKS_AVAILABLE +- (void)searchForItemsWithSearchString:(NSString *)searchString resultLimit:(NSInteger)resultLimit matchedItemHandler:(void (^)(NSArray *items))handleMatchedItems; +#endif + + + +- (NSArray *)localizedTitlesForItem:(id)item; + +@optional + + + +- (void)performActionForItem:(id)item; + + + +- (void)showAllHelpTopicsForSearchString:(NSString *)searchString; + +#endif +@end + + +@interface NSApplication (NSUserInterfaceItemSearching) + + + +- (void)registerUserInterfaceItemSearchHandler:(id)handler; + + + +- (void)unregisterUserInterfaceItemSearchHandler:(id)handler; + + + + +- (BOOL)searchString:(NSString *)searchString inUserInterfaceItemString:(NSString *)stringToSearch searchRange:(NSRange)searchRange foundRange:(NSRange *)foundRange; + +@end diff --git a/src/AppKit/NSUserInterfaceValidation.h b/src/AppKit/NSUserInterfaceValidation.h new file mode 100644 index 000000000..564edce3d --- /dev/null +++ b/src/AppKit/NSUserInterfaceValidation.h @@ -0,0 +1,11 @@ +#import +#import +@protocol NSValidatedUserInterfaceItem +- (SEL)action; +- (NSInteger)tag; +@end + + +@protocol NSUserInterfaceValidations +- (BOOL)validateUserInterfaceItem:(id )anItem; +@end diff --git a/src/AppKit/NSView.h b/src/AppKit/NSView.h index d08e37192..d5b0c0499 100644 --- a/src/AppKit/NSView.h +++ b/src/AppKit/NSView.h @@ -1,8 +1,570 @@ -#ifndef NSVIEW_H_ -#define NSVIEW_H_ -#include "NSResponder.h" +#import +#import +#import +#import +#import +#import +#import +#import + +@class NSBitmapImageRep, NSCursor, NSDraggingSession, NSGraphicsContext, NSImage, NSPasteboard, NSScrollView, NSTextInputContext, NSWindow, NSAttributedString; +@class CIFilter, CALayer, NSDictionary, NSScreen, NSShadow, NSTrackingArea; +@protocol NSDraggingSource; + +enum { + NSViewNotSizable = 0, + NSViewMinXMargin = 1, + NSViewWidthSizable = 2, + NSViewMaxXMargin = 4, + NSViewMinYMargin = 8, + NSViewHeightSizable = 16, + NSViewMaxYMargin = 32 +}; + +enum { + NSNoBorder = 0, + NSLineBorder = 1, + NSBezelBorder = 2, + NSGrooveBorder = 3 +}; +typedef NSUInteger NSBorderType; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 +enum { + + NSViewLayerContentsRedrawNever = 0, + + NSViewLayerContentsRedrawOnSetNeedsDisplay = 1, + + NSViewLayerContentsRedrawDuringViewResize = 2, + + NSViewLayerContentsRedrawBeforeViewResize = 3 +}; +#endif +typedef NSInteger NSViewLayerContentsRedrawPolicy; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 +enum { + NSViewLayerContentsPlacementScaleAxesIndependently = 0, + NSViewLayerContentsPlacementScaleProportionallyToFit = 1, + NSViewLayerContentsPlacementScaleProportionallyToFill = 2, + NSViewLayerContentsPlacementCenter = 3, + NSViewLayerContentsPlacementTop = 4, + NSViewLayerContentsPlacementTopRight = 5, + NSViewLayerContentsPlacementRight = 6, + NSViewLayerContentsPlacementBottomRight = 7, + NSViewLayerContentsPlacementBottom = 8, + NSViewLayerContentsPlacementBottomLeft = 9, + NSViewLayerContentsPlacementLeft = 10, + NSViewLayerContentsPlacementTopLeft = 11 +}; +#endif +typedef NSInteger NSViewLayerContentsPlacement; + +typedef struct __VFlags { +#ifdef __BIG_ENDIAN__ + unsigned int rotatedFromBase:1; + unsigned int rotatedOrScaledFromBase:1; + unsigned int autosizing:6; + unsigned int autoresizeSubviews:1; + unsigned int wantsGState:1; + unsigned int needsDisplay:1; + unsigned int validGState:1; + unsigned int newGState:1; + unsigned int noVerticalAutosizing:1; + unsigned int frameChangeNotesSuspended:1; + unsigned int needsFrameChangeNote:1; + unsigned int focusChangeNotesSuspended:1; + unsigned int boundsChangeNotesSuspended:1; + unsigned int needsBoundsChangeNote:1; + unsigned int removingWithoutInvalidation:1; + unsigned int isFlipped:1; + unsigned int needsDisplayForBounds:1; + unsigned int specialArchiving:1; + unsigned int ignoreHitTest:1; + unsigned int retainCount:6; + unsigned int isOpaque:1; + unsigned int aboutToResize:1; +#else + unsigned int aboutToResize:1; + unsigned int isOpaque:1; + unsigned int retainCount:6; + unsigned int ignoreHitTest:1; + unsigned int specialArchiving:1; + unsigned int needsDisplayForBounds:1; + unsigned int isFlipped:1; + unsigned int removingWithoutInvalidation:1; + unsigned int needsBoundsChangeNote:1; + unsigned int boundsChangeNotesSuspended:1; + unsigned int focusChangeNotesSuspended:1; + unsigned int needsFrameChangeNote:1; + unsigned int frameChangeNotesSuspended:1; + unsigned int noVerticalAutosizing:1; + unsigned int newGState:1; + unsigned int validGState:1; + unsigned int needsDisplay:1; + unsigned int wantsGState:1; + unsigned int autoresizeSubviews:1; + unsigned int autosizing:6; + unsigned int rotatedOrScaledFromBase:1; + unsigned int rotatedFromBase:1; +#endif +} _VFlags; + +typedef NSInteger NSTrackingRectTag; +typedef NSInteger NSToolTipTag; + +@class _NSViewAuxiliary; + +@interface NSView : NSResponder +{ + + NSRect _frame; + NSRect _bounds; + id _superview; + id _subviews; + NSWindow *_window; + id _gState; + id _frameMatrix; + CALayer *_layer; + id _dragTypes; + _NSViewAuxiliary *_viewAuxiliary; + _VFlags _vFlags; + struct __VFlags2 { + unsigned int nextKeyViewRefCount:14; + unsigned int previousKeyViewRefCount:14; + unsigned int isVisibleRect:1; + unsigned int hasToolTip:1; + unsigned int cachedIsFlipped:1; + unsigned int menuWasSet:1; + } _vFlags2; +} + +- (id)initWithFrame:(NSRect)frameRect; + +- (NSWindow *)window; +- (NSView *)superview; +- (NSArray *)subviews; +- (BOOL)isDescendantOf:(NSView *)aView; +- (NSView *)ancestorSharedWithView:(NSView *)aView; +- (NSView *)opaqueAncestor; +- (void)setHidden:(BOOL)flag; +- (BOOL)isHidden; +- (BOOL)isHiddenOrHasHiddenAncestor; + +- (void)getRectsBeingDrawn:(const NSRect **)rects count:(NSInteger *)count; +- (BOOL)needsToDrawRect:(NSRect)aRect; +- (BOOL)wantsDefaultClipping; +- (void)viewDidHide; +- (void)viewDidUnhide; + +- (void)setSubviews:(NSArray *)newSubviews; +- (void)addSubview:(NSView *)aView; +- (void)addSubview:(NSView *)aView positioned:(NSWindowOrderingMode)place relativeTo:(NSView *)otherView; +- (void)sortSubviewsUsingFunction:(NSComparisonResult (*)(id, id, void *))compare context:(void *)context; +- (void)viewWillMoveToWindow:(NSWindow *)newWindow; +- (void)viewDidMoveToWindow; +- (void)viewWillMoveToSuperview:(NSView *)newSuperview; +- (void)viewDidMoveToSuperview; +- (void)didAddSubview:(NSView *)subview; +- (void)willRemoveSubview:(NSView *)subview; +- (void)removeFromSuperview; +- (void)replaceSubview:(NSView *)oldView with:(NSView *)newView; +- (void)removeFromSuperviewWithoutNeedingDisplay; +- (void)viewDidChangeBackingProperties; + +- (void)setPostsFrameChangedNotifications:(BOOL)flag; +- (BOOL)postsFrameChangedNotifications; +- (void)resizeSubviewsWithOldSize:(NSSize)oldSize; +- (void)resizeWithOldSuperviewSize:(NSSize)oldSize; +- (void)setAutoresizesSubviews:(BOOL)flag; +- (BOOL)autoresizesSubviews; +- (void)setAutoresizingMask:(NSUInteger)mask; +- (NSUInteger)autoresizingMask; + +- (void)setFrameOrigin:(NSPoint)newOrigin; +- (void)setFrameSize:(NSSize)newSize; +- (void)setFrame:(NSRect)frameRect; +- (NSRect)frame; +- (void)setFrameRotation:(CGFloat)angle; +- (CGFloat)frameRotation; +- (void)setFrameCenterRotation:(CGFloat)angle; +- (CGFloat)frameCenterRotation; + +- (void)setBoundsOrigin:(NSPoint)newOrigin; +- (void)setBoundsSize:(NSSize)newSize; +- (void)setBoundsRotation:(CGFloat)angle; +- (CGFloat)boundsRotation; +- (void)translateOriginToPoint:(NSPoint)translation; +- (void)scaleUnitSquareToSize:(NSSize)newUnitSize; +- (void)rotateByAngle:(CGFloat)angle; +- (void)setBounds:(NSRect)aRect; +- (NSRect)bounds; + +- (BOOL)isFlipped; +- (BOOL)isRotatedFromBase; +- (BOOL)isRotatedOrScaledFromBase; + + + +- (BOOL)isOpaque; + +- (NSPoint)convertPoint:(NSPoint)aPoint fromView:(NSView *)aView; +- (NSPoint)convertPoint:(NSPoint)aPoint toView:(NSView *)aView; +- (NSSize)convertSize:(NSSize)aSize fromView:(NSView *)aView; +- (NSSize)convertSize:(NSSize)aSize toView:(NSView *)aView; +- (NSRect)convertRect:(NSRect)aRect fromView:(NSView *)aView; +- (NSRect)convertRect:(NSRect)aRect toView:(NSView *)aView; + + + +- (NSRect)backingAlignedRect:(NSRect)aRect options:(NSAlignmentOptions)options; +- (NSRect)centerScanRect:(NSRect)aRect; + + + +- (NSPoint)convertPointToBacking:(NSPoint)aPoint; +- (NSPoint)convertPointFromBacking:(NSPoint)aPoint; +- (NSSize)convertSizeToBacking:(NSSize)aSize; +- (NSSize)convertSizeFromBacking:(NSSize)aSize; +- (NSRect)convertRectToBacking:(NSRect)aRect; +- (NSRect)convertRectFromBacking:(NSRect)aRect; + + + +- (NSPoint)convertPointToLayer:(NSPoint)aPoint; +- (NSPoint)convertPointFromLayer:(NSPoint)aPoint; +- (NSSize)convertSizeToLayer:(NSSize)aSize; +- (NSSize)convertSizeFromLayer:(NSSize)aSize; +- (NSRect)convertRectToLayer:(NSRect)aRect; +- (NSRect)convertRectFromLayer:(NSRect)aRect; + + + +- (NSPoint)convertPointToBase:(NSPoint)aPoint; +- (NSPoint)convertPointFromBase:(NSPoint)aPoint; +- (NSSize)convertSizeToBase:(NSSize)aSize; +- (NSSize)convertSizeFromBase:(NSSize)aSize; +- (NSRect)convertRectToBase:(NSRect)aRect; +- (NSRect)convertRectFromBase:(NSRect)aRect; + + + +- (BOOL)canDrawConcurrently; + + +- (void)setCanDrawConcurrently:(BOOL)flag; + +- (BOOL)canDraw; +- (void)setNeedsDisplay:(BOOL)flag; +- (void)setNeedsDisplayInRect:(NSRect)invalidRect; +- (BOOL)needsDisplay; +- (void)lockFocus; +- (void)unlockFocus; +- (BOOL)lockFocusIfCanDraw; +- (BOOL)lockFocusIfCanDrawInContext:(NSGraphicsContext *)context; ++ (NSView *)focusView; +- (NSRect)visibleRect; + +- (void)display; +- (void)displayIfNeeded; +- (void)displayIfNeededIgnoringOpacity; +- (void)displayRect:(NSRect)rect; +- (void)displayIfNeededInRect:(NSRect)rect; +- (void)displayRectIgnoringOpacity:(NSRect)rect; +- (void)displayIfNeededInRectIgnoringOpacity:(NSRect)rect; +- (void)drawRect:(NSRect)dirtyRect; +- (void)displayRectIgnoringOpacity:(NSRect)aRect inContext:(NSGraphicsContext *)context; + +- (NSBitmapImageRep *)bitmapImageRepForCachingDisplayInRect:(NSRect)rect; +- (void)cacheDisplayInRect:(NSRect)rect toBitmapImageRep:(NSBitmapImageRep *)bitmapImageRep; +- (void)viewWillDraw; + +- (NSInteger)gState; +- (void)allocateGState; +- (oneway void)releaseGState; +- (void)setUpGState; +- (void)renewGState; + +- (void)scrollPoint:(NSPoint)aPoint; +- (BOOL)scrollRectToVisible:(NSRect)aRect; +- (BOOL)autoscroll:(NSEvent *)theEvent; +- (NSRect)adjustScroll:(NSRect)newVisible; +- (void)scrollRect:(NSRect)aRect by:(NSSize)delta; +- (void)translateRectsNeedingDisplayInRect:(NSRect)clipRect by:(NSSize)delta; + +- (NSView *)hitTest:(NSPoint)aPoint; +- (BOOL)mouse:(NSPoint)aPoint inRect:(NSRect)aRect; +- (id)viewWithTag:(NSInteger)aTag; +- (NSInteger)tag; +- (BOOL)performKeyEquivalent:(NSEvent *)theEvent; +- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent; +- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent; +- (BOOL)needsPanelToBecomeKey; +- (BOOL)mouseDownCanMoveWindow; + + + +- (void)setAcceptsTouchEvents:(BOOL)flag; +- (BOOL)acceptsTouchEvents; + + + +- (void)setWantsRestingTouches:(BOOL)flag; +- (BOOL)wantsRestingTouches; + +- (void)addCursorRect:(NSRect)aRect cursor:(NSCursor *)anObj; +- (void)removeCursorRect:(NSRect)aRect cursor:(NSCursor *)anObj; +- (void)discardCursorRects; +- (void)resetCursorRects; + +- (NSTrackingRectTag)addTrackingRect:(NSRect)aRect owner:(id)anObject userData:(void *)data assumeInside:(BOOL)flag; +- (void)removeTrackingRect:(NSTrackingRectTag)tag; + +- (CALayer *)makeBackingLayer; + + + +- (NSViewLayerContentsRedrawPolicy)layerContentsRedrawPolicy; +- (void)setLayerContentsRedrawPolicy:(NSViewLayerContentsRedrawPolicy)newPolicy; + +- (NSViewLayerContentsPlacement)layerContentsPlacement; +- (void)setLayerContentsPlacement:(NSViewLayerContentsPlacement)newPlacement; + + + +- (void)setWantsLayer:(BOOL)flag; +- (BOOL)wantsLayer; + + + +- (void)setLayer:(CALayer *)newLayer; +- (CALayer *)layer; + + + +- (BOOL)wantsUpdateLayer; + + + +- (void)updateLayer; + +- (void)setAlphaValue:(CGFloat)viewAlpha; +- (CGFloat)alphaValue; + +- (void)setBackgroundFilters:(NSArray *)filters; +- (NSArray *)backgroundFilters; + +- (void)setCompositingFilter:(CIFilter *)filter; +- (CIFilter *)compositingFilter; + +- (void)setContentFilters:(NSArray *)filters; +- (NSArray *)contentFilters; + +- (void)setShadow:(NSShadow *)shadow; +- (NSShadow *)shadow; + + + +- (void)addTrackingArea:(NSTrackingArea *)trackingArea; +- (void)removeTrackingArea:(NSTrackingArea *)trackingArea; +- (NSArray *)trackingAreas; + + + +- (void)updateTrackingAreas; + + +- (BOOL)shouldDrawColor; + +- (void)setPostsBoundsChangedNotifications:(BOOL)flag; +- (BOOL)postsBoundsChangedNotifications; + +- (NSScrollView *)enclosingScrollView; + +- (NSMenu *)menuForEvent:(NSEvent *)event; ++ (NSMenu *)defaultMenu; + +- (void)setToolTip:(NSString *)string; +- (NSString *)toolTip; +- (NSToolTipTag)addToolTipRect:(NSRect)aRect owner:(id)anObject userData:(void *)data; +- (void)removeToolTip:(NSToolTipTag)tag; +- (void)removeAllToolTips; + + + +- (void)viewWillStartLiveResize; + +- (void)viewDidEndLiveResize; + +- (BOOL)inLiveResize; + +- (BOOL)preservesContentDuringLiveResize; + +- (NSRect)rectPreservedDuringLiveResize; + +- (void)getRectsExposedDuringLiveResize:(NSRect[4])exposedRects count:(NSInteger *)count; + + + + +- (NSTextInputContext *)inputContext; + + + + + + + +- (NSRect)rectForSmartMagnificationAtPoint:(NSPoint)location inRect:(NSRect)visibleRect; -@interface NSView : NSResponder @end +@interface NSObject (NSLayerDelegateContentsScaleUpdating) + + + +- (BOOL)layer:(CALayer *)layer shouldInheritContentsScale:(CGFloat)newScale fromWindow:(NSWindow *)window; + +@end + +@interface NSObject(NSToolTipOwner) +- (NSString *)view:(NSView *)view stringForToolTip:(NSToolTipTag)tag point:(NSPoint)point userData:(void *)data; +@end + +@interface NSView(NSKeyboardUI) +- (void)setNextKeyView:(NSView *)next; +- (NSView *)nextKeyView; +- (NSView *)previousKeyView; +- (NSView *)nextValidKeyView; +- (NSView *)previousValidKeyView; + +- (BOOL)canBecomeKeyView; + +- (void)setKeyboardFocusRingNeedsDisplayInRect:(NSRect)rect; + +- (void)setFocusRingType:(NSFocusRingType)focusRingType; +- (NSFocusRingType)focusRingType; ++ (NSFocusRingType)defaultFocusRingType; + +- (void)drawFocusRingMask; +- (NSRect)focusRingMaskBounds; +- (void)noteFocusRingMaskChanged; + +@end + +@interface NSView(NSPrinting) + + +- (void)writeEPSInsideRect:(NSRect)rect toPasteboard:(NSPasteboard *)pasteboard; +- (NSData *)dataWithEPSInsideRect:(NSRect)rect; +- (void)writePDFInsideRect:(NSRect)rect toPasteboard:(NSPasteboard *)pasteboard; +- (NSData *)dataWithPDFInsideRect:(NSRect)rect; + + +- (void)print:(id)sender; + + +- (BOOL)knowsPageRange:(NSRangePointer)range; +- (CGFloat)heightAdjustLimit; +- (CGFloat)widthAdjustLimit; +- (void)adjustPageWidthNew:(CGFloat *)newRight left:(CGFloat)oldLeft right:(CGFloat)oldRight limit:(CGFloat)rightLimit; +- (void)adjustPageHeightNew:(CGFloat *)newBottom top:(CGFloat)oldTop bottom:(CGFloat)oldBottom limit:(CGFloat)bottomLimit; +- (NSRect)rectForPage:(NSInteger)page; +- (NSPoint)locationOfPrintRect:(NSRect)aRect; +- (void)drawPageBorderWithSize:(NSSize)borderSize; +- (NSAttributedString *)pageHeader; +- (NSAttributedString *)pageFooter; + + +- (void)drawSheetBorderWithSize:(NSSize)borderSize; + + + +- (NSString *)printJobTitle; +- (void)beginDocument; +- (void)endDocument; + +- (void)beginPageInRect:(NSRect)aRect atPlacement:(NSPoint)location; +- (void)endPage; +@end + + +@interface NSView(NSDrag) + + +- (NSDraggingSession *)beginDraggingSessionWithItems:(NSArray *)items event:(NSEvent *)event source:(id)source; + + + +- (void)dragImage:(NSImage *)anImage at:(NSPoint)viewLocation offset:(NSSize)initialOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pboard source:(id)sourceObj slideBack:(BOOL)slideFlag; + +- (NSArray *)registeredDraggedTypes; +- (void)registerForDraggedTypes:(NSArray *)newTypes; +- (void)unregisterDraggedTypes; + +- (BOOL)dragFile:(NSString *)filename fromRect:(NSRect)rect slideBack:(BOOL)aFlag event:(NSEvent *)event; +- (BOOL)dragPromisedFilesOfTypes:(NSArray *)typeArray fromRect:(NSRect)rect source:(id)sourceObject slideBack:(BOOL)aFlag event:(NSEvent *)event; +@end + +@interface NSView (NSFullScreenMode) +- (BOOL)enterFullScreenMode:(NSScreen *)screen withOptions:(NSDictionary *)options; +- (void)exitFullScreenModeWithOptions:(NSDictionary *)options; +- (BOOL)isInFullScreenMode; +@end + + +EXTERN_C NSString * const NSFullScreenModeAllScreens; +EXTERN_C NSString * const NSFullScreenModeSetting; +EXTERN_C NSString * const NSFullScreenModeWindowLevel; +EXTERN_C NSString * const NSFullScreenModeApplicationPresentationOptions; + +@interface NSView(NSDefinition) + + + + + + +- (void)showDefinitionForAttributedString:(NSAttributedString *)attrString atPoint:(NSPoint)textBaselineOrigin; + +#if NS_BLOCKS_AVAILABLE +- (void)showDefinitionForAttributedString:(NSAttributedString *)attrString range:(NSRange)targetRange options:(NSDictionary *)options baselineOriginProvider:(NSPoint (^)(NSRange adjustedRange))originProvider; #endif + +@end + + + +EXTERN_C NSString * const NSDefinitionPresentationTypeKey; +EXTERN_C NSString * const NSDefinitionPresentationTypeOverlay; +EXTERN_C NSString * const NSDefinitionPresentationTypeDictionaryApplication; + + +@interface NSView(NSFindIndicator) + + + +- (BOOL)isDrawingFindIndicator; + +@end + +@interface NSView(NSDeprecated) + + + +- (BOOL)performMnemonic:(NSString *)theString; + +@end + + + + +EXTERN_C NSString *NSViewFrameDidChangeNotification; +EXTERN_C NSString *NSViewFocusDidChangeNotification; +EXTERN_C NSString *NSViewBoundsDidChangeNotification; + +EXTERN_C NSString *NSViewGlobalFrameDidChangeNotification; + + +EXTERN_C NSString *NSViewDidUpdateTrackingAreasNotification; diff --git a/src/AppKit/NSViewController.h b/src/AppKit/NSViewController.h new file mode 100644 index 000000000..ed435ad1b --- /dev/null +++ b/src/AppKit/NSViewController.h @@ -0,0 +1,60 @@ +#import +#import + + +@class NSArray, NSBundle, NSPointerArray, NSView; + + +@interface NSViewController : NSResponder +{ + @private + NSString *_nibName; + NSBundle *_nibBundle; + id _representedObject; + NSString *_title; + IBOutlet NSView *view; + NSArray *_topLevelObjects; + NSPointerArray *_editors; + id _autounbinder; + NSString *_designNibBundleIdentifier; + id _reserved[2]; +} + + + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil; + + + +- (void)setRepresentedObject:(id)representedObject; +- (id)representedObject; + + + +- (void)setTitle:(NSString *)title; +- (NSString *)title; + + + +- (NSView *)view; + + + +- (void)loadView; + + + +- (NSString *)nibName; +- (NSBundle *)nibBundle; + + + +- (void)setView:(NSView *)view; + + + +- (void)commitEditingWithDelegate:(id)delegate didCommitSelector:(SEL)didCommitSelector contextInfo:(void *)contextInfo; +- (BOOL)commitEditing; +- (void)discardEditing; + +@end diff --git a/src/AppKit/NSWindow.h b/src/AppKit/NSWindow.h index da30e12da..7de0185a1 100644 --- a/src/AppKit/NSWindow.h +++ b/src/AppKit/NSWindow.h @@ -1,8 +1,798 @@ -#ifndef NSWINDOW_H_ -#define NSWINDOW_H_ -#include "NSResponder.h" +#import +#import +#import +#import +#import +#import +#import +#import +#import + +@class NSButton, NSButtonCell, NSColor, NSImage, NSPasteboard, NSScreen; +@class NSNotification, NSText, NSView, NSMutableSet, NSSet, NSDate; +@class NSToolbar, NSGraphicsContext, NSURL, NSColorSpace; +@class NSDockTile; + +@protocol NSWindowDelegate; + +#define NSAppKitVersionNumberWithCustomSheetPosition 686.0 +#define NSAppKitVersionNumberWithDeferredWindowDisplaySupport 1019.0 + +enum { + NSBorderlessWindowMask = 0, + NSTitledWindowMask = 1 << 0, + NSClosableWindowMask = 1 << 1, + NSMiniaturizableWindowMask = 1 << 2, + NSResizableWindowMask = 1 << 3 + +}; + + + +enum { + NSTexturedBackgroundWindowMask = 1 << 8 +}; + + + +enum { + NSUnscaledWindowMask = 1 << 11 +}; + + + +enum { + NSUnifiedTitleAndToolbarWindowMask = 1 << 12 +}; + + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 +enum { + NSFullScreenWindowMask = 1 << 14 +}; +#endif + + + +enum { + NSDisplayWindowRunLoopOrdering = 600000, + NSResetCursorRectsRunLoopOrdering = 700000 +}; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +enum { + NSWindowSharingNone = 0, + NSWindowSharingReadOnly = 1, + NSWindowSharingReadWrite = 2 +}; +#endif +typedef NSUInteger NSWindowSharingType; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +enum { + NSWindowBackingLocationDefault = 0, + NSWindowBackingLocationVideoMemory = 1, + NSWindowBackingLocationMainMemory = 2 +}; +#endif +typedef NSUInteger NSWindowBackingLocation; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +enum { + NSWindowCollectionBehaviorDefault = 0, + NSWindowCollectionBehaviorCanJoinAllSpaces = 1 << 0, + NSWindowCollectionBehaviorMoveToActiveSpace = 1 << 1 +}; +#endif + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + +enum { + NSWindowCollectionBehaviorManaged = 1 << 2, + NSWindowCollectionBehaviorTransient = 1 << 3, + NSWindowCollectionBehaviorStationary = 1 << 4, +}; + + +enum { + NSWindowCollectionBehaviorParticipatesInCycle = 1 << 5, + NSWindowCollectionBehaviorIgnoresCycle = 1 << 6 +}; +#endif + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + +enum { + NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7, + NSWindowCollectionBehaviorFullScreenAuxiliary = 1 << 8 +}; +#endif + + +typedef NSUInteger NSWindowCollectionBehavior; + + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 +enum { + NSWindowAnimationBehaviorDefault = 0, + NSWindowAnimationBehaviorNone = 2, + + NSWindowAnimationBehaviorDocumentWindow = 3, + NSWindowAnimationBehaviorUtilityWindow = 4, + NSWindowAnimationBehaviorAlertPanel = 5 +}; +#endif +typedef NSInteger NSWindowAnimationBehavior; + + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + +enum { + NSWindowNumberListAllApplications = 1 << 0, + NSWindowNumberListAllSpaces = 1 << 4 +}; +#endif + +typedef NSUInteger NSWindowNumberListOptions; + +#define NSNormalWindowLevel kCGNormalWindowLevel +#define NSFloatingWindowLevel kCGFloatingWindowLevel +#define NSSubmenuWindowLevel kCGTornOffMenuWindowLevel +#define NSTornOffMenuWindowLevel kCGTornOffMenuWindowLevel +#define NSMainMenuWindowLevel kCGMainMenuWindowLevel +#define NSStatusWindowLevel kCGStatusWindowLevel + +#define NSDockWindowLevel kCGDockWindowLevel +#define NSModalPanelWindowLevel kCGModalPanelWindowLevel +#define NSPopUpMenuWindowLevel kCGPopUpMenuWindowLevel +#define NSScreenSaverWindowLevel kCGScreenSaverWindowLevel + + +enum { + NSDirectSelection = 0, + NSSelectingNext, + NSSelectingPrevious +}; +typedef NSUInteger NSSelectionDirection; + + +enum { + NSWindowCloseButton, + NSWindowMiniaturizeButton, + NSWindowZoomButton, + NSWindowToolbarButton, + NSWindowDocumentIconButton +}; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 +enum { + NSWindowDocumentVersionsButton = 6, + NSWindowFullScreenButton +}; +#endif + +typedef NSUInteger NSWindowButton; + +@class NSWindowAuxiliary; +@class NSEvent; +@class NSWindowController; + +@interface NSWindow : NSResponder +{ + + NSRect _frame; + id _contentView; + id _delegate; + NSResponder *_firstResponder; + NSView *_lastLeftHit; + NSView *_lastRightHit; + id _counterpart; + id _fieldEditor; + int _winEventMask; + NSInteger _windowNum; + int _level; + NSColor *_backgroundColor; + id _borderView; + unsigned char _postingDisabled; + unsigned char _styleMask; + unsigned char _flushDisabled; + unsigned char _reservedWindow1; + void *_cursorRects; + void *_trectTable; + NSImage *_miniIcon; + int32_t _bamboo; + NSMutableSet *_dragTypes; + NSURL *_representedURL; + NSSize *_sizeLimits; + NSString *_frameSaveName; + NSSet *_regDragTypes; + struct __wFlags { + unsigned int backing:2; + unsigned int visible:1; + unsigned int isMainWindow:1; + unsigned int isKeyWindow:1; + unsigned int hidesOnDeactivate:1; + unsigned int dontFreeWhenClosed:1; + unsigned int oneShot:1; + unsigned int deferred:1; + unsigned int cursorRectsDisabled:1; + unsigned int haveFreeCursorRects:1; + unsigned int validCursorRects:1; + unsigned int docEdited:1; + unsigned int dynamicDepthLimit:1; + unsigned int worksWhenModal:1; + unsigned int limitedBecomeKey:1; + unsigned int needsFlush:1; + unsigned int viewsNeedDisplay:1; + unsigned int ignoredFirstMouse:1; + unsigned int repostedFirstMouse:1; + unsigned int windowDying:1; + unsigned int tempHidden:1; + unsigned int floatingPanel:1; + unsigned int wantsToBeOnMainScreen:1; + unsigned int optimizedDrawingOk:1; + unsigned int optimizeDrawing:1; + unsigned int titleIsRepresentedFilename:1; + unsigned int excludedFromWindowsMenu:1; + unsigned int depthLimit:4; + unsigned int delegateReturnsValidRequestor:1; + unsigned int lmouseupPending:1; + unsigned int rmouseupPending:1; + unsigned int wantsToDestroyRealWindow:1; + unsigned int wantsToRegDragTypes:1; + unsigned int sentInvalidateCursorRectsMsg:1; + unsigned int avoidsActivation:1; + unsigned int frameSavedUsingTitle:1; + unsigned int didRegDragTypes:1; + unsigned int delayedOneShot:1; + unsigned int postedNeedsDisplayNote:1; + unsigned int postedInvalidCursorRectsNote:1; + unsigned int initialFirstResponderTempSet:1; + unsigned int autodisplay:1; + unsigned int tossedFirstEvent:1; + unsigned int isImageCache:1; + unsigned int _unused:3; + unsigned int keyViewSelectionDirection:2; + unsigned int defaultButtonCellKETemporarilyDisabled:1; + unsigned int defaultButtonCellKEDisabled:1; + unsigned int menuHasBeenSet:1; + unsigned int wantsToBeModal:1; + unsigned int showingModalFrame:1; + unsigned int isTerminating:1; + unsigned int win32MouseActivationInProgress:1; + unsigned int makingFirstResponderForMouseDown:1; + unsigned int needsZoom:1; + unsigned int sentWindowNeedsDisplayMsg:1; + unsigned int liveResizeActive:1; + } _wFlags; + id _defaultButtonCell; + NSView *_initialFirstResponder; + NSWindowAuxiliary *_auxiliaryStorage; +} + ++ (NSRect)frameRectForContentRect:(NSRect)cRect styleMask:(NSUInteger)aStyle; ++ (NSRect)contentRectForFrameRect:(NSRect)fRect styleMask:(NSUInteger)aStyle; ++ (CGFloat)minFrameWidthWithTitle:(NSString *)aTitle styleMask:(NSUInteger)aStyle; ++ (NSWindowDepth)defaultDepthLimit; + +- (NSRect)frameRectForContentRect:(NSRect)contentRect; +- (NSRect)contentRectForFrameRect:(NSRect)frameRect; + +- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag; +- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag screen:(NSScreen *)screen; + +- (NSString *)title; +- (void)setTitle:(NSString *)aString; + + + + +- (void)setRepresentedURL:(NSURL *)url; +- (NSURL *)representedURL; +- (NSString *)representedFilename; +- (void)setRepresentedFilename:(NSString *)aString; +- (void)setTitleWithRepresentedFilename:(NSString *)filename; +- (void)setExcludedFromWindowsMenu:(BOOL)flag; +- (BOOL)isExcludedFromWindowsMenu; +- (void)setContentView:(NSView *)aView; +- (id)contentView; +- (void)setDelegate:(id )anObject; +- (id )delegate; +- (NSInteger)windowNumber; +- (NSUInteger)styleMask; + +- (void)setStyleMask:(NSUInteger)styleMask; +- (NSText *)fieldEditor:(BOOL)createFlag forObject:(id)anObject; +- (void)endEditingFor:(id)anObject; + +- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen; +- (void)setFrame:(NSRect)frameRect display:(BOOL)flag; +- (void)setContentSize:(NSSize)aSize; +- (void)setFrameOrigin:(NSPoint)aPoint; +- (void)setFrameTopLeftPoint:(NSPoint)aPoint; +- (NSPoint)cascadeTopLeftFromPoint:(NSPoint)topLeftPoint; +- (NSRect)frame; + + + + +- (NSTimeInterval)animationResizeTime:(NSRect)newFrame; + + +- (void)setFrame:(NSRect)frameRect display:(BOOL)displayFlag animate:(BOOL)animateFlag; + +- (BOOL)inLiveResize; + + +- (void)setShowsResizeIndicator:(BOOL)show; +- (BOOL)showsResizeIndicator; + +- (void)setResizeIncrements:(NSSize)increments; +- (NSSize)resizeIncrements; +- (void)setAspectRatio:(NSSize)ratio; +- (NSSize)aspectRatio; + +- (void)setContentResizeIncrements:(NSSize)increments; +- (NSSize)contentResizeIncrements; +- (void)setContentAspectRatio:(NSSize)ratio; +- (NSSize)contentAspectRatio; + +- (void)useOptimizedDrawing:(BOOL)flag; +- (void)disableFlushWindow; +- (void)enableFlushWindow; +- (BOOL)isFlushWindowDisabled; +- (void)flushWindow; +- (void)flushWindowIfNeeded; +- (void)setViewsNeedDisplay:(BOOL)flag; +- (BOOL)viewsNeedDisplay; +- (void)displayIfNeeded; +- (void)display; +- (void)setAutodisplay:(BOOL)flag; +- (BOOL)isAutodisplay; + +- (BOOL)preservesContentDuringLiveResize; +- (void)setPreservesContentDuringLiveResize:(BOOL)flag; + +- (void)update; + +- (BOOL)makeFirstResponder:(NSResponder *)aResponder; + +- (NSResponder *)firstResponder; + +- (NSInteger)resizeFlags; +- (void)keyDown:(NSEvent *)theEvent; +- (void)close; +- (void)setReleasedWhenClosed:(BOOL)flag; +- (BOOL)isReleasedWhenClosed; +- (void)miniaturize:(id)sender; +- (void)deminiaturize:(id)sender; +- (BOOL)isZoomed; +- (void)zoom:(id)sender; +- (BOOL)isMiniaturized; +- (BOOL)tryToPerform:(SEL)anAction with:(id)anObject; +- (id)validRequestorForSendType:(NSString *)sendType returnType:(NSString *)returnType; +- (void)setBackgroundColor:(NSColor *)color; +- (NSColor *)backgroundColor; + + + +- (void)setContentBorderThickness:(CGFloat)thickness forEdge:(NSRectEdge)edge; +- (CGFloat)contentBorderThicknessForEdge:(NSRectEdge)edge; + +- (void)setAutorecalculatesContentBorderThickness:(BOOL)flag forEdge:(NSRectEdge)edge; +- (BOOL)autorecalculatesContentBorderThicknessForEdge:(NSRectEdge)edge; + + +- (void)setMovable:(BOOL)flag; +- (BOOL)isMovable; + +- (void)setMovableByWindowBackground:(BOOL)flag; +- (BOOL)isMovableByWindowBackground; + +- (void)setHidesOnDeactivate:(BOOL)flag; +- (BOOL)hidesOnDeactivate; + + +- (void)setCanHide:(BOOL)flag; +- (BOOL)canHide; + +- (void)center; +- (void)makeKeyAndOrderFront:(id)sender; +- (void)orderFront:(id)sender; +- (void)orderBack:(id)sender; +- (void)orderOut:(id)sender; +- (void)orderWindow:(NSWindowOrderingMode)place relativeTo:(NSInteger)otherWin; +- (void)orderFrontRegardless; + +- (void)setMiniwindowImage:(NSImage *)image; +- (void)setMiniwindowTitle:(NSString *)title; +- (NSImage *)miniwindowImage; +- (NSString *)miniwindowTitle; + +- (NSDockTile *)dockTile; + +- (void)setDocumentEdited:(BOOL)flag; +- (BOOL)isDocumentEdited; +- (BOOL)isVisible; +- (BOOL)isKeyWindow; +- (BOOL)isMainWindow; +- (BOOL)canBecomeKeyWindow; +- (BOOL)canBecomeMainWindow; +- (void)makeKeyWindow; +- (void)makeMainWindow; +- (void)becomeKeyWindow; +- (void)resignKeyWindow; +- (void)becomeMainWindow; +- (void)resignMainWindow; + +- (BOOL)worksWhenModal; + + +- (BOOL)preventsApplicationTerminationWhenModal; +- (void)setPreventsApplicationTerminationWhenModal:(BOOL)flag; + + +- (NSRect)convertRectToScreen:(NSRect)aRect; +- (NSRect)convertRectFromScreen:(NSRect)aRect; + + +- (NSRect)convertRectToBacking:(NSRect)aRect; +- (NSRect)convertRectFromBacking:(NSRect)aRect; + + +- (NSRect)backingAlignedRect:(NSRect)aRect options:(NSAlignmentOptions)options; + + +- (CGFloat)backingScaleFactor; + + +- (NSPoint)convertBaseToScreen:(NSPoint)aPoint; +- (NSPoint)convertScreenToBase:(NSPoint)aPoint; + +- (void)performClose:(id)sender; +- (void)performMiniaturize:(id)sender; +- (void)performZoom:(id)sender; +- (NSInteger)gState; +- (void)setOneShot:(BOOL)flag; +- (BOOL)isOneShot; +- (NSData *)dataWithEPSInsideRect:(NSRect)rect; +- (NSData *)dataWithPDFInsideRect:(NSRect)rect; +- (void)print:(id)sender; + +- (void)disableCursorRects; +- (void)enableCursorRects; +- (void)discardCursorRects; +- (BOOL)areCursorRectsEnabled; +- (void)invalidateCursorRectsForView:(NSView *)aView; +- (void)resetCursorRects; + +- (void)setAllowsToolTipsWhenApplicationIsInactive:(BOOL)allowWhenInactive; + + +- (BOOL)allowsToolTipsWhenApplicationIsInactive; + + +- (void)setBackingType:(NSBackingStoreType)bufferingType; +- (NSBackingStoreType)backingType; +- (void)setLevel:(NSInteger)newLevel; +- (NSInteger)level; +- (void)setDepthLimit:(NSWindowDepth)limit; +- (NSWindowDepth)depthLimit; +- (void)setDynamicDepthLimit:(BOOL)flag; +- (BOOL)hasDynamicDepthLimit; +- (NSScreen *)screen; +- (NSScreen *)deepestScreen; +- (BOOL)canStoreColor; +- (void)setHasShadow:(BOOL)hasShadow; +- (BOOL)hasShadow; +- (void)invalidateShadow; +- (void)setAlphaValue:(CGFloat)windowAlpha; +- (CGFloat)alphaValue; +- (void)setOpaque:(BOOL)isOpaque; +- (BOOL)isOpaque; + + + + +- (void)setSharingType:(NSWindowSharingType)type; +- (NSWindowSharingType)sharingType; + + + +- (void)setPreferredBackingLocation:(NSWindowBackingLocation)backingLocation; + + +- (NSWindowBackingLocation)preferredBackingLocation; + + +- (NSWindowBackingLocation)backingLocation; + + + + +- (BOOL)allowsConcurrentViewDrawing; + + + +- (void)setAllowsConcurrentViewDrawing:(BOOL)flag; + +- (BOOL)displaysWhenScreenProfileChanges; +- (void)setDisplaysWhenScreenProfileChanges:(BOOL)flag; + +- (void)disableScreenUpdatesUntilFlush; + + + +- (BOOL)canBecomeVisibleWithoutLogin; +- (void)setCanBecomeVisibleWithoutLogin:(BOOL)flag; + + +- (void)setCollectionBehavior:(NSWindowCollectionBehavior)behavior; +- (NSWindowCollectionBehavior)collectionBehavior; + + + + +- (NSWindowAnimationBehavior)animationBehavior; +- (void)setAnimationBehavior:(NSWindowAnimationBehavior)newAnimationBehavior; + + + + +-(BOOL)canBeVisibleOnAllSpaces; +-(void)setCanBeVisibleOnAllSpaces:(BOOL)flag; + + +- (BOOL)isOnActiveSpace; + +- (void)toggleFullScreen:(id)sender; + +- (NSString *)stringWithSavedFrame; +- (void)setFrameFromString:(NSString *)string; +- (void)saveFrameUsingName:(NSString *)name; + +- (BOOL)setFrameUsingName:(NSString *)name force:(BOOL)force; +- (BOOL)setFrameUsingName:(NSString *)name; +- (BOOL)setFrameAutosaveName:(NSString *)name; +- (NSString *)frameAutosaveName; ++ (void)removeFrameUsingName:(NSString *)name; + + +- (void)cacheImageInRect:(NSRect)aRect; +- (void)restoreCachedImage; +- (void)discardCachedImage; + +- (NSSize)minSize; +- (NSSize)maxSize; +- (void)setMinSize:(NSSize)size; +- (void)setMaxSize:(NSSize)size; +- (NSSize)contentMinSize; +- (NSSize)contentMaxSize; +- (void)setContentMinSize:(NSSize)size; +- (void)setContentMaxSize:(NSSize)size; +- (NSEvent *)nextEventMatchingMask:(NSUInteger)mask; +- (NSEvent *)nextEventMatchingMask:(NSUInteger)mask untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag; +- (void)discardEventsMatchingMask:(NSUInteger)mask beforeEvent:(NSEvent *)lastEvent; +- (void)postEvent:(NSEvent *)event atStart:(BOOL)flag; +- (NSEvent *)currentEvent; +- (void)setAcceptsMouseMovedEvents:(BOOL)flag; +- (BOOL)acceptsMouseMovedEvents; +- (void)setIgnoresMouseEvents:(BOOL)flag; +- (BOOL)ignoresMouseEvents; +- (NSDictionary *)deviceDescription; +- (void)sendEvent:(NSEvent *)theEvent; +- (NSPoint)mouseLocationOutsideOfEventStream; ++ (void)menuChanged:(NSMenu *)menu; + +- (id)windowController; +- (void)setWindowController:(NSWindowController *)windowController; + +- (BOOL)isSheet; +- (NSWindow *)attachedSheet; + ++ (NSButton *)standardWindowButton:(NSWindowButton)b forStyleMask:(NSUInteger)styleMask; +- (NSButton *)standardWindowButton:(NSWindowButton)b; + +- (void)addChildWindow:(NSWindow *)childWin ordered:(NSWindowOrderingMode)place; +- (void)removeChildWindow:(NSWindow *)childWin; +- (NSArray *)childWindows; + +- (NSWindow *)parentWindow; +- (void)setParentWindow:(NSWindow *)window; + + + +- (NSGraphicsContext *)graphicsContext; + + + + +- (CGFloat)userSpaceScaleFactor; + + +- (void)setColorSpace:(NSColorSpace *)colorSpace; +- (NSColorSpace *)colorSpace; ++ (NSArray *)windowNumbersWithOptions:(NSWindowNumberListOptions)options; + + + ++ (NSInteger)windowNumberAtPoint:(NSPoint)point belowWindowWithWindowNumber:(NSInteger)windowNumber; -@interface NSWindow : NSResponder @end -#endif +@interface NSWindow(NSKeyboardUI) +- (void)setInitialFirstResponder:(NSView *)view; +- (NSView *)initialFirstResponder; +- (void)selectNextKeyView:(id)sender; +- (void)selectPreviousKeyView:(id)sender; +- (void)selectKeyViewFollowingView:(NSView *)aView; +- (void)selectKeyViewPrecedingView:(NSView *)aView; +- (NSSelectionDirection)keyViewSelectionDirection; +- (void)setDefaultButtonCell:(NSButtonCell *)defButt; +- (NSButtonCell *)defaultButtonCell; +- (void)disableKeyEquivalentForDefaultButtonCell; +- (void)enableKeyEquivalentForDefaultButtonCell; +- (void)setAutorecalculatesKeyViewLoop:(BOOL)flag; +- (BOOL)autorecalculatesKeyViewLoop; +- (void)recalculateKeyViewLoop; +@end + +@interface NSWindow (NSToolbarSupport) +- (void)setToolbar:(NSToolbar*)toolbar; +- (NSToolbar *)toolbar; +- (void)toggleToolbarShown:(id)sender; +- (void)runToolbarCustomizationPalette:(id)sender; +- (void)setShowsToolbarButton:(BOOL)show; +- (BOOL)showsToolbarButton; +@end + +@interface NSWindow(NSDrag) +- (void)dragImage:(NSImage *)anImage at:(NSPoint)baseLocation offset:(NSSize)initialOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pboard source:(id)sourceObj slideBack:(BOOL)slideFlag; + +- (void)registerForDraggedTypes:(NSArray *)newTypes; +- (void)unregisterDraggedTypes; +@end + +@interface NSWindow(NSCarbonExtensions) + +- (NSWindow *)initWithWindowRef:(void * )windowRef; + +- (void * )windowRef ; +@end + + +@protocol NSWindowDelegate +@optional +- (BOOL)windowShouldClose:(id)sender; +- (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)client; +- (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)frameSize; +- (NSRect)windowWillUseStandardFrame:(NSWindow *)window defaultFrame:(NSRect)newFrame; +- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame; +- (NSUndoManager *)windowWillReturnUndoManager:(NSWindow *)window; +- (NSRect)window:(NSWindow *)window willPositionSheet:(NSWindow *)sheet usingRect:(NSRect)rect; + + +- (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu; + + + +- (BOOL)window:(NSWindow *)window shouldDragDocumentWithEvent:(NSEvent *)event from:(NSPoint)dragImageLocation withPasteboard:(NSPasteboard *)pasteboard; + +- (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize; + +- (NSApplicationPresentationOptions)window:(NSWindow *)window willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions; + + + +- (NSArray *)customWindowsToEnterFullScreenForWindow:(NSWindow *)window; + + + +- (void)window:(NSWindow *)window startCustomAnimationToEnterFullScreenWithDuration:(NSTimeInterval)duration; + + + +- (void)windowDidFailToEnterFullScreen:(NSWindow *)window; + + + +- (NSArray *)customWindowsToExitFullScreenForWindow:(NSWindow *)window; + + + +- (void)window:(NSWindow *)window startCustomAnimationToExitFullScreenWithDuration:(NSTimeInterval)duration; + + + +- (void)windowDidFailToExitFullScreen:(NSWindow *)window; + + + + +- (NSSize)window:(NSWindow *)window willResizeForVersionBrowserWithMaxPreferredSize:(NSSize)maxPreferredFrameSize maxAllowedSize:(NSSize)maxAllowedFrameSize; + + + + +- (void)window:(NSWindow *)window willEncodeRestorableState:(NSCoder *)state; + + + +- (void)window:(NSWindow *)window didDecodeRestorableState:(NSCoder *)state; + + + +- (void)windowDidResize:(NSNotification *)notification; +- (void)windowDidExpose:(NSNotification *)notification; +- (void)windowWillMove:(NSNotification *)notification; +- (void)windowDidMove:(NSNotification *)notification; +- (void)windowDidBecomeKey:(NSNotification *)notification; +- (void)windowDidResignKey:(NSNotification *)notification; +- (void)windowDidBecomeMain:(NSNotification *)notification; +- (void)windowDidResignMain:(NSNotification *)notification; +- (void)windowWillClose:(NSNotification *)notification; +- (void)windowWillMiniaturize:(NSNotification *)notification; +- (void)windowDidMiniaturize:(NSNotification *)notification; +- (void)windowDidDeminiaturize:(NSNotification *)notification; +- (void)windowDidUpdate:(NSNotification *)notification; +- (void)windowDidChangeScreen:(NSNotification *)notification; +- (void)windowDidChangeScreenProfile:(NSNotification *)notification; +- (void)windowDidChangeBackingProperties:(NSNotification *)notification; +- (void)windowWillBeginSheet:(NSNotification *)notification; +- (void)windowDidEndSheet:(NSNotification *)notification; +- (void)windowWillStartLiveResize:(NSNotification *)notification; +- (void)windowDidEndLiveResize:(NSNotification *)notification; +- (void)windowWillEnterFullScreen:(NSNotification *)notification; +- (void)windowDidEnterFullScreen:(NSNotification *)notification; +- (void)windowWillExitFullScreen:(NSNotification *)notification; +- (void)windowDidExitFullScreen:(NSNotification *)notification; +- (void)windowWillEnterVersionBrowser:(NSNotification *)notification; +- (void)windowDidEnterVersionBrowser:(NSNotification *)notification; +- (void)windowWillExitVersionBrowser:(NSNotification *)notification; +- (void)windowDidExitVersionBrowser:(NSNotification *)notification; + +@end + + + +EXTERN_C NSString *NSWindowDidBecomeKeyNotification; +EXTERN_C NSString *NSWindowDidBecomeMainNotification; +EXTERN_C NSString *NSWindowDidChangeScreenNotification; +EXTERN_C NSString *NSWindowDidDeminiaturizeNotification; +EXTERN_C NSString *NSWindowDidExposeNotification; +EXTERN_C NSString *NSWindowDidMiniaturizeNotification; +EXTERN_C NSString *NSWindowDidMoveNotification; +EXTERN_C NSString *NSWindowDidResignKeyNotification; +EXTERN_C NSString *NSWindowDidResignMainNotification; +EXTERN_C NSString *NSWindowDidResizeNotification; +EXTERN_C NSString *NSWindowDidUpdateNotification; +EXTERN_C NSString *NSWindowWillCloseNotification; +EXTERN_C NSString *NSWindowWillMiniaturizeNotification; +EXTERN_C NSString *NSWindowWillMoveNotification; +EXTERN_C NSString *NSWindowWillBeginSheetNotification; +EXTERN_C NSString *NSWindowDidEndSheetNotification; + + + +EXTERN_C NSString * const NSWindowDidChangeBackingPropertiesNotification; + +EXTERN_C NSString * const NSBackingPropertyOldScaleFactorKey; +EXTERN_C NSString * const NSBackingPropertyOldColorSpaceKey; + + + + +EXTERN_C NSString *NSWindowDidChangeScreenProfileNotification; + + +EXTERN_C NSString * const NSWindowWillStartLiveResizeNotification; + +EXTERN_C NSString * const NSWindowDidEndLiveResizeNotification; +EXTERN_C NSString * const NSWindowWillEnterFullScreenNotification; +EXTERN_C NSString * const NSWindowDidEnterFullScreenNotification; +EXTERN_C NSString * const NSWindowWillExitFullScreenNotification; +EXTERN_C NSString * const NSWindowDidExitFullScreenNotification; +EXTERN_C NSString * const NSWindowWillEnterVersionBrowserNotification; +EXTERN_C NSString * const NSWindowDidEnterVersionBrowserNotification; +EXTERN_C NSString * const NSWindowWillExitVersionBrowserNotification; +EXTERN_C NSString * const NSWindowDidExitVersionBrowserNotification; diff --git a/src/AppKit/NSWindowController.h b/src/AppKit/NSWindowController.h new file mode 100644 index 000000000..a2c122962 --- /dev/null +++ b/src/AppKit/NSWindowController.h @@ -0,0 +1,106 @@ +#import +#import + +@class NSArray, NSDocument, NSWindow; + +@interface NSWindowController : NSResponder { + @private + NSWindow *_window; + NSString *_windowNibName; + NSDocument *_document; + NSArray *_topLevelObjects; + id _owner; + struct __wcFlags { + unsigned int shouldCloseDocument:1; + unsigned int shouldCascade:1; + unsigned int nibIsLoaded:1; + unsigned int nibNameIsPath:1; + unsigned int RESERVED:28; + } _wcFlags; + NSString *_frameAutosaveName; + id _moreVars; +} + +- (id)initWithWindow:(NSWindow *)window; + + +- (id)initWithWindowNibName:(NSString *)windowNibName; +- (id)initWithWindowNibName:(NSString *)windowNibName owner:(id)owner; +- (id)initWithWindowNibPath:(NSString *)windowNibPath owner:(id)owner; + + + + + + +- (NSString *)windowNibName; + + +- (NSString *)windowNibPath; + + +- (id)owner; + + +- (void)setWindowFrameAutosaveName:(NSString *)name; +- (NSString *)windowFrameAutosaveName; + + +- (void)setShouldCascadeWindows:(BOOL)flag; +- (BOOL)shouldCascadeWindows; + + + + + + +- (id)document; + + +- (void)setDocument:(NSDocument *)document; + + +- (void)setDocumentEdited:(BOOL)dirtyFlag; + + +- (void)setShouldCloseDocument:(BOOL)flag; +- (BOOL)shouldCloseDocument; + + + + + + +- (void)setWindow:(NSWindow *)window; + + +- (NSWindow *)window; + + +- (void)synchronizeWindowTitleWithDocumentName; + + +- (NSString *)windowTitleForDocumentDisplayName:(NSString *)displayName; + + +- (void)close; + + +- (IBAction)showWindow:(id)sender; + + + + + + +- (BOOL)isWindowLoaded; + + +- (void)windowWillLoad; +- (void)windowDidLoad; + + +- (void)loadWindow; + + +@end diff --git a/src/AppKit/NSWindowRestoration.h b/src/AppKit/NSWindowRestoration.h new file mode 100644 index 000000000..edc60582e --- /dev/null +++ b/src/AppKit/NSWindowRestoration.h @@ -0,0 +1,111 @@ +#import +#import +#import +#import + + + + + +@protocol NSWindowRestoration +#if NS_BLOCKS_AVAILABLE + + + + + + + ++ (void)restoreWindowWithIdentifier:(NSString *)identifier state:(NSCoder *)state completionHandler:(void (^)(NSWindow *, NSError *))completionHandler; +#endif +@end + + +@interface NSDocumentController (NSWindowRestoration) +@end + +@interface NSApplication (NSWindowRestoration) + +#if NS_BLOCKS_AVAILABLE + + + + + + +- (BOOL)restoreWindowWithIdentifier:(NSString *)identifier state:(NSCoder *)state completionHandler:(void (^)(NSWindow *, NSError *))completionHandler; +#endif + +@end + + + +EXTERN_C NSString * const NSApplicationDidFinishRestoringWindowsNotification; + + +@interface NSWindow (NSUserInterfaceRestoration) + + + +- (void)setRestorable:(BOOL)flag; +- (BOOL)isRestorable; + + + +- (void)setRestorationClass:(Class )restorationClass; +- (Class )restorationClass; + + +- (void)disableSnapshotRestoration; +- (void)enableSnapshotRestoration; + + +@end + + +@interface NSResponder (NSRestorableState) + + + +- (void)encodeRestorableStateWithCoder:(NSCoder *)coder; + + + +- (void)restoreStateWithCoder:(NSCoder *)coder; + + + + +- (void)invalidateRestorableState; + + + + ++ (NSArray *)restorableStateKeyPaths; + +@end + + +@interface NSApplication (NSRestorableStateExtension) +- (void)extendStateRestoration; +- (void)completeStateRestoration; + +@end + +@interface NSDocument (NSRestorableState) + + + + + + + +- (void)restoreDocumentWindowWithIdentifier:(NSString *)identifier state:(NSCoder *)state completionHandler:(void (^)(NSWindow *, NSError *))completionHandler; + + +- (void)encodeRestorableStateWithCoder:(NSCoder *)coder; +- (void)restoreStateWithCoder:(NSCoder *)coder; +- (void)invalidateRestorableState; ++ (NSArray *)restorableStateKeyPaths; + +@end diff --git a/src/AppKit/NSWindowScripting.h b/src/AppKit/NSWindowScripting.h new file mode 100644 index 000000000..edc4daf0c --- /dev/null +++ b/src/AppKit/NSWindowScripting.h @@ -0,0 +1,29 @@ +#import + +@class NSCloseCommand; +@class NSScriptCommand; + +@interface NSWindow(NSScripting) + + +- (BOOL)hasCloseBox; +- (BOOL)hasTitleBar; +- (BOOL)isFloatingPanel; +- (BOOL)isMiniaturizable; +- (BOOL)isModalPanel; +- (BOOL)isResizable; +- (BOOL)isZoomable; +- (NSInteger)orderedIndex; + + +- (void)setIsMiniaturized:(BOOL)flag; +- (void)setIsVisible:(BOOL)flag; +- (void)setIsZoomed:(BOOL)flag; +- (void)setOrderedIndex:(NSInteger)index; + + +- (id)handleCloseScriptCommand:(NSCloseCommand *)command; +- (id)handlePrintScriptCommand:(NSScriptCommand *)command; +- (id)handleSaveScriptCommand:(NSScriptCommand *)command; + +@end diff --git a/src/AppKit/NSWorkspace.h b/src/AppKit/NSWorkspace.h new file mode 100644 index 000000000..25a346566 --- /dev/null +++ b/src/AppKit/NSWorkspace.h @@ -0,0 +1,349 @@ +#import +#import +#import +#import + +@class NSArray, NSError, NSImage, NSView, NSNotificationCenter, NSURL, NSScreen, NSRunningApplication; + +typedef NSUInteger NSWorkspaceLaunchOptions; +enum { + NSWorkspaceLaunchAndPrint = 0x00000002, + NSWorkspaceLaunchInhibitingBackgroundOnly = 0x00000080, + NSWorkspaceLaunchWithoutAddingToRecents = 0x00000100, + NSWorkspaceLaunchWithoutActivation = 0x00000200, + NSWorkspaceLaunchAsync = 0x00010000, + NSWorkspaceLaunchAllowingClassicStartup = 0x00020000, + NSWorkspaceLaunchPreferringClassic = 0x00040000, + NSWorkspaceLaunchNewInstance = 0x00080000, + NSWorkspaceLaunchAndHide = 0x00100000, + NSWorkspaceLaunchAndHideOthers = 0x00200000, + + NSWorkspaceLaunchDefault = NSWorkspaceLaunchAsync | +NSWorkspaceLaunchAllowingClassicStartup +}; + +typedef NSUInteger NSWorkspaceIconCreationOptions; +enum { + NSExcludeQuickDrawElementsIconCreationOption = 1 << 1, + NSExclude10_4ElementsIconCreationOption = 1 << 2 +}; + +@interface NSWorkspace : NSObject { + + @private + NSNotificationCenter *notificationCenter; +#if ! __LP64__ + int deviceStatusCount; + int applicationStatusCount; +#endif + id _reservedWorkspace1; +} + + ++ (NSWorkspace *)sharedWorkspace; + + +- (NSNotificationCenter *)notificationCenter; + + + +- (BOOL)openFile:(NSString *)fullPath; +- (BOOL)openFile:(NSString *)fullPath withApplication:(NSString *)appName; +- (BOOL)openFile:(NSString *)fullPath withApplication:(NSString *)appName andDeactivate:(BOOL)flag; + + +- (BOOL)openFile:(NSString *)fullPath fromImage:(NSImage *)anImage at:(NSPoint)point inView:(NSView *)aView; + + +- (BOOL)openURL:(NSURL *)url; + + +- (BOOL)launchApplication:(NSString *)appName; + + + + + +- (NSRunningApplication *)launchApplicationAtURL:(NSURL *)url options:(NSWorkspaceLaunchOptions)options configuration:(NSDictionary *)configuration error:(NSError **)error; + + +- (BOOL)launchApplication:(NSString *)appName showIcon:(BOOL)showIcon autolaunch:(BOOL)autolaunch; + + +- (NSString *)fullPathForApplication:(NSString *)appName; + + +- (BOOL)selectFile:(NSString *)fullPath inFileViewerRootedAtPath:(NSString *)rootFullPath; + + +- (void)activateFileViewerSelectingURLs:(NSArray *)fileURLs; + + + +- (BOOL)showSearchResultsForQueryString:(NSString *)queryString; + + +- (void)noteFileSystemChanged:(NSString *)path; + + +- (BOOL)getInfoForFile:(NSString *)fullPath application:(NSString **)appName type:(NSString **)type; + + +- (BOOL)isFilePackageAtPath:(NSString *)fullPath; + + +- (NSImage *)iconForFile:(NSString *)fullPath; + + +- (NSImage *)iconForFiles:(NSArray *)fullPaths; + + +- (NSImage *)iconForFileType:(NSString *)fileType; + + + +- (BOOL)setIcon:(NSImage *)image forFile:(NSString *)fullPath options:(NSWorkspaceIconCreationOptions)options; + + +- (NSArray *)fileLabels; + + +- (NSArray *)fileLabelColors; + +#if NS_BLOCKS_AVAILABLE + + + + + + +- (void)recycleURLs:(NSArray *)URLs completionHandler:(void (^)(NSDictionary *newURLs, NSError *error))handler; +- (void)duplicateURLs:(NSArray *)URLs completionHandler:(void (^)(NSDictionary *newURLs, NSError *error))handler; +#endif +- (BOOL)getFileSystemInfoForPath:(NSString *)fullPath isRemovable:(BOOL *)removableFlag isWritable:(BOOL *)writableFlag isUnmountable:(BOOL *)unmountableFlag description:(NSString **)description type:(NSString **)fileSystemType; + + + + +- (BOOL)performFileOperation:(NSString *)operation source:(NSString *)source destination:(NSString *)destination files:(NSArray *)files tag:(NSInteger *)tag; + + +- (BOOL)unmountAndEjectDeviceAtPath:(NSString *)path; + + +- (BOOL)unmountAndEjectDeviceAtURL:(NSURL *)url error:(NSError **)error; + + +- (NSInteger)extendPowerOffBy:(NSInteger)requested; + + +- (void)hideOtherApplications; + + +- (NSURL *)URLForApplicationWithBundleIdentifier:(NSString *)bundleIdentifier; + + +- (NSURL *)URLForApplicationToOpenURL:(NSURL *)url; + + +- (NSString *)absolutePathForAppBundleWithIdentifier:(NSString *)bundleIdentifier; + + + + +- (BOOL)launchAppWithBundleIdentifier:(NSString *)bundleIdentifier options:(NSWorkspaceLaunchOptions)options additionalEventParamDescriptor:(NSAppleEventDescriptor *)descriptor launchIdentifier:(NSNumber **)identifier; +- (BOOL)openURLs:(NSArray *)urls withAppBundleIdentifier:(NSString *)bundleIdentifier options:(NSWorkspaceLaunchOptions)options additionalEventParamDescriptor:(NSAppleEventDescriptor *)descriptor launchIdentifiers:(NSArray **)identifiers; + + + + +- (NSRunningApplication *)frontmostApplication; + + +- (NSRunningApplication *)menuBarOwningApplication; + + + + + + +- (NSString *)typeOfFile:(NSString *)absoluteFilePath error:(NSError **)outError; + + + + + +- (NSString *)localizedDescriptionForType:(NSString *)typeName; + + + + + +- (NSString *)preferredFilenameExtensionForType:(NSString *)typeName; + + + + + +- (BOOL)filenameExtension:(NSString *)filenameExtension isValidForType:(NSString *)typeName; + + + + + + + +- (BOOL)type:(NSString *)firstTypeName conformsToType:(NSString *)secondTypeName; + + +@end + + + +@interface NSWorkspace (NSDesktopImages) + + + + + +- (BOOL)setDesktopImageURL:(NSURL *)url forScreen:(NSScreen *)screen options:(NSDictionary *)options error:(NSError **)error; + + + +- (NSURL *)desktopImageURLForScreen:(NSScreen *)screen; + + + +- (NSDictionary *)desktopImageOptionsForScreen:(NSScreen *)screen; + +@end + + + + + +EXTERN_C NSString * const NSWorkspaceDesktopImageScalingKey; + + + +EXTERN_C NSString * const NSWorkspaceDesktopImageAllowClippingKey; + + + +EXTERN_C NSString * const NSWorkspaceDesktopImageFillColorKey; + + + + + + +EXTERN_C NSString * const NSWorkspaceApplicationKey; + +EXTERN_C NSString * NSWorkspaceWillLaunchApplicationNotification; +EXTERN_C NSString * NSWorkspaceDidLaunchApplicationNotification; +EXTERN_C NSString * NSWorkspaceDidTerminateApplicationNotification; +EXTERN_C NSString * const NSWorkspaceDidHideApplicationNotification; +EXTERN_C NSString * const NSWorkspaceDidUnhideApplicationNotification; +EXTERN_C NSString * const NSWorkspaceDidActivateApplicationNotification; +EXTERN_C NSString * const NSWorkspaceDidDeactivateApplicationNotification; + + + + + + +EXTERN_C NSString * const NSWorkspaceVolumeLocalizedNameKey; +EXTERN_C NSString * const NSWorkspaceVolumeURLKey; + + + +EXTERN_C NSString * const NSWorkspaceVolumeOldLocalizedNameKey; +EXTERN_C NSString * const NSWorkspaceVolumeOldURLKey; + +EXTERN_C NSString * NSWorkspaceDidMountNotification; +EXTERN_C NSString * NSWorkspaceDidUnmountNotification; +EXTERN_C NSString * NSWorkspaceWillUnmountNotification; + + + +EXTERN_C NSString * const NSWorkspaceDidRenameVolumeNotification; + + + +EXTERN_C NSString * const NSWorkspaceWillPowerOffNotification; + +EXTERN_C NSString * NSWorkspaceWillSleepNotification; +EXTERN_C NSString * NSWorkspaceDidWakeNotification; + +EXTERN_C NSString * const NSWorkspaceScreensDidSleepNotification; +EXTERN_C NSString * const NSWorkspaceScreensDidWakeNotification; + + +EXTERN_C NSString * NSWorkspaceSessionDidBecomeActiveNotification; +EXTERN_C NSString * NSWorkspaceSessionDidResignActiveNotification; + + + + +EXTERN_C NSString * NSWorkspaceDidPerformFileOperationNotification; + + + +EXTERN_C NSString * const NSWorkspaceDidChangeFileLabelsNotification; + +EXTERN_C NSString * const NSWorkspaceActiveSpaceDidChangeNotification; + + + + +EXTERN_C NSString * const NSWorkspaceLaunchConfigurationAppleEvent; +EXTERN_C NSString * const NSWorkspaceLaunchConfigurationArguments; +EXTERN_C NSString * const NSWorkspaceLaunchConfigurationEnvironment; +EXTERN_C NSString * const NSWorkspaceLaunchConfigurationArchitecture; + + + +EXTERN_C NSString * NSWorkspaceMoveOperation; +EXTERN_C NSString * NSWorkspaceCopyOperation; +EXTERN_C NSString * NSWorkspaceLinkOperation; +EXTERN_C NSString * NSWorkspaceCompressOperation; +EXTERN_C NSString * NSWorkspaceDecompressOperation; +EXTERN_C NSString * NSWorkspaceEncryptOperation; +EXTERN_C NSString * NSWorkspaceDecryptOperation; +EXTERN_C NSString * NSWorkspaceDestroyOperation; +EXTERN_C NSString * NSWorkspaceRecycleOperation; +EXTERN_C NSString * NSWorkspaceDuplicateOperation; + + + + +@interface NSWorkspace (NSDeprecated) +- (BOOL)openTempFile:(NSString *)fullPath; +- (void)findApplications; +- (void)noteUserDefaultsChanged; +- (void)slideImage:(NSImage *)image from:(NSPoint)fromPoint to:(NSPoint)toPoint; +- (void)checkForRemovableMedia; +- (void)noteFileSystemChanged; +- (BOOL)fileSystemChanged; +- (BOOL)userDefaultsChanged; +- (NSArray *)mountNewRemovableMedia; +- (NSDictionary *)activeApplication; + + +- (NSArray *)mountedLocalVolumePaths; + + +- (NSArray *)mountedRemovableMedia; + + + + +- (NSArray *)launchedApplications; + +@end + +EXTERN_C NSString *NSPlainFileType; +EXTERN_C NSString *NSDirectoryFileType; +EXTERN_C NSString *NSApplicationFileType; +EXTERN_C NSString *NSFilesystemFileType; +EXTERN_C NSString *NSShellCommandFileType; diff --git a/tools/stripcomments.sh b/tools/stripcomments.sh index c287b0c90..d23cf7125 100755 --- a/tools/stripcomments.sh +++ b/tools/stripcomments.sh @@ -3,5 +3,5 @@ # This cool can be used to strip most of the copyrightable material from header files. # Remember that all files processed with this script stil need to be checked manually! -gcc -DNS_BLOCKS_AVAILABLE -fpreprocessed -dD -E "$1" | egrep -v '# [[:digit:]]' | sed -r 's/APPKIT_EXTERN/EXTERN_C/;s/ ?(NS_AVAILABLE(_MAC)?|NS_DEPRECATED_MAC|NS_CLASS_AVAILABLE)\([^)]+\)//;s/#pragma mark.*//' +gcc -DNS_BLOCKS_AVAILABLE -fpreprocessed -dD -E "$1" | egrep -v '# [[:digit:]]' | sed -r 's/APPKIT_EXTERN/EXTERN_C/;s/ ?(NS_AVAILABLE(_MAC)?|NS_DEPRECATED_MAC|NS_CLASS_AVAILABLE)\([^)]+\)//;s/#pragma mark.*//;s/NS_AUTOMATED_REFCOUNT_WEAK_UNAVAILABLE//;s/NS_RETURNS_INNER_POINTER//;s/NS_FORMAT_FUNCTION\(([0-9]+), ?([0-9]+)\)//'