addToBuilder static method

void addToBuilder(
  1. ObjCProtocolBuilder builder, {
  2. required NSImage? imageForBounds_attributes_location_textContainer_(
    1. CGRect,
    2. NSDictionary,
    3. NSTextLocation,
    4. NSTextContainer?,
    ),
  3. required CGRect attachmentBoundsForAttributes_location_textContainer_proposedLineFragment_position_(
    1. NSDictionary,
    2. NSTextLocation,
    3. NSTextContainer?,
    4. CGRect,
    5. CGPoint,
    ),
  4. required NSTextAttachmentViewProvider? viewProviderForParentView_location_textContainer_(
    1. NSView?,
    2. NSTextLocation,
    3. NSTextContainer?
    ),
  5. bool $keepIsolateAlive = true,
})

Adds the implementation of the NSTextAttachmentLayout protocol to an existing objc.ObjCProtocolBuilder.

Note: You cannot call this method after you have called builder.build.

Implementation

static void addToBuilder(
  objc.ObjCProtocolBuilder builder, {
  required NSImage? Function(
    objc.CGRect,
    objc.NSDictionary,
    NSTextLocation,
    NSTextContainer?,
  )
  imageForBounds_attributes_location_textContainer_,
  required objc.CGRect Function(
    objc.NSDictionary,
    NSTextLocation,
    NSTextContainer?,
    objc.CGRect,
    objc.CGPoint,
  )
  attachmentBoundsForAttributes_location_textContainer_proposedLineFragment_position_,
  required NSTextAttachmentViewProvider? Function(
    NSView?,
    NSTextLocation,
    NSTextContainer?,
  )
  viewProviderForParentView_location_textContainer_,
  bool $keepIsolateAlive = true,
}) {
  NSTextAttachmentLayout.imageForBounds_attributes_location_textContainer_
      .implement(builder, imageForBounds_attributes_location_textContainer_);
  NSTextAttachmentLayout
      .attachmentBoundsForAttributes_location_textContainer_proposedLineFragment_position_
      .implement(
        builder,
        attachmentBoundsForAttributes_location_textContainer_proposedLineFragment_position_,
      );
  NSTextAttachmentLayout.viewProviderForParentView_location_textContainer_
      .implement(builder, viewProviderForParentView_location_textContainer_);
  builder.addProtocol($protocol);
}