implementAsBlocking static method
NSTextViewportLayoutControllerDelegate
implementAsBlocking({
- required CGRect viewportBoundsForTextViewportLayoutController_(),
- required void textViewportLayoutController_configureRenderingSurfaceForTextLayoutFragment_(),
- void textViewportLayoutControllerWillLayout_()?,
- void textViewportLayoutControllerDidLayout_()?,
- bool $keepIsolateAlive = true,
Builds an object that implements the NSTextViewportLayoutControllerDelegate 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 NSTextViewportLayoutControllerDelegate implementAsBlocking({
required objc.CGRect Function(NSTextViewportLayoutController)
viewportBoundsForTextViewportLayoutController_,
required void Function(NSTextViewportLayoutController, NSTextLayoutFragment)
textViewportLayoutController_configureRenderingSurfaceForTextLayoutFragment_,
void Function(NSTextViewportLayoutController)?
textViewportLayoutControllerWillLayout_,
void Function(NSTextViewportLayoutController)?
textViewportLayoutControllerDidLayout_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(
debugName: 'NSTextViewportLayoutControllerDelegate',
);
NSTextViewportLayoutControllerDelegate
.viewportBoundsForTextViewportLayoutController_
.implement(builder, viewportBoundsForTextViewportLayoutController_);
NSTextViewportLayoutControllerDelegate
.textViewportLayoutController_configureRenderingSurfaceForTextLayoutFragment_
.implementAsBlocking(
builder,
textViewportLayoutController_configureRenderingSurfaceForTextLayoutFragment_,
);
NSTextViewportLayoutControllerDelegate
.textViewportLayoutControllerWillLayout_
.implementAsBlocking(builder, textViewportLayoutControllerWillLayout_);
NSTextViewportLayoutControllerDelegate
.textViewportLayoutControllerDidLayout_
.implementAsBlocking(builder, textViewportLayoutControllerDidLayout_);
builder.addProtocol($protocol);
return NSTextViewportLayoutControllerDelegate.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}