addToBuilder static method

void addToBuilder(
  1. ObjCProtocolBuilder builder, {
  2. NSTextLayoutFragment textLayoutManager_textLayoutFragmentForLocation_inTextElement_(
    1. NSTextLayoutManager,
    2. NSTextLocation,
    3. NSTextElement
    )?,
  3. bool textLayoutManager_shouldBreakLineBeforeLocation_hyphenating_(
    1. NSTextLayoutManager,
    2. NSTextLocation,
    3. bool
    )?,
  4. NSDictionary? textLayoutManager_renderingAttributesForLink_atLocation_defaultAttributes_(
    1. NSTextLayoutManager,
    2. ObjCObjectBase,
    3. NSTextLocation,
    4. NSDictionary,
    )?,
  5. bool $keepIsolateAlive = true,
})

Adds the implementation of the NSTextLayoutManagerDelegate 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, {
  NSTextLayoutFragment Function(
    NSTextLayoutManager,
    NSTextLocation,
    NSTextElement,
  )?
  textLayoutManager_textLayoutFragmentForLocation_inTextElement_,
  bool Function(NSTextLayoutManager, NSTextLocation, bool)?
  textLayoutManager_shouldBreakLineBeforeLocation_hyphenating_,
  objc.NSDictionary? Function(
    NSTextLayoutManager,
    objc.ObjCObjectBase,
    NSTextLocation,
    objc.NSDictionary,
  )?
  textLayoutManager_renderingAttributesForLink_atLocation_defaultAttributes_,
  bool $keepIsolateAlive = true,
}) {
  NSTextLayoutManagerDelegate
      .textLayoutManager_textLayoutFragmentForLocation_inTextElement_
      .implement(
        builder,
        textLayoutManager_textLayoutFragmentForLocation_inTextElement_,
      );
  NSTextLayoutManagerDelegate
      .textLayoutManager_shouldBreakLineBeforeLocation_hyphenating_
      .implement(
        builder,
        textLayoutManager_shouldBreakLineBeforeLocation_hyphenating_,
      );
  NSTextLayoutManagerDelegate
      .textLayoutManager_renderingAttributesForLink_atLocation_defaultAttributes_
      .implement(
        builder,
        textLayoutManager_renderingAttributesForLink_atLocation_defaultAttributes_,
      );
  builder.addProtocol($protocol);
}