implement static method
NSImageDelegate
implement({})
Builds an object that implements the NSImageDelegate 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 NSImageDelegate implement({
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_.implement(
builder,
image_willLoadRepresentation_,
);
NSImageDelegate.image_didLoadRepresentationHeader_.implement(
builder,
image_didLoadRepresentationHeader_,
);
NSImageDelegate.image_didLoadPartOfRepresentation_withValidRows_.implement(
builder,
image_didLoadPartOfRepresentation_withValidRows_,
);
NSImageDelegate.image_didLoadRepresentation_withStatus_.implement(
builder,
image_didLoadRepresentation_withStatus_,
);
builder.addProtocol($protocol);
return NSImageDelegate.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}