[NSLayoutManager] Complete bindings for NSLayoutManager. Fixes #4740. (#4853)

Fix numerous issues with NSLayoutManager[Delegate]:

* The classes are available in both AppKit and UIKit, but the bindings are
  duplicated (unsuccessfully) in both appkit.cs and uikit.cs. So create a new
  xkit.cs that is shared between XI and XM, and put a shared version of the
  bindings there.

* Bind everything that hasn't already been bound (or deprecated by Apple).

* Methods that take a nullable NSRangePointer has been bound with three overloads:

	* A protected overridable (exported) method that uses IntPtr.
	* A public method without the parameter.
	* A public method with the parameter typed as 'ref NSRange'.

	This makes sure the native method can be overridden if needed, while at
	the same time making it possible to call without providing the nullable
	parameter.

* Fix numerous ugly bindings:

	* There's a great nint/nuint confusion for parameters referring to
	  'character index' and 'glyph index'. XI seems to prefer nuint, while XM
	  seems to prefer nint. Standardize on nuint, since that's how Apple
	  created them.

	* Many methods have names than sound like Objective-C. Fix them all,
	  either right away when possible, or for XAMCORE_4_0.

	* Several parameter names have been modified to comply with our naming
	  guidelines (no abbreviations).

Fixes https://github.com/xamarin/xamarin-macios/issues/4740.
This commit is contained in:
Rolf Bjarne Kvinge 2018-10-01 14:17:28 +02:00 коммит произвёл Alex Soto
Родитель 6ebe19f630
Коммит dbd247ed38
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: E1DEAE5773ADA456
9 изменённых файлов: 1222 добавлений и 855 удалений

Просмотреть файл

@ -1,23 +1,22 @@
// Copyright 2015 Xamarin, Inc.
#if !WATCH
#if !MONOMAC
using NSFont=UIKit.UIFont;
#endif
using System;
using ObjCRuntime;
using Foundation;
using CoreGraphics;
#if MONOMAC
namespace AppKit {
partial class NSLayoutManager {
#if !XAMCORE_2_0
public uint GlyphAtIndex (nint glyphIndex, ref bool isValidIndex)
{
return GlyphAtIndexisValidIndex ((nuint) glyphIndex, ref isValidIndex);
}
public uint GlyphAtIndex (nint glyphIndex)
{
return GlyphCount (glyphIndex);
}
#else
namespace UIKit {
#endif
partial class NSLayoutManager {
#if !XAMCORE_4_0 && MONOMAC
[Deprecated (PlatformName.MacOSX, 10, 11)]
public CGRect [] GetRectArray (NSRange glyphRange, NSRange selectedGlyphRange, NSTextContainer textContainer)
{
@ -37,8 +36,9 @@ namespace AppKit {
}
return returnArray;
}
#endif // MONOMAC
#if !XAMCORE_4_0
#if !XAMCORE_4_0 && MONOMAC
[Obsolete ("Use 'GetIntAttribute' instead.")]
public virtual nint IntAttributeforGlyphAtIndex (nint attributeTag, nint glyphIndex)
{
@ -47,3 +47,5 @@ namespace AppKit {
#endif
}
}
#endif // !WATCH

Просмотреть файл

@ -20,7 +20,15 @@ using CoreGraphics;
using Foundation;
using ObjCRuntime;
#if MONOMAC
using UIFont=AppKit.NSFont;
#endif
#if MONOMAC
namespace AppKit {
#else
namespace UIKit {
#endif
partial class NSLayoutManager {
public unsafe nuint GetGlyphs (
NSRange glyphRange,
@ -53,7 +61,7 @@ namespace UIKit {
#endif
fixed (nuint* charIBuffer = charIndexBuffer) {
fixed (byte* bidi = bidiLevelBuffer) {
rv = GetGlyphsInternal (glyphRange, (IntPtr) glyphs, (IntPtr) properties, (IntPtr) charIBuffer, (IntPtr) bidi);
rv = GetGlyphs (glyphRange, (IntPtr) glyphs, (IntPtr) properties, (IntPtr) charIBuffer, (IntPtr) bidi);
}
}
}
@ -67,7 +75,11 @@ namespace UIKit {
}
}
#if XAMCORE_4_0 || MONOMAC
public unsafe void ShowGlyphs (
#else
public unsafe void ShowCGGlyphs (
#endif
short[] /* const CGGlyph* = CGFontIndex* = unsigned short* */ glyphs,
CGPoint[] /* const CGPoint* */ positions,
nuint /* NSUInteger */ glyphCount,
@ -78,70 +90,76 @@ namespace UIKit {
{
fixed (short* gl = glyphs) {
fixed (CGPoint* pos = positions) {
ShowCGGlyphsInternal ((IntPtr) gl, (IntPtr) pos, glyphCount, font, textMatrix, attributes, graphicsContext);
ShowGlyphs ((IntPtr) gl, (IntPtr) pos, glyphCount, font, textMatrix, attributes, graphicsContext);
}
}
}
#if !XAMCORE_4_0 && !MONOMAC
// TextContainerForGlyphAtIndex
[Obsolete ("Use 'GetTextContainer' instead.")]
public NSTextContainer TextContainerForGlyphAtIndex (nuint glyphIndex)
{
return TextContainerForGlyphAtIndexInternal (glyphIndex, IntPtr.Zero);
return GetTextContainer (glyphIndex);
}
public unsafe NSTextContainer TextContainerForGlyphAtIndex (nuint glyphIndex, ref NSRange effectiveGlyphRange)
[Obsolete ("Use 'GetTextContainer' instead.")]
public NSTextContainer TextContainerForGlyphAtIndex (nuint glyphIndex, ref NSRange effectiveGlyphRange)
{
fixed (NSRange* ptr = &effectiveGlyphRange)
return TextContainerForGlyphAtIndexInternal (glyphIndex, (IntPtr) ptr);
return GetTextContainer (glyphIndex, out effectiveGlyphRange);
}
// LineFragmentRectForGlyphAtIndex
[Obsolete ("Use 'GetLineFragmentRect' instead.")]
public CGRect LineFragmentRectForGlyphAtIndex (nuint glyphIndex)
{
return LineFragmentRectForGlyphAtIndexInternal (glyphIndex, IntPtr.Zero);
return GetLineFragmentRect (glyphIndex);
}
public unsafe CGRect LineFragmentRectForGlyphAtIndex (nuint glyphIndex, ref NSRange effectiveGlyphRange)
[Obsolete ("Use 'GetLineFragmentRect' instead.")]
public CGRect LineFragmentRectForGlyphAtIndex (nuint glyphIndex, ref NSRange effectiveGlyphRange)
{
fixed (NSRange* ptr = &effectiveGlyphRange)
return LineFragmentRectForGlyphAtIndexInternal (glyphIndex, (IntPtr) ptr);
return GetLineFragmentRect (glyphIndex, out effectiveGlyphRange);
}
// LineFragmentUsedRectForGlyphAtIndex
[Obsolete ("Use 'GetLineFragmentUsedRect' instead.")]
public CGRect LineFragmentUsedRectForGlyphAtIndex (nuint glyphIndex)
{
return LineFragmentUsedRectForGlyphAtIndexInternal (glyphIndex, IntPtr.Zero);
return GetLineFragmentUsedRect (glyphIndex);
}
public unsafe CGRect LineFragmentUsedRectForGlyphAtIndex (nuint glyphIndex, ref NSRange effectiveGlyphRange)
[Obsolete ("Use 'GetLineFragmentUsedRect' instead.")]
public CGRect LineFragmentUsedRectForGlyphAtIndex (nuint glyphIndex, ref NSRange effectiveGlyphRange)
{
fixed (NSRange* ptr = &effectiveGlyphRange)
return LineFragmentUsedRectForGlyphAtIndexInternal (glyphIndex, (IntPtr) ptr);
return GetLineFragmentUsedRect (glyphIndex, out effectiveGlyphRange);
}
// GlyphRangeForCharacterRange
[Obsolete ("Use 'GetGlyphRange' instead.")]
public NSRange GlyphRangeForCharacterRange (NSRange charRange)
{
return GlyphRangeForCharacterRangeInternal (charRange, IntPtr.Zero);
return GetGlyphRange (charRange);
}
public unsafe NSRange GlyphRangeForCharacterRange (NSRange charRange, ref NSRange actualCharRange)
[Obsolete ("Use 'GetGlyphRange' instead.")]
public NSRange GlyphRangeForCharacterRange (NSRange charRange, ref NSRange actualCharRange)
{
fixed (NSRange* ptr = &actualCharRange)
return GlyphRangeForCharacterRangeInternal (charRange, (IntPtr) ptr);
return GetGlyphRange (charRange, out actualCharRange);
}
// CharacterRangeForGlyphRange
[Obsolete ("Use 'GetCharacterRange' instead.")]
public NSRange CharacterRangeForGlyphRange (NSRange charRange)
{
return CharacterRangeForGlyphRangeInternal (charRange, IntPtr.Zero);
return GetCharacterRange (charRange);
}
public unsafe NSRange CharacterRangeForGlyphRange (NSRange charRange, ref NSRange actualCharRange)
public NSRange CharacterRangeForGlyphRange (NSRange charRange, ref NSRange actualCharRange)
{
fixed (NSRange* ptr = &actualCharRange)
return CharacterRangeForGlyphRangeInternal (charRange, (IntPtr) ptr);
return GetCharacterRange (charRange, out actualCharRange);
}
#endif // !XAMCORE_4_0 && !MONOMAC
public unsafe nuint GetLineFragmentInsertionPoints (
nuint /* NSUInteger */ charIndex,

Просмотреть файл

@ -10676,454 +10676,6 @@ namespace AppKit {
NSLayoutConstraint [] GetConstraintsAffectingLayout (NSLayoutConstraintOrientation orientation);
}
delegate void NSTextLayoutEnumerateLineFragments (CGRect rect, CGRect usedRectangle, NSTextContainer textContainer, NSRange glyphRange, out bool stop);
delegate void NSTextLayoutEnumerateEnclosingRects (CGRect rect, out bool stop);
[DesignatedDefaultCtor]
[BaseType (typeof (NSObject))]
partial interface NSLayoutManager : NSCoding {
[Export ("attributedString")]
NSAttributedString AttributedString { get; }
[Export ("replaceTextStorage:")]
void ReplaceTextStorage (NSTextStorage newTextStorage);
[Export ("textContainers")]
NSTextContainer [] TextContainers { get; }
[Export ("addTextContainer:")]
[PostGet ("TextContainers")]
void AddTextContainer (NSTextContainer container);
[Export ("insertTextContainer:atIndex:")]
[PostGet ("TextContainers")]
void InsertTextContainer (NSTextContainer container, nint index);
[Export ("removeTextContainerAtIndex:")]
[PostGet ("TextContainers")]
void RemoveTextContainer (nint index);
[Export ("textContainerChangedGeometry:")]
void TextContainerChangedGeometry (NSTextContainer container);
[Export ("textContainerChangedTextView:")]
void TextContainerChangedTextView (NSTextContainer container);
[Export ("layoutOptions")]
NSGlyphStorageOptions LayoutOptions { get; }
[Export ("hasNonContiguousLayout")]
bool HasNonContiguousLayout { get; }
//[Export ("invalidateGlyphsForCharacterRange:changeInLength:actualCharacterRange:")]
//void InvalidateGlyphs (NSRange charRange, int changeInLength, NSRangePointer actualCharRange);
//[Export ("invalidateLayoutForCharacterRange:actualCharacterRange:")]
//void InvalidateLayout (NSRange charRange, NSRangePointer actualCharRange);
//[Export ("invalidateLayoutForCharacterRange:isSoft:actualCharacterRange:")]
//void InvalidateLayout (NSRange charRange, bool isSoft, NSRangePointer actualCharRange);
[Export ("invalidateDisplayForCharacterRange:")]
void InvalidateDisplayForCharacterRange (NSRange charRange);
[Export ("invalidateDisplayForGlyphRange:")]
void InvalidateDisplayForGlyphRange (NSRange glyphRange);
#if !XAMCORE_4_0
[Availability (Deprecated = Platform.Mac_10_11, Message = "Use ProcessEditing (NSTextStorage textStorage, NSTextStorageEditActions editMask, NSRange newCharRange, nint delta, NSRange invalidatedCharRange) instead).")]
[Export ("textStorage:edited:range:changeInLength:invalidatedRange:")]
void TextStorageEdited (NSTextStorage str, NSTextStorageEditedFlags editedMask, NSRange newCharRange, nint changeInLength, NSRange invalidatedCharRange);
#endif
[Export ("ensureGlyphsForCharacterRange:")]
void EnsureGlyphsForCharacterRange (NSRange charRange);
[Export ("ensureGlyphsForGlyphRange:")]
void EnsureGlyphsForGlyphRange (NSRange glyphRange);
[Export ("ensureLayoutForCharacterRange:")]
void EnsureLayoutForCharacterRange (NSRange charRange);
[Export ("ensureLayoutForGlyphRange:")]
void EnsureLayoutForGlyphRange (NSRange glyphRange);
[Export ("ensureLayoutForTextContainer:")]
void EnsureLayoutForTextContainer (NSTextContainer container);
[Export ("ensureLayoutForBoundingRect:inTextContainer:")]
void EnsureLayoutForBoundingRect (CGRect bounds, NSTextContainer container);
//[Export ("insertGlyphs:length:forStartingGlyphAtIndex:characterIndex:")]
//void InsertGlyphs (uint [] glyphs, int length, int glyphIndex, int charIndex);
[Export ("insertGlyph:atGlyphIndex:characterIndex:")]
void InsertGlyph (uint /* NSGlyph = unsigned int */ glyph, nint glyphIndex, nint charIndex);
[Export ("replaceGlyphAtIndex:withGlyph:")]
void ReplaceGlyphAtIndex (nint glyphIndex, uint /* NSGlyph = unsigned int */ newGlyph);
[Export ("deleteGlyphsInRange:")]
void DeleteGlyphs (NSRange glyphRange);
[Export ("setCharacterIndex:forGlyphAtIndex:")]
void SetCharacterIndex (nint charIndex, nint glyphIndex);
[Export ("setIntAttribute:value:forGlyphAtIndex:")]
void SetIntAttribute (nint attributeTag, nint value, nint glyphIndex);
[Export ("invalidateGlyphsOnLayoutInvalidationForGlyphRange:")]
void InvalidateGlyphsOnLayoutInvalidation (NSRange glyphRange);
[Export ("numberOfGlyphs")]
nint NumberOfGlyphs { get; }
[Export ("glyphAtIndex:isValidIndex:")]
#if XAMCORE_2_0
uint /* NSGlyph = unsigned int */ GlyphAtIndex (nint glyphIndex, ref bool isValidIndex);
#else
[Obsolete ("Use 'GlyphAtIndex' instead.")]
uint /* NSGlyph = unsigned int */ GlyphAtIndexisValidIndex (nuint glyphIndex, ref bool isValidIndex);
#endif
[Export ("glyphAtIndex:")]
#if XAMCORE_2_0
uint /* NSGlyph = unsigned int */ GlyphAtIndex (nint glyphIndex);
#else
[Obsolete ("Use 'GlyphAtIndex' instead.")]
uint /* NSGlyph = unsigned int */ GlyphCount (nint glyphIndex);
#endif
[Export ("isValidGlyphIndex:")]
bool IsValidGlyphIndex (nint glyphIndex);
[Export ("characterIndexForGlyphAtIndex:")]
nuint CharacterIndexForGlyphAtIndex (nint glyphIndex);
[Export ("glyphIndexForCharacterAtIndex:")]
nuint GlyphIndexForCharacterAtIndex (nint charIndex);
[Export ("intAttribute:forGlyphAtIndex:")]
nint GetIntAttribute (nint attributeTag, nint glyphIndex);
[Export ("setTextContainer:forGlyphRange:")]
void SetTextContainerForRange (NSTextContainer container, NSRange glyphRange);
[Export ("setLineFragmentRect:forGlyphRange:usedRect:")]
void SetLineFragmentRect (CGRect fragmentRect, NSRange glyphRange, CGRect usedRect);
[Export ("setExtraLineFragmentRect:usedRect:textContainer:")]
void SetExtraLineFragmentRect (CGRect fragmentRect, CGRect usedRect, NSTextContainer container);
[Export ("setLocation:forStartOfGlyphRange:")]
void SetLocation (CGPoint location, NSRange forStartOfGlyphRange);
//[Export ("setLocations:startingGlyphIndexes:count:forGlyphRange:")]
//void SetLocations (NSPointArray locations, int glyphIndexes, uint count, NSRange glyphRange);
[Export ("setNotShownAttribute:forGlyphAtIndex:")]
void SetNotShownAttribute (bool flag, nint glyphIndex);
[Export ("setDrawsOutsideLineFragment:forGlyphAtIndex:")]
void SetDrawsOutsideLineFragment (bool flag, nint glyphIndex);
[Export ("setAttachmentSize:forGlyphRange:")]
void SetAttachmentSize (CGSize attachmentSize, NSRange glyphRange);
[Export ("getFirstUnlaidCharacterIndex:glyphIndex:")]
void GetFirstUnlaidCharacterIndex (ref nuint charIndex, ref nuint glyphIndex);
[Export ("firstUnlaidCharacterIndex")]
nint FirstUnlaidCharacterIndex { get; }
[Export ("firstUnlaidGlyphIndex")]
nint FirstUnlaidGlyphIndex { get; }
//[Export ("textContainerForGlyphAtIndex:effectiveRange:")]
//NSTextContainer TextContainerForGlyphAt (int glyphIndex, NSRangePointer effectiveGlyphRange);
[Export ("usedRectForTextContainer:")]
CGRect GetUsedRectForTextContainer (NSTextContainer container);
//[Export ("lineFragmentRectForGlyphAtIndex:effectiveRange:")]
//CGRect LineFragmentRectForGlyphAt (int glyphIndex, NSRangePointer effectiveGlyphRange);
//[Export ("lineFragmentUsedRectForGlyphAtIndex:effectiveRange:")]
//CGRect LineFragmentUsedRectForGlyphAt (int glyphIndex, NSRangePointer effectiveGlyphRange);
//[Export ("lineFragmentRectForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:")]
//CGRect LineFragmentRectForGlyphAt (int glyphIndex, NSRangePointer effectiveGlyphRange, bool flag);
//[Export ("lineFragmentUsedRectForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:")]
//CGRect LineFragmentUsedRectForGlyphAt (int glyphIndex, NSRangePointer effectiveGlyphRange, bool flag);
//[Export ("textContainerForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:")]
//NSTextContainer TextContainerForGlyphAt (int glyphIndex, NSRangePointer effectiveGlyphRange, bool flag);
[Export ("extraLineFragmentRect")]
CGRect ExtraLineFragmentRect { get; }
[Export ("extraLineFragmentUsedRect")]
CGRect ExtraLineFragmentUsedRect { get; }
[Export ("extraLineFragmentTextContainer")]
NSTextContainer ExtraLineFragmentTextContainer { get; }
[Export ("locationForGlyphAtIndex:")]
CGPoint LocationForGlyphAtIndex (nint glyphIndex);
[Export ("notShownAttributeForGlyphAtIndex:")]
bool NotShownAttributeForGlyphAtIndex (nint glyphIndex);
[Export ("drawsOutsideLineFragmentForGlyphAtIndex:")]
bool DrawsOutsideLineFragmentForGlyphAt (nint glyphIndex);
[Export ("attachmentSizeForGlyphAtIndex:")]
CGSize AttachmentSizeForGlyphAt (nint glyphIndex);
[Export ("setLayoutRect:forTextBlock:glyphRange:")]
void SetLayoutRect (CGRect layoutRect, NSTextBlock forTextBlock, NSRange glyphRange);
[Export ("setBoundsRect:forTextBlock:glyphRange:")]
void SetBoundsRect (CGRect boundsRect, NSTextBlock forTextBlock, NSRange glyphRange);
[Export ("layoutRectForTextBlock:glyphRange:")]
CGRect LayoutRect (NSTextBlock block, NSRange glyphRange);
[Export ("boundsRectForTextBlock:glyphRange:")]
CGRect BoundsRect (NSTextBlock block, NSRange glyphRange);
//[Export ("layoutRectForTextBlock:atIndex:effectiveRange:")]
//CGRect LayoutRect (NSTextBlock block, int glyphIndex, NSRangePointer effectiveGlyphRange);
//[Export ("boundsRectForTextBlock:atIndex:effectiveRange:")]
//CGRect BoundsRect (NSTextBlock block, int glyphIndex, NSRangePointer effectiveGlyphRange);
//[Export ("glyphRangeForCharacterRange:actualCharacterRange:")]
//NSRange GetGlyphRange (NSRange charRange, NSRangePointer actualCharRange);
//[Export ("characterRangeForGlyphRange:actualGlyphRange:")]
//NSRange GetCharacterRange (NSRange glyphRange, NSRangePointer actualGlyphRange);
[Export ("glyphRangeForTextContainer:")]
NSRange GetGlyphRange (NSTextContainer container);
[Export ("rangeOfNominallySpacedGlyphsContainingIndex:")]
NSRange RangeOfNominallySpacedGlyphsContainingIndex (nint glyphIndex);
//[Export ("rectArrayForCharacterRange:withinSelectedCharacterRange:inTextContainer:rectCount:")]
//NSRectArray RectArrayForCharacterRangewithinSelectedCharacterRangeinTextContainerrectCount (NSRange charRange, NSRange selCharRange, NSTextContainer container, uint rectCount);
[Internal]
[Export ("rectArrayForGlyphRange:withinSelectedGlyphRange:inTextContainer:rectCount:")]
[Availability (Deprecated = Platform.Mac_10_11)]
IntPtr GetRectArray (NSRange glyphRange, NSRange selectedGlyphRange, IntPtr textContainerHandle, out nuint rectCount);
[Export ("boundingRectForGlyphRange:inTextContainer:")]
CGRect BoundingRectForGlyphRange (NSRange glyphRange, NSTextContainer container);
[Export ("glyphRangeForBoundingRect:inTextContainer:")]
NSRange GlyphRangeForBoundingRect (CGRect bounds, NSTextContainer container);
[Export ("glyphRangeForBoundingRectWithoutAdditionalLayout:inTextContainer:")]
NSRange GlyphRangeForBoundingRectWithoutAdditionalLayout (CGRect bounds, NSTextContainer container);
[Export ("glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:")]
nuint GlyphIndexForPointInTextContainer (CGPoint point, NSTextContainer container, ref nfloat fractionOfDistanceThroughGlyph);
[Export ("glyphIndexForPoint:inTextContainer:")]
nuint GlyphIndexForPoint (CGPoint point, NSTextContainer container);
[Export ("fractionOfDistanceThroughGlyphForPoint:inTextContainer:")]
nfloat FractionOfDistanceThroughGlyphForPoint (CGPoint point, NSTextContainer container);
[Export ("characterIndexForPoint:inTextContainer:fractionOfDistanceBetweenInsertionPoints:")]
nuint CharacterIndexForPoint (CGPoint point, NSTextContainer container, ref nfloat fractionOfDistanceBetweenInsertionPoints);
[Export ("getLineFragmentInsertionPointsForCharacterAtIndex:alternatePositions:inDisplayOrder:positions:characterIndexes:")]
nuint GetLineFragmentInsertionPoints (nuint charIndex, bool aFlag, bool dFlag, IntPtr positions, IntPtr charIndexes);
//[Export ("temporaryAttributesAtCharacterIndex:effectiveRange:")]
//NSDictionary GetTemporaryAttributes (int charIndex, NSRangePointer effectiveCharRange);
[Export ("setTemporaryAttributes:forCharacterRange:")]
void SetTemporaryAttributes (NSDictionary attrs, NSRange charRange);
[Export ("addTemporaryAttributes:forCharacterRange:")]
void AddTemporaryAttributes (NSDictionary attrs, NSRange charRange);
[Export ("removeTemporaryAttribute:forCharacterRange:")]
void RemoveTemporaryAttribute (string attrName, NSRange charRange);
//[Export ("temporaryAttribute:atCharacterIndex:effectiveRange:")]
//NSObject GetTemporaryAttribute (string attrName, uint location, NSRangePointer range);
//[Export ("temporaryAttribute:atCharacterIndex:longestEffectiveRange:inRange:")]
//NSObject GetTemporaryAttribute (string attrName, uint location, NSRangePointer range, NSRange rangeLimit);
//[Export ("temporaryAttributesAtCharacterIndex:longestEffectiveRange:inRange:")]
//NSDictionary GetTemporaryAttributes (int characterIndex, NSRangePointer longestEffectiveRange, NSRange rangeLimit);
[Export ("addTemporaryAttribute:value:forCharacterRange:")]
void AddTemporaryAttribute (string attrName, NSObject value, NSRange charRange);
[Export ("substituteFontForFont:")]
NSFont SubstituteFontForFont (NSFont originalFont);
[Export ("defaultLineHeightForFont:")]
nfloat DefaultLineHeightForFont (NSFont theFont);
[Export ("defaultBaselineOffsetForFont:")]
nfloat DefaultBaselineOffsetForFont (NSFont theFont);
//Detected properties
[Export ("textStorage")]
NSTextStorage TextStorage { get; set; }
[Export ("glyphGenerator", ArgumentSemantic.Retain)]
NSGlyphGenerator GlyphGenerator { get; set; }
[Export ("typesetter", ArgumentSemantic.Retain)]
NSTypesetter Typesetter { get; set; }
[Export ("delegate", ArgumentSemantic.Assign)][NullAllowed]
NSObject WeakDelegate { get; set; }
[Wrap ("WeakDelegate")]
[Protocolize]
NSLayoutManagerDelegate Delegate { get; set; }
[Export ("backgroundLayoutEnabled")]
bool BackgroundLayoutEnabled { get; set; }
[Export ("usesScreenFonts")]
bool UsesScreenFonts { get; set; }
[Export ("showsInvisibleCharacters")]
bool ShowsInvisibleCharacters { get; set; }
[Export ("showsControlCharacters")]
bool ShowsControlCharacters { get; set; }
[Export ("hyphenationFactor")]
float HyphenationFactor { get; set; } /* float, not CGFloat */
[Export ("defaultAttachmentScaling")]
NSImageScaling DefaultAttachmentScaling { get; set; }
[Export ("typesetterBehavior")]
NSTypesetterBehavior TypesetterBehavior { get; set; }
[Export ("allowsNonContiguousLayout")]
bool AllowsNonContiguousLayout { get; set; }
[Export ("usesFontLeading")]
bool UsesFontLeading { get; set; }
[Export ("drawBackgroundForGlyphRange:atPoint:")]
void DrawBackgroundForGlyphRange (NSRange glyphsToShow, CGPoint origin);
[Export ("drawGlyphsForGlyphRange:atPoint:")]
void DrawGlyphsForGlyphRange (NSRange glyphsToShow, CGPoint origin);
[Export ("characterRangeForGlyphRange:actualGlyphRange:")]
NSRange CharacterRangeForGlyphRange (NSRange glyphRange, out NSRange actualGlyphRange);
[Export ("glyphRangeForCharacterRange:actualCharacterRange:")]
NSRange GlyphRangeForCharacterRange (NSRange charRange, out NSRange actualCharRange);
[Mac (10,10)]
[Export ("getGlyphsInRange:glyphs:properties:characterIndexes:bidiLevels:")]
[Internal]
nuint GetGlyphsInternal (NSRange glyphRange, IntPtr glyphBuffer, IntPtr props, IntPtr charIndexBuffer, IntPtr bidiLevelBuffer);
[Mac (10,10)]
[Export ("propertyForGlyphAtIndex:")]
NSGlyphProperty GetProperty (nuint glyphIndex);
[Mac (10,11)]
[Export ("CGGlyphAtIndex:isValidIndex:")]
ushort GetCGGlyph (nuint glyphIndex, out bool isValidIndex);
[Mac (10,11)]
[Export ("CGGlyphAtIndex:")]
ushort GetCGGlyph (nuint glyphIndex);
[Mac (10,11)]
[Export ("processEditingForTextStorage:edited:range:changeInLength:invalidatedRange:")]
void ProcessEditing (NSTextStorage textStorage, NSTextStorageEditActions editMask, NSRange newCharRange, nint delta, NSRange invalidatedCharRange);
[Mac (10,11)]
[Export ("setGlyphs:properties:characterIndexes:font:forGlyphRange:")]
void SetGlyphs (IntPtr glyphs, IntPtr props, IntPtr charIndexes, NSFont aFont, NSRange glyphRange);
[Mac (10,11)]
[Export ("truncatedGlyphRangeInLineFragmentForGlyphAtIndex:")]
NSRange GetTruncatedGlyphRangeInLineFragment (nuint glyphIndex);
[Mac (10,11)]
[Export ("enumerateLineFragmentsForGlyphRange:usingBlock:")]
void EnumerateLineFragments (NSRange glyphRange, NSTextLayoutEnumerateLineFragments callback);
[Mac (10,11)]
[Export ("enumerateEnclosingRectsForGlyphRange:withinSelectedGlyphRange:inTextContainer:usingBlock:")]
void EnumerateEnclosingRects (NSRange glyphRange, NSRange selectedRange, NSTextContainer textContainer, NSTextLayoutEnumerateEnclosingRects callback);
[Mac (10, 14, onlyOn64: true)]
[Export ("limitsLayoutForSuspiciousContents")]
bool LimitsLayoutForSuspiciousContents { get; set; }
}
[BaseType (typeof (NSObject))]
[Model]
[Protocol]
interface NSLayoutManagerDelegate {
[Export ("layoutManagerDidInvalidateLayout:")]
void LayoutInvalidated (NSLayoutManager sender);
[Export ("layoutManager:didCompleteLayoutForTextContainer:atEnd:")]
void LayoutCompleted (NSLayoutManager layoutManager, NSTextContainer textContainer, bool layoutFinishedFlag);
[Export ("layoutManager:shouldUseTemporaryAttributes:forDrawingToScreen:atCharacterIndex:effectiveRange:")]
NSDictionary ShouldUseTemporaryAttributes (NSLayoutManager layoutManager, NSDictionary temporaryAttributes, bool drawingToScreen, nint charIndex, IntPtr effectiveCharRange);
[Mac (10,11)]
[Export ("layoutManager:shouldGenerateGlyphs:properties:characterIndexes:font:forGlyphRange:")]
nuint ShouldGenerateGlyphs (NSLayoutManager layoutManager, IntPtr glyphBuffer, IntPtr props, IntPtr charIndexes, NSFont aFont, NSRange glyphRange);
[Mac (10,11)]
[Export ("layoutManager:lineSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:")]
nfloat GetLineSpacingAfterGlyph (NSLayoutManager layoutManager, nuint glyphIndex, CGRect rect);
[Mac (10,11)]
[Export ("layoutManager:paragraphSpacingBeforeGlyphAtIndex:withProposedLineFragmentRect:")]
nfloat GetParagraphSpacingBeforeGlyph (NSLayoutManager layoutManager, nuint glyphIndex, CGRect rect);
[Mac (10,11)]
[Export ("layoutManager:paragraphSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:")]
nfloat GetParagraphSpacingAfterGlyph (NSLayoutManager layoutManager, nuint glyphIndex, CGRect rect);
[Mac (10,11)]
[Export ("layoutManager:shouldUseAction:forControlCharacterAtIndex:")]
NSControlCharacterAction ShouldUseAction (NSLayoutManager layoutManager, NSControlCharacterAction action, nuint charIndex);
[Mac (10,11)]
[Export ("layoutManager:shouldBreakLineByWordBeforeCharacterAtIndex:")]
bool ShouldBreakLineByWordBeforeCharacter (NSLayoutManager layoutManager, nuint charIndex);
[Mac (10,11)]
[Export ("layoutManager:shouldBreakLineByHyphenatingBeforeCharacterAtIndex:")]
bool ShouldBreakLineByHyphenatingBeforeCharacter (NSLayoutManager layoutManager, nuint charIndex);
[Mac (10,11)]
[Export ("layoutManager:boundingBoxForControlGlyphAtIndex:forTextContainer:proposedLineFragment:glyphPosition:characterIndex:")]
CGRect GetBoundingBox (NSLayoutManager layoutManager, nuint glyphIndex, NSTextContainer textContainer, CGRect proposedRect, CGPoint glyphPosition, nuint charIndex);
[Mac (10,11)]
[Export ("layoutManager:textContainer:didChangeGeometryFromSize:")]
void DidChangeGeometry (NSLayoutManager layoutManager, NSTextContainer textContainer, CGSize oldSize);
}
[Mac (10,10)]
[BaseType (typeof (NSGestureRecognizer))]
interface NSMagnificationGestureRecognizer {

Просмотреть файл

@ -108,6 +108,7 @@ APPKIT_SOURCES = \
AppKit/NSGraphicsContext.cs \
AppKit/NSImage.cs \
AppKit/NSLayoutManager.cs \
UIKit/NSLayoutManager.cs \
AppKit/NSLevelIndicator.cs \
AppKit/NSMatrix.cs \
AppKit/NSMenu.cs \
@ -1449,6 +1450,7 @@ UIKIT_SOURCES = \
UIKit/Compat.cs \
UIKit/NSLayoutConstraint.cs \
UIKit/NSLayoutManager.cs \
AppKit/NSLayoutManager.cs \
UIKit/UIAccessibility.cs \
UIKit/UIAccessibilityCustomAction.cs \
UIKit/UIActionSheet.cs \
@ -1710,7 +1712,7 @@ MAC_FRAMEWORKS = \
$(COMMON_FRAMEWORKS) \
Accounts \
AdSupport \
AppKit \
AppKit XKit \
AudioToolbox \
AudioUnit \
AVKit \
@ -1867,7 +1869,7 @@ IOS_FRAMEWORKS = \
StoreKit \
SystemConfiguration \
Twitter \
UIKit \
UIKit XKit \
UserNotifications \
UserNotificationsUI \
VideoToolbox \
@ -1899,7 +1901,7 @@ WATCHOS_FRAMEWORKS = \
NaturalLanguage \
PassKit \
Security \
UIKit \
UIKit XKit \
UserNotifications \
WatchConnectivity \
WatchKit \
@ -1951,7 +1953,7 @@ TVOS_FRAMEWORKS = \
TVMLKit \
TVUIKit \
TVServices \
UIKit \
UIKit XKit \
UserNotifications \
VideoSubscriberAccount \
VideoToolbox \

Просмотреть файл

@ -139,8 +139,6 @@ namespace UIKit {
// hacks to ease compilation
interface CIColor {}
#else
delegate void NSTextLayoutEnumerateLineFragments (CGRect rect, CGRect usedRectangle, NSTextContainer textContainer, NSRange glyphRange, ref bool stop);
delegate void NSTextLayoutEnumerateEnclosingRects (CGRect rect, ref bool stop);
delegate void UICompletionHandler (bool finished);
delegate void UIOperationHandler (bool success);
delegate void UICollectionViewLayoutInteractiveTransitionCompletion (bool completed, bool finished);
@ -885,7 +883,6 @@ namespace UIKit {
[iOS (7,0)]
[BaseType (typeof (NSObject))]
partial interface NSTextContainer : NSTextLayoutOrientationProvider, NSCoding {
[DesignatedInitializer]
[Export ("initWithSize:")]
IntPtr Constructor (CGSize size);
@ -1002,335 +999,6 @@ namespace UIKit {
void DidProcessEditing (NSTextStorage textStorage, NSTextStorageEditActions editedMask, NSRange editedRange, nint delta);
}
[iOS (7,0)]
[BaseType (typeof (NSObject))]
[DesignatedDefaultCtor]
interface NSLayoutManager : NSCoding {
[NullAllowed] // by default this property is null
[Export ("textStorage", ArgumentSemantic.Assign)]
NSTextStorage TextStorage { get; set; }
[Export ("textContainers")]
NSTextContainer [] TextContainers { get; }
[Export ("addTextContainer:")]
[PostGet ("TextContainers")]
void AddTextContainer (NSTextContainer container);
[Export ("insertTextContainer:atIndex:")]
[PostGet ("TextContainers")]
void InsertTextContainer (NSTextContainer container, nint index);
[Export ("removeTextContainerAtIndex:")]
[PostGet ("TextContainers")]
void RemoveTextContainer (nint index);
[Export ("textContainerChangedGeometry:")]
void TextContainerChangedGeometry (NSTextContainer container);
[Export ("delegate", ArgumentSemantic.Assign), NullAllowed]
NSObject WeakDelegate { get; set; }
[Wrap ("WeakDelegate")]
[Protocolize]
NSLayoutManagerDelegate Delegate { get; set; }
[Export ("showsInvisibleCharacters")]
bool ShowsInvisibleCharacters { get; set; }
[Export ("showsControlCharacters")]
bool ShowsControlCharacters { get; set; }
[Export ("hyphenationFactor")]
nfloat HyphenationFactor { get; set; }
[Export ("usesFontLeading")]
bool UsesFontLeading { get; set; }
[Export ("allowsNonContiguousLayout")]
bool AllowsNonContiguousLayout { get; set; }
[Export ("hasNonContiguousLayout")]
bool HasNonContiguousLayout { get; }
[Export ("invalidateGlyphsForCharacterRange:changeInLength:actualCharacterRange:")]
void InvalidateGlyphs (NSRange charRange, nint delta, out NSRange actualCharRange);
[Export ("invalidateLayoutForCharacterRange:actualCharacterRange:")]
void InvalidateLayout (NSRange charRange, out NSRange actualCharRange);
[Export ("invalidateDisplayForCharacterRange:")]
void InvalidateDisplayForCharacterRange (NSRange charRange);
[Export ("invalidateDisplayForGlyphRange:")]
void InvalidateDisplayForGlyphRange (NSRange glyphRange);
[Export ("processEditingForTextStorage:edited:range:changeInLength:invalidatedRange:")]
void ProcessEditing (NSTextStorage textStorage, NSTextStorageEditActions editMask, NSRange newCharRange, nint delta, NSRange invalidatedCharRange);
[Export ("ensureGlyphsForCharacterRange:")]
void EnsureGlyphsForCharacterRange (NSRange charRange);
[Export ("ensureGlyphsForGlyphRange:")]
void EnsureGlyphsForGlyphRange (NSRange glyphRange);
[Export ("ensureLayoutForCharacterRange:")]
void EnsureLayoutForCharacterRange (NSRange charRange);
[Export ("ensureLayoutForGlyphRange:")]
void EnsureLayoutForGlyphRange (NSRange glyphRange);
[Export ("ensureLayoutForTextContainer:")]
void EnsureLayoutForTextContainer (NSTextContainer container);
[Export ("ensureLayoutForBoundingRect:inTextContainer:")]
void EnsureLayoutForBoundingRect (CGRect bounds, NSTextContainer container);
[Export ("setGlyphs:properties:characterIndexes:font:forGlyphRange:")]
void SetGlyphs (IntPtr glyphs, IntPtr props, IntPtr charIndexes, UIFont aFont, NSRange glyphRange);
[Export ("numberOfGlyphs")]
nuint NumberOfGlyphs { get; }
[Availability (Deprecated = Platform.iOS_9_0, Message = "Use 'GetGlyph' instead.")]
[Export ("glyphAtIndex:isValidIndex:")]
ushort GlyphAtIndex (nuint glyphIndex, ref bool isValidIndex);
[Availability (Deprecated = Platform.iOS_9_0, Message = "Use 'GetGlyph' instead.")]
[Export ("glyphAtIndex:")]
ushort GlyphAtIndex (nuint glyphIndex);
[Export ("isValidGlyphIndex:")]
bool IsValidGlyphIndex (nuint glyphIndex);
[Export ("propertyForGlyphAtIndex:")]
NSGlyphProperty PropertyForGlyphAtIndex (nuint glyphIndex);
[Export ("characterIndexForGlyphAtIndex:")]
nuint CharacterIndexForGlyphAtIndex (nuint glyphIndex);
[Export ("glyphIndexForCharacterAtIndex:")]
nuint GlyphIndexForCharacterAtIndex (nuint charIndex);
[Export ("getGlyphsInRange:glyphs:properties:characterIndexes:bidiLevels:")]
[Internal]
nuint GetGlyphsInternal (NSRange glyphRange, IntPtr glyphBuffer, IntPtr props, IntPtr charIndexBuffer, IntPtr bidiLevelBuffer);
[Export ("setTextContainer:forGlyphRange:")]
void SetTextContainer (NSTextContainer container, NSRange glyphRange);
[Export ("setLineFragmentRect:forGlyphRange:usedRect:")]
void SetLineFragmentRect (CGRect fragmentRect, NSRange glyphRange, CGRect usedRect);
[Export ("setExtraLineFragmentRect:usedRect:textContainer:")]
void SetExtraLineFragmentRect (CGRect fragmentRect, CGRect usedRect, NSTextContainer container);
[Export ("setLocation:forStartOfGlyphRange:")]
void SetLocation (CGPoint location, NSRange glyphRange);
[Export ("setNotShownAttribute:forGlyphAtIndex:")]
void SetNotShownAttribute (bool flag, nuint glyphIndex);
[Export ("setDrawsOutsideLineFragment:forGlyphAtIndex:")]
void SetDrawsOutsideLineFragment (bool flag, nuint glyphIndex);
[Export ("setAttachmentSize:forGlyphRange:")]
void SetAttachmentSize (CGSize attachmentSize, NSRange glyphRange);
[Export ("getFirstUnlaidCharacterIndex:glyphIndex:")]
void GetFirstUnlaidCharacterIndex (ref nuint charIndex, ref nuint glyphIndex);
[Export ("firstUnlaidCharacterIndex")]
nuint FirstUnlaidCharacterIndex { get; }
[Export ("firstUnlaidGlyphIndex")]
nuint FirstUnlaidGlyphIndex { get; }
[Export ("textContainerForGlyphAtIndex:effectiveRange:")]
[Internal]
NSTextContainer TextContainerForGlyphAtIndexInternal (nuint glyphIndex, IntPtr effectiveGlyphRange);
[Export ("usedRectForTextContainer:")]
CGRect GetUsedRectForTextContainer (NSTextContainer container);
[Export ("lineFragmentRectForGlyphAtIndex:effectiveRange:")]
[Internal]
CGRect LineFragmentRectForGlyphAtIndexInternal (nuint glyphIndex, IntPtr effectiveGlyphRange);
[Export ("lineFragmentUsedRectForGlyphAtIndex:effectiveRange:")]
[Internal]
CGRect LineFragmentUsedRectForGlyphAtIndexInternal (nuint glyphIndex, IntPtr effectiveGlyphRange);
[Export ("extraLineFragmentRect", ArgumentSemantic.Copy)]
CGRect ExtraLineFragmentRect { get; }
[Export ("extraLineFragmentUsedRect", ArgumentSemantic.Copy)]
CGRect ExtraLineFragmentUsedRect { get; }
[Export ("extraLineFragmentTextContainer", ArgumentSemantic.Copy)]
NSTextContainer ExtraLineFragmentTextContainer { get; }
[Export ("locationForGlyphAtIndex:")]
CGPoint LocationForGlyphAtIndex (nuint glyphIndex);
[Export ("notShownAttributeForGlyphAtIndex:")]
bool NotShownAttributeForGlyphAtIndex (nuint glyphIndex);
[Export ("drawsOutsideLineFragmentForGlyphAtIndex:")]
bool DrawsOutsideLineFragmentForGlyphAtIndex (nuint glyphIndex);
[Export ("attachmentSizeForGlyphAtIndex:")]
CGSize AttachmentSizeForGlyphAtIndex (nuint glyphIndex);
[Export ("truncatedGlyphRangeInLineFragmentForGlyphAtIndex:")]
NSRange TruncatedGlyphRangeInLineFragmentForGlyphAtIndex (nuint glyphIndex);
[Export ("glyphRangeForCharacterRange:actualCharacterRange:")]
[Internal]
NSRange GlyphRangeForCharacterRangeInternal (NSRange charRange, IntPtr actualCharRange);
[Export ("characterRangeForGlyphRange:actualGlyphRange:")]
#if XAMCORE_2_0
[Internal]
#endif
NSRange CharacterRangeForGlyphRangeInternal (NSRange glyphRange, IntPtr actualGlyphRange);
[Export ("glyphRangeForTextContainer:")]
NSRange GetGlyphRange (NSTextContainer container);
[Export ("rangeOfNominallySpacedGlyphsContainingIndex:")]
NSRange RangeOfNominallySpacedGlyphsContainingIndex (nuint glyphIndex);
[Export ("boundingRectForGlyphRange:inTextContainer:")]
CGRect BoundingRectForGlyphRange (NSRange glyphRange, NSTextContainer container);
[Export ("glyphRangeForBoundingRect:inTextContainer:")]
NSRange GlyphRangeForBoundingRect (CGRect bounds, NSTextContainer container);
[Export ("glyphRangeForBoundingRectWithoutAdditionalLayout:inTextContainer:")]
NSRange GlyphRangeForBoundingRectWithoutAdditionalLayout (CGRect bounds, NSTextContainer container);
[Export ("glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:")]
nuint GlyphIndexForPoint (CGPoint point, NSTextContainer container, ref nfloat partialFraction);
[Export ("glyphIndexForPoint:inTextContainer:")]
nuint GlyphIndexForPoint (CGPoint point, NSTextContainer container);
[Export ("fractionOfDistanceThroughGlyphForPoint:inTextContainer:")]
nfloat FractionOfDistanceThroughGlyphForPoint (CGPoint point, NSTextContainer container);
[Export ("characterIndexForPoint:inTextContainer:fractionOfDistanceBetweenInsertionPoints:")]
nuint CharacterIndexForPoint (CGPoint point, NSTextContainer container, ref nfloat partialFraction);
[Export ("getLineFragmentInsertionPointsForCharacterAtIndex:alternatePositions:inDisplayOrder:positions:characterIndexes:")]
#if XAMCORE_2_0
[Internal]
#endif
nuint GetLineFragmentInsertionPoints (nuint charIndex, bool alternatePosition, bool inDisplayOrder, IntPtr positions, IntPtr charIndexes);
[Export ("enumerateLineFragmentsForGlyphRange:usingBlock:")]
void EnumerateLineFragments (NSRange glyphRange, NSTextLayoutEnumerateLineFragments callback);
[Export ("enumerateEnclosingRectsForGlyphRange:withinSelectedGlyphRange:inTextContainer:usingBlock:")]
void EnumerateEnclosingRects (NSRange glyphRange, NSRange selectedRange, NSTextContainer textContainer, NSTextLayoutEnumerateEnclosingRects callback);
[Export ("drawBackgroundForGlyphRange:atPoint:")]
void DrawBackgroundForGlyphRange (NSRange glyphsToShow, CGPoint origin);
[Export ("drawGlyphsForGlyphRange:atPoint:")]
void DrawGlyphs (NSRange glyphsToShow, CGPoint origin);
[Export ("showCGGlyphs:positions:count:font:matrix:attributes:inContext:")]
[Internal]
void ShowCGGlyphsInternal (IntPtr glyphs, IntPtr positions, nuint glyphCount, UIFont font, CGAffineTransform textMatrix, NSDictionary attributes, [NullAllowed] CGContext graphicsContext);
// Can't make this internal and expose a manually written API, since you're supposed to override this method, not call it yourself.
//[Export ("fillBackgroundRectArray:count:forCharacterRange:color:")]
//void FillBackgroundRectArray (IntPtr rectArray, nuint rectCount, NSRange charRange, UIColor color);
[Export ("drawUnderlineForGlyphRange:underlineType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:")]
void DrawUnderline (NSRange glyphRange, NSUnderlineStyle underlineVal, nfloat baselineOffset, CGRect lineRect, NSRange lineGlyphRange, CGPoint containerOrigin);
[Export ("underlineGlyphRange:underlineType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:")]
void Underline (NSRange glyphRange, NSUnderlineStyle underlineVal, CGRect lineRect, NSRange lineGlyphRange, CGPoint containerOrigin);
[Export ("drawStrikethroughForGlyphRange:strikethroughType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:")]
void DrawStrikethrough (NSRange glyphRange, NSUnderlineStyle strikethroughVal, nfloat baselineOffset, CGRect lineRect, NSRange lineGlyphRange, CGPoint containerOrigin);
[Export ("strikethroughGlyphRange:strikethroughType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:")]
void Strikethrough (NSRange glyphRange, NSUnderlineStyle strikethroughVal, CGRect lineRect, NSRange lineGlyphRange, CGPoint containerOrigin);
[iOS (9,0)]
[Export ("textContainerForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:")]
[return: NullAllowed]
NSTextContainer GetTextContainer (nuint glyphIndex, out NSRange effectiveGlyphRange, bool withoutAdditionalLayout);
[iOS (9,0)]
[Export ("lineFragmentRectForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:")]
CGRect GetLineFragmentRect (nuint glyphIndex, out NSRange effectiveGlyphRange, bool withoutAdditionalLayout);
[iOS (9,0)]
[Export ("lineFragmentUsedRectForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:")]
CGRect GetLineFragmentUsedRect (nuint glyphIndex, out NSRange effectiveGlyphRange, bool withoutAdditionalLayout);
[iOS (9,0)] // documented as 7.0 but missing in 8.x
[Export ("CGGlyphAtIndex:isValidIndex:")]
unsafe ushort GetGlyph (nuint glyphIndex, ref bool isValidIndex);
[iOS (9,0)] // documented as 7.0 but missing in 8.x
[Export ("CGGlyphAtIndex:")]
ushort GetGlyph (nuint glyphIndex);
[NoWatch]
[TV (12, 0), iOS (12, 0)]
[Export ("limitsLayoutForSuspiciousContents")]
bool LimitsLayoutForSuspiciousContents { get; set; }
}
[Model, BaseType (typeof (NSObject))]
[Protocol]
[iOS (7,0)]
partial interface NSLayoutManagerDelegate {
[Export ("layoutManager:shouldGenerateGlyphs:properties:characterIndexes:font:forGlyphRange:")]
nuint ShouldGenerateGlyphs (NSLayoutManager layoutManager, IntPtr glyphBuffer, IntPtr props, IntPtr charIndexes, UIFont aFont, NSRange glyphRange);
[Export ("layoutManager:lineSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:")]
nfloat LineSpacingAfterGlyphAtIndex (NSLayoutManager layoutManager, nuint glyphIndex, CGRect rect);
[Export ("layoutManager:paragraphSpacingBeforeGlyphAtIndex:withProposedLineFragmentRect:")]
nfloat ParagraphSpacingBeforeGlyphAtIndex (NSLayoutManager layoutManager, nuint glyphIndex, CGRect rect);
[Export ("layoutManager:paragraphSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:")]
nfloat ParagraphSpacingAfterGlyphAtIndex (NSLayoutManager layoutManager, nuint glyphIndex, CGRect rect);
[Export ("layoutManager:shouldUseAction:forControlCharacterAtIndex:")]
NSControlCharacterAction ShouldUseAction (NSLayoutManager layoutManager, NSControlCharacterAction action, nuint charIndex);
[Export ("layoutManager:shouldBreakLineByWordBeforeCharacterAtIndex:")]
bool ShouldBreakLineByWordBeforeCharacter (NSLayoutManager layoutManager, nuint charIndex);
[Export ("layoutManager:shouldBreakLineByHyphenatingBeforeCharacterAtIndex:")]
bool ShouldBreakLineByHyphenatingBeforeCharacter (NSLayoutManager layoutManager, nuint charIndex);
[Export ("layoutManager:boundingBoxForControlGlyphAtIndex:forTextContainer:proposedLineFragment:glyphPosition:characterIndex:")]
CGRect BoundingBoxForControlGlyph (NSLayoutManager layoutManager, nuint glyphIndex, NSTextContainer textContainer, CGRect proposedRect, CGPoint glyphPosition, nuint charIndex);
[Export ("layoutManagerDidInvalidateLayout:")]
void DidInvalidatedLayout (NSLayoutManager sender);
[Export ("layoutManager:didCompleteLayoutForTextContainer:atEnd:")]
void DidCompleteLayout (NSLayoutManager layoutManager, NSTextContainer textContainer, bool layoutFinishedFlag);
[Export ("layoutManager:textContainer:didChangeGeometryFromSize:")]
void DidChangeGeometry (NSLayoutManager layoutManager, NSTextContainer textContainer, CGSize oldSize);
[iOS (9,0)]
[Export ("layoutManager:shouldSetLineFragmentRect:lineFragmentUsedRect:baselineOffset:inTextContainer:forGlyphRange:")]
bool ShouldSetLineFragmentRect (NSLayoutManager layoutManager, ref CGRect lineFragmentRect, ref CGRect lineFragmentUsedRect, ref nfloat baselineOffset, NSTextContainer textContainer, NSRange glyphRange);
}
#endif // !WATCH
[Category]

1149
src/xkit.cs Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -55,6 +55,8 @@ namespace MonoTouchFixtures.UIKit {
Assert.False (lm.ShowsInvisibleCharacters, "ShowsInvisibleCharacters");
Assert.Null (lm.TextStorage, "TextStorage");
Assert.True (lm.UsesFontLeading, "UsesFontLeading");
if (TestRuntime.CheckXcodeVersion (10, 0))
Assert.False (lm.LimitsLayoutForSuspiciousContents, "LimitsLayoutForSuspiciousContents");
}
}

Просмотреть файл

@ -178,4 +178,3 @@
!missing-field! NSCharacterEncodingDocumentOption not bound
!missing-field! NSDefaultAttributesDocumentOption not bound
!missing-field! NSDocumentTypeDocumentOption not bound
!missing-selector! NSLayoutManager::fillBackgroundRectArray:count:forCharacterRange:color: not bound

Просмотреть файл

@ -34,6 +34,16 @@
!missing-selector! NSObject::textStorageDidProcessEditing: not bound
!missing-selector! NSObject::textStorageWillProcessEditing: not bound
## Defined in NSLayoutManager (NSLayoutManagerDeprecated)
!missing-selector! NSLayoutManager::getGlyphs:range: not bound
!missing-selector! NSLayoutManager::getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits: not bound
!missing-selector! NSLayoutManager::getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:bidiLevels: not bound
!missing-selector! NSLayoutManager::insertGlyphs:length:forStartingGlyphAtIndex:characterIndex: not bound
!missing-selector! NSLayoutManager::invalidateLayoutForCharacterRange:isSoft:actualCharacterRange: not bound
!missing-selector! NSLayoutManager::rectArrayForCharacterRange:withinSelectedCharacterRange:inTextContainer:rectCount: not bound
!missing-selector! NSLayoutManager::setLocations:startingGlyphIndexes:count:forGlyphRange: not bound
!missing-selector! NSLayoutManager::showPackedGlyphs:length:glyphRange:atPoint:font:color:printingAdjustment: not bound
## Used in sandbox for NSOpen/Save panel but never should have been bound. #if !XAMCORE_3_0'ed
!unknown-type! NSRemoteOpenPanel bound
!unknown-type! NSRemoteSavePanel bound
@ -652,7 +662,6 @@
!missing-protocol-member! NSDraggingSource::draggingSession:sourceOperationMaskForDraggingContext: not found
!missing-protocol-member! NSDraggingSource::draggingSession:willBeginAtPoint: not found
!missing-protocol-member! NSDraggingSource::ignoreModifierKeysForDraggingSession: not found
!missing-protocol-member! NSLayoutManagerDelegate::layoutManager:shouldSetLineFragmentRect:lineFragmentUsedRect:baselineOffset:inTextContainer:forGlyphRange: not found
!missing-protocol-member! NSPopoverDelegate::popoverShouldDetach: not found
!missing-protocol-member! NSTextInputClient::doCommandBySelector: not found
!missing-protocol-member! NSTextViewDelegate::textView:clickedOnCell:inRect: not found
@ -817,40 +826,6 @@
!missing-selector! NSInputManager::markedTextAbandoned: not bound
!missing-selector! NSInputManager::markedTextSelectionChanged:client: not bound
!missing-selector! NSInputServer::initWithDelegate:name: not bound
!missing-selector! NSLayoutManager::boundsRectForTextBlock:atIndex:effectiveRange: not bound
!missing-selector! NSLayoutManager::drawStrikethroughForGlyphRange:strikethroughType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin: not bound
!missing-selector! NSLayoutManager::drawUnderlineForGlyphRange:underlineType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin: not bound
!missing-selector! NSLayoutManager::fillBackgroundRectArray:count:forCharacterRange:color: not bound
!missing-selector! NSLayoutManager::firstTextView not bound
!missing-selector! NSLayoutManager::getGlyphs:range: not bound
!missing-selector! NSLayoutManager::getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits: not bound
!missing-selector! NSLayoutManager::getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:bidiLevels: not bound
!missing-selector! NSLayoutManager::insertGlyphs:length:forStartingGlyphAtIndex:characterIndex: not bound
!missing-selector! NSLayoutManager::invalidateGlyphsForCharacterRange:changeInLength:actualCharacterRange: not bound
!missing-selector! NSLayoutManager::invalidateLayoutForCharacterRange:actualCharacterRange: not bound
!missing-selector! NSLayoutManager::invalidateLayoutForCharacterRange:isSoft:actualCharacterRange: not bound
!missing-selector! NSLayoutManager::layoutManagerOwnsFirstResponderInWindow: not bound
!missing-selector! NSLayoutManager::layoutRectForTextBlock:atIndex:effectiveRange: not bound
!missing-selector! NSLayoutManager::lineFragmentRectForGlyphAtIndex:effectiveRange: not bound
!missing-selector! NSLayoutManager::lineFragmentRectForGlyphAtIndex:effectiveRange:withoutAdditionalLayout: not bound
!missing-selector! NSLayoutManager::lineFragmentUsedRectForGlyphAtIndex:effectiveRange: not bound
!missing-selector! NSLayoutManager::lineFragmentUsedRectForGlyphAtIndex:effectiveRange:withoutAdditionalLayout: not bound
!missing-selector! NSLayoutManager::rectArrayForCharacterRange:withinSelectedCharacterRange:inTextContainer:rectCount: not bound
!missing-selector! NSLayoutManager::rulerAccessoryViewForTextView:paragraphStyle:ruler:enabled: not bound
!missing-selector! NSLayoutManager::rulerMarkersForTextView:paragraphStyle:ruler: not bound
!missing-selector! NSLayoutManager::setLocations:startingGlyphIndexes:count:forGlyphRange: not bound
!missing-selector! NSLayoutManager::showAttachmentCell:inRect:characterIndex: not bound
!missing-selector! NSLayoutManager::showCGGlyphs:positions:count:font:matrix:attributes:inContext: not bound
!missing-selector! NSLayoutManager::showPackedGlyphs:length:glyphRange:atPoint:font:color:printingAdjustment: not bound
!missing-selector! NSLayoutManager::strikethroughGlyphRange:strikethroughType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin: not bound
!missing-selector! NSLayoutManager::temporaryAttribute:atCharacterIndex:effectiveRange: not bound
!missing-selector! NSLayoutManager::temporaryAttribute:atCharacterIndex:longestEffectiveRange:inRange: not bound
!missing-selector! NSLayoutManager::temporaryAttributesAtCharacterIndex:effectiveRange: not bound
!missing-selector! NSLayoutManager::temporaryAttributesAtCharacterIndex:longestEffectiveRange:inRange: not bound
!missing-selector! NSLayoutManager::textContainerForGlyphAtIndex:effectiveRange: not bound
!missing-selector! NSLayoutManager::textContainerForGlyphAtIndex:effectiveRange:withoutAdditionalLayout: not bound
!missing-selector! NSLayoutManager::textViewForBeginningOfSelection not bound
!missing-selector! NSLayoutManager::underlineGlyphRange:underlineType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin: not bound
!missing-selector! NSMatrix::sortUsingFunction:context: not bound
!missing-selector! NSMediaLibraryBrowserController::frame not bound
!missing-selector! NSMediaLibraryBrowserController::isVisible not bound