addToBuilderAsBlocking static method

void addToBuilderAsBlocking(
  1. ObjCProtocolBuilder builder, {
  2. required CGRect viewportBoundsForTextViewportLayoutController_(
    1. NSTextViewportLayoutController
    ),
  3. required void textViewportLayoutController_configureRenderingSurfaceForTextLayoutFragment_(
    1. NSTextViewportLayoutController,
    2. NSTextLayoutFragment
    ),
  4. void textViewportLayoutControllerWillLayout_(
    1. NSTextViewportLayoutController
    )?,
  5. void textViewportLayoutControllerDidLayout_(
    1. NSTextViewportLayoutController
    )?,
  6. bool $keepIsolateAlive = true,
})

Adds the implementation of the NSTextViewportLayoutControllerDelegate protocol to an existing objc.ObjCProtocolBuilder. All methods that can be implemented as blocking listeners will be.

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

Implementation

static void addToBuilderAsBlocking(
  objc.ObjCProtocolBuilder builder, {
  required objc.CGRect Function(NSTextViewportLayoutController)
  viewportBoundsForTextViewportLayoutController_,
  required void Function(NSTextViewportLayoutController, NSTextLayoutFragment)
  textViewportLayoutController_configureRenderingSurfaceForTextLayoutFragment_,
  void Function(NSTextViewportLayoutController)?
  textViewportLayoutControllerWillLayout_,
  void Function(NSTextViewportLayoutController)?
  textViewportLayoutControllerDidLayout_,
  bool $keepIsolateAlive = true,
}) {
  NSTextViewportLayoutControllerDelegate
      .viewportBoundsForTextViewportLayoutController_
      .implement(builder, viewportBoundsForTextViewportLayoutController_);
  NSTextViewportLayoutControllerDelegate
      .textViewportLayoutController_configureRenderingSurfaceForTextLayoutFragment_
      .implementAsBlocking(
        builder,
        textViewportLayoutController_configureRenderingSurfaceForTextLayoutFragment_,
      );
  NSTextViewportLayoutControllerDelegate
      .textViewportLayoutControllerWillLayout_
      .implementAsBlocking(builder, textViewportLayoutControllerWillLayout_);
  NSTextViewportLayoutControllerDelegate
      .textViewportLayoutControllerDidLayout_
      .implementAsBlocking(builder, textViewportLayoutControllerDidLayout_);
  builder.addProtocol($protocol);
}