implement static method

NSViewLayerContentScaleDelegate implement({
  1. bool layer_shouldInheritContentsScale_fromWindow_(
    1. CALayer,
    2. DartCGFloat,
    3. NSWindow
    )?,
  2. bool $keepIsolateAlive = true,
})

Builds an object that implements the NSViewLayerContentScaleDelegate 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 NSViewLayerContentScaleDelegate implement({
  bool Function(CALayer, DartCGFloat, NSWindow)?
  layer_shouldInheritContentsScale_fromWindow_,
  bool $keepIsolateAlive = true,
}) {
  final builder = objc.ObjCProtocolBuilder(
    debugName: 'NSViewLayerContentScaleDelegate',
  );
  NSViewLayerContentScaleDelegate.layer_shouldInheritContentsScale_fromWindow_
      .implement(builder, layer_shouldInheritContentsScale_fromWindow_);
  builder.addProtocol($protocol);
  return NSViewLayerContentScaleDelegate.castFrom(
    builder.build(keepIsolateAlive: $keepIsolateAlive),
  );
}