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