implementAsBlocking static method

NSColorPickingDefault implementAsBlocking({
  1. required Dartinstancetype? initWithPickerMask_colorPanel_(
    1. DartNSUInteger,
    2. NSColorPanel$1
    ),
  2. required NSImage provideNewButtonImage(),
  3. required void insertNewButtonImage_in_(
    1. NSImage,
    2. NSButtonCell
    ),
  4. required void viewSizeChanged_(
    1. ObjCObjectBase? sender
    ),
  5. required void alphaControlAddedOrRemoved_(
    1. ObjCObjectBase? sender
    ),
  6. required void attachColorList_(
    1. NSColorList
    ),
  7. required void detachColorList_(
    1. NSColorList
    ),
  8. required void setMode_(
    1. NSColorPanelMode
    ),
  9. required DartCADynamicRange buttonToolTip(),
  10. required CGSize minContentSize(),
  11. bool $keepIsolateAlive = true,
})

Builds an object that implements the NSColorPickingDefault 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 NSColorPickingDefault implementAsBlocking({
  required Dartinstancetype? Function(DartNSUInteger, NSColorPanel$1)
  initWithPickerMask_colorPanel_,
  required NSImage Function() provideNewButtonImage,
  required void Function(NSImage, NSButtonCell) insertNewButtonImage_in_,
  required void Function(objc.ObjCObjectBase?) viewSizeChanged_,
  required void Function(objc.ObjCObjectBase?) alphaControlAddedOrRemoved_,
  required void Function(NSColorList) attachColorList_,
  required void Function(NSColorList) detachColorList_,
  required void Function(NSColorPanelMode) setMode_,
  required objc.NSString Function() buttonToolTip,
  required NSSize Function() minContentSize,
  bool $keepIsolateAlive = true,
}) {
  final builder = objc.ObjCProtocolBuilder(
    debugName: 'NSColorPickingDefault',
  );
  NSColorPickingDefault.initWithPickerMask_colorPanel_.implement(
    builder,
    initWithPickerMask_colorPanel_,
  );
  NSColorPickingDefault.provideNewButtonImage.implement(
    builder,
    provideNewButtonImage,
  );
  NSColorPickingDefault.insertNewButtonImage_in_.implementAsBlocking(
    builder,
    insertNewButtonImage_in_,
  );
  NSColorPickingDefault.viewSizeChanged_.implementAsBlocking(
    builder,
    viewSizeChanged_,
  );
  NSColorPickingDefault.alphaControlAddedOrRemoved_.implementAsBlocking(
    builder,
    alphaControlAddedOrRemoved_,
  );
  NSColorPickingDefault.attachColorList_.implementAsBlocking(
    builder,
    attachColorList_,
  );
  NSColorPickingDefault.detachColorList_.implementAsBlocking(
    builder,
    detachColorList_,
  );
  NSColorPickingDefault.setMode_.implementAsBlocking(builder, setMode_);
  NSColorPickingDefault.buttonToolTip.implement(builder, buttonToolTip);
  NSColorPickingDefault.minContentSize.implement(builder, minContentSize);
  builder.addProtocol($protocol);
  return NSColorPickingDefault.castFrom(
    builder.build(keepIsolateAlive: $keepIsolateAlive),
  );
}