1{ Parsed from AppKit.framework NSLayoutManager.h }
2
3
4{$ifdef TYPES}
5type
6  NSLayoutManagerPtr = ^NSLayoutManager;
7  NSTextLayoutOrientationProviderProtocolPtr = ^NSTextLayoutOrientationProviderProtocol;
8  NSLayoutManagerDelegateProtocolPtr = ^NSLayoutManagerDelegateProtocol;
9{$endif}
10
11{$ifdef TYPES}
12const
13  NSGlyphAttributeSoft = 0;
14  NSGlyphAttributeElastic = 1;
15  NSGlyphAttributeBidiLevel = 2;
16  NSGlyphAttributeInscribe = 5;
17
18type
19  NSGlyphInscription = NSUInteger;
20  NSGlyphInscriptionPtr = ^NSGlyphInscription;
21
22const
23  NSGlyphInscribeBase = 0;
24  NSGlyphInscribeBelow = 1;
25  NSGlyphInscribeAbove = 2;
26  NSGlyphInscribeOverstrike = 3;
27  NSGlyphInscribeOverBelow = 4;
28
29type
30  NSTypesetterBehavior = NSInteger;
31  NSTypesetterBehaviorPtr = ^NSTypesetterBehavior;
32
33const
34  NSTypesetterLatestBehavior = -1;
35  NSTypesetterOriginalBehavior = 0;
36  NSTypesetterBehavior_10_2_WithCompatibility = 1;
37  NSTypesetterBehavior_10_2 = 2;
38  NSTypesetterBehavior_10_3 = 3;
39  NSTypesetterBehavior_10_4 = 4;
40
41type
42  NSTextLayoutOrientation = NSInteger;
43  NSTextLayoutOrientationPtr = ^NSTextLayoutOrientation;
44
45const
46  NSTextLayoutOrientationHorizontal = 0;
47  NSTextLayoutOrientationVertical = 1;
48{$endif}
49
50{$ifdef PROTOCOLS}
51
52type
53  NSTextLayoutOrientationProviderProtocol = objcprotocol external name 'NSTextLayoutOrientationProvider'
54    function layoutOrientation: NSTextLayoutOrientation; message 'layoutOrientation'; { available in 10_7 }
55  end;
56{$endif}
57
58{$ifdef CLASSES}
59
60type
61  NSLayoutManager = objcclass external (NSObject, NSCodingProtocol, NSGlyphStorageProtocol)
62  private
63    _textStorage: NSTextStorage;
64    _glyphGenerator: NSGlyphGenerator;
65    _typesetter: NSTypesetter;
66    _textContainers: NSMutableArray;
67    _containerUsedRects: NSStorage;
68    _glyphs: NSStorage;
69    _containerRuns: NSRunStorage;
70    _fragmentRuns: NSRunStorage;
71    _glyphLocations: NSRunStorage;
72    _glyphRotationRuns: NSRunStorage;
73    _extraLineFragmentRect: NSRect;
74    _extraLineFragmentUsedRect: NSRect;
75    _extraLineFragmentContainer: NSTextContainer;
76    _glyphHoles: NSSortedArray;
77    _layoutHoles: NSSortedArray;
78    _lmFlags: bitpacked record
79      case byte of
80        0: (_anonBitField__lmFlags0: cuint);
81        1: (
82          containersAreFull: 0..1;
83          glyphsMightDrawOutsideLines: 0..1;
84          backgroundLayoutEnabled: 0..1;
85          resizingInProgress: 0..1;
86          allowScreenFonts: 0..1;
87          cachedRectArrayInUse: 0..1;
88          displayInvalidationInProgress: 0..1;
89          insertionPointNeedsUpdate: 0..1;
90          layoutManagerInDirtyList: 0..1;
91          originalFontOverride: 0..1;
92          showInvisibleCharacters: 0..1;
93          showControlCharacters: 0..1;
94          delegateRespondsToDidInvalidate: 0..1;
95          delegateRespondsToDidComplete: 0..1;
96          glyphFormat: 0..((1 shl 2)-1);
97          textStorageRespondsToIsEditing: 0..1;
98          notifyEditedInProgress: 0..1;
99          containersChanged: 0..1;
100          isGeneratingGlyphs: 0..1;
101          hasNonGeneratedGlyphData: 0..1;
102          inBackgroundLayout: 0..1;
103          syncAlignmentToDirection: 0..1;
104          defaultAttachmentScaling: 0..((1 shl 2)-1);
105          usesFontLeading: 0..1;
106          seenRightToLeft: 0..1;
107          ignoresViewTransformations: 0..1;
108          needToFlushGlyph: 0..1;
109          flipsIfNeeded: 0..1;
110          allowNonContig: 0..1;
111          useNonContig: 0..1;
112        );
113      end;
114    _delegate: id;
115    _textViewResizeDisableStack: cushort;
116    _displayInvalidationDisableStack: cushort;
117    _deferredDisplayCharRange: NSRange;
118    _firstTextView: NSTextView;
119    _cachedRectArray: NSRectPtr;
120    _cachedRectArrayCapacity: NSUInteger;
121    _glyphBuffer: PChar;
122    _glyphBufferSize: NSUInteger;
123    _cachedLocationNominalGlyphRange: NSRange;
124    _cachedLocationGlyphIndex: NSUInteger;
125    _cachedLocation: NSPoint;
126    _cachedFontCharRange: NSRange;
127    _cachedFont: NSFont;
128    _firstUnlaidGlyphIndex: NSUInteger;
129    _firstUnlaidCharIndex: NSUInteger;
130    _rulerAccView: NSBox;
131    _rulerAccViewAlignmentButtons: id;
132    _rulerAccViewSpacing: id;
133    _rulerAccViewLeftTabWell: NSTabWell;
134    _rulerAccViewRightTabWell: NSTabWell;
135    _rulerAccViewCenterTabWell: NSTabWell;
136    _rulerAccViewDecimalTabWell: NSTabWell;
137    _rulerAccViewStyles: id;
138    _rulerAccViewLists: id;
139    _newlyFilledGlyphRange: NSRange;
140    _extraData: id;
141  public
142    function init: instancetype; message 'init'; { NS_DESIGNATED_INITIALIZER }
143    procedure setTextStorage(newValue: NSTextStorage); message 'setTextStorage:';
144    function textStorage: NSTextStorage; message 'textStorage';
145    function attributedString: NSAttributedString; message 'attributedString';
146    procedure replaceTextStorage (newTextStorage: NSTextStorage); message 'replaceTextStorage:';
147    procedure setGlyphGenerator(newValue: NSGlyphGenerator); message 'setGlyphGenerator:';
148    function glyphGenerator: NSGlyphGenerator; message 'glyphGenerator';
149    procedure setTypesetter(newValue: NSTypesetter); message 'setTypesetter:';
150    function typesetter: NSTypesetter; message 'typesetter';
151    procedure setDelegate(newValue: NSLayoutManagerDelegateProtocol); message 'setDelegate:';
152    function delegate: NSLayoutManagerDelegateProtocol; message 'delegate';
153    function textContainers: NSArray; message 'textContainers';
154    procedure addTextContainer (container: NSTextContainer); message 'addTextContainer:';
155    procedure insertTextContainer_atIndex (container: NSTextContainer; index: NSUInteger); message 'insertTextContainer:atIndex:';
156    procedure removeTextContainerAtIndex (index: NSUInteger); message 'removeTextContainerAtIndex:';
157    procedure textContainerChangedGeometry (container: NSTextContainer); message 'textContainerChangedGeometry:';
158    procedure textContainerChangedTextView (container: NSTextContainer); message 'textContainerChangedTextView:';
159    procedure setBackgroundLayoutEnabled(newValue: ObjCBOOL); message 'setBackgroundLayoutEnabled:';
160    function backgroundLayoutEnabled: ObjCBOOL; message 'backgroundLayoutEnabled';
161    procedure setUsesScreenFonts(newValue: ObjCBOOL); message 'setUsesScreenFonts:';
162    function usesScreenFonts: ObjCBOOL; message 'usesScreenFonts';
163    procedure setShowsInvisibleCharacters(newValue: ObjCBOOL); message 'setShowsInvisibleCharacters:';
164    function showsInvisibleCharacters: ObjCBOOL; message 'showsInvisibleCharacters';
165    procedure setShowsControlCharacters(newValue: ObjCBOOL); message 'setShowsControlCharacters:';
166    function showsControlCharacters: ObjCBOOL; message 'showsControlCharacters';
167    procedure setHyphenationFactor(newValue: single); message 'setHyphenationFactor:';
168    function hyphenationFactor: single; message 'hyphenationFactor';
169    procedure setDefaultAttachmentScaling(newValue: NSImageScaling); message 'setDefaultAttachmentScaling:';
170    function defaultAttachmentScaling: NSImageScaling; message 'defaultAttachmentScaling';
171    procedure setTypesetterBehavior(newValue: NSTypesetterBehavior); message 'setTypesetterBehavior:';
172    function typesetterBehavior: NSTypesetterBehavior; message 'typesetterBehavior';
173    function layoutOptions: NSUInteger; message 'layoutOptions';
174    procedure setAllowsNonContiguousLayout(newValue: ObjCBOOL); message 'setAllowsNonContiguousLayout:';
175    function allowsNonContiguousLayout: ObjCBOOL; message 'allowsNonContiguousLayout';
176    function hasNonContiguousLayout: ObjCBOOL; message 'hasNonContiguousLayout';
177    procedure invalidateGlyphsForCharacterRange_changeInLength_actualCharacterRange (charRange: NSRange; delta: NSInteger; actualCharRange: NSRangePointer); message 'invalidateGlyphsForCharacterRange:changeInLength:actualCharacterRange:';
178    procedure invalidateLayoutForCharacterRange_actualCharacterRange (charRange: NSRange; actualCharRange: NSRangePointer); message 'invalidateLayoutForCharacterRange:actualCharacterRange:'; { available in 10_5 }
179    procedure invalidateLayoutForCharacterRange_isSoft_actualCharacterRange (charRange: NSRange; flag: ObjCBOOL; actualCharRange: NSRangePointer); message 'invalidateLayoutForCharacterRange:isSoft:actualCharacterRange:';
180    procedure invalidateDisplayForCharacterRange (charRange: NSRange); message 'invalidateDisplayForCharacterRange:';
181    procedure invalidateDisplayForGlyphRange (glyphRange: NSRange); message 'invalidateDisplayForGlyphRange:';
182    procedure textStorage_edited_range_changeInLength_invalidatedRange (str: NSTextStorage; editedMask: NSTextStorageEditedOptions; newCharRange: NSRange; delta: NSInteger; invalidatedCharRange: NSRange); message 'textStorage:edited:range:changeInLength:invalidatedRange:';
183    procedure ensureGlyphsForCharacterRange (charRange: NSRange); message 'ensureGlyphsForCharacterRange:'; { available in 10_5 }
184    procedure ensureGlyphsForGlyphRange (glyphRange: NSRange); message 'ensureGlyphsForGlyphRange:'; { available in 10_5 }
185    procedure ensureLayoutForCharacterRange (charRange: NSRange); message 'ensureLayoutForCharacterRange:'; { available in 10_5 }
186    procedure ensureLayoutForGlyphRange (glyphRange: NSRange); message 'ensureLayoutForGlyphRange:'; { available in 10_5 }
187    procedure ensureLayoutForTextContainer (container: NSTextContainer); message 'ensureLayoutForTextContainer:'; { available in 10_5 }
188    procedure ensureLayoutForBoundingRect_inTextContainer (bounds: NSRect; container: NSTextContainer); message 'ensureLayoutForBoundingRect:inTextContainer:'; { available in 10_5 }
189    procedure insertGlyphs_length_forStartingGlyphAtIndex_characterIndex (glyphs: NSGlyphPtr; length: NSUInteger; glyphIndex: NSUInteger; charIndex: NSUInteger); message 'insertGlyphs:length:forStartingGlyphAtIndex:characterIndex:';
190    procedure insertGlyph_atGlyphIndex_characterIndex (glyph: NSGlyph; glyphIndex: NSUInteger; charIndex: NSUInteger); message 'insertGlyph:atGlyphIndex:characterIndex:';
191    procedure replaceGlyphAtIndex_withGlyph (glyphIndex: NSUInteger; newGlyph: NSGlyph); message 'replaceGlyphAtIndex:withGlyph:';
192    procedure deleteGlyphsInRange (glyphRange: NSRange); message 'deleteGlyphsInRange:';
193    procedure setCharacterIndex_forGlyphAtIndex (charIndex: NSUInteger; glyphIndex: NSUInteger); message 'setCharacterIndex:forGlyphAtIndex:';
194    procedure setIntAttribute_value_forGlyphAtIndex (attributeTag: NSInteger; val: NSInteger; glyphIndex: NSUInteger); message 'setIntAttribute:value:forGlyphAtIndex:';
195    procedure invalidateGlyphsOnLayoutInvalidationForGlyphRange (glyphRange: NSRange); message 'invalidateGlyphsOnLayoutInvalidationForGlyphRange:'; { available in 10_5 }
196    function numberOfGlyphs: NSUInteger; message 'numberOfGlyphs';
197    function glyphAtIndex_isValidIndex (glyphIndex: NSUInteger; isValidIndex: pObjCBOOL): NSGlyph; message 'glyphAtIndex:isValidIndex:';
198    function glyphAtIndex (glyphIndex: NSUInteger): NSGlyph; message 'glyphAtIndex:';
199    function isValidGlyphIndex (glyphIndex: NSUInteger): ObjCBOOL; message 'isValidGlyphIndex:';
200    function characterIndexForGlyphAtIndex (glyphIndex: NSUInteger): NSUInteger; message 'characterIndexForGlyphAtIndex:';
201    function glyphIndexForCharacterAtIndex (charIndex: NSUInteger): NSUInteger; message 'glyphIndexForCharacterAtIndex:'; { available in 10_5 }
202    function intAttribute_forGlyphAtIndex (attributeTag: NSInteger; glyphIndex: NSUInteger): NSInteger; message 'intAttribute:forGlyphAtIndex:';
203    function getGlyphsInRange_glyphs_characterIndexes_glyphInscriptions_elasticBits (glyphRange: NSRange; glyphBuffer: NSGlyphPtr; charIndexBuffer: NSUIntegerPtr; inscribeBuffer: NSGlyphInscriptionPtr; elasticBuffer: pObjCBOOL): NSUInteger; message 'getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:';
204    function getGlyphsInRange_glyphs_characterIndexes_glyphInscriptions_elasticBits_bidiLevels (glyphRange: NSRange; glyphBuffer: NSGlyphPtr; charIndexBuffer: NSUIntegerPtr; inscribeBuffer: NSGlyphInscriptionPtr; elasticBuffer: pObjCBOOL; bidiLevelBuffer: PChar): NSUInteger; message 'getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:bidiLevels:';
205    function getGlyphs_range (glyphArray: NSGlyphPtr; glyphRange: NSRange): NSUInteger; message 'getGlyphs:range:';
206    procedure setTextContainer_forGlyphRange (container: NSTextContainer; glyphRange: NSRange); message 'setTextContainer:forGlyphRange:';
207    procedure setLineFragmentRect_forGlyphRange_usedRect (fragmentRect: NSRect; glyphRange: NSRange; usedRect: NSRect); message 'setLineFragmentRect:forGlyphRange:usedRect:';
208    procedure setExtraLineFragmentRect_usedRect_textContainer (fragmentRect: NSRect; usedRect: NSRect; container: NSTextContainer); message 'setExtraLineFragmentRect:usedRect:textContainer:';
209    procedure setLocation_forStartOfGlyphRange (location: NSPoint; glyphRange: NSRange); message 'setLocation:forStartOfGlyphRange:';
210    procedure setLocations_startingGlyphIndexes_count_forGlyphRange (locations: NSPointArray; glyphIndexes: NSUIntegerPtr; count: NSUInteger; glyphRange: NSRange); message 'setLocations:startingGlyphIndexes:count:forGlyphRange:'; { available in 10_5 }
211    procedure setNotShownAttribute_forGlyphAtIndex (flag: ObjCBOOL; glyphIndex: NSUInteger); message 'setNotShownAttribute:forGlyphAtIndex:';
212    procedure setDrawsOutsideLineFragment_forGlyphAtIndex (flag: ObjCBOOL; glyphIndex: NSUInteger); message 'setDrawsOutsideLineFragment:forGlyphAtIndex:';
213    procedure setAttachmentSize_forGlyphRange (attachmentSize: NSSize; glyphRange: NSRange); message 'setAttachmentSize:forGlyphRange:';
214    procedure getFirstUnlaidCharacterIndex_glyphIndex (charIndex: NSUIntegerPtr; glyphIndex: NSUIntegerPtr); message 'getFirstUnlaidCharacterIndex:glyphIndex:';
215    function firstUnlaidCharacterIndex: NSUInteger; message 'firstUnlaidCharacterIndex';
216    function firstUnlaidGlyphIndex: NSUInteger; message 'firstUnlaidGlyphIndex';
217    function textContainerForGlyphAtIndex_effectiveRange (glyphIndex: NSUInteger; effectiveGlyphRange: NSRangePointer): NSTextContainer; message 'textContainerForGlyphAtIndex:effectiveRange:';
218    function usedRectForTextContainer (container: NSTextContainer): NSRect; message 'usedRectForTextContainer:';
219    function lineFragmentRectForGlyphAtIndex_effectiveRange (glyphIndex: NSUInteger; effectiveGlyphRange: NSRangePointer): NSRect; message 'lineFragmentRectForGlyphAtIndex:effectiveRange:';
220    function lineFragmentUsedRectForGlyphAtIndex_effectiveRange (glyphIndex: NSUInteger; effectiveGlyphRange: NSRangePointer): NSRect; message 'lineFragmentUsedRectForGlyphAtIndex:effectiveRange:';
221    function lineFragmentRectForGlyphAtIndex_effectiveRange_withoutAdditionalLayout (glyphIndex: NSUInteger; effectiveGlyphRange: NSRangePointer; flag: ObjCBOOL): NSRect; message 'lineFragmentRectForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:';
222    function lineFragmentUsedRectForGlyphAtIndex_effectiveRange_withoutAdditionalLayout (glyphIndex: NSUInteger; effectiveGlyphRange: NSRangePointer; flag: ObjCBOOL): NSRect; message 'lineFragmentUsedRectForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:';
223    function textContainerForGlyphAtIndex_effectiveRange_withoutAdditionalLayout (glyphIndex: NSUInteger; effectiveGlyphRange: NSRangePointer; flag: ObjCBOOL): NSTextContainer; message 'textContainerForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:';
224    function extraLineFragmentRect: NSRect; message 'extraLineFragmentRect';
225    function extraLineFragmentUsedRect: NSRect; message 'extraLineFragmentUsedRect';
226    function extraLineFragmentTextContainer: NSTextContainer; message 'extraLineFragmentTextContainer';
227    function locationForGlyphAtIndex (glyphIndex: NSUInteger): NSPoint; message 'locationForGlyphAtIndex:';
228    function notShownAttributeForGlyphAtIndex (glyphIndex: NSUInteger): ObjCBOOL; message 'notShownAttributeForGlyphAtIndex:';
229    function drawsOutsideLineFragmentForGlyphAtIndex (glyphIndex: NSUInteger): ObjCBOOL; message 'drawsOutsideLineFragmentForGlyphAtIndex:';
230    function attachmentSizeForGlyphAtIndex (glyphIndex: NSUInteger): NSSize; message 'attachmentSizeForGlyphAtIndex:';
231    procedure setLayoutRect_forTextBlock_glyphRange (rect: NSRect; block: NSTextBlock; glyphRange: NSRange); message 'setLayoutRect:forTextBlock:glyphRange:';
232    procedure setBoundsRect_forTextBlock_glyphRange (rect: NSRect; block: NSTextBlock; glyphRange: NSRange); message 'setBoundsRect:forTextBlock:glyphRange:';
233    function layoutRectForTextBlock_glyphRange (block: NSTextBlock; glyphRange: NSRange): NSRect; message 'layoutRectForTextBlock:glyphRange:';
234    function boundsRectForTextBlock_glyphRange (block: NSTextBlock; glyphRange: NSRange): NSRect; message 'boundsRectForTextBlock:glyphRange:';
235    function layoutRectForTextBlock_atIndex_effectiveRange (block: NSTextBlock; glyphIndex: NSUInteger; effectiveGlyphRange: NSRangePointer): NSRect; message 'layoutRectForTextBlock:atIndex:effectiveRange:';
236    function boundsRectForTextBlock_atIndex_effectiveRange (block: NSTextBlock; glyphIndex: NSUInteger; effectiveGlyphRange: NSRangePointer): NSRect; message 'boundsRectForTextBlock:atIndex:effectiveRange:';
237    function glyphRangeForCharacterRange_actualCharacterRange (charRange: NSRange; actualCharRange: NSRangePointer): NSRange; message 'glyphRangeForCharacterRange:actualCharacterRange:';
238    function characterRangeForGlyphRange_actualGlyphRange (glyphRange: NSRange; actualGlyphRange: NSRangePointer): NSRange; message 'characterRangeForGlyphRange:actualGlyphRange:';
239    function glyphRangeForTextContainer (container: NSTextContainer): NSRange; message 'glyphRangeForTextContainer:';
240    function rangeOfNominallySpacedGlyphsContainingIndex (glyphIndex: NSUInteger): NSRange; message 'rangeOfNominallySpacedGlyphsContainingIndex:';
241    function rectArrayForCharacterRange_withinSelectedCharacterRange_inTextContainer_rectCount (charRange: NSRange; selCharRange: NSRange; container: NSTextContainer; rectCount: NSUIntegerPtr): NSRectArray; message 'rectArrayForCharacterRange:withinSelectedCharacterRange:inTextContainer:rectCount:';
242    function rectArrayForGlyphRange_withinSelectedGlyphRange_inTextContainer_rectCount (glyphRange: NSRange; selGlyphRange: NSRange; container: NSTextContainer; rectCount: NSUIntegerPtr): NSRectArray; message 'rectArrayForGlyphRange:withinSelectedGlyphRange:inTextContainer:rectCount:';
243    function boundingRectForGlyphRange_inTextContainer (glyphRange: NSRange; container: NSTextContainer): NSRect; message 'boundingRectForGlyphRange:inTextContainer:';
244    function glyphRangeForBoundingRect_inTextContainer (bounds: NSRect; container: NSTextContainer): NSRange; message 'glyphRangeForBoundingRect:inTextContainer:';
245    function glyphRangeForBoundingRectWithoutAdditionalLayout_inTextContainer (bounds: NSRect; container: NSTextContainer): NSRange; message 'glyphRangeForBoundingRectWithoutAdditionalLayout:inTextContainer:';
246    function glyphIndexForPoint_inTextContainer_fractionOfDistanceThroughGlyph (point: NSPoint; container: NSTextContainer; partialFraction: CGFloatPtr): NSUInteger; message 'glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:';
247    function glyphIndexForPoint_inTextContainer (point: NSPoint; container: NSTextContainer): NSUInteger; message 'glyphIndexForPoint:inTextContainer:';
248    function fractionOfDistanceThroughGlyphForPoint_inTextContainer (point: NSPoint; container: NSTextContainer): CGFloat; message 'fractionOfDistanceThroughGlyphForPoint:inTextContainer:';
249    function characterIndexForPoint_inTextContainer_fractionOfDistanceBetweenInsertionPoints (point: NSPoint; container: NSTextContainer; partialFraction: CGFloatPtr): NSUInteger; message 'characterIndexForPoint:inTextContainer:fractionOfDistanceBetweenInsertionPoints:'; { available in 10_6 }
250    function getLineFragmentInsertionPointsForCharacterAtIndex_alternatePositions_inDisplayOrder_positions_characterIndexes (charIndex: NSUInteger; aFlag: ObjCBOOL; dFlag: ObjCBOOL; positions: CGFloatPtr; charIndexes: NSUIntegerPtr): NSUInteger; message 'getLineFragmentInsertionPointsForCharacterAtIndex:alternatePositions:inDisplayOrder:positions:characterIndexes:'; { available in 10_5 }
251    function temporaryAttributesAtCharacterIndex_effectiveRange (charIndex: NSUInteger; effectiveCharRange: NSRangePointer): NSDictionary; message 'temporaryAttributesAtCharacterIndex:effectiveRange:';
252    procedure setTemporaryAttributes_forCharacterRange (attrs: NSDictionary; charRange: NSRange); message 'setTemporaryAttributes:forCharacterRange:';
253    procedure addTemporaryAttributes_forCharacterRange (attrs: NSDictionary; charRange: NSRange); message 'addTemporaryAttributes:forCharacterRange:';
254    procedure removeTemporaryAttribute_forCharacterRange (attrName: NSString; charRange: NSRange); message 'removeTemporaryAttribute:forCharacterRange:';
255    function temporaryAttribute_atCharacterIndex_effectiveRange (attrName: NSString; location: NSUInteger; range: NSRangePointer): id; message 'temporaryAttribute:atCharacterIndex:effectiveRange:'; { available in 10_5 }
256    function temporaryAttribute_atCharacterIndex_longestEffectiveRange_inRange (attrName: NSString; location: NSUInteger; range: NSRangePointer; rangeLimit: NSRange): id; message 'temporaryAttribute:atCharacterIndex:longestEffectiveRange:inRange:'; { available in 10_5 }
257    function temporaryAttributesAtCharacterIndex_longestEffectiveRange_inRange (location: NSUInteger; range: NSRangePointer; rangeLimit: NSRange): NSDictionary; message 'temporaryAttributesAtCharacterIndex:longestEffectiveRange:inRange:'; { available in 10_5 }
258    procedure addTemporaryAttribute_value_forCharacterRange (attrName: NSString; value: id; charRange: NSRange); message 'addTemporaryAttribute:value:forCharacterRange:'; { available in 10_5 }
259    function substituteFontForFont (originalFont: NSFont): NSFont; message 'substituteFontForFont:';
260    function defaultLineHeightForFont (theFont: NSFont): CGFloat; message 'defaultLineHeightForFont:';
261    function defaultBaselineOffsetForFont (theFont: NSFont): CGFloat; message 'defaultBaselineOffsetForFont:';
262    procedure setUsesFontLeading(newValue: ObjCBOOL); message 'setUsesFontLeading:';
263    function usesFontLeading: ObjCBOOL; message 'usesFontLeading';
264
265    { Adopted protocols }
266    procedure encodeWithCoder (aCoder: NSCoder); message 'encodeWithCoder:';
267    function initWithCoder (aDecoder: NSCoder): id; message 'initWithCoder:';
268  end;
269
270
271type
272  NSTextViewSupport = objccategory external (NSLayoutManager)
273    function rulerMarkersForTextView_paragraphStyle_ruler (view: NSTextView; style: NSParagraphStyle; ruler: NSRulerView): NSArray; message 'rulerMarkersForTextView:paragraphStyle:ruler:';
274    function rulerAccessoryViewForTextView_paragraphStyle_ruler_enabled (view: NSTextView; style: NSParagraphStyle; ruler: NSRulerView; isEnabled: ObjCBOOL): NSView; message 'rulerAccessoryViewForTextView:paragraphStyle:ruler:enabled:';
275    function layoutManagerOwnsFirstResponderInWindow (window: NSWindow): ObjCBOOL; message 'layoutManagerOwnsFirstResponderInWindow:';
276    function firstTextView: NSTextView; message 'firstTextView';
277    function textViewForBeginningOfSelection: NSTextView; message 'textViewForBeginningOfSelection';
278    procedure drawBackgroundForGlyphRange_atPoint (glyphsToShow: NSRange; origin: NSPoint); message 'drawBackgroundForGlyphRange:atPoint:';
279    procedure drawGlyphsForGlyphRange_atPoint (glyphsToShow: NSRange; origin: NSPoint); message 'drawGlyphsForGlyphRange:atPoint:';
280    procedure showCGGlyphs_positions_count_font_matrix_attributes_inContext (glyphs: CGGlyphPtr; positions: NSPointPtr; glyphCount: NSUInteger; font: NSFont; textMatrix: NSAffineTransform; attributes: NSDictionary; graphicsContext: NSGraphicsContext); message 'showCGGlyphs:positions:count:font:matrix:attributes:inContext:'; { available in 10_7 }
281    procedure showPackedGlyphs_length_glyphRange_atPoint_font_color_printingAdjustment (glyphs: PChar; glyphLen: NSUInteger; glyphRange: NSRange; point: NSPoint; font: NSFont; color: NSColor; printingAdjustment: NSSize); message 'showPackedGlyphs:length:glyphRange:atPoint:font:color:printingAdjustment:'; deprecated 'in 10_0, 10_7';
282    procedure showAttachmentCell_inRect_characterIndex (cell: NSCell; rect: NSRect; attachmentIndex: NSUInteger); message 'showAttachmentCell:inRect:characterIndex:';
283    procedure fillBackgroundRectArray_count_forCharacterRange_color (rectArray: NSRectArray; rectCount: NSUInteger; charRange: NSRange; color: NSColor); message 'fillBackgroundRectArray:count:forCharacterRange:color:'; { available in 10_6 }
284    procedure drawUnderlineForGlyphRange_underlineType_baselineOffset_lineFragmentRect_lineFragmentGlyphRange_containerOrigin (glyphRange: NSRange; underlineVal: NSInteger; baselineOffset: CGFloat; lineRect: NSRect; lineGlyphRange: NSRange; containerOrigin: NSPoint); message 'drawUnderlineForGlyphRange:underlineType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:';
285    procedure underlineGlyphRange_underlineType_lineFragmentRect_lineFragmentGlyphRange_containerOrigin (glyphRange: NSRange; underlineVal: NSInteger; lineRect: NSRect; lineGlyphRange: NSRange; containerOrigin: NSPoint); message 'underlineGlyphRange:underlineType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:';
286    procedure drawStrikethroughForGlyphRange_strikethroughType_baselineOffset_lineFragmentRect_lineFragmentGlyphRange_containerOrigin (glyphRange: NSRange; strikethroughVal: NSInteger; baselineOffset: CGFloat; lineRect: NSRect; lineGlyphRange: NSRange; containerOrigin: NSPoint); message 'drawStrikethroughForGlyphRange:strikethroughType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:';
287    procedure strikethroughGlyphRange_strikethroughType_lineFragmentRect_lineFragmentGlyphRange_containerOrigin (glyphRange: NSRange; strikethroughVal: NSInteger; lineRect: NSRect; lineGlyphRange: NSRange; containerOrigin: NSPoint); message 'strikethroughGlyphRange:strikethroughType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:';
288  end;
289{$endif}
290
291{$ifdef PROTOCOLS}
292
293type
294  NSLayoutManagerDelegateProtocol = objcprotocol external name 'NSLayoutManagerDelegate' (NSObjectProtocol)
295  optional
296    procedure layoutManagerDidInvalidateLayout (sender: NSLayoutManager); message 'layoutManagerDidInvalidateLayout:';
297    procedure layoutManager_didCompleteLayoutForTextContainer_atEnd (layoutManager: NSLayoutManager; textContainer: NSTextContainer; layoutFinishedFlag: ObjCBOOL); message 'layoutManager:didCompleteLayoutForTextContainer:atEnd:';
298    function layoutManager_shouldUseTemporaryAttributes_forDrawingToScreen_atCharacterIndex_effectiveRange (layoutManager: NSLayoutManager; attrs: NSDictionary; toScreen: ObjCBOOL; charIndex: NSUInteger; effectiveCharRange: NSRangePointer): NSDictionary; message 'layoutManager:shouldUseTemporaryAttributes:forDrawingToScreen:atCharacterIndex:effectiveRange:'; { available in 10_5 }
299  end;
300{$endif}
301
302