implementAsBlocking static method
NSGlyphStorage
implementAsBlocking({
- required void insertGlyphs_length_forStartingGlyphAtIndex_characterIndex_(),
- required void setIntAttribute_value_forGlyphAtIndex_(),
- required NSAttributedString attributedString(),
- required int layoutOptions(),
- bool $keepIsolateAlive = true,
Builds an object that implements the NSGlyphStorage protocol. To implement
multiple protocols, use addToBuilder or objc.ObjCProtocolBuilder directly. All
methods that can be implemented as blocking listeners will be.
If $keepIsolateAlive is true, this protocol will keep this isolate
alive until it is garbage collected by both Dart and ObjC.
Implementation
static NSGlyphStorage implementAsBlocking({
required void Function(
ffi.Pointer<NSGlyph>,
DartNSUInteger,
DartNSUInteger,
DartNSUInteger,
)
insertGlyphs_length_forStartingGlyphAtIndex_characterIndex_,
required void Function(DartNSInteger, DartNSInteger, DartNSUInteger)
setIntAttribute_value_forGlyphAtIndex_,
required NSAttributedString Function() attributedString,
required DartNSUInteger Function() layoutOptions,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(debugName: 'NSGlyphStorage');
NSGlyphStorage.insertGlyphs_length_forStartingGlyphAtIndex_characterIndex_
.implementAsBlocking(
builder,
insertGlyphs_length_forStartingGlyphAtIndex_characterIndex_,
);
NSGlyphStorage.setIntAttribute_value_forGlyphAtIndex_.implementAsBlocking(
builder,
setIntAttribute_value_forGlyphAtIndex_,
);
NSGlyphStorage.attributedString.implement(builder, attributedString);
NSGlyphStorage.layoutOptions.implement(builder, layoutOptions);
builder.addProtocol($protocol);
return NSGlyphStorage.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}