implement static method
NSLayoutManagerDelegate
implement({
- DartNSUInteger layoutManager_shouldGenerateGlyphs_properties_characterIndexes_font_forGlyphRange_()?,
- DartCGFloat layoutManager_lineSpacingAfterGlyphAtIndex_withProposedLineFragmentRect_()?,
- DartCGFloat layoutManager_paragraphSpacingBeforeGlyphAtIndex_withProposedLineFragmentRect_()?,
- DartCGFloat layoutManager_paragraphSpacingAfterGlyphAtIndex_withProposedLineFragmentRect_()?,
- NSControlCharacterAction layoutManager_shouldUseAction_forControlCharacterAtIndex_()?,
- bool layoutManager_shouldBreakLineByWordBeforeCharacterAtIndex_()?,
- bool layoutManager_shouldBreakLineByHyphenatingBeforeCharacterAtIndex_()?,
- NSRect layoutManager_boundingBoxForControlGlyphAtIndex_forTextContainer_proposedLineFragment_glyphPosition_characterIndex_()?,
- bool layoutManager_shouldSetLineFragmentRect_lineFragmentUsedRect_baselineOffset_inTextContainer_forGlyphRange_()?,
- void layoutManagerDidInvalidateLayout_()?,
- void layoutManager_didCompleteLayoutForTextContainer_atEnd_()?,
- void layoutManager_textContainer_didChangeGeometryFromSize_()?,
- NSDictionary? layoutManager_shouldUseTemporaryAttributes_forDrawingToScreen_atCharacterIndex_effectiveRange_(
- NSLayoutManager,
- NSDictionary,
- bool,
- DartNSUInteger,
- NSRangePointer,
- bool $keepIsolateAlive = true,
Builds an object that implements the NSLayoutManagerDelegate protocol. To implement
multiple protocols, use addToBuilder or objc.ObjCProtocolBuilder directly.
If $keepIsolateAlive is true, this protocol will keep this isolate
alive until it is garbage collected by both Dart and ObjC.
Implementation
static NSLayoutManagerDelegate implement({
DartNSUInteger Function(
NSLayoutManager,
ffi.Pointer<CGGlyph>,
ffi.Pointer<NSInteger>,
ffi.Pointer<NSUInteger>,
NSFont,
NSRange,
)?
layoutManager_shouldGenerateGlyphs_properties_characterIndexes_font_forGlyphRange_,
DartCGFloat Function(NSLayoutManager, DartNSUInteger, NSRect)?
layoutManager_lineSpacingAfterGlyphAtIndex_withProposedLineFragmentRect_,
DartCGFloat Function(NSLayoutManager, DartNSUInteger, NSRect)?
layoutManager_paragraphSpacingBeforeGlyphAtIndex_withProposedLineFragmentRect_,
DartCGFloat Function(NSLayoutManager, DartNSUInteger, NSRect)?
layoutManager_paragraphSpacingAfterGlyphAtIndex_withProposedLineFragmentRect_,
NSControlCharacterAction Function(
NSLayoutManager,
NSControlCharacterAction,
DartNSUInteger,
)?
layoutManager_shouldUseAction_forControlCharacterAtIndex_,
bool Function(NSLayoutManager, DartNSUInteger)?
layoutManager_shouldBreakLineByWordBeforeCharacterAtIndex_,
bool Function(NSLayoutManager, DartNSUInteger)?
layoutManager_shouldBreakLineByHyphenatingBeforeCharacterAtIndex_,
NSRect Function(
NSLayoutManager,
DartNSUInteger,
NSTextContainer,
NSRect,
NSPoint,
DartNSUInteger,
)?
layoutManager_boundingBoxForControlGlyphAtIndex_forTextContainer_proposedLineFragment_glyphPosition_characterIndex_,
bool Function(
NSLayoutManager,
ffi.Pointer<NSRect>,
ffi.Pointer<NSRect>,
ffi.Pointer<CGFloat>,
NSTextContainer,
NSRange,
)?
layoutManager_shouldSetLineFragmentRect_lineFragmentUsedRect_baselineOffset_inTextContainer_forGlyphRange_,
void Function(NSLayoutManager)? layoutManagerDidInvalidateLayout_,
void Function(NSLayoutManager, NSTextContainer?, bool)?
layoutManager_didCompleteLayoutForTextContainer_atEnd_,
void Function(NSLayoutManager, NSTextContainer, NSSize)?
layoutManager_textContainer_didChangeGeometryFromSize_,
objc.NSDictionary? Function(
NSLayoutManager,
objc.NSDictionary,
bool,
DartNSUInteger,
NSRangePointer,
)?
layoutManager_shouldUseTemporaryAttributes_forDrawingToScreen_atCharacterIndex_effectiveRange_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(
debugName: 'NSLayoutManagerDelegate',
);
NSLayoutManagerDelegate
.layoutManager_shouldGenerateGlyphs_properties_characterIndexes_font_forGlyphRange_
.implement(
builder,
layoutManager_shouldGenerateGlyphs_properties_characterIndexes_font_forGlyphRange_,
);
NSLayoutManagerDelegate
.layoutManager_lineSpacingAfterGlyphAtIndex_withProposedLineFragmentRect_
.implement(
builder,
layoutManager_lineSpacingAfterGlyphAtIndex_withProposedLineFragmentRect_,
);
NSLayoutManagerDelegate
.layoutManager_paragraphSpacingBeforeGlyphAtIndex_withProposedLineFragmentRect_
.implement(
builder,
layoutManager_paragraphSpacingBeforeGlyphAtIndex_withProposedLineFragmentRect_,
);
NSLayoutManagerDelegate
.layoutManager_paragraphSpacingAfterGlyphAtIndex_withProposedLineFragmentRect_
.implement(
builder,
layoutManager_paragraphSpacingAfterGlyphAtIndex_withProposedLineFragmentRect_,
);
NSLayoutManagerDelegate
.layoutManager_shouldUseAction_forControlCharacterAtIndex_
.implement(
builder,
layoutManager_shouldUseAction_forControlCharacterAtIndex_,
);
NSLayoutManagerDelegate
.layoutManager_shouldBreakLineByWordBeforeCharacterAtIndex_
.implement(
builder,
layoutManager_shouldBreakLineByWordBeforeCharacterAtIndex_,
);
NSLayoutManagerDelegate
.layoutManager_shouldBreakLineByHyphenatingBeforeCharacterAtIndex_
.implement(
builder,
layoutManager_shouldBreakLineByHyphenatingBeforeCharacterAtIndex_,
);
NSLayoutManagerDelegate
.layoutManager_boundingBoxForControlGlyphAtIndex_forTextContainer_proposedLineFragment_glyphPosition_characterIndex_
.implement(
builder,
layoutManager_boundingBoxForControlGlyphAtIndex_forTextContainer_proposedLineFragment_glyphPosition_characterIndex_,
);
NSLayoutManagerDelegate
.layoutManager_shouldSetLineFragmentRect_lineFragmentUsedRect_baselineOffset_inTextContainer_forGlyphRange_
.implement(
builder,
layoutManager_shouldSetLineFragmentRect_lineFragmentUsedRect_baselineOffset_inTextContainer_forGlyphRange_,
);
NSLayoutManagerDelegate.layoutManagerDidInvalidateLayout_.implement(
builder,
layoutManagerDidInvalidateLayout_,
);
NSLayoutManagerDelegate
.layoutManager_didCompleteLayoutForTextContainer_atEnd_
.implement(
builder,
layoutManager_didCompleteLayoutForTextContainer_atEnd_,
);
NSLayoutManagerDelegate
.layoutManager_textContainer_didChangeGeometryFromSize_
.implement(
builder,
layoutManager_textContainer_didChangeGeometryFromSize_,
);
NSLayoutManagerDelegate
.layoutManager_shouldUseTemporaryAttributes_forDrawingToScreen_atCharacterIndex_effectiveRange_
.implement(
builder,
layoutManager_shouldUseTemporaryAttributes_forDrawingToScreen_atCharacterIndex_effectiveRange_,
);
builder.addProtocol($protocol);
return NSLayoutManagerDelegate.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}