addToBuilderAsBlocking static method

void addToBuilderAsBlocking(
  1. ObjCProtocolBuilder builder, {
  2. required NSTextStorage? textStorage(),
  3. required void setTextStorage_(
    1. NSTextStorage?
    ),
  4. required void processEditingForTextStorage_edited_range_changeInLength_invalidatedRange_(
    1. NSTextStorage,
    2. NSTextStorageEditActions,
    3. NSRange,
    4. DartNSInteger,
    5. NSRange,
    ),
  5. required void performEditingTransactionForTextStorage_usingBlock_(
    1. NSTextStorage,
    2. ObjCBlock<Void Function()>
    ),
  6. bool $keepIsolateAlive = true,
})

Adds the implementation of the NSTextStorageObserving 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 NSTextStorage? Function() textStorage,
  required void Function(NSTextStorage?) setTextStorage_,
  required void Function(
    NSTextStorage,
    NSTextStorageEditActions,
    NSRange,
    DartNSInteger,
    NSRange,
  )
  processEditingForTextStorage_edited_range_changeInLength_invalidatedRange_,
  required void Function(NSTextStorage, objc.ObjCBlock<ffi.Void Function()>)
  performEditingTransactionForTextStorage_usingBlock_,
  bool $keepIsolateAlive = true,
}) {
  NSTextStorageObserving.textStorage.implement(builder, textStorage);
  NSTextStorageObserving.setTextStorage_.implementAsBlocking(
    builder,
    setTextStorage_,
  );
  NSTextStorageObserving
      .processEditingForTextStorage_edited_range_changeInLength_invalidatedRange_
      .implementAsBlocking(
        builder,
        processEditingForTextStorage_edited_range_changeInLength_invalidatedRange_,
      );
  NSTextStorageObserving.performEditingTransactionForTextStorage_usingBlock_
      .implementAsBlocking(
        builder,
        performEditingTransactionForTextStorage_usingBlock_,
      );
  builder.addProtocol($protocol);
}