implement static method
NSTextAttachmentLayout
implement({
- required NSImage? imageForBounds_attributes_location_textContainer_(
- CGRect,
- NSDictionary,
- NSTextLocation,
- NSTextContainer?,
- required CGRect attachmentBoundsForAttributes_location_textContainer_proposedLineFragment_position_(
- NSDictionary,
- NSTextLocation,
- NSTextContainer?,
- CGRect,
- CGPoint,
- required NSTextAttachmentViewProvider? viewProviderForParentView_location_textContainer_(),
- bool $keepIsolateAlive = true,
Builds an object that implements the NSTextAttachmentLayout 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 NSTextAttachmentLayout implement({
required NSImage? Function(
objc.CGRect,
objc.NSDictionary,
NSTextLocation,
NSTextContainer?,
)
imageForBounds_attributes_location_textContainer_,
required objc.CGRect Function(
objc.NSDictionary,
NSTextLocation,
NSTextContainer?,
objc.CGRect,
objc.CGPoint,
)
attachmentBoundsForAttributes_location_textContainer_proposedLineFragment_position_,
required NSTextAttachmentViewProvider? Function(
NSView?,
NSTextLocation,
NSTextContainer?,
)
viewProviderForParentView_location_textContainer_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(
debugName: 'NSTextAttachmentLayout',
);
NSTextAttachmentLayout.imageForBounds_attributes_location_textContainer_
.implement(builder, imageForBounds_attributes_location_textContainer_);
NSTextAttachmentLayout
.attachmentBoundsForAttributes_location_textContainer_proposedLineFragment_position_
.implement(
builder,
attachmentBoundsForAttributes_location_textContainer_proposedLineFragment_position_,
);
NSTextAttachmentLayout.viewProviderForParentView_location_textContainer_
.implement(builder, viewProviderForParentView_location_textContainer_);
builder.addProtocol($protocol);
return NSTextAttachmentLayout.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}