implementAsBlocking static method
NSImageDelegate
implementAsBlocking({})
Builds an object that implements the NSImageDelegate 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 NSImageDelegate implementAsBlocking({
NSImage? Function(NSImage, NSRect)? imageDidNotDraw_inRect_,
void Function(NSImage, NSImageRep)? image_willLoadRepresentation_,
void Function(NSImage, NSImageRep)? image_didLoadRepresentationHeader_,
void Function(NSImage, NSImageRep, DartNSInteger)?
image_didLoadPartOfRepresentation_withValidRows_,
void Function(NSImage, NSImageRep, NSImageLoadStatus)?
image_didLoadRepresentation_withStatus_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(debugName: 'NSImageDelegate');
NSImageDelegate.imageDidNotDraw_inRect_.implement(
builder,
imageDidNotDraw_inRect_,
);
NSImageDelegate.image_willLoadRepresentation_.implementAsBlocking(
builder,
image_willLoadRepresentation_,
);
NSImageDelegate.image_didLoadRepresentationHeader_.implementAsBlocking(
builder,
image_didLoadRepresentationHeader_,
);
NSImageDelegate.image_didLoadPartOfRepresentation_withValidRows_
.implementAsBlocking(
builder,
image_didLoadPartOfRepresentation_withValidRows_,
);
NSImageDelegate.image_didLoadRepresentation_withStatus_.implementAsBlocking(
builder,
image_didLoadRepresentation_withStatus_,
);
builder.addProtocol($protocol);
return NSImageDelegate.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}